diff --git a/src/Ranges.jl b/src/Ranges.jl index 6c205a7..69e2f13 100644 --- a/src/Ranges.jl +++ b/src/Ranges.jl @@ -10,15 +10,15 @@ export range, RangeData, slider register_normal_element("q__range", context = @__MODULE__) register_normal_element("q__slider", context = @__MODULE__) -# we have to use UnitRange because Quasar does not send back the step so we always -# end up with a UnitRange from Quasar -# this means that we need to use UnitRange on the Julia side and do the stepping in Quasar -# so no StepRange is allowed here -Base.@kwdef mutable struct RangeData{T} - range::UnitRange{T} +const QRangeType = Union{Symbol, String, Real} + +Base.@kwdef mutable struct RangeData{QRangeType} + min::QRangeType + max::QRangeType end -const QRangeType = Union{Symbol, String, Real} +RangeData(ar::AbstractRange{<:QRangeType}) = RangeData(first(ar), last(ar)) + struct QRange <: AbstractRange{QRangeType} min::QRangeType step::QRangeType