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,81 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "navigationrail".freeze
|
|
9
9
|
WIRE = "NavigationRail".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
visible_destinations = Array(destinations).reject { |destination| destination.respond_to?(:props) && destination.props["visible"] == false }
|
|
13
|
-
unless destinations.nil? || visible_destinations.length >= 2
|
|
14
|
-
raise ArgumentError, "navigation_rail destinations must include at least two visible destinations"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
unless selected_index.nil? || destinations.nil? || (0...visible_destinations.length).cover?(selected_index)
|
|
18
|
-
raise IndexError, "navigation_rail selected_index is out of range"
|
|
19
|
-
end
|
|
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, :data, :destinations, :disabled, :elevation, :expand, :expand_loose, :extended, :group_alignment, :height, :indicator_color, :indicator_shape, :key, :label_type, :leading, :left, :margin, :min_extended_width, :min_width, :offset, :opacity, :right, :rotate, :rtl, :scale, :selected_index, :selected_label_text_style, :size_change_interval, :tooltip, :top, :trailing, :unselected_label_text_style, :use_indicator, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
{
|
|
26
|
-
elevation: elevation,
|
|
27
|
-
min_extended_width: min_extended_width,
|
|
28
|
-
min_width: min_width
|
|
29
|
-
}.each do |name, value|
|
|
30
|
-
raise ArgumentError, "navigation_rail #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
props = {}
|
|
34
|
-
props[:align] = align unless align.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[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
46
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
47
|
-
props[:col] = col unless col.nil?
|
|
48
|
-
props[:data] = data unless data.nil?
|
|
49
|
-
props[:destinations] = destinations unless destinations.nil?
|
|
50
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
51
|
-
props[:elevation] = elevation unless elevation.nil?
|
|
52
|
-
props[:expand] = expand unless expand.nil?
|
|
53
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
54
|
-
props[:extended] = extended unless extended.nil?
|
|
55
|
-
props[:group_alignment] = group_alignment unless group_alignment.nil?
|
|
56
|
-
props[:height] = height unless height.nil?
|
|
57
|
-
props[:indicator_color] = indicator_color unless indicator_color.nil?
|
|
58
|
-
props[:indicator_shape] = indicator_shape unless indicator_shape.nil?
|
|
59
|
-
props[:key] = key unless key.nil?
|
|
60
|
-
props[:label_type] = label_type unless label_type.nil?
|
|
61
|
-
props[:leading] = leading unless leading.nil?
|
|
62
|
-
props[:left] = left unless left.nil?
|
|
63
|
-
props[:margin] = margin unless margin.nil?
|
|
64
|
-
props[:min_extended_width] = min_extended_width unless min_extended_width.nil?
|
|
65
|
-
props[:min_width] = min_width unless min_width.nil?
|
|
66
|
-
props[:offset] = offset unless offset.nil?
|
|
67
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
68
|
-
props[:right] = right unless right.nil?
|
|
69
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
70
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
71
|
-
props[:scale] = scale unless scale.nil?
|
|
72
|
-
props[:selected_index] = selected_index unless selected_index.nil?
|
|
73
|
-
props[:selected_label_text_style] = selected_label_text_style unless selected_label_text_style.nil?
|
|
74
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
75
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
76
|
-
props[:top] = top unless top.nil?
|
|
77
|
-
props[:trailing] = trailing unless trailing.nil?
|
|
78
|
-
props[:unselected_label_text_style] = unselected_label_text_style unless unselected_label_text_style.nil?
|
|
79
|
-
props[:use_indicator] = use_indicator unless use_indicator.nil?
|
|
80
|
-
props[:visible] = visible unless visible.nil?
|
|
81
|
-
props[:width] = width unless width.nil?
|
|
82
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
83
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
84
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
85
|
-
super(type: TYPE, id: id, **props)
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
86
20
|
end
|
|
87
21
|
end
|
|
88
22
|
end
|
|
@@ -8,9 +8,58 @@ module Ruflet
|
|
|
8
8
|
TYPE = "outlinedbutton".freeze
|
|
9
9
|
WIRE = "OutlinedButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
raise ArgumentError, "outlined_button requires content or icon" if content.nil? && icon.nil?
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bottom, :clip_behavior, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :icon, :icon_color, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :style, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_blur, :on_click, :on_focus, :on_hover, :on_long_press, :on_size_change].freeze
|
|
13
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
|
+
adaptive = props[:adaptive]
|
|
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
|
+
clip_behavior = props[:clip_behavior]
|
|
31
|
+
col = props[:col]
|
|
32
|
+
content = props[:content]
|
|
33
|
+
data = props[:data]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
expand = props[:expand]
|
|
36
|
+
expand_loose = props[:expand_loose]
|
|
37
|
+
height = props[:height]
|
|
38
|
+
icon = props[:icon]
|
|
39
|
+
icon_color = props[:icon_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
|
+
size_change_interval = props[:size_change_interval]
|
|
50
|
+
style = props[:style]
|
|
51
|
+
tooltip = props[:tooltip]
|
|
52
|
+
top = props[:top]
|
|
53
|
+
url = props[:url]
|
|
54
|
+
visible = props[:visible]
|
|
55
|
+
width = props[:width]
|
|
56
|
+
on_animation_end = props[:on_animation_end]
|
|
57
|
+
on_blur = props[:on_blur]
|
|
58
|
+
on_click = props[:on_click]
|
|
59
|
+
on_focus = props[:on_focus]
|
|
60
|
+
on_hover = props[:on_hover]
|
|
61
|
+
on_long_press = props[:on_long_press]
|
|
62
|
+
on_size_change = props[:on_size_change]
|
|
14
63
|
autofocus = false if autofocus.nil?
|
|
15
64
|
clip_behavior = "none" if clip_behavior.nil?
|
|
16
65
|
|
|
@@ -8,15 +8,77 @@ module Ruflet
|
|
|
8
8
|
TYPE = "outlinediconbutton".freeze
|
|
9
9
|
WIRE = "OutlinedIconButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :bottom, :col, :data, :disabled, :disabled_color, :enable_feedback, :expand, :expand_loose, :focus_color, :height, :highlight_color, :hover_color, :icon, :icon_color, :icon_size, :key, :left, :margin, :mouse_cursor, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :selected, :selected_icon, :selected_icon_color, :size_change_interval, :size_constraints, :splash_color, :splash_radius, :style, :tooltip, :top, :url, :visible, :visual_density, :width, :on_animation_end, :on_blur, :on_click, :on_focus, :on_hover, :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
|
+
adaptive = props[:adaptive]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
alignment = props[:alignment]
|
|
19
|
+
animate_align = props[:animate_align]
|
|
20
|
+
animate_margin = props[:animate_margin]
|
|
21
|
+
animate_offset = props[:animate_offset]
|
|
22
|
+
animate_opacity = props[:animate_opacity]
|
|
23
|
+
animate_position = props[:animate_position]
|
|
24
|
+
animate_rotation = props[:animate_rotation]
|
|
25
|
+
animate_scale = props[:animate_scale]
|
|
26
|
+
animate_size = props[:animate_size]
|
|
27
|
+
aspect_ratio = props[:aspect_ratio]
|
|
28
|
+
autofocus = props[:autofocus]
|
|
29
|
+
badge = props[:badge]
|
|
30
|
+
bgcolor = props[:bgcolor]
|
|
31
|
+
bottom = props[:bottom]
|
|
32
|
+
col = props[:col]
|
|
33
|
+
data = props[:data]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
disabled_color = props[:disabled_color]
|
|
36
|
+
enable_feedback = props[:enable_feedback]
|
|
37
|
+
expand = props[:expand]
|
|
38
|
+
expand_loose = props[:expand_loose]
|
|
39
|
+
focus_color = props[:focus_color]
|
|
40
|
+
height = props[:height]
|
|
41
|
+
highlight_color = props[:highlight_color]
|
|
42
|
+
hover_color = props[:hover_color]
|
|
43
|
+
icon = props[:icon]
|
|
44
|
+
icon_color = props[:icon_color]
|
|
45
|
+
icon_size = props[:icon_size]
|
|
46
|
+
key = props[:key]
|
|
47
|
+
left = props[:left]
|
|
48
|
+
margin = props[:margin]
|
|
49
|
+
mouse_cursor = props[:mouse_cursor]
|
|
50
|
+
offset = props[:offset]
|
|
51
|
+
opacity = props[:opacity]
|
|
52
|
+
padding = props[:padding]
|
|
53
|
+
right = props[:right]
|
|
54
|
+
rotate = props[:rotate]
|
|
55
|
+
rtl = props[:rtl]
|
|
56
|
+
scale = props[:scale]
|
|
57
|
+
selected = props[:selected]
|
|
58
|
+
selected_icon = props[:selected_icon]
|
|
59
|
+
selected_icon_color = props[:selected_icon_color]
|
|
60
|
+
size_change_interval = props[:size_change_interval]
|
|
61
|
+
size_constraints = props[:size_constraints]
|
|
62
|
+
splash_color = props[:splash_color]
|
|
63
|
+
splash_radius = props[:splash_radius]
|
|
64
|
+
style = props[:style]
|
|
65
|
+
tooltip = props[:tooltip]
|
|
66
|
+
top = props[:top]
|
|
67
|
+
url = props[:url]
|
|
68
|
+
visible = props[:visible]
|
|
69
|
+
visual_density = props[:visual_density]
|
|
70
|
+
width = props[:width]
|
|
71
|
+
on_animation_end = props[:on_animation_end]
|
|
72
|
+
on_blur = props[:on_blur]
|
|
73
|
+
on_click = props[:on_click]
|
|
74
|
+
on_focus = props[:on_focus]
|
|
75
|
+
on_hover = props[:on_hover]
|
|
76
|
+
on_long_press = props[:on_long_press]
|
|
77
|
+
on_size_change = props[:on_size_change]
|
|
12
78
|
alignment = "center" if alignment.nil?
|
|
13
79
|
autofocus = false if autofocus.nil?
|
|
14
80
|
icon_size = 24 if icon_size.nil?
|
|
15
81
|
padding = { "all" => 8 } if padding.nil?
|
|
16
|
-
unless splash_radius.nil? || splash_radius.positive?
|
|
17
|
-
raise ArgumentError, "outlined_icon_button splash_radius must be greater than 0"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
82
|
props = {}
|
|
21
83
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
22
84
|
props[:align] = align unless align.nil?
|
|
@@ -8,68 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "popupmenubutton".freeze
|
|
9
9
|
WIRE = "PopupMenuButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
{ elevation: elevation, icon_size: icon_size, splash_radius: splash_radius }.each do |name, value|
|
|
13
|
-
raise ArgumentError, "popup_menu_button #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
|
|
14
|
-
end
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :clip_behavior, :col, :content, :data, :disabled, :elevation, :enable_feedback, :expand, :expand_loose, :height, :icon, :icon_color, :icon_size, :items, :key, :left, :margin, :menu_padding, :menu_position, :offset, :opacity, :padding, :popup_animation_style, :right, :rotate, :rtl, :scale, :shadow_color, :shape, :size_change_interval, :size_constraints, :splash_radius, :style, :tooltip, :top, :visible, :width, :on_animation_end, :on_cancel, :on_open, :on_select, :on_size_change].freeze
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
props
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
24
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
25
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
26
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
27
|
-
props[:badge] = badge unless badge.nil?
|
|
28
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
29
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
30
|
-
props[:clip_behavior] = clip_behavior unless clip_behavior.nil?
|
|
31
|
-
props[:col] = col unless col.nil?
|
|
32
|
-
props[:content] = content unless content.nil?
|
|
33
|
-
props[:data] = data unless data.nil?
|
|
34
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
35
|
-
props[:elevation] = elevation unless elevation.nil?
|
|
36
|
-
props[:enable_feedback] = enable_feedback unless enable_feedback.nil?
|
|
37
|
-
props[:expand] = expand unless expand.nil?
|
|
38
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
39
|
-
props[:height] = height unless height.nil?
|
|
40
|
-
props[:icon] = icon unless icon.nil?
|
|
41
|
-
props[:icon_color] = icon_color unless icon_color.nil?
|
|
42
|
-
props[:icon_size] = icon_size unless icon_size.nil?
|
|
43
|
-
props[:items] = items unless items.nil?
|
|
44
|
-
props[:key] = key unless key.nil?
|
|
45
|
-
props[:left] = left unless left.nil?
|
|
46
|
-
props[:margin] = margin unless margin.nil?
|
|
47
|
-
props[:menu_padding] = menu_padding unless menu_padding.nil?
|
|
48
|
-
props[:menu_position] = menu_position unless menu_position.nil?
|
|
49
|
-
props[:offset] = offset unless offset.nil?
|
|
50
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
51
|
-
props[:padding] = padding unless padding.nil?
|
|
52
|
-
props[:popup_animation_style] = popup_animation_style unless popup_animation_style.nil?
|
|
53
|
-
props[:right] = right unless right.nil?
|
|
54
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
55
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
56
|
-
props[:scale] = scale unless scale.nil?
|
|
57
|
-
props[:shadow_color] = shadow_color unless shadow_color.nil?
|
|
58
|
-
props[:shape] = shape unless shape.nil?
|
|
59
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
60
|
-
props[:size_constraints] = size_constraints unless size_constraints.nil?
|
|
61
|
-
props[:splash_radius] = splash_radius unless splash_radius.nil?
|
|
62
|
-
props[:style] = style unless style.nil?
|
|
63
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
64
|
-
props[:top] = top unless top.nil?
|
|
65
|
-
props[:visible] = visible unless visible.nil?
|
|
66
|
-
props[:width] = width unless width.nil?
|
|
67
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
68
|
-
props[:on_cancel] = on_cancel unless on_cancel.nil?
|
|
69
|
-
props[:on_open] = on_open unless on_open.nil?
|
|
70
|
-
props[:on_select] = on_select unless on_select.nil?
|
|
71
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
72
|
-
super(type: TYPE, id: id, **props)
|
|
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)
|
|
73
20
|
end
|
|
74
21
|
end
|
|
75
22
|
end
|
|
@@ -9,12 +9,6 @@ module Ruflet
|
|
|
9
9
|
WIRE = "PopupMenuItem".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, badge: nil, checked: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, icon: nil, key: nil, label_text_style: nil, mouse_cursor: nil, opacity: nil, padding: nil, rtl: nil, tooltip: nil, visible: nil, on_click: nil)
|
|
12
|
-
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
-
raise ArgumentError, "popup_menu_item requires visible content"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
raise ArgumentError, "popup_menu_item height must be greater than or equal to 0" unless height.nil? || height >= 0
|
|
17
|
-
|
|
18
12
|
props = {}
|
|
19
13
|
props[:badge] = badge unless badge.nil?
|
|
20
14
|
props[:checked] = checked unless checked.nil?
|
|
@@ -8,63 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "progressbar".freeze
|
|
9
9
|
WIRE = "ProgressBar".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
bar_height: bar_height,
|
|
14
|
-
semantics_value: semantics_value,
|
|
15
|
-
stop_indicator_radius: stop_indicator_radius,
|
|
16
|
-
track_gap: track_gap
|
|
17
|
-
}.each do |name, numeric_value|
|
|
18
|
-
raise ArgumentError, "progress_bar #{name} must be greater than or equal to 0" unless numeric_value.nil? || numeric_value >= 0
|
|
19
|
-
end
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bar_height, :bgcolor, :border_radius, :bottom, :col, :color, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :semantics_label, :semantics_value, :size_change_interval, :stop_indicator_color, :stop_indicator_radius, :tooltip, :top, :track_gap, :value, :visible, :width, :year_2023, :on_animation_end, :on_size_change].freeze
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
props
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
29
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
30
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
31
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
32
|
-
props[:badge] = badge unless badge.nil?
|
|
33
|
-
props[:bar_height] = bar_height unless bar_height.nil?
|
|
34
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
35
|
-
props[:border_radius] = border_radius unless border_radius.nil?
|
|
36
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
37
|
-
props[:col] = col unless col.nil?
|
|
38
|
-
props[:color] = color unless color.nil?
|
|
39
|
-
props[:data] = data unless data.nil?
|
|
40
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
41
|
-
props[:expand] = expand unless expand.nil?
|
|
42
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
43
|
-
props[:height] = height unless height.nil?
|
|
44
|
-
props[:key] = key unless key.nil?
|
|
45
|
-
props[:left] = left unless left.nil?
|
|
46
|
-
props[:margin] = margin unless margin.nil?
|
|
47
|
-
props[:offset] = offset unless offset.nil?
|
|
48
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
49
|
-
props[:right] = right unless right.nil?
|
|
50
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
51
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
52
|
-
props[:scale] = scale unless scale.nil?
|
|
53
|
-
props[:semantics_label] = semantics_label unless semantics_label.nil?
|
|
54
|
-
props[:semantics_value] = semantics_value unless semantics_value.nil?
|
|
55
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
56
|
-
props[:stop_indicator_color] = stop_indicator_color unless stop_indicator_color.nil?
|
|
57
|
-
props[:stop_indicator_radius] = stop_indicator_radius unless stop_indicator_radius.nil?
|
|
58
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
59
|
-
props[:top] = top unless top.nil?
|
|
60
|
-
props[:track_gap] = track_gap unless track_gap.nil?
|
|
61
|
-
props[:value] = value unless value.nil?
|
|
62
|
-
props[:visible] = visible unless visible.nil?
|
|
63
|
-
props[:width] = width unless width.nil?
|
|
64
|
-
props[:year_2023] = year_2023 unless year_2023.nil?
|
|
65
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
66
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
67
|
-
super(type: TYPE, id: id, **props)
|
|
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)
|
|
68
20
|
end
|
|
69
21
|
end
|
|
70
22
|
end
|
|
@@ -8,63 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "progressring".freeze
|
|
9
9
|
WIRE = "ProgressRing".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
semantics_value: semantics_value,
|
|
14
|
-
stroke_width: stroke_width,
|
|
15
|
-
track_gap: track_gap
|
|
16
|
-
}.each do |name, numeric_value|
|
|
17
|
-
raise ArgumentError, "progress_ring #{name} must be greater than or equal to 0" unless numeric_value.nil? || numeric_value >= 0
|
|
18
|
-
end
|
|
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, :color, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :semantics_label, :semantics_value, :size_change_interval, :size_constraints, :stroke_align, :stroke_cap, :stroke_width, :tooltip, :top, :track_gap, :value, :visible, :width, :year_2023, :on_animation_end, :on_size_change].freeze
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
props
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
28
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
29
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
30
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
31
|
-
props[:badge] = badge unless badge.nil?
|
|
32
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
33
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
34
|
-
props[:col] = col unless col.nil?
|
|
35
|
-
props[:color] = color unless color.nil?
|
|
36
|
-
props[:data] = data unless data.nil?
|
|
37
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
38
|
-
props[:expand] = expand unless expand.nil?
|
|
39
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
40
|
-
props[:height] = height unless height.nil?
|
|
41
|
-
props[:key] = key unless key.nil?
|
|
42
|
-
props[:left] = left unless left.nil?
|
|
43
|
-
props[:margin] = margin unless margin.nil?
|
|
44
|
-
props[:offset] = offset unless offset.nil?
|
|
45
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
46
|
-
props[:padding] = padding unless padding.nil?
|
|
47
|
-
props[:right] = right unless right.nil?
|
|
48
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
49
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
50
|
-
props[:scale] = scale unless scale.nil?
|
|
51
|
-
props[:semantics_label] = semantics_label unless semantics_label.nil?
|
|
52
|
-
props[:semantics_value] = semantics_value unless semantics_value.nil?
|
|
53
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
54
|
-
props[:size_constraints] = size_constraints unless size_constraints.nil?
|
|
55
|
-
props[:stroke_align] = stroke_align unless stroke_align.nil?
|
|
56
|
-
props[:stroke_cap] = stroke_cap unless stroke_cap.nil?
|
|
57
|
-
props[:stroke_width] = stroke_width unless stroke_width.nil?
|
|
58
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
59
|
-
props[:top] = top unless top.nil?
|
|
60
|
-
props[:track_gap] = track_gap unless track_gap.nil?
|
|
61
|
-
props[:value] = value unless value.nil?
|
|
62
|
-
props[:visible] = visible unless visible.nil?
|
|
63
|
-
props[:width] = width unless width.nil?
|
|
64
|
-
props[:year_2023] = year_2023 unless year_2023.nil?
|
|
65
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
66
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
67
|
-
super(type: TYPE, id: id, **props)
|
|
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)
|
|
68
20
|
end
|
|
69
21
|
end
|
|
70
22
|
end
|
|
@@ -8,60 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "radio".freeze
|
|
9
9
|
WIRE = "Radio".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[:expand] = expand unless expand.nil?
|
|
32
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
33
|
-
props[:fill_color] = fill_color unless fill_color.nil?
|
|
34
|
-
props[:focus_color] = focus_color unless focus_color.nil?
|
|
35
|
-
props[:height] = height unless height.nil?
|
|
36
|
-
props[:hover_color] = hover_color unless hover_color.nil?
|
|
37
|
-
props[:key] = key unless key.nil?
|
|
38
|
-
props[:label] = label unless label.nil?
|
|
39
|
-
props[:label_position] = label_position unless label_position.nil?
|
|
40
|
-
props[:label_style] = label_style unless label_style.nil?
|
|
41
|
-
props[:left] = left unless left.nil?
|
|
42
|
-
props[:margin] = margin unless margin.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[:right] = right unless right.nil?
|
|
48
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
49
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
50
|
-
props[:scale] = scale unless scale.nil?
|
|
51
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
52
|
-
props[:splash_radius] = splash_radius unless splash_radius.nil?
|
|
53
|
-
props[:toggleable] = toggleable unless toggleable.nil?
|
|
54
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
55
|
-
props[:top] = top unless top.nil?
|
|
56
|
-
props[:value] = value unless value.nil?
|
|
57
|
-
props[:visible] = visible unless visible.nil?
|
|
58
|
-
props[:visual_density] = visual_density unless visual_density.nil?
|
|
59
|
-
props[:width] = width unless width.nil?
|
|
60
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
61
|
-
props[:on_blur] = on_blur unless on_blur.nil?
|
|
62
|
-
props[:on_focus] = on_focus unless on_focus.nil?
|
|
63
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
64
|
-
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, :expand, :expand_loose, :fill_color, :focus_color, :height, :hover_color, :key, :label, :label_position, :label_style, :left, :margin, :mouse_cursor, :offset, :opacity, :overlay_color, :right, :rotate, :rtl, :scale, :size_change_interval, :splash_radius, :toggleable, :tooltip, :top, :value, :visible, :visual_density, :width, :on_animation_end, :on_blur, :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)
|
|
65
20
|
end
|
|
66
21
|
end
|
|
67
22
|
end
|