diff --git a/src/Range.jl b/src/Range.jl index afa78a25..4c25ced1 100644 --- a/src/Range.jl +++ b/src/Range.jl @@ -10,21 +10,25 @@ export range, RangeData, slider Genie.Renderer.Html.register_normal_element("q__range", context = @__MODULE__) Genie.Renderer.Html.register_normal_element("q__slider", context = @__MODULE__) - Base.@kwdef mutable struct RangeData{T} range::UnitRange{T} end -function Base.range( range::AbstractRange{T} where T <: Real, - fieldname::Union{Symbol,Nothing}, +function Base.range( + range::AbstractRange{T} where T <: Real, + fieldname::Union{Symbol,Nothing} = nothing, args...; wrap::Function = StippleUI.DEFAULT_WRAPPER, kwargs...) wrap() do - q__range(args...; attributes( - [Symbol(":min") => first(range), Symbol(":max") => last(range), Symbol(":step") => step(range), - :fieldname => fieldname, kwargs...], StippleUI.API.ATTRIBUTES_MAPPINGS)...) + q__range( args...; + attributes( + [ Symbol(":min") => first(range), + Symbol(":max") => last(range), + Symbol(":step") => step(range), + :fieldname => fieldname, kwargs... + ], StippleUI.API.ATTRIBUTES_MAPPINGS)...) end end