ruflet_core 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -18
- data/lib/ruflet/version.rb +1 -1
- data/lib/ruflet_core.rb +9 -7
- data/lib/ruflet_protocol/ruflet/protocol.rb +28 -54
- data/lib/ruflet_ui/ruflet/app.rb +1 -1
- data/lib/ruflet_ui/ruflet/colors.rb +4 -18
- data/lib/ruflet_ui/ruflet/control.rb +65 -63
- data/lib/ruflet_ui/ruflet/dsl.rb +10 -3
- data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/icons/icon_constant_names.rb +29 -0
- data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/page.rb +303 -460
- data/lib/ruflet_ui/ruflet/ui/control_factory.rb +68 -12
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +13 -6
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +45 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +43 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +0 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +56 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +53 -8
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +54 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +47 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +52 -10
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +52 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +49 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +50 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +46 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +61 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +145 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +47 -12
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb +8 -40
- data/lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb +16 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/badge_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/banner_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomappbar_control.rb +8 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomsheet_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/button_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/card_control.rb +8 -50
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb +7 -81
- data/lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb +7 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb +9 -65
- data/lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb +7 -88
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb +9 -55
- data/lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb +8 -58
- data/lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdown_control.rb +8 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +9 -103
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownoption_control.rb +0 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanel_control.rb +7 -51
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanellist_control.rb +46 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansiontile_control.rb +69 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/fillediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonalbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonaliconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb +7 -69
- data/lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb +8 -68
- data/lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb +8 -74
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +99 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb +7 -59
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawer_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationrail_control.rb +7 -73
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinedbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenubutton_control.rb +8 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenuitem_control.rb +0 -6
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressbar_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressring_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/radio_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb +7 -62
- data/lib/ruflet_ui/ruflet/ui/controls/materials/reorderablelistview_control.rb +9 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +5 -26
- data/lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb +80 -11
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segmentedbutton_control.rb +7 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/slider_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb +37 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbaraction_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_control.rb +25 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb +52 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/switch_control.rb +9 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbar_control.rb +8 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbarview_control.rb +43 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabs_control.rb +7 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textfield_control.rb +9 -132
- data/lib/ruflet_ui/ruflet/ui/controls/materials/timepicker_control.rb +10 -34
- data/lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +1 -114
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +13 -28
- data/lib/ruflet_ui/ruflet/ui/controls/shared/animatedswitcher_control.rb +46 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/arc_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +1 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/canvas_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/circle_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/column_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dismissible_control.rb +52 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/draggable_control.rb +1 -7
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dragtarget_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/shared/fletapp_control.rb +9 -46
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gesturedetector_control.rb +9 -113
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gridview_control.rb +57 -13
- data/lib/ruflet_ui/ruflet/ui/controls/shared/hero_control.rb +9 -40
- data/lib/ruflet_ui/ruflet/ui/controls/shared/icon_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/interactiveviewer_control.rb +9 -53
- data/lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/listview_control.rb +57 -11
- data/lib/ruflet_ui/ruflet/ui/controls/shared/markdown_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/oval_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb +9 -58
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pagelet_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pageview_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/path_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/placeholder_control.rb +44 -9
- data/lib/ruflet_ui/ruflet/ui/controls/shared/points_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rect_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb +43 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb +47 -15
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rotatedbox_control.rb +97 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/row_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_controls.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb +48 -4
- data/lib/ruflet_ui/ruflet/ui/{services/ruflet → controls/shared}/screenshot_control.rb +18 -2
- data/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb +65 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shadermask_control.rb +9 -41
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shimmer_control.rb +9 -44
- data/lib/ruflet_ui/ruflet/ui/controls/shared/stack_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb +9 -35
- data/lib/ruflet_ui/ruflet/ui/controls/shared/transparentpointer_control.rb +9 -38
- data/lib/ruflet_ui/ruflet/ui/controls/shared/view_control.rb +63 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/window_control.rb +40 -66
- data/lib/ruflet_ui/ruflet/ui/controls/shared/windowdragarea_control.rb +45 -4
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +61 -17
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/accelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/audio_recorder_control.rb +14 -36
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/barometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/clipboard_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/connectivity_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/filepicker_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/flashlight_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/geolocator_control.rb +14 -30
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/gyroscope_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/hapticfeedback_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/magnetometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/permissionhandler_control.rb +5 -20
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/screenbrightness_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/securestorage_control.rb +22 -49
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb +20 -15
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/shakedetector_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/share_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/sharedpreferences_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/storagepaths_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/urllauncher_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/useraccelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/wakelock_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +20 -1
- data/lib/ruflet_ui.rb +12 -10
- metadata +8 -9
- data/lib/ruflet_ui/ruflet/types/animation.rb +0 -110
- data/lib/ruflet_ui/ruflet/ui/controls/materials/codeeditor_control.rb +0 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_controls.rb +0 -311
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rive_control.rb +0 -87
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_controls.rb +0 -109
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/tester_control.rb +0 -126
|
@@ -8,15 +8,70 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinofilledbutton".freeze
|
|
9
9
|
WIRE = "CupertinoFilledButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :border_radius, :bottom, :col, :color, :content, :data, :disabled, :disabled_bgcolor, :expand, :expand_loose, :focus_color, :height, :icon, :icon_color, :key, :left, :margin, :min_size, :mouse_cursor, :offset, :opacity, :opacity_on_click, :padding, :right, :rotate, :rtl, :scale, :size, :size_change_interval, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_blur, :on_click, :on_focus, :on_long_press, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
alignment = props[:alignment]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
autofocus = props[:autofocus]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bgcolor = props[:bgcolor]
|
|
30
|
+
border_radius = props[:border_radius]
|
|
31
|
+
bottom = props[:bottom]
|
|
32
|
+
col = props[:col]
|
|
33
|
+
color = props[:color]
|
|
34
|
+
content = props[:content]
|
|
35
|
+
data = props[:data]
|
|
36
|
+
disabled = props[:disabled]
|
|
37
|
+
disabled_bgcolor = props[:disabled_bgcolor]
|
|
38
|
+
expand = props[:expand]
|
|
39
|
+
expand_loose = props[:expand_loose]
|
|
40
|
+
focus_color = props[:focus_color]
|
|
41
|
+
height = props[:height]
|
|
42
|
+
icon = props[:icon]
|
|
43
|
+
icon_color = props[:icon_color]
|
|
44
|
+
key = props[:key]
|
|
45
|
+
left = props[:left]
|
|
46
|
+
margin = props[:margin]
|
|
47
|
+
min_size = props[:min_size]
|
|
48
|
+
mouse_cursor = props[:mouse_cursor]
|
|
49
|
+
offset = props[:offset]
|
|
50
|
+
opacity = props[:opacity]
|
|
51
|
+
opacity_on_click = props[:opacity_on_click]
|
|
52
|
+
padding = props[:padding]
|
|
53
|
+
right = props[:right]
|
|
54
|
+
rotate = props[:rotate]
|
|
55
|
+
rtl = props[:rtl]
|
|
56
|
+
scale = props[:scale]
|
|
57
|
+
size = props[:size]
|
|
58
|
+
size_change_interval = props[:size_change_interval]
|
|
59
|
+
tooltip = props[:tooltip]
|
|
60
|
+
top = props[:top]
|
|
61
|
+
url = props[:url]
|
|
62
|
+
visible = props[:visible]
|
|
63
|
+
width = props[:width]
|
|
64
|
+
on_animation_end = props[:on_animation_end]
|
|
65
|
+
on_blur = props[:on_blur]
|
|
66
|
+
on_click = props[:on_click]
|
|
67
|
+
on_focus = props[:on_focus]
|
|
68
|
+
on_long_press = props[:on_long_press]
|
|
69
|
+
on_size_change = props[:on_size_change]
|
|
12
70
|
alignment = "center" if alignment.nil?
|
|
13
71
|
autofocus = false if autofocus.nil?
|
|
14
72
|
border_radius = { "all" => 8.0 } if border_radius.nil?
|
|
15
73
|
opacity_on_click = 0.4 if opacity_on_click.nil?
|
|
16
74
|
size = "large" if size.nil?
|
|
17
|
-
unless opacity_on_click.respond_to?(:between?) && opacity_on_click.between?(0.0, 1.0)
|
|
18
|
-
raise ArgumentError, "cupertino_filled_button opacity_on_click must be between 0.0 and 1.0"
|
|
19
|
-
end
|
|
20
75
|
|
|
21
76
|
props = {}
|
|
22
77
|
props[:align] = align unless align.nil?
|
|
@@ -8,19 +8,64 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinolisttile".freeze
|
|
9
9
|
WIRE = "CupertinoListTile".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
KEYWORDS = [:additional_info, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bgcolor_activated, :bottom, :col, :data, :disabled, :expand, :expand_loose, :height, :key, :leading, :leading_size, :leading_to_title, :left, :margin, :notched, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :size_change_interval, :subtitle, :title, :toggle_inputs, :tooltip, :top, :trailing, :url, :visible, :width, :on_animation_end, :on_click, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
additional_info = props[:additional_info]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
badge = props[:badge]
|
|
28
|
+
bgcolor = props[:bgcolor]
|
|
29
|
+
bgcolor_activated = props[:bgcolor_activated]
|
|
30
|
+
bottom = props[:bottom]
|
|
31
|
+
col = props[:col]
|
|
32
|
+
data = props[:data]
|
|
33
|
+
disabled = props[:disabled]
|
|
34
|
+
expand = props[:expand]
|
|
35
|
+
expand_loose = props[:expand_loose]
|
|
36
|
+
height = props[:height]
|
|
37
|
+
key = props[:key]
|
|
38
|
+
leading = props[:leading]
|
|
39
|
+
leading_size = props[:leading_size]
|
|
40
|
+
leading_to_title = props[:leading_to_title]
|
|
41
|
+
left = props[:left]
|
|
42
|
+
margin = props[:margin]
|
|
43
|
+
notched = props[:notched]
|
|
44
|
+
offset = props[:offset]
|
|
45
|
+
opacity = props[:opacity]
|
|
46
|
+
padding = props[:padding]
|
|
47
|
+
right = props[:right]
|
|
48
|
+
rotate = props[:rotate]
|
|
49
|
+
rtl = props[:rtl]
|
|
50
|
+
scale = props[:scale]
|
|
51
|
+
size_change_interval = props[:size_change_interval]
|
|
52
|
+
subtitle = props[:subtitle]
|
|
53
|
+
title = props[:title]
|
|
54
|
+
toggle_inputs = props[:toggle_inputs]
|
|
55
|
+
tooltip = props[:tooltip]
|
|
56
|
+
top = props[:top]
|
|
57
|
+
trailing = props[:trailing]
|
|
58
|
+
url = props[:url]
|
|
59
|
+
visible = props[:visible]
|
|
60
|
+
width = props[:width]
|
|
61
|
+
on_animation_end = props[:on_animation_end]
|
|
62
|
+
on_click = props[:on_click]
|
|
63
|
+
on_size_change = props[:on_size_change]
|
|
64
|
+
raise ArgumentError, "cupertino_list_tile requires title" if title.nil?
|
|
13
65
|
notched = false if notched.nil?
|
|
14
66
|
leading_size = notched ? 30.0 : 28.0 if leading_size.nil?
|
|
15
67
|
leading_to_title = notched ? 12.0 : 16.0 if leading_to_title.nil?
|
|
16
68
|
toggle_inputs = false if toggle_inputs.nil?
|
|
17
|
-
{
|
|
18
|
-
leading_size: leading_size,
|
|
19
|
-
leading_to_title: leading_to_title
|
|
20
|
-
}.each do |name, value|
|
|
21
|
-
raise ArgumentError, "cupertino_list_tile #{name} must be greater than or equal to 0" if value.negative?
|
|
22
|
-
end
|
|
23
|
-
|
|
24
69
|
props = {}
|
|
25
70
|
props[:additional_info] = additional_info unless additional_info.nil?
|
|
26
71
|
props[:align] = align unless align.nil?
|
|
@@ -8,17 +8,55 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinonavigationbar".freeze
|
|
9
9
|
WIRE = "CupertinoNavigationBar".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :border, :bottom, :col, :data, :destinations, :disabled, :expand, :expand_loose, :height, :icon_size, :inactive_color, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :selected_index, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
active_color = props[:active_color]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
badge = props[:badge]
|
|
28
|
+
bgcolor = props[:bgcolor]
|
|
29
|
+
border = props[:border]
|
|
30
|
+
bottom = props[:bottom]
|
|
31
|
+
col = props[:col]
|
|
32
|
+
data = props[:data]
|
|
33
|
+
destinations = props[:destinations]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
expand = props[:expand]
|
|
36
|
+
expand_loose = props[:expand_loose]
|
|
37
|
+
height = props[:height]
|
|
38
|
+
icon_size = props[:icon_size]
|
|
39
|
+
inactive_color = props[:inactive_color]
|
|
40
|
+
key = props[:key]
|
|
41
|
+
left = props[:left]
|
|
42
|
+
margin = props[:margin]
|
|
43
|
+
offset = props[:offset]
|
|
44
|
+
opacity = props[:opacity]
|
|
45
|
+
right = props[:right]
|
|
46
|
+
rotate = props[:rotate]
|
|
47
|
+
rtl = props[:rtl]
|
|
48
|
+
scale = props[:scale]
|
|
49
|
+
selected_index = props[:selected_index]
|
|
50
|
+
size_change_interval = props[:size_change_interval]
|
|
51
|
+
tooltip = props[:tooltip]
|
|
52
|
+
top = props[:top]
|
|
53
|
+
visible = props[:visible]
|
|
54
|
+
width = props[:width]
|
|
55
|
+
on_animation_end = props[:on_animation_end]
|
|
56
|
+
on_change = props[:on_change]
|
|
57
|
+
on_size_change = props[:on_size_change]
|
|
12
58
|
icon_size = 30 if icon_size.nil?
|
|
13
59
|
selected_index = 0 if selected_index.nil?
|
|
14
|
-
visible_destinations = Array(destinations).reject { |destination| destination.respond_to?(:props) && destination.props["visible"] == false }
|
|
15
|
-
unless destinations.nil? || visible_destinations.length >= 2
|
|
16
|
-
raise ArgumentError, "cupertino_navigation_bar destinations must include at least two visible destinations"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
unless destinations.nil? || (0...visible_destinations.length).cover?(selected_index)
|
|
20
|
-
raise IndexError, "cupertino_navigation_bar selected_index is out of range"
|
|
21
|
-
end
|
|
22
60
|
|
|
23
61
|
props = {}
|
|
24
62
|
props[:active_color] = active_color unless active_color.nil?
|
|
@@ -8,7 +8,58 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinopicker".freeze
|
|
9
9
|
WIRE = "CupertinoPicker".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :controls, :data, :default_selection_overlay_bgcolor, :diameter_ratio, :disabled, :expand, :expand_loose, :height, :item_extent, :key, :left, :looping, :magnification, :margin, :off_axis_fraction, :offset, :opacity, :right, :rotate, :rtl, :scale, :selected_index, :selection_overlay, :size_change_interval, :squeeze, :tooltip, :top, :use_magnifier, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
animate_align = props[:animate_align]
|
|
18
|
+
animate_margin = props[:animate_margin]
|
|
19
|
+
animate_offset = props[:animate_offset]
|
|
20
|
+
animate_opacity = props[:animate_opacity]
|
|
21
|
+
animate_position = props[:animate_position]
|
|
22
|
+
animate_rotation = props[:animate_rotation]
|
|
23
|
+
animate_scale = props[:animate_scale]
|
|
24
|
+
animate_size = props[:animate_size]
|
|
25
|
+
aspect_ratio = props[:aspect_ratio]
|
|
26
|
+
badge = props[:badge]
|
|
27
|
+
bgcolor = props[:bgcolor]
|
|
28
|
+
bottom = props[:bottom]
|
|
29
|
+
col = props[:col]
|
|
30
|
+
controls = props[:controls]
|
|
31
|
+
data = props[:data]
|
|
32
|
+
default_selection_overlay_bgcolor = props[:default_selection_overlay_bgcolor]
|
|
33
|
+
diameter_ratio = props[:diameter_ratio]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
expand = props[:expand]
|
|
36
|
+
expand_loose = props[:expand_loose]
|
|
37
|
+
height = props[:height]
|
|
38
|
+
item_extent = props[:item_extent]
|
|
39
|
+
key = props[:key]
|
|
40
|
+
left = props[:left]
|
|
41
|
+
looping = props[:looping]
|
|
42
|
+
magnification = props[:magnification]
|
|
43
|
+
margin = props[:margin]
|
|
44
|
+
off_axis_fraction = props[:off_axis_fraction]
|
|
45
|
+
offset = props[:offset]
|
|
46
|
+
opacity = props[:opacity]
|
|
47
|
+
right = props[:right]
|
|
48
|
+
rotate = props[:rotate]
|
|
49
|
+
rtl = props[:rtl]
|
|
50
|
+
scale = props[:scale]
|
|
51
|
+
selected_index = props[:selected_index]
|
|
52
|
+
selection_overlay = props[:selection_overlay]
|
|
53
|
+
size_change_interval = props[:size_change_interval]
|
|
54
|
+
squeeze = props[:squeeze]
|
|
55
|
+
tooltip = props[:tooltip]
|
|
56
|
+
top = props[:top]
|
|
57
|
+
use_magnifier = props[:use_magnifier]
|
|
58
|
+
visible = props[:visible]
|
|
59
|
+
width = props[:width]
|
|
60
|
+
on_animation_end = props[:on_animation_end]
|
|
61
|
+
on_change = props[:on_change]
|
|
62
|
+
on_size_change = props[:on_size_change]
|
|
12
63
|
diameter_ratio = 1.07 if diameter_ratio.nil?
|
|
13
64
|
item_extent = 32.0 if item_extent.nil?
|
|
14
65
|
looping = false if looping.nil?
|
|
@@ -18,15 +69,6 @@ module Ruflet
|
|
|
18
69
|
squeeze = 1.45 if squeeze.nil?
|
|
19
70
|
use_magnifier = false if use_magnifier.nil?
|
|
20
71
|
|
|
21
|
-
{
|
|
22
|
-
item_extent: item_extent,
|
|
23
|
-
magnification: magnification,
|
|
24
|
-
squeeze: squeeze
|
|
25
|
-
}.each do |name, value|
|
|
26
|
-
raise ArgumentError, "cupertino_picker #{name} must be greater than 0" unless value.positive?
|
|
27
|
-
end
|
|
28
|
-
raise ArgumentError, "cupertino_picker selected_index must be greater than or equal to 0" if selected_index.negative?
|
|
29
|
-
|
|
30
72
|
props = {}
|
|
31
73
|
props[:align] = align unless align.nil?
|
|
32
74
|
props[:animate_align] = animate_align unless animate_align.nil?
|
|
@@ -8,7 +8,58 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinoradio".freeze
|
|
9
9
|
WIRE = "CupertinoRadio".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :fill_color, :focus_color, :height, :inactive_color, :key, :label, :label_position, :left, :margin, :mouse_cursor, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :toggleable, :tooltip, :top, :use_checkmark_style, :value, :visible, :width, :on_animation_end, :on_blur, :on_focus, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
active_color = props[:active_color]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
autofocus = props[:autofocus]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bottom = props[:bottom]
|
|
30
|
+
col = props[:col]
|
|
31
|
+
data = props[:data]
|
|
32
|
+
disabled = props[:disabled]
|
|
33
|
+
expand = props[:expand]
|
|
34
|
+
expand_loose = props[:expand_loose]
|
|
35
|
+
fill_color = props[:fill_color]
|
|
36
|
+
focus_color = props[:focus_color]
|
|
37
|
+
height = props[:height]
|
|
38
|
+
inactive_color = props[:inactive_color]
|
|
39
|
+
key = props[:key]
|
|
40
|
+
label = props[:label]
|
|
41
|
+
label_position = props[:label_position]
|
|
42
|
+
left = props[:left]
|
|
43
|
+
margin = props[:margin]
|
|
44
|
+
mouse_cursor = props[:mouse_cursor]
|
|
45
|
+
offset = props[:offset]
|
|
46
|
+
opacity = props[:opacity]
|
|
47
|
+
right = props[:right]
|
|
48
|
+
rotate = props[:rotate]
|
|
49
|
+
rtl = props[:rtl]
|
|
50
|
+
scale = props[:scale]
|
|
51
|
+
size_change_interval = props[:size_change_interval]
|
|
52
|
+
toggleable = props[:toggleable]
|
|
53
|
+
tooltip = props[:tooltip]
|
|
54
|
+
top = props[:top]
|
|
55
|
+
use_checkmark_style = props[:use_checkmark_style]
|
|
56
|
+
value = props[:value]
|
|
57
|
+
visible = props[:visible]
|
|
58
|
+
width = props[:width]
|
|
59
|
+
on_animation_end = props[:on_animation_end]
|
|
60
|
+
on_blur = props[:on_blur]
|
|
61
|
+
on_focus = props[:on_focus]
|
|
62
|
+
on_size_change = props[:on_size_change]
|
|
12
63
|
autofocus = false if autofocus.nil?
|
|
13
64
|
label_position = "right" if label_position.nil?
|
|
14
65
|
toggleable = false if toggleable.nil?
|
|
@@ -8,7 +8,55 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinosegmentedbutton".freeze
|
|
9
9
|
WIRE = "CupertinoSegmentedButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :border_color, :bottom, :click_color, :col, :controls, :data, :disabled, :disabled_color, :disabled_text_color, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :selected_color, :selected_index, :size_change_interval, :tooltip, :top, :unselected_color, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
animate_align = props[:animate_align]
|
|
18
|
+
animate_margin = props[:animate_margin]
|
|
19
|
+
animate_offset = props[:animate_offset]
|
|
20
|
+
animate_opacity = props[:animate_opacity]
|
|
21
|
+
animate_position = props[:animate_position]
|
|
22
|
+
animate_rotation = props[:animate_rotation]
|
|
23
|
+
animate_scale = props[:animate_scale]
|
|
24
|
+
animate_size = props[:animate_size]
|
|
25
|
+
aspect_ratio = props[:aspect_ratio]
|
|
26
|
+
badge = props[:badge]
|
|
27
|
+
border_color = props[:border_color]
|
|
28
|
+
bottom = props[:bottom]
|
|
29
|
+
click_color = props[:click_color]
|
|
30
|
+
col = props[:col]
|
|
31
|
+
controls = props[:controls]
|
|
32
|
+
data = props[:data]
|
|
33
|
+
disabled = props[:disabled]
|
|
34
|
+
disabled_color = props[:disabled_color]
|
|
35
|
+
disabled_text_color = props[:disabled_text_color]
|
|
36
|
+
expand = props[:expand]
|
|
37
|
+
expand_loose = props[:expand_loose]
|
|
38
|
+
height = props[:height]
|
|
39
|
+
key = props[:key]
|
|
40
|
+
left = props[:left]
|
|
41
|
+
margin = props[:margin]
|
|
42
|
+
offset = props[:offset]
|
|
43
|
+
opacity = props[:opacity]
|
|
44
|
+
padding = props[:padding]
|
|
45
|
+
right = props[:right]
|
|
46
|
+
rotate = props[:rotate]
|
|
47
|
+
rtl = props[:rtl]
|
|
48
|
+
scale = props[:scale]
|
|
49
|
+
selected_color = props[:selected_color]
|
|
50
|
+
selected_index = props[:selected_index]
|
|
51
|
+
size_change_interval = props[:size_change_interval]
|
|
52
|
+
tooltip = props[:tooltip]
|
|
53
|
+
top = props[:top]
|
|
54
|
+
unselected_color = props[:unselected_color]
|
|
55
|
+
visible = props[:visible]
|
|
56
|
+
width = props[:width]
|
|
57
|
+
on_animation_end = props[:on_animation_end]
|
|
58
|
+
on_change = props[:on_change]
|
|
59
|
+
on_size_change = props[:on_size_change]
|
|
12
60
|
selected_index = 0 if selected_index.nil?
|
|
13
61
|
|
|
14
62
|
props = {}
|
|
@@ -8,13 +8,58 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinoslider".freeze
|
|
9
9
|
WIRE = "CupertinoSlider".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :data, :disabled, :divisions, :expand, :expand_loose, :height, :key, :left, :margin, :max, :min, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :thumb_color, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_change_end, :on_change_start, :on_focus, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
active_color = props[:active_color]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
badge = props[:badge]
|
|
28
|
+
bottom = props[:bottom]
|
|
29
|
+
col = props[:col]
|
|
30
|
+
data = props[:data]
|
|
31
|
+
disabled = props[:disabled]
|
|
32
|
+
divisions = props[:divisions]
|
|
33
|
+
expand = props[:expand]
|
|
34
|
+
expand_loose = props[:expand_loose]
|
|
35
|
+
height = props[:height]
|
|
36
|
+
key = props[:key]
|
|
37
|
+
left = props[:left]
|
|
38
|
+
margin = props[:margin]
|
|
39
|
+
max = props[:max]
|
|
40
|
+
min = props[:min]
|
|
41
|
+
offset = props[:offset]
|
|
42
|
+
opacity = props[:opacity]
|
|
43
|
+
right = props[:right]
|
|
44
|
+
rotate = props[:rotate]
|
|
45
|
+
rtl = props[:rtl]
|
|
46
|
+
scale = props[:scale]
|
|
47
|
+
size_change_interval = props[:size_change_interval]
|
|
48
|
+
thumb_color = props[:thumb_color]
|
|
49
|
+
tooltip = props[:tooltip]
|
|
50
|
+
top = props[:top]
|
|
51
|
+
value = props[:value]
|
|
52
|
+
visible = props[:visible]
|
|
53
|
+
width = props[:width]
|
|
54
|
+
on_animation_end = props[:on_animation_end]
|
|
55
|
+
on_blur = props[:on_blur]
|
|
56
|
+
on_change = props[:on_change]
|
|
57
|
+
on_change_end = props[:on_change_end]
|
|
58
|
+
on_change_start = props[:on_change_start]
|
|
59
|
+
on_focus = props[:on_focus]
|
|
60
|
+
on_size_change = props[:on_size_change]
|
|
12
61
|
min = 0.0 if min.nil?
|
|
13
62
|
max = 1.0 if max.nil?
|
|
14
|
-
raise ArgumentError, "cupertino_slider min must be less than or equal to max" if min > max
|
|
15
|
-
raise ArgumentError, "cupertino_slider divisions must be greater than 0" unless divisions.nil? || divisions.positive?
|
|
16
|
-
raise ArgumentError, "cupertino_slider value must be greater than or equal to min" unless value.nil? || value >= min
|
|
17
|
-
raise ArgumentError, "cupertino_slider value must be less than or equal to max" unless value.nil? || value <= max
|
|
18
63
|
|
|
19
64
|
props = {}
|
|
20
65
|
props[:active_color] = active_color unless active_color.nil?
|
|
@@ -8,7 +8,52 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinoslidingsegmentedbutton".freeze
|
|
9
9
|
WIRE = "CupertinoSlidingSegmentedButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :controls, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :padding, :proportional_width, :right, :rotate, :rtl, :scale, :selected_index, :size_change_interval, :thumb_color, :tooltip, :top, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
animate_align = props[:animate_align]
|
|
18
|
+
animate_margin = props[:animate_margin]
|
|
19
|
+
animate_offset = props[:animate_offset]
|
|
20
|
+
animate_opacity = props[:animate_opacity]
|
|
21
|
+
animate_position = props[:animate_position]
|
|
22
|
+
animate_rotation = props[:animate_rotation]
|
|
23
|
+
animate_scale = props[:animate_scale]
|
|
24
|
+
animate_size = props[:animate_size]
|
|
25
|
+
aspect_ratio = props[:aspect_ratio]
|
|
26
|
+
badge = props[:badge]
|
|
27
|
+
bgcolor = props[:bgcolor]
|
|
28
|
+
bottom = props[:bottom]
|
|
29
|
+
col = props[:col]
|
|
30
|
+
controls = props[:controls]
|
|
31
|
+
data = props[:data]
|
|
32
|
+
disabled = props[:disabled]
|
|
33
|
+
expand = props[:expand]
|
|
34
|
+
expand_loose = props[:expand_loose]
|
|
35
|
+
height = props[:height]
|
|
36
|
+
key = props[:key]
|
|
37
|
+
left = props[:left]
|
|
38
|
+
margin = props[:margin]
|
|
39
|
+
offset = props[:offset]
|
|
40
|
+
opacity = props[:opacity]
|
|
41
|
+
padding = props[:padding]
|
|
42
|
+
proportional_width = props[:proportional_width]
|
|
43
|
+
right = props[:right]
|
|
44
|
+
rotate = props[:rotate]
|
|
45
|
+
rtl = props[:rtl]
|
|
46
|
+
scale = props[:scale]
|
|
47
|
+
selected_index = props[:selected_index]
|
|
48
|
+
size_change_interval = props[:size_change_interval]
|
|
49
|
+
thumb_color = props[:thumb_color]
|
|
50
|
+
tooltip = props[:tooltip]
|
|
51
|
+
top = props[:top]
|
|
52
|
+
visible = props[:visible]
|
|
53
|
+
width = props[:width]
|
|
54
|
+
on_animation_end = props[:on_animation_end]
|
|
55
|
+
on_change = props[:on_change]
|
|
56
|
+
on_size_change = props[:on_size_change]
|
|
12
57
|
proportional_width = false if proportional_width.nil?
|
|
13
58
|
selected_index = 0 if selected_index.nil?
|
|
14
59
|
|
|
@@ -8,7 +8,67 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinoswitch".freeze
|
|
9
9
|
WIRE = "CupertinoSwitch".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:active_thumb_image, :active_thumb_image_src, :active_track_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :focus_color, :height, :inactive_thumb_color, :inactive_thumb_image, :inactive_thumb_image_src, :inactive_track_color, :key, :label, :label_position, :left, :margin, :off_label_color, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :thumb_color, :thumb_icon, :tooltip, :top, :track_outline_color, :track_outline_width, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_focus, :on_image_error, :on_label_color, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
active_thumb_image = props[:active_thumb_image]
|
|
17
|
+
active_thumb_image_src = props[:active_thumb_image_src]
|
|
18
|
+
active_track_color = props[:active_track_color]
|
|
19
|
+
align = props[:align]
|
|
20
|
+
animate_align = props[:animate_align]
|
|
21
|
+
animate_margin = props[:animate_margin]
|
|
22
|
+
animate_offset = props[:animate_offset]
|
|
23
|
+
animate_opacity = props[:animate_opacity]
|
|
24
|
+
animate_position = props[:animate_position]
|
|
25
|
+
animate_rotation = props[:animate_rotation]
|
|
26
|
+
animate_scale = props[:animate_scale]
|
|
27
|
+
animate_size = props[:animate_size]
|
|
28
|
+
aspect_ratio = props[:aspect_ratio]
|
|
29
|
+
autofocus = props[:autofocus]
|
|
30
|
+
badge = props[:badge]
|
|
31
|
+
bottom = props[:bottom]
|
|
32
|
+
col = props[:col]
|
|
33
|
+
data = props[:data]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
expand = props[:expand]
|
|
36
|
+
expand_loose = props[:expand_loose]
|
|
37
|
+
focus_color = props[:focus_color]
|
|
38
|
+
height = props[:height]
|
|
39
|
+
inactive_thumb_color = props[:inactive_thumb_color]
|
|
40
|
+
inactive_thumb_image = props[:inactive_thumb_image]
|
|
41
|
+
inactive_thumb_image_src = props[:inactive_thumb_image_src]
|
|
42
|
+
inactive_track_color = props[:inactive_track_color]
|
|
43
|
+
key = props[:key]
|
|
44
|
+
label = props[:label]
|
|
45
|
+
label_position = props[:label_position]
|
|
46
|
+
left = props[:left]
|
|
47
|
+
margin = props[:margin]
|
|
48
|
+
off_label_color = props[:off_label_color]
|
|
49
|
+
offset = props[:offset]
|
|
50
|
+
opacity = props[:opacity]
|
|
51
|
+
right = props[:right]
|
|
52
|
+
rotate = props[:rotate]
|
|
53
|
+
rtl = props[:rtl]
|
|
54
|
+
scale = props[:scale]
|
|
55
|
+
size_change_interval = props[:size_change_interval]
|
|
56
|
+
thumb_color = props[:thumb_color]
|
|
57
|
+
thumb_icon = props[:thumb_icon]
|
|
58
|
+
tooltip = props[:tooltip]
|
|
59
|
+
top = props[:top]
|
|
60
|
+
track_outline_color = props[:track_outline_color]
|
|
61
|
+
track_outline_width = props[:track_outline_width]
|
|
62
|
+
value = props[:value]
|
|
63
|
+
visible = props[:visible]
|
|
64
|
+
width = props[:width]
|
|
65
|
+
on_animation_end = props[:on_animation_end]
|
|
66
|
+
on_blur = props[:on_blur]
|
|
67
|
+
on_change = props[:on_change]
|
|
68
|
+
on_focus = props[:on_focus]
|
|
69
|
+
on_image_error = props[:on_image_error]
|
|
70
|
+
on_label_color = props[:on_label_color]
|
|
71
|
+
on_size_change = props[:on_size_change]
|
|
12
72
|
active_thumb_image_src = active_thumb_image if active_thumb_image_src.nil?
|
|
13
73
|
inactive_thumb_image_src = inactive_thumb_image if inactive_thumb_image_src.nil?
|
|
14
74
|
autofocus = false if autofocus.nil?
|