Comments (8)
The element pagination-ellipsis
is also a god candidate for this.
Here is how it is implemented in Fulma:
/// Generate <li><button class="pagination-ellipsis">…</button></li>
/// You control the `button` element
let ellipsis (options: GenericOption list) =
li [ ]
[ GenericOptions
.Parse(options, parseOptions, "pagination-ellipsis")
.AddProp(DangerouslySetInnerHTML { __html = "…" })
.ToReactElement(span) ]
from feliz.bulma.
When working on #21, I am also adding some tiny abstraction over some of the elements. Only tiny ones when reading the PR we will be to review if all of them make sense of not.
Right now, I am porting everything from Fulma as most of them has been asked by the community over time.
from feliz.bulma.
In Fulma, tabs
abstraction is really simple:
/// Generate <div class="tabs"><ul></ul></div>
let tabs (options: Option list) children =
let parseOptions (result : GenericOptions) option =
match option with
| IsCentered
| IsRight
| IsBoxed
| IsToggle
| IsToggleRounded
| IsFullWidth -> result.AddCaseName option
| Size size -> ofSize size |> result.AddClass
| Props props -> result.AddProps props
| CustomClass customClass -> result.AddClass customClass
| Modifiers modifiers -> result.AddModifiers modifiers
GenericOptions.Parse(options, parseOptions, "tabs").ToReactElement(div, [ ul [ ] children ])
/// Generate <li></li>
let tab (options: Tab.Option list) children =
let parseOptions (result : GenericOptions) option =
match option with
| Tab.IsActive state -> if state then result.AddCaseName option else result
| Tab.Props props -> result.AddProps props
| Tab.CustomClass customClass -> result.AddClass customClass
| Tab.Modifiers modifiers -> result.AddModifiers modifiers
GenericOptions.Parse(options, parseOptions).ToReactElement(li, children)
The idea, is that whenever the user use Tabs.tabs
we directly add the ul
under the div
because we know it is required.
from feliz.bulma.
The button element can also be a candidate:
module Input =
let internal btnInput typ options =
let hasProps =
options
|> List.exists (fun opts ->
match opts with
| Props _ -> true
| _ -> false
)
if hasProps then
let newOptions =
options
|> List.map (fun opts ->
match opts with
| Props props -> Props ((Type typ :> IHTMLProp) ::props)
| forward -> forward
)
btnView (fun options _ -> input options) newOptions [ ]
else
btnView (fun options _ -> input options) ((Props [ Type typ ])::options) [ ]
/// Generate <input type="reset" class="button" />
let reset options = btnInput "reset" options
/// Generate <input type="submit" class="button" />
let submit options = btnInput "submit" options
The idea is it add the correct type directly, yep I am lazy sometimes ^^
from feliz.bulma.
In fact, you already added the button reset
and submit
specialization
from feliz.bulma.
I think we can mark this one as done as well, can't we?
from feliz.bulma.
There is still the tabs/tab abstraction to make I think. I didn't check the source code beforing saying that so can be wrong
from feliz.bulma.
Ok, I assume this one is now (thanks to Maxime) done
from feliz.bulma.
Related Issues (20)
- No constructors are available for the type Bulma.tabs HOT 8
- Missing abstractions for level heading and title? HOT 1
- Undefined Reference in DateTimePicker HOT 8
- DateTimePicker, TimePicker display is wrong
- Is the documentation correct regaring the version of Bulma (0.8.0) that is supported? HOT 2
- How do I add bulma-calendar to my style sheet HOT 4
- Bulma.image generates without its child "img" tag. HOT 2
- Bulma Intellisense error: `Fable.React` does not contain `ReactElement` HOT 8
- After recent package updates, DateTimePicker stopped working. (Problem seems to be upstream.)
- It looks like `Bulma.title.X` modifiers are not consistent with other modifiers
- Duplicate className property warnings/errors
- Error in documentation? HOT 2
- Panel: Elements get ignored implicitly HOT 1
- Simplify/minisize number of open namespace instructions HOT 4
- Supporting span as select HOT 3
- How do I set tags in Feliz.Bulma.TagsInput? HOT 2
- Feliz.Bulma.Calendar get value HOT 3
- [Timeline] Missing modifiers for no-headers support
- Can we relax FSharp.Core requirements on this library? HOT 1
- Burger not showing on mobile devices HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feliz.bulma.