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,7 +8,151 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinotextfield".freeze
|
|
9
9
|
WIRE = "CupertinoTextField".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :align_label_with_hint, :always_call_on_tap, :animate_align, :animate_cursor_opacity, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autocorrect, :autofill_hints, :autofocus, :badge, :bgcolor, :blend_mode, :border, :border_color, :border_radius, :border_width, :bottom, :can_request_focus, :can_reveal_password, :capitalization, :clear_button_semantics_label, :clear_button_visibility_mode, :clip_behavior, :col, :collapsed, :color, :content_padding, :counter, :counter_style, :cursor_color, :cursor_error_color, :cursor_height, :cursor_radius, :cursor_width, :data, :dense, :disabled, :enable_ime_personalized_learning, :enable_interactive_selection, :enable_stylus_handwriting, :enable_suggestions, :error, :error_max_lines, :error_style, :expand, :expand_loose, :fill_color, :filled, :fit_parent_size, :focus_color, :focused_bgcolor, :focused_border_color, :focused_border_width, :focused_color, :gradient, :height, :helper, :helper_max_lines, :helper_style, :hint_fade_duration, :hint_max_lines, :hint_style, :hint_text, :hover_color, :icon, :ignore_pointers, :ignore_up_down_keys, :image, :input_filter, :key, :keyboard_brightness, :keyboard_type, :label, :label_style, :left, :margin, :max_length, :max_lines, :min_lines, :mouse_cursor, :multiline, :obscuring_character, :offset, :opacity, :padding, :password, :placeholder_style, :placeholder_text, :prefix, :prefix_icon, :prefix_icon_size_constraints, :prefix_style, :prefix_visibility_mode, :read_only, :right, :rotate, :rtl, :scale, :scroll_padding, :selection, :selection_color, :shadows, :shift_enter, :show_cursor, :size_change_interval, :size_constraints, :smart_dashes_type, :smart_quotes_type, :strut_style, :suffix, :suffix_icon, :suffix_icon_size_constraints, :suffix_style, :suffix_visibility_mode, :text_align, :text_size, :text_style, :text_vertical_align, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_click, :on_focus, :on_selection_change, :on_size_change, :on_submit, :on_tap_outside].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
|
+
align_label_with_hint = props[:align_label_with_hint]
|
|
19
|
+
always_call_on_tap = props[:always_call_on_tap]
|
|
20
|
+
animate_align = props[:animate_align]
|
|
21
|
+
animate_cursor_opacity = props[:animate_cursor_opacity]
|
|
22
|
+
animate_margin = props[:animate_margin]
|
|
23
|
+
animate_offset = props[:animate_offset]
|
|
24
|
+
animate_opacity = props[:animate_opacity]
|
|
25
|
+
animate_position = props[:animate_position]
|
|
26
|
+
animate_rotation = props[:animate_rotation]
|
|
27
|
+
animate_scale = props[:animate_scale]
|
|
28
|
+
animate_size = props[:animate_size]
|
|
29
|
+
aspect_ratio = props[:aspect_ratio]
|
|
30
|
+
autocorrect = props[:autocorrect]
|
|
31
|
+
autofill_hints = props[:autofill_hints]
|
|
32
|
+
autofocus = props[:autofocus]
|
|
33
|
+
badge = props[:badge]
|
|
34
|
+
bgcolor = props[:bgcolor]
|
|
35
|
+
blend_mode = props[:blend_mode]
|
|
36
|
+
border = props[:border]
|
|
37
|
+
border_color = props[:border_color]
|
|
38
|
+
border_radius = props[:border_radius]
|
|
39
|
+
border_width = props[:border_width]
|
|
40
|
+
bottom = props[:bottom]
|
|
41
|
+
can_request_focus = props[:can_request_focus]
|
|
42
|
+
can_reveal_password = props[:can_reveal_password]
|
|
43
|
+
capitalization = props[:capitalization]
|
|
44
|
+
clear_button_semantics_label = props[:clear_button_semantics_label]
|
|
45
|
+
clear_button_visibility_mode = props[:clear_button_visibility_mode]
|
|
46
|
+
clip_behavior = props[:clip_behavior]
|
|
47
|
+
col = props[:col]
|
|
48
|
+
collapsed = props[:collapsed]
|
|
49
|
+
color = props[:color]
|
|
50
|
+
content_padding = props[:content_padding]
|
|
51
|
+
counter = props[:counter]
|
|
52
|
+
counter_style = props[:counter_style]
|
|
53
|
+
cursor_color = props[:cursor_color]
|
|
54
|
+
cursor_error_color = props[:cursor_error_color]
|
|
55
|
+
cursor_height = props[:cursor_height]
|
|
56
|
+
cursor_radius = props[:cursor_radius]
|
|
57
|
+
cursor_width = props[:cursor_width]
|
|
58
|
+
data = props[:data]
|
|
59
|
+
dense = props[:dense]
|
|
60
|
+
disabled = props[:disabled]
|
|
61
|
+
enable_ime_personalized_learning = props[:enable_ime_personalized_learning]
|
|
62
|
+
enable_interactive_selection = props[:enable_interactive_selection]
|
|
63
|
+
enable_stylus_handwriting = props[:enable_stylus_handwriting]
|
|
64
|
+
enable_suggestions = props[:enable_suggestions]
|
|
65
|
+
error = props[:error]
|
|
66
|
+
error_max_lines = props[:error_max_lines]
|
|
67
|
+
error_style = props[:error_style]
|
|
68
|
+
expand = props[:expand]
|
|
69
|
+
expand_loose = props[:expand_loose]
|
|
70
|
+
fill_color = props[:fill_color]
|
|
71
|
+
filled = props[:filled]
|
|
72
|
+
fit_parent_size = props[:fit_parent_size]
|
|
73
|
+
focus_color = props[:focus_color]
|
|
74
|
+
focused_bgcolor = props[:focused_bgcolor]
|
|
75
|
+
focused_border_color = props[:focused_border_color]
|
|
76
|
+
focused_border_width = props[:focused_border_width]
|
|
77
|
+
focused_color = props[:focused_color]
|
|
78
|
+
gradient = props[:gradient]
|
|
79
|
+
height = props[:height]
|
|
80
|
+
helper = props[:helper]
|
|
81
|
+
helper_max_lines = props[:helper_max_lines]
|
|
82
|
+
helper_style = props[:helper_style]
|
|
83
|
+
hint_fade_duration = props[:hint_fade_duration]
|
|
84
|
+
hint_max_lines = props[:hint_max_lines]
|
|
85
|
+
hint_style = props[:hint_style]
|
|
86
|
+
hint_text = props[:hint_text]
|
|
87
|
+
hover_color = props[:hover_color]
|
|
88
|
+
icon = props[:icon]
|
|
89
|
+
ignore_pointers = props[:ignore_pointers]
|
|
90
|
+
ignore_up_down_keys = props[:ignore_up_down_keys]
|
|
91
|
+
image = props[:image]
|
|
92
|
+
input_filter = props[:input_filter]
|
|
93
|
+
key = props[:key]
|
|
94
|
+
keyboard_brightness = props[:keyboard_brightness]
|
|
95
|
+
keyboard_type = props[:keyboard_type]
|
|
96
|
+
label = props[:label]
|
|
97
|
+
label_style = props[:label_style]
|
|
98
|
+
left = props[:left]
|
|
99
|
+
margin = props[:margin]
|
|
100
|
+
max_length = props[:max_length]
|
|
101
|
+
max_lines = props[:max_lines]
|
|
102
|
+
min_lines = props[:min_lines]
|
|
103
|
+
mouse_cursor = props[:mouse_cursor]
|
|
104
|
+
multiline = props[:multiline]
|
|
105
|
+
obscuring_character = props[:obscuring_character]
|
|
106
|
+
offset = props[:offset]
|
|
107
|
+
opacity = props[:opacity]
|
|
108
|
+
padding = props[:padding]
|
|
109
|
+
password = props[:password]
|
|
110
|
+
placeholder_style = props[:placeholder_style]
|
|
111
|
+
placeholder_text = props[:placeholder_text]
|
|
112
|
+
prefix = props[:prefix]
|
|
113
|
+
prefix_icon = props[:prefix_icon]
|
|
114
|
+
prefix_icon_size_constraints = props[:prefix_icon_size_constraints]
|
|
115
|
+
prefix_style = props[:prefix_style]
|
|
116
|
+
prefix_visibility_mode = props[:prefix_visibility_mode]
|
|
117
|
+
read_only = props[:read_only]
|
|
118
|
+
right = props[:right]
|
|
119
|
+
rotate = props[:rotate]
|
|
120
|
+
rtl = props[:rtl]
|
|
121
|
+
scale = props[:scale]
|
|
122
|
+
scroll_padding = props[:scroll_padding]
|
|
123
|
+
selection = props[:selection]
|
|
124
|
+
selection_color = props[:selection_color]
|
|
125
|
+
shadows = props[:shadows]
|
|
126
|
+
shift_enter = props[:shift_enter]
|
|
127
|
+
show_cursor = props[:show_cursor]
|
|
128
|
+
size_change_interval = props[:size_change_interval]
|
|
129
|
+
size_constraints = props[:size_constraints]
|
|
130
|
+
smart_dashes_type = props[:smart_dashes_type]
|
|
131
|
+
smart_quotes_type = props[:smart_quotes_type]
|
|
132
|
+
strut_style = props[:strut_style]
|
|
133
|
+
suffix = props[:suffix]
|
|
134
|
+
suffix_icon = props[:suffix_icon]
|
|
135
|
+
suffix_icon_size_constraints = props[:suffix_icon_size_constraints]
|
|
136
|
+
suffix_style = props[:suffix_style]
|
|
137
|
+
suffix_visibility_mode = props[:suffix_visibility_mode]
|
|
138
|
+
text_align = props[:text_align]
|
|
139
|
+
text_size = props[:text_size]
|
|
140
|
+
text_style = props[:text_style]
|
|
141
|
+
text_vertical_align = props[:text_vertical_align]
|
|
142
|
+
tooltip = props[:tooltip]
|
|
143
|
+
top = props[:top]
|
|
144
|
+
value = props[:value]
|
|
145
|
+
visible = props[:visible]
|
|
146
|
+
width = props[:width]
|
|
147
|
+
on_animation_end = props[:on_animation_end]
|
|
148
|
+
on_blur = props[:on_blur]
|
|
149
|
+
on_change = props[:on_change]
|
|
150
|
+
on_click = props[:on_click]
|
|
151
|
+
on_focus = props[:on_focus]
|
|
152
|
+
on_selection_change = props[:on_selection_change]
|
|
153
|
+
on_size_change = props[:on_size_change]
|
|
154
|
+
on_submit = props[:on_submit]
|
|
155
|
+
on_tap_outside = props[:on_tap_outside]
|
|
12
156
|
clear_button_semantics_label = "Clear" if clear_button_semantics_label.nil?
|
|
13
157
|
clear_button_visibility_mode = "never" if clear_button_visibility_mode.nil?
|
|
14
158
|
padding = { "all" => 7 } if padding.nil?
|
|
@@ -8,24 +8,59 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinotimerpicker".freeze
|
|
9
9
|
WIRE = "CupertinoTimerPicker".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :data, :disabled, :expand, :expand_loose, :height, :item_extent, :key, :left, :margin, :minute_interval, :mode, :offset, :opacity, :right, :rotate, :rtl, :scale, :second_interval, :size_change_interval, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
alignment = props[:alignment]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
badge = props[:badge]
|
|
28
|
+
bgcolor = props[:bgcolor]
|
|
29
|
+
bottom = props[:bottom]
|
|
30
|
+
col = props[:col]
|
|
31
|
+
data = props[:data]
|
|
32
|
+
disabled = props[:disabled]
|
|
33
|
+
expand = props[:expand]
|
|
34
|
+
expand_loose = props[:expand_loose]
|
|
35
|
+
height = props[:height]
|
|
36
|
+
item_extent = props[:item_extent]
|
|
37
|
+
key = props[:key]
|
|
38
|
+
left = props[:left]
|
|
39
|
+
margin = props[:margin]
|
|
40
|
+
minute_interval = props[:minute_interval]
|
|
41
|
+
mode = props[:mode]
|
|
42
|
+
offset = props[:offset]
|
|
43
|
+
opacity = props[:opacity]
|
|
44
|
+
right = props[:right]
|
|
45
|
+
rotate = props[:rotate]
|
|
46
|
+
rtl = props[:rtl]
|
|
47
|
+
scale = props[:scale]
|
|
48
|
+
second_interval = props[:second_interval]
|
|
49
|
+
size_change_interval = props[:size_change_interval]
|
|
50
|
+
tooltip = props[:tooltip]
|
|
51
|
+
top = props[:top]
|
|
52
|
+
value = props[:value]
|
|
53
|
+
visible = props[:visible]
|
|
54
|
+
width = props[:width]
|
|
55
|
+
on_animation_end = props[:on_animation_end]
|
|
56
|
+
on_change = props[:on_change]
|
|
57
|
+
on_size_change = props[:on_size_change]
|
|
12
58
|
alignment = "center" if alignment.nil?
|
|
13
59
|
item_extent = 32.0 if item_extent.nil?
|
|
14
60
|
minute_interval = 1 if minute_interval.nil?
|
|
15
61
|
mode = "hour_minute_seconds" if mode.nil?
|
|
16
62
|
second_interval = 1 if second_interval.nil?
|
|
17
63
|
value = 0 if value.nil?
|
|
18
|
-
raise ArgumentError, "cupertino_timer_picker item_extent must be greater than 0" unless item_extent.positive?
|
|
19
|
-
unless minute_interval.positive? && (60 % minute_interval).zero?
|
|
20
|
-
raise ArgumentError, "cupertino_timer_picker minute_interval must be a positive factor of 60"
|
|
21
|
-
end
|
|
22
|
-
unless second_interval.positive? && (60 % second_interval).zero?
|
|
23
|
-
raise ArgumentError, "cupertino_timer_picker second_interval must be a positive factor of 60"
|
|
24
|
-
end
|
|
25
|
-
raise ArgumentError, "cupertino_timer_picker value must be greater than or equal to 0" unless value >= 0
|
|
26
|
-
raise ArgumentError, "cupertino_timer_picker value must be less than 24 hours" unless value < 86_400
|
|
27
|
-
raise ArgumentError, "cupertino_timer_picker value must be a multiple of minute_interval" unless (value % minute_interval).zero?
|
|
28
|
-
raise ArgumentError, "cupertino_timer_picker value must be a multiple of second_interval" unless (value % second_interval).zero?
|
|
29
64
|
|
|
30
65
|
props = {}
|
|
31
66
|
props[:align] = align unless align.nil?
|
|
@@ -8,15 +8,70 @@ module Ruflet
|
|
|
8
8
|
TYPE = "cupertinotintedbutton".freeze
|
|
9
9
|
WIRE = "CupertinoTintedButton".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :border_radius, :bottom, :col, :color, :content, :data, :disabled, :disabled_bgcolor, :expand, :expand_loose, :focus_color, :height, :icon, :icon_color, :key, :left, :margin, :min_size, :mouse_cursor, :offset, :opacity, :opacity_on_click, :padding, :right, :rotate, :rtl, :scale, :size, :size_change_interval, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_blur, :on_click, :on_focus, :on_long_press, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
alignment = props[:alignment]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
autofocus = props[:autofocus]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bgcolor = props[:bgcolor]
|
|
30
|
+
border_radius = props[:border_radius]
|
|
31
|
+
bottom = props[:bottom]
|
|
32
|
+
col = props[:col]
|
|
33
|
+
color = props[:color]
|
|
34
|
+
content = props[:content]
|
|
35
|
+
data = props[:data]
|
|
36
|
+
disabled = props[:disabled]
|
|
37
|
+
disabled_bgcolor = props[:disabled_bgcolor]
|
|
38
|
+
expand = props[:expand]
|
|
39
|
+
expand_loose = props[:expand_loose]
|
|
40
|
+
focus_color = props[:focus_color]
|
|
41
|
+
height = props[:height]
|
|
42
|
+
icon = props[:icon]
|
|
43
|
+
icon_color = props[:icon_color]
|
|
44
|
+
key = props[:key]
|
|
45
|
+
left = props[:left]
|
|
46
|
+
margin = props[:margin]
|
|
47
|
+
min_size = props[:min_size]
|
|
48
|
+
mouse_cursor = props[:mouse_cursor]
|
|
49
|
+
offset = props[:offset]
|
|
50
|
+
opacity = props[:opacity]
|
|
51
|
+
opacity_on_click = props[:opacity_on_click]
|
|
52
|
+
padding = props[:padding]
|
|
53
|
+
right = props[:right]
|
|
54
|
+
rotate = props[:rotate]
|
|
55
|
+
rtl = props[:rtl]
|
|
56
|
+
scale = props[:scale]
|
|
57
|
+
size = props[:size]
|
|
58
|
+
size_change_interval = props[:size_change_interval]
|
|
59
|
+
tooltip = props[:tooltip]
|
|
60
|
+
top = props[:top]
|
|
61
|
+
url = props[:url]
|
|
62
|
+
visible = props[:visible]
|
|
63
|
+
width = props[:width]
|
|
64
|
+
on_animation_end = props[:on_animation_end]
|
|
65
|
+
on_blur = props[:on_blur]
|
|
66
|
+
on_click = props[:on_click]
|
|
67
|
+
on_focus = props[:on_focus]
|
|
68
|
+
on_long_press = props[:on_long_press]
|
|
69
|
+
on_size_change = props[:on_size_change]
|
|
12
70
|
alignment = "center" if alignment.nil?
|
|
13
71
|
autofocus = false if autofocus.nil?
|
|
14
72
|
border_radius = { "all" => 8.0 } if border_radius.nil?
|
|
15
73
|
opacity_on_click = 0.4 if opacity_on_click.nil?
|
|
16
74
|
size = "large" if size.nil?
|
|
17
|
-
unless opacity_on_click.respond_to?(:between?) && opacity_on_click.between?(0.0, 1.0)
|
|
18
|
-
raise ArgumentError, "cupertino_tinted_button opacity_on_click must be between 0.0 and 1.0"
|
|
19
|
-
end
|
|
20
75
|
|
|
21
76
|
props = {}
|
|
22
77
|
props[:align] = align unless align.nil?
|
|
@@ -8,52 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "alertdialog".freeze
|
|
9
9
|
WIRE = "AlertDialog".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
if title.nil? && content.nil? && (actions.nil? || actions.empty?)
|
|
13
|
-
raise ArgumentError, "alert_dialog requires title, content, or actions"
|
|
14
|
-
end
|
|
11
|
+
KEYWORDS = [:action_button_padding, :actions, :actions_alignment, :actions_overflow_button_spacing, :actions_padding, :adaptive, :alignment, :badge, :barrier_color, :bgcolor, :clip_behavior, :col, :content, :content_padding, :content_text_style, :data, :disabled, :elevation, :expand, :expand_loose, :icon, :icon_color, :icon_padding, :inset_padding, :key, :modal, :opacity, :open, :rtl, :scrollable, :semantics_label, :shadow_color, :shape, :title, :title_padding, :title_text_style, :tooltip, :visible, :on_dismiss].freeze
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
props
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
props[:alignment] = alignment unless alignment.nil?
|
|
24
|
-
props[:badge] = badge unless badge.nil?
|
|
25
|
-
props[:barrier_color] = barrier_color unless barrier_color.nil?
|
|
26
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
27
|
-
props[:clip_behavior] = clip_behavior unless clip_behavior.nil?
|
|
28
|
-
props[:col] = col unless col.nil?
|
|
29
|
-
props[:content] = content unless content.nil?
|
|
30
|
-
props[:content_padding] = content_padding unless content_padding.nil?
|
|
31
|
-
props[:content_text_style] = content_text_style unless content_text_style.nil?
|
|
32
|
-
props[:data] = data unless data.nil?
|
|
33
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
34
|
-
props[:elevation] = elevation unless elevation.nil?
|
|
35
|
-
props[:expand] = expand unless expand.nil?
|
|
36
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
37
|
-
props[:icon] = icon unless icon.nil?
|
|
38
|
-
props[:icon_color] = icon_color unless icon_color.nil?
|
|
39
|
-
props[:icon_padding] = icon_padding unless icon_padding.nil?
|
|
40
|
-
props[:inset_padding] = inset_padding unless inset_padding.nil?
|
|
41
|
-
props[:key] = key unless key.nil?
|
|
42
|
-
props[:modal] = modal unless modal.nil?
|
|
43
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
44
|
-
props[:open] = open unless open.nil?
|
|
45
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
46
|
-
props[:scrollable] = scrollable unless scrollable.nil?
|
|
47
|
-
props[:semantics_label] = semantics_label unless semantics_label.nil?
|
|
48
|
-
props[:shadow_color] = shadow_color unless shadow_color.nil?
|
|
49
|
-
props[:shape] = shape unless shape.nil?
|
|
50
|
-
props[:title] = title unless title.nil?
|
|
51
|
-
props[:title_padding] = title_padding unless title_padding.nil?
|
|
52
|
-
props[:title_text_style] = title_text_style unless title_text_style.nil?
|
|
53
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
54
|
-
props[:visible] = visible unless visible.nil?
|
|
55
|
-
props[:on_dismiss] = on_dismiss unless on_dismiss.nil?
|
|
56
|
-
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)
|
|
57
20
|
end
|
|
58
21
|
end
|
|
59
22
|
end
|
|
@@ -8,47 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "appbar".freeze
|
|
9
9
|
WIRE = "AppBar".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
unless toolbar_opacity.nil? || (0.0..1.0).cover?(toolbar_opacity)
|
|
13
|
-
raise ArgumentError, "app_bar toolbar_opacity must be between 0.0 and 1.0"
|
|
14
|
-
end
|
|
11
|
+
KEYWORDS = [:actions, :actions_padding, :adaptive, :automatically_imply_leading, :badge, :bgcolor, :center_title, :clip_behavior, :col, :color, :data, :disabled, :elevation, :elevation_on_scroll, :exclude_header_semantics, :expand, :expand_loose, :force_material_transparency, :key, :leading, :leading_width, :opacity, :rtl, :secondary, :shadow_color, :shape, :title, :title_spacing, :title_text_style, :toolbar_height, :toolbar_opacity, :toolbar_text_style, :tooltip, :visible].freeze
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
props
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
props[:center_title] = center_title unless center_title.nil?
|
|
24
|
-
props[:clip_behavior] = clip_behavior unless clip_behavior.nil?
|
|
25
|
-
props[:col] = col unless col.nil?
|
|
26
|
-
props[:color] = color unless color.nil?
|
|
27
|
-
props[:data] = data unless data.nil?
|
|
28
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
29
|
-
props[:elevation] = elevation unless elevation.nil?
|
|
30
|
-
props[:elevation_on_scroll] = elevation_on_scroll unless elevation_on_scroll.nil?
|
|
31
|
-
props[:exclude_header_semantics] = exclude_header_semantics unless exclude_header_semantics.nil?
|
|
32
|
-
props[:expand] = expand unless expand.nil?
|
|
33
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
34
|
-
props[:force_material_transparency] = force_material_transparency unless force_material_transparency.nil?
|
|
35
|
-
props[:key] = key unless key.nil?
|
|
36
|
-
props[:leading] = leading unless leading.nil?
|
|
37
|
-
props[:leading_width] = leading_width unless leading_width.nil?
|
|
38
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
39
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
40
|
-
props[:secondary] = secondary unless secondary.nil?
|
|
41
|
-
props[:shadow_color] = shadow_color unless shadow_color.nil?
|
|
42
|
-
props[:shape] = shape unless shape.nil?
|
|
43
|
-
props[:title] = title unless title.nil?
|
|
44
|
-
props[:title_spacing] = title_spacing unless title_spacing.nil?
|
|
45
|
-
props[:title_text_style] = title_text_style unless title_text_style.nil?
|
|
46
|
-
props[:toolbar_height] = toolbar_height unless toolbar_height.nil?
|
|
47
|
-
props[:toolbar_opacity] = toolbar_opacity unless toolbar_opacity.nil?
|
|
48
|
-
props[:toolbar_text_style] = toolbar_text_style unless toolbar_text_style.nil?
|
|
49
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
50
|
-
props[:visible] = visible unless visible.nil?
|
|
51
|
-
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)
|
|
52
20
|
end
|
|
53
21
|
end
|
|
54
22
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class AudioControl < Ruflet::Control
|
|
8
8
|
TYPE = "audio".freeze
|
|
9
9
|
WIRE = "Audio".freeze
|
|
10
|
+
KEYWORDS = [:autoplay, :balance, :data, :key, :opacity, :playback_rate, :release_mode, :rtl, :src, :src_base64, :tooltip, :visible, :volume, :on_duration_change, :on_error, :on_loaded, :on_position_change, :on_seek_complete, :on_state_change].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, autoplay: nil, balance: nil, data: nil, key: nil, opacity: nil, playback_rate: nil, release_mode: nil, rtl: nil, src: nil, src_base64: nil, tooltip: nil, visible: nil, volume: nil, on_duration_change: nil, on_error: nil, on_loaded: nil, on_position_change: nil, on_seek_complete: nil, on_state_change: nil)
|
|
12
13
|
props = {}
|
|
@@ -45,7 +46,13 @@ module Ruflet
|
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
def play(position: 0, timeout: 10, on_result: nil)
|
|
48
|
-
runtime_page&.invoke(
|
|
49
|
+
runtime_page&.invoke(
|
|
50
|
+
self,
|
|
51
|
+
"play",
|
|
52
|
+
args: { "position" => position.nil? ? 0 : position },
|
|
53
|
+
timeout: timeout,
|
|
54
|
+
on_result: on_result
|
|
55
|
+
)
|
|
49
56
|
end
|
|
50
57
|
|
|
51
58
|
def release(timeout: 10, on_result: nil)
|
|
@@ -56,10 +63,14 @@ module Ruflet
|
|
|
56
63
|
runtime_page&.invoke(self, "resume", timeout: timeout, on_result: on_result)
|
|
57
64
|
end
|
|
58
65
|
|
|
59
|
-
def seek(position_milliseconds
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
def seek(position_milliseconds, timeout: 10, on_result: nil)
|
|
67
|
+
runtime_page&.invoke(
|
|
68
|
+
self,
|
|
69
|
+
"seek",
|
|
70
|
+
args: { "position" => position_milliseconds },
|
|
71
|
+
timeout: timeout,
|
|
72
|
+
on_result: on_result
|
|
73
|
+
)
|
|
63
74
|
end
|
|
64
75
|
end
|
|
65
76
|
end
|
|
@@ -8,7 +8,50 @@ module Ruflet
|
|
|
8
8
|
TYPE = "autocomplete".freeze
|
|
9
9
|
WIRE = "AutoComplete".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :suggestions, :suggestions_max_height, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_change, :on_select, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
animate_align = props[:animate_align]
|
|
18
|
+
animate_margin = props[:animate_margin]
|
|
19
|
+
animate_offset = props[:animate_offset]
|
|
20
|
+
animate_opacity = props[:animate_opacity]
|
|
21
|
+
animate_position = props[:animate_position]
|
|
22
|
+
animate_rotation = props[:animate_rotation]
|
|
23
|
+
animate_scale = props[:animate_scale]
|
|
24
|
+
animate_size = props[:animate_size]
|
|
25
|
+
aspect_ratio = props[:aspect_ratio]
|
|
26
|
+
badge = props[:badge]
|
|
27
|
+
bottom = props[:bottom]
|
|
28
|
+
col = props[:col]
|
|
29
|
+
data = props[:data]
|
|
30
|
+
disabled = props[:disabled]
|
|
31
|
+
expand = props[:expand]
|
|
32
|
+
expand_loose = props[:expand_loose]
|
|
33
|
+
height = props[:height]
|
|
34
|
+
key = props[:key]
|
|
35
|
+
left = props[:left]
|
|
36
|
+
margin = props[:margin]
|
|
37
|
+
offset = props[:offset]
|
|
38
|
+
opacity = props[:opacity]
|
|
39
|
+
right = props[:right]
|
|
40
|
+
rotate = props[:rotate]
|
|
41
|
+
rtl = props[:rtl]
|
|
42
|
+
scale = props[:scale]
|
|
43
|
+
size_change_interval = props[:size_change_interval]
|
|
44
|
+
suggestions = props[:suggestions]
|
|
45
|
+
suggestions_max_height = props[:suggestions_max_height]
|
|
46
|
+
tooltip = props[:tooltip]
|
|
47
|
+
top = props[:top]
|
|
48
|
+
value = props[:value]
|
|
49
|
+
visible = props[:visible]
|
|
50
|
+
width = props[:width]
|
|
51
|
+
on_animation_end = props[:on_animation_end]
|
|
52
|
+
on_change = props[:on_change]
|
|
53
|
+
on_select = props[:on_select]
|
|
54
|
+
on_size_change = props[:on_size_change]
|
|
12
55
|
suggestions = [] if suggestions.nil?
|
|
13
56
|
suggestions_max_height = 200 if suggestions_max_height.nil?
|
|
14
57
|
value = "" if value.nil?
|
|
@@ -9,13 +9,6 @@ module Ruflet
|
|
|
9
9
|
WIRE = "Badge".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, alignment: nil, bgcolor: nil, data: nil, key: nil, label: nil, label_visible: nil, large_size: nil, offset: nil, padding: nil, small_size: nil, text_color: nil, text_style: nil)
|
|
12
|
-
{
|
|
13
|
-
large_size: large_size,
|
|
14
|
-
small_size: small_size
|
|
15
|
-
}.each do |name, value|
|
|
16
|
-
raise ArgumentError, "badge #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
|
|
17
|
-
end
|
|
18
|
-
|
|
19
12
|
props = {}
|
|
20
13
|
props[:alignment] = alignment unless alignment.nil?
|
|
21
14
|
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
@@ -10,13 +10,6 @@ module Ruflet
|
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, actions: nil, adaptive: nil, badge: nil, bgcolor: nil, col: nil, content: nil, content_padding: nil, content_text_style: nil, data: nil, disabled: nil, divider_color: nil, elevation: nil, expand: nil, expand_loose: nil, force_actions_below: nil, key: nil, leading: nil, leading_padding: nil, margin: nil, min_action_bar_height: nil, opacity: nil, open: nil, rtl: nil, shadow_color: nil, surface_tint_color: nil, tooltip: nil, visible: nil, on_dismiss: nil, on_visible: nil)
|
|
12
12
|
raise ArgumentError, "banner requires content" if content.nil?
|
|
13
|
-
raise ArgumentError, "banner requires at least one actions control" if actions.nil? || actions.empty?
|
|
14
|
-
{
|
|
15
|
-
elevation: elevation,
|
|
16
|
-
min_action_bar_height: min_action_bar_height
|
|
17
|
-
}.each do |name, value|
|
|
18
|
-
raise ArgumentError, "banner #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
|
|
19
|
-
end
|
|
20
13
|
|
|
21
14
|
props = {}
|
|
22
15
|
props[:actions] = actions unless actions.nil?
|