ruflet_core 0.0.17 → 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 -30
- 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 -50
- data/lib/ruflet_ui/ruflet/control.rb +69 -64
- 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 +308 -526
- 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 +7 -8
- 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,70 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "rangeslider".freeze
|
|
9
9
|
WIRE = "RangeSlider".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
min_value = min.nil? ? 0.0 : min
|
|
13
|
-
max_value = max.nil? ? 1.0 : max
|
|
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, :end_value, :expand, :expand_loose, :height, :inactive_color, :key, :label, :left, :margin, :max, :min, :mouse_cursor, :offset, :opacity, :overlay_color, :right, :rotate, :round, :rtl, :scale, :size_change_interval, :start_value, :tooltip, :top, :visible, :width, :on_animation_end, :on_change, :on_change_end, :on_change_start, :on_size_change].freeze
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
unless start_value.nil? || end_value.nil? || start_value <= end_value
|
|
22
|
-
raise ArgumentError, "range_slider start_value must be less than or equal to end_value"
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
23
18
|
end
|
|
24
|
-
|
|
25
|
-
props = {}
|
|
26
|
-
props[:active_color] = active_color unless active_color.nil?
|
|
27
|
-
props[:align] = align unless align.nil?
|
|
28
|
-
props[:animate_align] = animate_align unless animate_align.nil?
|
|
29
|
-
props[:animate_margin] = animate_margin unless animate_margin.nil?
|
|
30
|
-
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
31
|
-
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
32
|
-
props[:animate_position] = animate_position unless animate_position.nil?
|
|
33
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
34
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
35
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
36
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
37
|
-
props[:badge] = badge unless badge.nil?
|
|
38
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
39
|
-
props[:col] = col unless col.nil?
|
|
40
|
-
props[:data] = data unless data.nil?
|
|
41
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
42
|
-
props[:divisions] = divisions unless divisions.nil?
|
|
43
|
-
props[:end_value] = end_value unless end_value.nil?
|
|
44
|
-
props[:expand] = expand unless expand.nil?
|
|
45
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
46
|
-
props[:height] = height unless height.nil?
|
|
47
|
-
props[:inactive_color] = inactive_color unless inactive_color.nil?
|
|
48
|
-
props[:key] = key unless key.nil?
|
|
49
|
-
props[:label] = label unless label.nil?
|
|
50
|
-
props[:left] = left unless left.nil?
|
|
51
|
-
props[:margin] = margin unless margin.nil?
|
|
52
|
-
props[:max] = max unless max.nil?
|
|
53
|
-
props[:min] = min unless min.nil?
|
|
54
|
-
props[:mouse_cursor] = mouse_cursor unless mouse_cursor.nil?
|
|
55
|
-
props[:offset] = offset unless offset.nil?
|
|
56
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
57
|
-
props[:overlay_color] = overlay_color unless overlay_color.nil?
|
|
58
|
-
props[:right] = right unless right.nil?
|
|
59
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
60
|
-
props[:round] = round unless round.nil?
|
|
61
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
62
|
-
props[:scale] = scale unless scale.nil?
|
|
63
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
64
|
-
props[:start_value] = start_value unless start_value.nil?
|
|
65
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
66
|
-
props[:top] = top unless top.nil?
|
|
67
|
-
props[:visible] = visible unless visible.nil?
|
|
68
|
-
props[:width] = width unless width.nil?
|
|
69
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
70
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
71
|
-
props[:on_change_end] = on_change_end unless on_change_end.nil?
|
|
72
|
-
props[:on_change_start] = on_change_start unless on_change_start.nil?
|
|
73
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
74
|
-
super(type: TYPE, id: id, **props)
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
75
20
|
end
|
|
76
21
|
end
|
|
77
22
|
end
|
|
@@ -8,70 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "reorderablelistview".freeze
|
|
9
9
|
WIRE = "ReorderableListView".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_position] = animate_position unless animate_position.nil?
|
|
21
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
22
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
23
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
24
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
25
|
-
props[:auto_scroll] = auto_scroll unless auto_scroll.nil?
|
|
26
|
-
props[:auto_scroller_velocity_scalar] = auto_scroller_velocity_scalar unless auto_scroller_velocity_scalar.nil?
|
|
27
|
-
props[:badge] = badge unless badge.nil?
|
|
28
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
29
|
-
props[:build_controls_on_demand] = build_controls_on_demand unless build_controls_on_demand.nil?
|
|
30
|
-
props[:cache_extent] = cache_extent unless cache_extent.nil?
|
|
31
|
-
props[:clip_behavior] = clip_behavior unless clip_behavior.nil?
|
|
32
|
-
props[:col] = col unless col.nil?
|
|
33
|
-
props[:controls] = controls unless controls.nil?
|
|
34
|
-
props[:data] = data unless data.nil?
|
|
35
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
36
|
-
props[:divider_thickness] = divider_thickness unless divider_thickness.nil?
|
|
37
|
-
props[:expand] = expand unless expand.nil?
|
|
38
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
39
|
-
props[:first_item_prototype] = first_item_prototype unless first_item_prototype.nil?
|
|
40
|
-
props[:footer] = footer unless footer.nil?
|
|
41
|
-
props[:header] = header unless header.nil?
|
|
42
|
-
props[:height] = height unless height.nil?
|
|
43
|
-
props[:horizontal] = horizontal unless horizontal.nil?
|
|
44
|
-
props[:item_extent] = item_extent unless item_extent.nil?
|
|
45
|
-
props[:key] = key unless key.nil?
|
|
46
|
-
props[:left] = left unless left.nil?
|
|
47
|
-
props[:margin] = margin unless margin.nil?
|
|
48
|
-
props[:mouse_cursor] = mouse_cursor unless mouse_cursor.nil?
|
|
49
|
-
props[:offset] = offset unless offset.nil?
|
|
50
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
51
|
-
props[:padding] = padding unless padding.nil?
|
|
52
|
-
props[:prototype_item] = prototype_item unless prototype_item.nil?
|
|
53
|
-
props[:reverse] = reverse unless reverse.nil?
|
|
54
|
-
props[:right] = right unless right.nil?
|
|
55
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
56
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
57
|
-
props[:scale] = scale unless scale.nil?
|
|
58
|
-
props[:scroll] = scroll unless scroll.nil?
|
|
59
|
-
props[:scroll_interval] = scroll_interval unless scroll_interval.nil?
|
|
60
|
-
props[:semantic_child_count] = semantic_child_count unless semantic_child_count.nil?
|
|
61
|
-
props[:show_default_drag_handles] = show_default_drag_handles unless show_default_drag_handles.nil?
|
|
62
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
63
|
-
props[:spacing] = spacing unless spacing.nil?
|
|
64
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
65
|
-
props[:top] = top unless top.nil?
|
|
66
|
-
props[:visible] = visible unless visible.nil?
|
|
67
|
-
props[:width] = width unless width.nil?
|
|
68
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
69
|
-
props[:on_reorder] = on_reorder unless on_reorder.nil?
|
|
70
|
-
props[:on_reorder_end] = on_reorder_end unless on_reorder_end.nil?
|
|
71
|
-
props[:on_reorder_start] = on_reorder_start unless on_reorder_start.nil?
|
|
72
|
-
props[:on_scroll] = on_scroll unless on_scroll.nil?
|
|
73
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
74
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :anchor, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :auto_scroll, :auto_scroller_velocity_scalar, :badge, :bottom, :build_controls_on_demand, :cache_extent, :clip_behavior, :col, :controls, :data, :disabled, :divider_thickness, :expand, :expand_loose, :first_item_prototype, :footer, :header, :height, :horizontal, :item_extent, :key, :left, :margin, :mouse_cursor, :offset, :opacity, :padding, :prototype_item, :reverse, :right, :rotate, :rtl, :scale, :scroll, :scroll_interval, :semantic_child_count, :show_default_drag_handles, :size_change_interval, :spacing, :tooltip, :top, :visible, :width, :on_animation_end, :on_reorder, :on_reorder_end, :on_reorder_start, :on_scroll, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
75
20
|
end
|
|
76
21
|
end
|
|
77
22
|
end
|
|
@@ -15,7 +15,6 @@ require_relative "card_control"
|
|
|
15
15
|
require_relative "checkbox_control"
|
|
16
16
|
require_relative "chip_control"
|
|
17
17
|
require_relative "circleavatar_control"
|
|
18
|
-
require_relative "codeeditor_control"
|
|
19
18
|
require_relative "container_control"
|
|
20
19
|
require_relative "contextmenu_control"
|
|
21
20
|
require_relative "datacell_control"
|
|
@@ -38,7 +37,6 @@ require_relative "filledtonaliconbutton_control"
|
|
|
38
37
|
require_relative "floatingactionbutton_control"
|
|
39
38
|
require_relative "iconbutton_control"
|
|
40
39
|
require_relative "listtile_control"
|
|
41
|
-
require_relative "map_controls"
|
|
42
40
|
require_relative "menubar_control"
|
|
43
41
|
require_relative "menuitembutton_control"
|
|
44
42
|
require_relative "navigationbar_control"
|
|
@@ -54,17 +52,18 @@ require_relative "popupmenubutton_control"
|
|
|
54
52
|
require_relative "popupmenuitem_control"
|
|
55
53
|
require_relative "progressbar_control"
|
|
56
54
|
require_relative "progressring_control"
|
|
55
|
+
require_relative "spinkit_control"
|
|
57
56
|
require_relative "radio_control"
|
|
58
57
|
require_relative "radiogroup_control"
|
|
59
58
|
require_relative "rangeslider_control"
|
|
60
59
|
require_relative "reorderablelistview_control"
|
|
61
|
-
require_relative "rive_control"
|
|
62
60
|
require_relative "searchbar_control"
|
|
63
61
|
require_relative "segment_control"
|
|
64
62
|
require_relative "segmentedbutton_control"
|
|
65
63
|
require_relative "selectionarea_control"
|
|
66
64
|
require_relative "slider_control"
|
|
67
65
|
require_relative "snackbar_control"
|
|
66
|
+
require_relative "snackbaraction_control"
|
|
68
67
|
require_relative "submenubutton_control"
|
|
69
68
|
require_relative "switch_control"
|
|
70
69
|
require_relative "tab_control"
|
|
@@ -122,8 +121,6 @@ module Ruflet
|
|
|
122
121
|
"chip" => RufletComponents::ChipControl,
|
|
123
122
|
"circle_avatar" => RufletComponents::CircleAvatarControl,
|
|
124
123
|
"circleavatar" => RufletComponents::CircleAvatarControl,
|
|
125
|
-
"code_editor" => RufletComponents::CodeEditorControl,
|
|
126
|
-
"codeeditor" => RufletComponents::CodeEditorControl,
|
|
127
124
|
"container" => RufletComponents::ContainerControl,
|
|
128
125
|
"context_menu" => RufletComponents::ContextMenuControl,
|
|
129
126
|
"contextmenu" => RufletComponents::ContextMenuControl,
|
|
@@ -171,26 +168,6 @@ module Ruflet
|
|
|
171
168
|
"linechartdatapoint" => RufletComponents::LineChartDataPointControl,
|
|
172
169
|
"list_tile" => RufletComponents::ListTileControl,
|
|
173
170
|
"listtile" => RufletComponents::ListTileControl,
|
|
174
|
-
"map" => RufletComponents::MapControl,
|
|
175
|
-
"tile_layer" => RufletComponents::TileLayerControl,
|
|
176
|
-
"tilelayer" => RufletComponents::TileLayerControl,
|
|
177
|
-
"marker_layer" => RufletComponents::MarkerLayerControl,
|
|
178
|
-
"markerlayer" => RufletComponents::MarkerLayerControl,
|
|
179
|
-
"marker" => RufletComponents::MarkerControl,
|
|
180
|
-
"circle_layer" => RufletComponents::CircleLayerControl,
|
|
181
|
-
"circlelayer" => RufletComponents::CircleLayerControl,
|
|
182
|
-
"circle_marker" => RufletComponents::CircleMarkerControl,
|
|
183
|
-
"circlemarker" => RufletComponents::CircleMarkerControl,
|
|
184
|
-
"polyline_layer" => RufletComponents::PolylineLayerControl,
|
|
185
|
-
"polylinelayer" => RufletComponents::PolylineLayerControl,
|
|
186
|
-
"polyline_marker" => RufletComponents::PolylineMarkerControl,
|
|
187
|
-
"polylinemarker" => RufletComponents::PolylineMarkerControl,
|
|
188
|
-
"polygon_layer" => RufletComponents::PolygonLayerControl,
|
|
189
|
-
"polygonlayer" => RufletComponents::PolygonLayerControl,
|
|
190
|
-
"polygon_marker" => RufletComponents::PolygonMarkerControl,
|
|
191
|
-
"polygonmarker" => RufletComponents::PolygonMarkerControl,
|
|
192
|
-
"simple_attribution" => RufletComponents::SimpleAttributionControl,
|
|
193
|
-
"simpleattribution" => RufletComponents::SimpleAttributionControl,
|
|
194
171
|
"menu_bar" => RufletComponents::MenuBarControl,
|
|
195
172
|
"menu_item_button" => RufletComponents::MenuItemButtonControl,
|
|
196
173
|
"menubar" => RufletComponents::MenuBarControl,
|
|
@@ -224,6 +201,7 @@ module Ruflet
|
|
|
224
201
|
"progress_ring" => RufletComponents::ProgressRingControl,
|
|
225
202
|
"progressbar" => RufletComponents::ProgressBarControl,
|
|
226
203
|
"progressring" => RufletComponents::ProgressRingControl,
|
|
204
|
+
"spinkit" => RufletComponents::SpinkitControl,
|
|
227
205
|
"radio" => RufletComponents::RadioControl,
|
|
228
206
|
"radio_group" => RufletComponents::RadioGroupControl,
|
|
229
207
|
"radiogroup" => RufletComponents::RadioGroupControl,
|
|
@@ -239,7 +217,6 @@ module Ruflet
|
|
|
239
217
|
"rangeslider" => RufletComponents::RangeSliderControl,
|
|
240
218
|
"reorderable_list_view" => RufletComponents::ReorderableListViewControl,
|
|
241
219
|
"reorderablelistview" => RufletComponents::ReorderableListViewControl,
|
|
242
|
-
"rive" => RufletComponents::RiveControl,
|
|
243
220
|
"search_bar" => RufletComponents::SearchBarControl,
|
|
244
221
|
"searchbar" => RufletComponents::SearchBarControl,
|
|
245
222
|
"segment" => RufletComponents::SegmentControl,
|
|
@@ -253,6 +230,8 @@ module Ruflet
|
|
|
253
230
|
"scatterchartspot" => RufletComponents::ScatterChartSpotControl,
|
|
254
231
|
"slider" => RufletComponents::SliderControl,
|
|
255
232
|
"snack_bar" => RufletComponents::SnackBarControl,
|
|
233
|
+
"snack_bar_action" => RufletComponents::SnackBarActionControl,
|
|
234
|
+
"snackbaraction" => RufletComponents::SnackBarActionControl,
|
|
256
235
|
"snackbar" => RufletComponents::SnackBarControl,
|
|
257
236
|
"submenu_button" => RufletComponents::SubmenuButtonControl,
|
|
258
237
|
"submenubutton" => RufletComponents::SubmenuButtonControl,
|
|
@@ -8,21 +8,90 @@ module Ruflet
|
|
|
8
8
|
TYPE = "searchbar".freeze
|
|
9
9
|
WIRE = "SearchBar".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, :autofocus, :badge, :bar_bgcolor, :bar_border_side, :bar_elevation, :bar_hint_text, :bar_hint_text_style, :bar_leading, :bar_overlay_color, :bar_padding, :bar_scroll_padding, :bar_shadow_color, :bar_shape, :bar_size_constraints, :bar_text_style, :bar_trailing, :bottom, :capitalization, :col, :controls, :data, :disabled, :divider_color, :expand, :expand_loose, :full_screen, :height, :key, :keyboard_type, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :shrink_wrap, :size_change_interval, :tooltip, :top, :value, :view_bar_padding, :view_bgcolor, :view_elevation, :view_header_height, :view_header_text_style, :view_hint_text, :view_hint_text_style, :view_leading, :view_padding, :view_shape, :view_side, :view_size_constraints, :view_trailing, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_focus, :on_size_change, :on_submit, :on_tap, :on_tap_outside_bar].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
|
+
autofocus = props[:autofocus]
|
|
27
|
+
badge = props[:badge]
|
|
28
|
+
bar_bgcolor = props[:bar_bgcolor]
|
|
29
|
+
bar_border_side = props[:bar_border_side]
|
|
30
|
+
bar_elevation = props[:bar_elevation]
|
|
31
|
+
bar_hint_text = props[:bar_hint_text]
|
|
32
|
+
bar_hint_text_style = props[:bar_hint_text_style]
|
|
33
|
+
bar_leading = props[:bar_leading]
|
|
34
|
+
bar_overlay_color = props[:bar_overlay_color]
|
|
35
|
+
bar_padding = props[:bar_padding]
|
|
36
|
+
bar_scroll_padding = props[:bar_scroll_padding]
|
|
37
|
+
bar_shadow_color = props[:bar_shadow_color]
|
|
38
|
+
bar_shape = props[:bar_shape]
|
|
39
|
+
bar_size_constraints = props[:bar_size_constraints]
|
|
40
|
+
bar_text_style = props[:bar_text_style]
|
|
41
|
+
bar_trailing = props[:bar_trailing]
|
|
42
|
+
bottom = props[:bottom]
|
|
43
|
+
capitalization = props[:capitalization]
|
|
44
|
+
col = props[:col]
|
|
45
|
+
controls = props[:controls]
|
|
46
|
+
data = props[:data]
|
|
47
|
+
disabled = props[:disabled]
|
|
48
|
+
divider_color = props[:divider_color]
|
|
49
|
+
expand = props[:expand]
|
|
50
|
+
expand_loose = props[:expand_loose]
|
|
51
|
+
full_screen = props[:full_screen]
|
|
52
|
+
height = props[:height]
|
|
53
|
+
key = props[:key]
|
|
54
|
+
keyboard_type = props[:keyboard_type]
|
|
55
|
+
left = props[:left]
|
|
56
|
+
margin = props[:margin]
|
|
57
|
+
offset = props[:offset]
|
|
58
|
+
opacity = props[:opacity]
|
|
59
|
+
right = props[:right]
|
|
60
|
+
rotate = props[:rotate]
|
|
61
|
+
rtl = props[:rtl]
|
|
62
|
+
scale = props[:scale]
|
|
63
|
+
shrink_wrap = props[:shrink_wrap]
|
|
64
|
+
size_change_interval = props[:size_change_interval]
|
|
65
|
+
tooltip = props[:tooltip]
|
|
66
|
+
top = props[:top]
|
|
67
|
+
value = props[:value]
|
|
68
|
+
view_bar_padding = props[:view_bar_padding]
|
|
69
|
+
view_bgcolor = props[:view_bgcolor]
|
|
70
|
+
view_elevation = props[:view_elevation]
|
|
71
|
+
view_header_height = props[:view_header_height]
|
|
72
|
+
view_header_text_style = props[:view_header_text_style]
|
|
73
|
+
view_hint_text = props[:view_hint_text]
|
|
74
|
+
view_hint_text_style = props[:view_hint_text_style]
|
|
75
|
+
view_leading = props[:view_leading]
|
|
76
|
+
view_padding = props[:view_padding]
|
|
77
|
+
view_shape = props[:view_shape]
|
|
78
|
+
view_side = props[:view_side]
|
|
79
|
+
view_size_constraints = props[:view_size_constraints]
|
|
80
|
+
view_trailing = props[:view_trailing]
|
|
81
|
+
visible = props[:visible]
|
|
82
|
+
width = props[:width]
|
|
83
|
+
on_animation_end = props[:on_animation_end]
|
|
84
|
+
on_blur = props[:on_blur]
|
|
85
|
+
on_change = props[:on_change]
|
|
86
|
+
on_focus = props[:on_focus]
|
|
87
|
+
on_size_change = props[:on_size_change]
|
|
88
|
+
on_submit = props[:on_submit]
|
|
89
|
+
on_tap = props[:on_tap]
|
|
90
|
+
on_tap_outside_bar = props[:on_tap_outside_bar]
|
|
12
91
|
autofocus = false if autofocus.nil?
|
|
13
92
|
full_screen = false if full_screen.nil?
|
|
14
93
|
value = "" if value.nil?
|
|
15
94
|
|
|
16
|
-
{
|
|
17
|
-
bar_elevation: bar_elevation,
|
|
18
|
-
view_elevation: view_elevation,
|
|
19
|
-
view_header_height: view_header_height
|
|
20
|
-
}.each do |name, value|
|
|
21
|
-
next unless value.is_a?(Numeric)
|
|
22
|
-
|
|
23
|
-
raise ArgumentError, "search_bar #{name} must be greater than or equal to 0" if value.negative?
|
|
24
|
-
end
|
|
25
|
-
|
|
26
95
|
props = {}
|
|
27
96
|
props[:align] = align unless align.nil?
|
|
28
97
|
props[:animate_align] = animate_align unless animate_align.nil?
|
|
@@ -11,9 +11,6 @@ module Ruflet
|
|
|
11
11
|
def initialize(id: nil, badge: nil, col: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, icon: nil, key: nil, label: nil, opacity: nil, rtl: nil, tooltip: nil, value: nil, visible: nil)
|
|
12
12
|
raise ArgumentError, "segment requires value" if value.nil?
|
|
13
13
|
|
|
14
|
-
visible_label = label && (!label.respond_to?(:props) || label.props["visible"] != false)
|
|
15
|
-
raise ArgumentError, "segment requires visible label or icon" if !visible_label && icon.nil?
|
|
16
|
-
|
|
17
14
|
props = {}
|
|
18
15
|
props[:badge] = badge unless badge.nil?
|
|
19
16
|
props[:col] = col unless col.nil?
|
|
@@ -8,72 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "segmentedbutton".freeze
|
|
9
9
|
WIRE = "SegmentedButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
visible_segments = Array(segments).reject { |segment| segment.respond_to?(:props) && segment.props["visible"] == false }
|
|
13
|
-
raise ArgumentError, "segmented_button requires at least one visible segment" if visible_segments.empty?
|
|
11
|
+
KEYWORDS = [:align, :allow_empty_selection, :allow_multiple_selection, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :data, :direction, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :segments, :selected, :selected_icon, :show_selected_icon, :size_change_interval, :style, :tooltip, :top, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
18
|
end
|
|
19
|
-
|
|
20
|
-
raise ArgumentError, "segmented_button selected cannot contain multiple values unless allow_multiple_selection is true"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
segment_values = visible_segments.filter_map do |segment|
|
|
24
|
-
segment.respond_to?(:props) ? segment.props["value"] : nil
|
|
25
|
-
end
|
|
26
|
-
missing_values = selected_values - segment_values
|
|
27
|
-
unless missing_values.empty?
|
|
28
|
-
raise ArgumentError, "segmented_button selected values must match segment values"
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
props = {}
|
|
32
|
-
props[:align] = align unless align.nil?
|
|
33
|
-
props[:allow_empty_selection] = allow_empty_selection unless allow_empty_selection.nil?
|
|
34
|
-
props[:allow_multiple_selection] = allow_multiple_selection unless allow_multiple_selection.nil?
|
|
35
|
-
props[:animate_align] = animate_align unless animate_align.nil?
|
|
36
|
-
props[:animate_margin] = animate_margin unless animate_margin.nil?
|
|
37
|
-
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
38
|
-
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
39
|
-
props[:animate_position] = animate_position unless animate_position.nil?
|
|
40
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
41
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
42
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
43
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
44
|
-
props[:badge] = badge unless badge.nil?
|
|
45
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
46
|
-
props[:col] = col unless col.nil?
|
|
47
|
-
props[:data] = data unless data.nil?
|
|
48
|
-
props[:direction] = direction unless direction.nil?
|
|
49
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
50
|
-
props[:expand] = expand unless expand.nil?
|
|
51
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
52
|
-
props[:height] = height unless height.nil?
|
|
53
|
-
props[:key] = key unless key.nil?
|
|
54
|
-
props[:left] = left unless left.nil?
|
|
55
|
-
props[:margin] = margin unless margin.nil?
|
|
56
|
-
props[:offset] = offset unless offset.nil?
|
|
57
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
58
|
-
props[:padding] = padding unless padding.nil?
|
|
59
|
-
props[:right] = right unless right.nil?
|
|
60
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
61
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
62
|
-
props[:scale] = scale unless scale.nil?
|
|
63
|
-
props[:segments] = segments unless segments.nil?
|
|
64
|
-
props[:selected] = selected unless selected.nil?
|
|
65
|
-
props[:selected_icon] = selected_icon unless selected_icon.nil?
|
|
66
|
-
props[:show_selected_icon] = show_selected_icon unless show_selected_icon.nil?
|
|
67
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
68
|
-
props[:style] = style unless style.nil?
|
|
69
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
70
|
-
props[:top] = top unless top.nil?
|
|
71
|
-
props[:visible] = visible unless visible.nil?
|
|
72
|
-
props[:width] = width unless width.nil?
|
|
73
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
74
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
75
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
76
|
-
super(type: TYPE, id: id, **props)
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
77
20
|
end
|
|
78
21
|
end
|
|
79
22
|
end
|
|
@@ -9,9 +9,7 @@ module Ruflet
|
|
|
9
9
|
WIRE = "SelectionArea".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, badge: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, opacity: nil, rtl: nil, tooltip: nil, visible: nil, on_change: nil)
|
|
12
|
-
|
|
13
|
-
raise ArgumentError, "selection_area requires visible content"
|
|
14
|
-
end
|
|
12
|
+
raise ArgumentError, "selection_area requires content" if content.nil?
|
|
15
13
|
|
|
16
14
|
props = {}
|
|
17
15
|
props[:badge] = badge unless badge.nil?
|
|
@@ -8,66 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "slider".freeze
|
|
9
9
|
WIRE = "Slider".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_position] = animate_position unless animate_position.nil?
|
|
21
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
22
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
23
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
24
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
25
|
-
props[:autofocus] = autofocus unless autofocus.nil?
|
|
26
|
-
props[:badge] = badge unless badge.nil?
|
|
27
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
28
|
-
props[:col] = col unless col.nil?
|
|
29
|
-
props[:data] = data unless data.nil?
|
|
30
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
31
|
-
props[:divisions] = divisions unless divisions.nil?
|
|
32
|
-
props[:expand] = expand unless expand.nil?
|
|
33
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
34
|
-
props[:height] = height unless height.nil?
|
|
35
|
-
props[:inactive_color] = inactive_color unless inactive_color.nil?
|
|
36
|
-
props[:interaction] = interaction unless interaction.nil?
|
|
37
|
-
props[:key] = key unless key.nil?
|
|
38
|
-
props[:label] = label unless label.nil?
|
|
39
|
-
props[:left] = left unless left.nil?
|
|
40
|
-
props[:margin] = margin unless margin.nil?
|
|
41
|
-
props[:max] = max unless max.nil?
|
|
42
|
-
props[:min] = min unless min.nil?
|
|
43
|
-
props[:mouse_cursor] = mouse_cursor unless mouse_cursor.nil?
|
|
44
|
-
props[:offset] = offset unless offset.nil?
|
|
45
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
46
|
-
props[:overlay_color] = overlay_color unless overlay_color.nil?
|
|
47
|
-
props[:padding] = padding unless padding.nil?
|
|
48
|
-
props[:right] = right unless right.nil?
|
|
49
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
50
|
-
props[:round] = round unless round.nil?
|
|
51
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
52
|
-
props[:scale] = scale unless scale.nil?
|
|
53
|
-
props[:secondary_active_color] = secondary_active_color unless secondary_active_color.nil?
|
|
54
|
-
props[:secondary_track_value] = secondary_track_value unless secondary_track_value.nil?
|
|
55
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
56
|
-
props[:thumb_color] = thumb_color unless thumb_color.nil?
|
|
57
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
58
|
-
props[:top] = top unless top.nil?
|
|
59
|
-
props[:value] = value unless value.nil?
|
|
60
|
-
props[:visible] = visible unless visible.nil?
|
|
61
|
-
props[:width] = width unless width.nil?
|
|
62
|
-
props[:year_2023] = year_2023 unless year_2023.nil?
|
|
63
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
64
|
-
props[:on_blur] = on_blur unless on_blur.nil?
|
|
65
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
66
|
-
props[:on_change_end] = on_change_end unless on_change_end.nil?
|
|
67
|
-
props[:on_change_start] = on_change_start unless on_change_start.nil?
|
|
68
|
-
props[:on_focus] = on_focus unless on_focus.nil?
|
|
69
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
70
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:active_color, :adaptive, :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, :divisions, :expand, :expand_loose, :height, :inactive_color, :interaction, :key, :label, :left, :margin, :max, :min, :mouse_cursor, :offset, :opacity, :overlay_color, :padding, :right, :rotate, :round, :rtl, :scale, :secondary_active_color, :secondary_track_value, :size_change_interval, :thumb_color, :tooltip, :top, :value, :visible, :width, :year_2023, :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
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
71
20
|
end
|
|
72
21
|
end
|
|
73
22
|
end
|
|
@@ -8,11 +8,44 @@ module Ruflet
|
|
|
8
8
|
TYPE = "snackbar".freeze
|
|
9
9
|
WIRE = "SnackBar".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:action, :action_overflow_threshold, :adaptive, :badge, :behavior, :bgcolor, :clip_behavior, :close_icon_color, :col, :content, :data, :disabled, :dismiss_direction, :duration, :elevation, :expand, :expand_loose, :key, :margin, :opacity, :open, :padding, :persist, :rtl, :shape, :show_close_icon, :tooltip, :visible, :width, :on_action, :on_dismiss, :on_visible].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
|
+
action = props[:action]
|
|
17
|
+
action_overflow_threshold = props[:action_overflow_threshold]
|
|
18
|
+
adaptive = props[:adaptive]
|
|
19
|
+
badge = props[:badge]
|
|
20
|
+
behavior = props[:behavior]
|
|
21
|
+
bgcolor = props[:bgcolor]
|
|
22
|
+
clip_behavior = props[:clip_behavior]
|
|
23
|
+
close_icon_color = props[:close_icon_color]
|
|
24
|
+
col = props[:col]
|
|
25
|
+
content = props[:content]
|
|
26
|
+
data = props[:data]
|
|
27
|
+
disabled = props[:disabled]
|
|
28
|
+
dismiss_direction = props[:dismiss_direction]
|
|
29
|
+
duration = props[:duration]
|
|
30
|
+
elevation = props[:elevation]
|
|
31
|
+
expand = props[:expand]
|
|
32
|
+
expand_loose = props[:expand_loose]
|
|
33
|
+
key = props[:key]
|
|
34
|
+
margin = props[:margin]
|
|
35
|
+
opacity = props[:opacity]
|
|
36
|
+
open = props[:open]
|
|
37
|
+
padding = props[:padding]
|
|
38
|
+
persist = props[:persist]
|
|
39
|
+
rtl = props[:rtl]
|
|
40
|
+
shape = props[:shape]
|
|
41
|
+
show_close_icon = props[:show_close_icon]
|
|
42
|
+
tooltip = props[:tooltip]
|
|
43
|
+
visible = props[:visible]
|
|
44
|
+
width = props[:width]
|
|
45
|
+
on_action = props[:on_action]
|
|
46
|
+
on_dismiss = props[:on_dismiss]
|
|
47
|
+
on_visible = props[:on_visible]
|
|
12
48
|
raise ArgumentError, "snack_bar requires content" if content.nil?
|
|
13
|
-
unless action_overflow_threshold.nil? || (0.0..1.0).cover?(action_overflow_threshold)
|
|
14
|
-
raise ArgumentError, "snack_bar action_overflow_threshold must be between 0.0 and 1.0"
|
|
15
|
-
end
|
|
16
49
|
|
|
17
50
|
props = {}
|
|
18
51
|
props[:action] = action unless action.nil?
|