@@ -185,15 +185,17 @@ Create a widget to select numbers with placeholder `label`. An optional `range`
185
185
specifies maximum and minimum value accepted as well as the step.
186
186
"""
187
187
function spinbox (:: WidgetTheme , label= " " ; value= nothing , placeholder= label, isinteger= nothing , kwargs... )
188
- isinteger = something (isinteger, isa (_val (value), Integer))
189
- T = isinteger ? Int : Float64
190
- (value isa AbstractObservable) || (value = Observable {Union{T, Nothing}} (value))
188
+ isinteger === nothing || @warn " `isinteger` is deprecated"
189
+ if ! isa (value, AbstractObservable)
190
+ T = something (isinteger, isa (value, Integer)) ? Int : Float64
191
+ value = Observable {Union{T, Nothing}} (value)
192
+ end
191
193
ui = input (value; isnumeric= true , placeholder= placeholder, typ= " number" , kwargs... )
192
194
Widget {:spinbox} (ui, output = value)
193
195
end
194
196
195
- spinbox (T:: WidgetTheme , vals:: AbstractRange , args... ; value= first (vals), isinteger = ( eltype (vals) <: Integer ), kwargs... ) =
196
- spinbox (T, args... ; value= value, isinteger = isinteger, min= minimum (vals), max= maximum (vals), step= step (vals), kwargs... )
197
+ spinbox (T:: WidgetTheme , vals:: AbstractRange , args... ; value= first (vals), kwargs... ) =
198
+ spinbox (T, args... ; value= value, min= minimum (vals), max= maximum (vals), step= step (vals), kwargs... )
197
199
198
200
"""
199
201
`autocomplete(options, label=""; value="")`
@@ -260,17 +262,6 @@ function input(::WidgetTheme; typ="text", kwargs...)
260
262
input (o; typ= typ, kwargs... )
261
263
end
262
264
263
- function input (T:: WidgetTheme , :: Type{S} , args... ; isinteger= nothing , kwargs... ) where {S<: Number }
264
- (isinteger === nothing ) && (isinteger = S<: Integer ? true : S<: AbstractFloat ? false : nothing )
265
- spinbox (T, args... ; isinteger= isinteger, kwargs... )
266
- end
267
-
268
- input (T:: WidgetTheme , :: Type{<:Bool} , args... ; kwargs... ) = toggle (T, args... ; kwargs... )
269
- input (T:: WidgetTheme , :: Type{<:AbstractString} , args... ; kwargs... ) = textbox (T, args... ; kwargs... )
270
- input (T:: WidgetTheme , :: Type{<:Dates.Date} , args... ; kwargs... ) = datepicker (T, args... ; kwargs... )
271
- input (T:: WidgetTheme , :: Type{<:Dates.Time} , args... ; kwargs... ) = timepicker (T, args... ; kwargs... )
272
- input (T:: WidgetTheme , :: Type{<:Color} , args... ; kwargs... ) = colorpicker (T, args... ; kwargs... )
273
-
274
265
"""
275
266
`button(content... = "Press me!"; value=0)`
276
267
0 commit comments