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,138 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "textfield".freeze
|
|
9
9
|
WIRE = "TextField".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
21
|
-
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
22
|
-
props[:animate_position] = animate_position unless animate_position.nil?
|
|
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[:autocorrect] = autocorrect unless autocorrect.nil?
|
|
28
|
-
props[:autofill_hints] = autofill_hints unless autofill_hints.nil?
|
|
29
|
-
props[:autofocus] = autofocus unless autofocus.nil?
|
|
30
|
-
props[:badge] = badge unless badge.nil?
|
|
31
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
32
|
-
props[:border] = border unless border.nil?
|
|
33
|
-
props[:border_color] = border_color unless border_color.nil?
|
|
34
|
-
props[:border_radius] = border_radius unless border_radius.nil?
|
|
35
|
-
props[:border_width] = border_width unless border_width.nil?
|
|
36
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
37
|
-
props[:can_request_focus] = can_request_focus unless can_request_focus.nil?
|
|
38
|
-
props[:can_reveal_password] = can_reveal_password unless can_reveal_password.nil?
|
|
39
|
-
props[:capitalization] = capitalization unless capitalization.nil?
|
|
40
|
-
props[:clip_behavior] = clip_behavior unless clip_behavior.nil?
|
|
41
|
-
props[:col] = col unless col.nil?
|
|
42
|
-
props[:collapsed] = collapsed unless collapsed.nil?
|
|
43
|
-
props[:color] = color unless color.nil?
|
|
44
|
-
props[:content_padding] = content_padding unless content_padding.nil?
|
|
45
|
-
props[:counter] = counter unless counter.nil?
|
|
46
|
-
props[:counter_style] = counter_style unless counter_style.nil?
|
|
47
|
-
props[:cursor_color] = cursor_color unless cursor_color.nil?
|
|
48
|
-
props[:cursor_error_color] = cursor_error_color unless cursor_error_color.nil?
|
|
49
|
-
props[:cursor_height] = cursor_height unless cursor_height.nil?
|
|
50
|
-
props[:cursor_radius] = cursor_radius unless cursor_radius.nil?
|
|
51
|
-
props[:cursor_width] = cursor_width unless cursor_width.nil?
|
|
52
|
-
props[:data] = data unless data.nil?
|
|
53
|
-
props[:dense] = dense unless dense.nil?
|
|
54
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
55
|
-
props[:enable_ime_personalized_learning] = enable_ime_personalized_learning unless enable_ime_personalized_learning.nil?
|
|
56
|
-
props[:enable_interactive_selection] = enable_interactive_selection unless enable_interactive_selection.nil?
|
|
57
|
-
props[:enable_stylus_handwriting] = enable_stylus_handwriting unless enable_stylus_handwriting.nil?
|
|
58
|
-
props[:enable_suggestions] = enable_suggestions unless enable_suggestions.nil?
|
|
59
|
-
props[:error] = error unless error.nil?
|
|
60
|
-
props[:error_max_lines] = error_max_lines unless error_max_lines.nil?
|
|
61
|
-
props[:error_style] = error_style unless error_style.nil?
|
|
62
|
-
props[:expand] = expand unless expand.nil?
|
|
63
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
64
|
-
props[:fill_color] = fill_color unless fill_color.nil?
|
|
65
|
-
props[:filled] = filled unless filled.nil?
|
|
66
|
-
props[:fit_parent_size] = fit_parent_size unless fit_parent_size.nil?
|
|
67
|
-
props[:focus_color] = focus_color unless focus_color.nil?
|
|
68
|
-
props[:focused_bgcolor] = focused_bgcolor unless focused_bgcolor.nil?
|
|
69
|
-
props[:focused_border_color] = focused_border_color unless focused_border_color.nil?
|
|
70
|
-
props[:focused_border_width] = focused_border_width unless focused_border_width.nil?
|
|
71
|
-
props[:focused_color] = focused_color unless focused_color.nil?
|
|
72
|
-
props[:height] = height unless height.nil?
|
|
73
|
-
props[:helper] = helper unless helper.nil?
|
|
74
|
-
props[:helper_max_lines] = helper_max_lines unless helper_max_lines.nil?
|
|
75
|
-
props[:helper_style] = helper_style unless helper_style.nil?
|
|
76
|
-
props[:hint_fade_duration] = hint_fade_duration unless hint_fade_duration.nil?
|
|
77
|
-
props[:hint_max_lines] = hint_max_lines unless hint_max_lines.nil?
|
|
78
|
-
props[:hint_style] = hint_style unless hint_style.nil?
|
|
79
|
-
props[:hint_text] = hint_text unless hint_text.nil?
|
|
80
|
-
props[:hover_color] = hover_color unless hover_color.nil?
|
|
81
|
-
props[:icon] = icon unless icon.nil?
|
|
82
|
-
props[:ignore_pointers] = ignore_pointers unless ignore_pointers.nil?
|
|
83
|
-
props[:ignore_up_down_keys] = ignore_up_down_keys unless ignore_up_down_keys.nil?
|
|
84
|
-
props[:input_filter] = input_filter unless input_filter.nil?
|
|
85
|
-
props[:key] = key unless key.nil?
|
|
86
|
-
props[:keyboard_brightness] = keyboard_brightness unless keyboard_brightness.nil?
|
|
87
|
-
props[:keyboard_type] = keyboard_type unless keyboard_type.nil?
|
|
88
|
-
props[:label] = label unless label.nil?
|
|
89
|
-
props[:label_style] = label_style unless label_style.nil?
|
|
90
|
-
props[:left] = left unless left.nil?
|
|
91
|
-
props[:margin] = margin unless margin.nil?
|
|
92
|
-
props[:max_length] = max_length unless max_length.nil?
|
|
93
|
-
props[:max_lines] = max_lines unless max_lines.nil?
|
|
94
|
-
props[:min_lines] = min_lines unless min_lines.nil?
|
|
95
|
-
props[:mouse_cursor] = mouse_cursor unless mouse_cursor.nil?
|
|
96
|
-
props[:multiline] = multiline unless multiline.nil?
|
|
97
|
-
props[:obscuring_character] = obscuring_character unless obscuring_character.nil?
|
|
98
|
-
props[:offset] = offset unless offset.nil?
|
|
99
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
100
|
-
props[:password] = password unless password.nil?
|
|
101
|
-
props[:prefix] = prefix unless prefix.nil?
|
|
102
|
-
props[:prefix_icon] = prefix_icon unless prefix_icon.nil?
|
|
103
|
-
props[:prefix_icon_size_constraints] = prefix_icon_size_constraints unless prefix_icon_size_constraints.nil?
|
|
104
|
-
props[:prefix_style] = prefix_style unless prefix_style.nil?
|
|
105
|
-
props[:read_only] = read_only unless read_only.nil?
|
|
106
|
-
props[:right] = right unless right.nil?
|
|
107
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
108
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
109
|
-
props[:scale] = scale unless scale.nil?
|
|
110
|
-
props[:scroll_padding] = scroll_padding unless scroll_padding.nil?
|
|
111
|
-
props[:selection] = selection unless selection.nil?
|
|
112
|
-
props[:selection_color] = selection_color unless selection_color.nil?
|
|
113
|
-
props[:shift_enter] = shift_enter unless shift_enter.nil?
|
|
114
|
-
props[:show_cursor] = show_cursor unless show_cursor.nil?
|
|
115
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
116
|
-
props[:size_constraints] = size_constraints unless size_constraints.nil?
|
|
117
|
-
props[:smart_dashes_type] = smart_dashes_type unless smart_dashes_type.nil?
|
|
118
|
-
props[:smart_quotes_type] = smart_quotes_type unless smart_quotes_type.nil?
|
|
119
|
-
props[:strut_style] = strut_style unless strut_style.nil?
|
|
120
|
-
props[:suffix] = suffix unless suffix.nil?
|
|
121
|
-
props[:suffix_icon] = suffix_icon unless suffix_icon.nil?
|
|
122
|
-
props[:suffix_icon_size_constraints] = suffix_icon_size_constraints unless suffix_icon_size_constraints.nil?
|
|
123
|
-
props[:suffix_style] = suffix_style unless suffix_style.nil?
|
|
124
|
-
props[:text_align] = text_align unless text_align.nil?
|
|
125
|
-
props[:text_size] = text_size unless text_size.nil?
|
|
126
|
-
props[:text_style] = text_style unless text_style.nil?
|
|
127
|
-
props[:text_vertical_align] = text_vertical_align unless text_vertical_align.nil?
|
|
128
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
129
|
-
props[:top] = top unless top.nil?
|
|
130
|
-
props[:value] = value unless value.nil?
|
|
131
|
-
props[:visible] = visible unless visible.nil?
|
|
132
|
-
props[:width] = width unless width.nil?
|
|
133
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
134
|
-
props[:on_blur] = on_blur unless on_blur.nil?
|
|
135
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
136
|
-
props[:on_click] = on_click unless on_click.nil?
|
|
137
|
-
props[:on_focus] = on_focus unless on_focus.nil?
|
|
138
|
-
props[:on_selection_change] = on_selection_change unless on_selection_change.nil?
|
|
139
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
140
|
-
props[:on_submit] = on_submit unless on_submit.nil?
|
|
141
|
-
props[:on_tap_outside] = on_tap_outside unless on_tap_outside.nil?
|
|
142
|
-
super(type: TYPE, id: id, **props)
|
|
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, :border, :border_color, :border_radius, :border_width, :bottom, :can_request_focus, :can_reveal_password, :capitalization, :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, :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, :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, :password, :prefix, :prefix_icon, :prefix_icon_size_constraints, :prefix_style, :read_only, :right, :rotate, :rtl, :scale, :scroll_padding, :selection, :selection_color, :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, :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
|
+
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)
|
|
143
20
|
end
|
|
144
21
|
end
|
|
145
22
|
end
|
|
@@ -8,40 +8,16 @@ module Ruflet
|
|
|
8
8
|
TYPE = "timepicker".freeze
|
|
9
9
|
WIRE = "TimePicker".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
props[:entry_mode] = entry_mode unless entry_mode.nil?
|
|
22
|
-
props[:error_invalid_text] = error_invalid_text unless error_invalid_text.nil?
|
|
23
|
-
props[:expand] = expand unless expand.nil?
|
|
24
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
25
|
-
props[:help_text] = help_text unless help_text.nil?
|
|
26
|
-
props[:hour_format] = hour_format unless hour_format.nil?
|
|
27
|
-
props[:hour_label_text] = hour_label_text unless hour_label_text.nil?
|
|
28
|
-
props[:key] = key unless key.nil?
|
|
29
|
-
props[:locale] = locale unless locale.nil?
|
|
30
|
-
props[:minute_label_text] = minute_label_text unless minute_label_text.nil?
|
|
31
|
-
props[:modal] = modal unless modal.nil?
|
|
32
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
33
|
-
props[:open] = open unless open.nil?
|
|
34
|
-
props[:orientation] = orientation unless orientation.nil?
|
|
35
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
36
|
-
props[:switch_to_input_icon] = switch_to_input_icon unless switch_to_input_icon.nil?
|
|
37
|
-
props[:switch_to_timer_icon] = switch_to_timer_icon unless switch_to_timer_icon.nil?
|
|
38
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
39
|
-
props[:value] = value unless value.nil?
|
|
40
|
-
props[:visible] = visible unless visible.nil?
|
|
41
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
42
|
-
props[:on_dismiss] = on_dismiss unless on_dismiss.nil?
|
|
43
|
-
props[:on_entry_mode_change] = on_entry_mode_change unless on_entry_mode_change.nil?
|
|
44
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:adaptive, :badge, :barrier_color, :cancel_text, :col, :confirm_text, :data, :disabled, :entry_mode, :error_invalid_text, :expand, :expand_loose, :help_text, :hour_format, :hour_label_text, :key, :locale, :minute_label_text, :modal, :opacity, :open, :orientation, :rtl, :switch_to_input_icon, :switch_to_timer_icon, :tooltip, :value, :visible, :on_change, :on_dismiss, :on_entry_mode_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
|
+
value = Ruflet::Protocol.time_of_day(value) if key == :value
|
|
18
|
+
compact[key] = value unless value.nil?
|
|
19
|
+
end
|
|
20
|
+
super(type: TYPE, id: id, **compact)
|
|
45
21
|
end
|
|
46
22
|
end
|
|
47
23
|
end
|
|
@@ -9,15 +9,6 @@ module Ruflet
|
|
|
9
9
|
WIRE = "VerticalDivider".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, badge: nil, col: nil, color: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, leading_indent: nil, opacity: nil, radius: nil, rtl: nil, thickness: nil, tooltip: nil, trailing_indent: nil, visible: nil, width: nil)
|
|
12
|
-
{
|
|
13
|
-
leading_indent: leading_indent,
|
|
14
|
-
thickness: thickness,
|
|
15
|
-
trailing_indent: trailing_indent,
|
|
16
|
-
width: width
|
|
17
|
-
}.each do |name, value|
|
|
18
|
-
raise ArgumentError, "vertical_divider #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
|
|
19
|
-
end
|
|
20
|
-
|
|
21
12
|
props = {}
|
|
22
13
|
props[:badge] = badge unless badge.nil?
|
|
23
14
|
props[:col] = col unless col.nil?
|
|
@@ -8,48 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "video".freeze
|
|
9
9
|
WIRE = "Video".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:fit] = fit unless fit.nil?
|
|
21
|
-
props[:fullscreen] = fullscreen unless fullscreen.nil?
|
|
22
|
-
props[:height] = height unless height.nil?
|
|
23
|
-
props[:key] = key unless key.nil?
|
|
24
|
-
props[:muted] = muted unless muted.nil?
|
|
25
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
26
|
-
props[:pause_upon_entering_background_mode] = pause_upon_entering_background_mode unless pause_upon_entering_background_mode.nil?
|
|
27
|
-
props[:pitch] = pitch unless pitch.nil?
|
|
28
|
-
props[:playlist] = playlist unless playlist.nil?
|
|
29
|
-
props[:playlist_mode] = playlist_mode unless playlist_mode.nil?
|
|
30
|
-
props[:playback_rate] = playback_rate unless playback_rate.nil?
|
|
31
|
-
props[:resume_upon_entering_foreground_mode] = resume_upon_entering_foreground_mode unless resume_upon_entering_foreground_mode.nil?
|
|
32
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
33
|
-
props[:show_controls] = show_controls unless show_controls.nil?
|
|
34
|
-
props[:shuffle_playlist] = shuffle_playlist unless shuffle_playlist.nil?
|
|
35
|
-
props[:subtitle_configuration] = subtitle_configuration unless subtitle_configuration.nil?
|
|
36
|
-
props[:title] = title unless title.nil?
|
|
37
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
38
|
-
props[:visible] = visible unless visible.nil?
|
|
39
|
-
props[:volume] = volume unless volume.nil?
|
|
40
|
-
props[:wakelock] = wakelock unless wakelock.nil?
|
|
41
|
-
props[:width] = width unless width.nil?
|
|
42
|
-
props[:on_completed] = on_completed unless on_completed.nil?
|
|
43
|
-
props[:on_complete] = on_complete unless on_complete.nil?
|
|
44
|
-
props[:on_enter_fullscreen] = on_enter_fullscreen unless on_enter_fullscreen.nil?
|
|
45
|
-
props[:on_error] = on_error unless on_error.nil?
|
|
46
|
-
props[:on_exit_fullscreen] = on_exit_fullscreen unless on_exit_fullscreen.nil?
|
|
47
|
-
props[:on_load] = on_load unless on_load.nil?
|
|
48
|
-
props[:on_loaded] = on_loaded unless on_loaded.nil?
|
|
49
|
-
props[:on_state_change] = on_state_change unless on_state_change.nil?
|
|
50
|
-
props[:on_track_change] = on_track_change unless on_track_change.nil?
|
|
51
|
-
props[:on_track_changed] = on_track_changed unless on_track_changed.nil?
|
|
52
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:alignment, :aspect_ratio, :autoplay, :configuration, :data, :fill_color, :filter_quality, :fit, :fullscreen, :height, :key, :muted, :opacity, :pause_upon_entering_background_mode, :pitch, :playlist, :playlist_mode, :playback_rate, :resume_upon_entering_foreground_mode, :rtl, :show_controls, :shuffle_playlist, :subtitle_configuration, :title, :tooltip, :visible, :volume, :wakelock, :width, :on_completed, :on_complete, :on_enter_fullscreen, :on_error, :on_exit_fullscreen, :on_load, :on_loaded, :on_state_change, :on_track_change, :on_track_changed].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)
|
|
53
20
|
end
|
|
54
21
|
|
|
55
22
|
def get_current_position(timeout: 10, on_result: nil)
|
|
@@ -4,33 +4,11 @@ module Ruflet
|
|
|
4
4
|
module UI
|
|
5
5
|
module Controls
|
|
6
6
|
module RufletComponents
|
|
7
|
-
# WebView control — parity with Flet's WebView
|
|
8
|
-
# (https://flet.dev/docs/controls/webview/).
|
|
9
|
-
#
|
|
10
|
-
# Properties: url, bgcolor, prevent_links, plus the usual layout props.
|
|
11
|
-
# Events: on_page_started, on_page_ended, on_web_resource_error,
|
|
12
|
-
# on_progress, on_url_change, on_scroll, on_console_message,
|
|
13
|
-
# on_javascript_alert_dialog.
|
|
14
|
-
# Methods (invoked over the wire on a mounted control): reload, go_back,
|
|
15
|
-
# go_forward, can_go_back, can_go_forward, run_javascript, load_html,
|
|
16
|
-
# load_request, load_file, scroll_to, scroll_by, clear_cache,
|
|
17
|
-
# clear_local_storage, enable_zoom, disable_zoom, set_javascript_mode,
|
|
18
|
-
# get_current_url, get_title, get_user_agent.
|
|
19
|
-
#
|
|
20
|
-
# Platform note: the native webview (and therefore run_javascript and the
|
|
21
|
-
# events/methods) runs on iOS, Android and macOS. On web it falls back to
|
|
22
|
-
# an <iframe>, which cannot run the methods and which most external sites
|
|
23
|
-
# block via X-Frame-Options/CSP — embed your own same-origin pages there.
|
|
24
7
|
class WebViewControl < Ruflet::Control
|
|
25
8
|
TYPE = "WebView".freeze
|
|
26
9
|
WIRE = "WebView".freeze
|
|
27
10
|
|
|
28
|
-
def initialize(id: nil, bgcolor: nil, data: nil, enable_javascript: nil, expand: nil,
|
|
29
|
-
height: nil, key: nil, method: nil, opacity: nil, prevent_links: nil,
|
|
30
|
-
rtl: nil, tooltip: nil, url: nil, visible: nil, width: nil,
|
|
31
|
-
on_page_ended: nil, on_page_started: nil, on_web_resource_error: nil,
|
|
32
|
-
on_progress: nil, on_url_change: nil, on_scroll: nil,
|
|
33
|
-
on_console_message: nil, on_javascript_alert_dialog: nil)
|
|
11
|
+
def initialize(id: nil, bgcolor: nil, data: nil, enable_javascript: nil, expand: nil, height: nil, key: nil, method: nil, opacity: nil, rtl: nil, tooltip: nil, url: nil, visible: nil, width: nil, on_page_ended: nil, on_page_started: nil, on_web_resource_error: nil)
|
|
34
12
|
props = {}
|
|
35
13
|
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
36
14
|
props[:data] = data unless data.nil?
|
|
@@ -40,7 +18,6 @@ module Ruflet
|
|
|
40
18
|
props[:key] = key unless key.nil?
|
|
41
19
|
props[:method] = method unless method.nil?
|
|
42
20
|
props[:opacity] = opacity unless opacity.nil?
|
|
43
|
-
props[:prevent_links] = prevent_links unless prevent_links.nil?
|
|
44
21
|
props[:rtl] = rtl unless rtl.nil?
|
|
45
22
|
props[:tooltip] = tooltip unless tooltip.nil?
|
|
46
23
|
props[:url] = url unless url.nil?
|
|
@@ -49,98 +26,8 @@ module Ruflet
|
|
|
49
26
|
props[:on_page_ended] = on_page_ended unless on_page_ended.nil?
|
|
50
27
|
props[:on_page_started] = on_page_started unless on_page_started.nil?
|
|
51
28
|
props[:on_web_resource_error] = on_web_resource_error unless on_web_resource_error.nil?
|
|
52
|
-
props[:on_progress] = on_progress unless on_progress.nil?
|
|
53
|
-
props[:on_url_change] = on_url_change unless on_url_change.nil?
|
|
54
|
-
props[:on_scroll] = on_scroll unless on_scroll.nil?
|
|
55
|
-
props[:on_console_message] = on_console_message unless on_console_message.nil?
|
|
56
|
-
props[:on_javascript_alert_dialog] = on_javascript_alert_dialog unless on_javascript_alert_dialog.nil?
|
|
57
29
|
super(type: TYPE, id: id, **props)
|
|
58
30
|
end
|
|
59
|
-
|
|
60
|
-
# --- Navigation --------------------------------------------------
|
|
61
|
-
|
|
62
|
-
def reload = invoke_webview_method("reload")
|
|
63
|
-
def go_back = invoke_webview_method("go_back")
|
|
64
|
-
def go_forward = invoke_webview_method("go_forward")
|
|
65
|
-
|
|
66
|
-
def can_go_back(timeout: 10, &on_result)
|
|
67
|
-
invoke_webview_method("can_go_back", timeout: timeout, on_result: on_result)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def can_go_forward(timeout: 10, &on_result)
|
|
71
|
-
invoke_webview_method("can_go_forward", timeout: timeout, on_result: on_result)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# --- Loading content ---------------------------------------------
|
|
75
|
-
|
|
76
|
-
def load_request(url, method: "get")
|
|
77
|
-
invoke_webview_method("load_request", { "url" => url.to_s, "method" => method.to_s })
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
def load_html(value, base_url: nil)
|
|
81
|
-
args = { "value" => value.to_s }
|
|
82
|
-
args["base_url"] = base_url.to_s unless base_url.nil?
|
|
83
|
-
invoke_webview_method("load_html", args)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def load_file(path)
|
|
87
|
-
invoke_webview_method("load_file", { "path" => path.to_s })
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# --- JavaScript injection ---------------------------------------
|
|
91
|
-
|
|
92
|
-
# Run arbitrary JS inside the page — e.g. hide a node so a native
|
|
93
|
-
# control can take its place:
|
|
94
|
-
# webview.run_javascript("document.getElementById('banner').remove()")
|
|
95
|
-
def run_javascript(value)
|
|
96
|
-
invoke_webview_method("run_javascript", { "value" => value.to_s })
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
def set_javascript_mode(mode)
|
|
100
|
-
invoke_webview_method("set_javascript_mode", { "mode" => mode.to_s })
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
# --- Scrolling ---------------------------------------------------
|
|
104
|
-
|
|
105
|
-
def scroll_to(x, y)
|
|
106
|
-
invoke_webview_method("scroll_to", { "x" => x.to_i, "y" => y.to_i })
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
def scroll_by(x, y)
|
|
110
|
-
invoke_webview_method("scroll_by", { "x" => x.to_i, "y" => y.to_i })
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
# --- Storage / zoom ----------------------------------------------
|
|
114
|
-
|
|
115
|
-
def clear_cache = invoke_webview_method("clear_cache")
|
|
116
|
-
def clear_local_storage = invoke_webview_method("clear_local_storage")
|
|
117
|
-
def enable_zoom = invoke_webview_method("enable_zoom")
|
|
118
|
-
def disable_zoom = invoke_webview_method("disable_zoom")
|
|
119
|
-
|
|
120
|
-
# --- Introspection (result delivered to the block) ---------------
|
|
121
|
-
|
|
122
|
-
def get_current_url(timeout: 10, &on_result)
|
|
123
|
-
invoke_webview_method("get_current_url", timeout: timeout, on_result: on_result)
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
def get_title(timeout: 10, &on_result)
|
|
127
|
-
invoke_webview_method("get_title", timeout: timeout, on_result: on_result)
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
def get_user_agent(timeout: 10, &on_result)
|
|
131
|
-
invoke_webview_method("get_user_agent", timeout: timeout, on_result: on_result)
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
private
|
|
135
|
-
|
|
136
|
-
def invoke_webview_method(name, args = nil, timeout: 10, on_result: nil)
|
|
137
|
-
page = runtime_page
|
|
138
|
-
unless page && wire_id
|
|
139
|
-
raise "WebView ##{id} is not mounted yet — add it to the page before calling #{name}."
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
page.invoke(self, name, args: args, timeout: timeout, on_result: on_result)
|
|
143
|
-
end
|
|
144
31
|
end
|
|
145
32
|
end
|
|
146
33
|
end
|
|
@@ -39,7 +39,6 @@ require_relative "materials/card_control"
|
|
|
39
39
|
require_relative "materials/checkbox_control"
|
|
40
40
|
require_relative "materials/chip_control"
|
|
41
41
|
require_relative "materials/circleavatar_control"
|
|
42
|
-
require_relative "materials/codeeditor_control"
|
|
43
42
|
require_relative "materials/container_control"
|
|
44
43
|
require_relative "materials/contextmenu_control"
|
|
45
44
|
require_relative "materials/datacell_control"
|
|
@@ -59,11 +58,10 @@ require_relative "materials/filledbutton_control"
|
|
|
59
58
|
require_relative "materials/fillediconbutton_control"
|
|
60
59
|
require_relative "materials/filledtonalbutton_control"
|
|
61
60
|
require_relative "materials/filledtonaliconbutton_control"
|
|
62
|
-
require_relative "materials/spinkit_controls"
|
|
63
61
|
require_relative "materials/floatingactionbutton_control"
|
|
64
62
|
require_relative "materials/iconbutton_control"
|
|
65
63
|
require_relative "materials/listtile_control"
|
|
66
|
-
require_relative "materials/
|
|
64
|
+
require_relative "materials/map_control"
|
|
67
65
|
require_relative "materials/menubar_control"
|
|
68
66
|
require_relative "materials/menuitembutton_control"
|
|
69
67
|
require_relative "materials/navigationbar_control"
|
|
@@ -79,17 +77,18 @@ require_relative "materials/popupmenubutton_control"
|
|
|
79
77
|
require_relative "materials/popupmenuitem_control"
|
|
80
78
|
require_relative "materials/progressbar_control"
|
|
81
79
|
require_relative "materials/progressring_control"
|
|
80
|
+
require_relative "materials/spinkit_control"
|
|
82
81
|
require_relative "materials/radio_control"
|
|
83
82
|
require_relative "materials/radiogroup_control"
|
|
84
83
|
require_relative "materials/rangeslider_control"
|
|
85
84
|
require_relative "materials/reorderablelistview_control"
|
|
86
|
-
require_relative "materials/rive_control"
|
|
87
85
|
require_relative "materials/searchbar_control"
|
|
88
86
|
require_relative "materials/segment_control"
|
|
89
87
|
require_relative "materials/segmentedbutton_control"
|
|
90
88
|
require_relative "materials/selectionarea_control"
|
|
91
89
|
require_relative "materials/slider_control"
|
|
92
90
|
require_relative "materials/snackbar_control"
|
|
91
|
+
require_relative "materials/snackbaraction_control"
|
|
93
92
|
require_relative "materials/submenubutton_control"
|
|
94
93
|
require_relative "materials/switch_control"
|
|
95
94
|
require_relative "materials/tab_control"
|
|
@@ -140,7 +139,9 @@ require_relative "shared/rect_control"
|
|
|
140
139
|
require_relative "shared/reorderabledraghandle_control"
|
|
141
140
|
require_relative "shared/responsiverow_control"
|
|
142
141
|
require_relative "shared/row_control"
|
|
142
|
+
require_relative "shared/rotatedbox_control"
|
|
143
143
|
require_relative "shared/safearea_control"
|
|
144
|
+
require_relative "shared/screenshot_control"
|
|
144
145
|
require_relative "shared/semantics_control"
|
|
145
146
|
require_relative "shared/serviceregistry_control"
|
|
146
147
|
require_relative "shared/shadermask_control"
|
|
@@ -209,8 +210,6 @@ module Ruflet
|
|
|
209
210
|
"circle" => RufletComponents::CircleControl,
|
|
210
211
|
"circle_avatar" => RufletComponents::CircleAvatarControl,
|
|
211
212
|
"circleavatar" => RufletComponents::CircleAvatarControl,
|
|
212
|
-
"code_editor" => RufletComponents::CodeEditorControl,
|
|
213
|
-
"codeeditor" => RufletComponents::CodeEditorControl,
|
|
214
213
|
"color" => RufletComponents::ColorControl,
|
|
215
214
|
"column" => RufletComponents::ColumnControl,
|
|
216
215
|
"container" => RufletComponents::ContainerControl,
|
|
@@ -329,27 +328,8 @@ module Ruflet
|
|
|
329
328
|
"list_tile" => RufletComponents::ListTileControl,
|
|
330
329
|
"list_view" => RufletComponents::ListViewControl,
|
|
331
330
|
"listtile" => RufletComponents::ListTileControl,
|
|
332
|
-
"listview" => RufletComponents::ListViewControl,
|
|
333
331
|
"map" => RufletComponents::MapControl,
|
|
334
|
-
"
|
|
335
|
-
"tilelayer" => RufletComponents::TileLayerControl,
|
|
336
|
-
"marker_layer" => RufletComponents::MarkerLayerControl,
|
|
337
|
-
"markerlayer" => RufletComponents::MarkerLayerControl,
|
|
338
|
-
"marker" => RufletComponents::MarkerControl,
|
|
339
|
-
"circle_layer" => RufletComponents::CircleLayerControl,
|
|
340
|
-
"circlelayer" => RufletComponents::CircleLayerControl,
|
|
341
|
-
"circle_marker" => RufletComponents::CircleMarkerControl,
|
|
342
|
-
"circlemarker" => RufletComponents::CircleMarkerControl,
|
|
343
|
-
"polyline_layer" => RufletComponents::PolylineLayerControl,
|
|
344
|
-
"polylinelayer" => RufletComponents::PolylineLayerControl,
|
|
345
|
-
"polyline_marker" => RufletComponents::PolylineMarkerControl,
|
|
346
|
-
"polylinemarker" => RufletComponents::PolylineMarkerControl,
|
|
347
|
-
"polygon_layer" => RufletComponents::PolygonLayerControl,
|
|
348
|
-
"polygonlayer" => RufletComponents::PolygonLayerControl,
|
|
349
|
-
"polygon_marker" => RufletComponents::PolygonMarkerControl,
|
|
350
|
-
"polygonmarker" => RufletComponents::PolygonMarkerControl,
|
|
351
|
-
"simple_attribution" => RufletComponents::SimpleAttributionControl,
|
|
352
|
-
"simpleattribution" => RufletComponents::SimpleAttributionControl,
|
|
332
|
+
"listview" => RufletComponents::ListViewControl,
|
|
353
333
|
"markdown" => RufletComponents::MarkdownControl,
|
|
354
334
|
"menu_bar" => RufletComponents::MenuBarControl,
|
|
355
335
|
"menu_item_button" => RufletComponents::MenuItemButtonControl,
|
|
@@ -395,6 +375,7 @@ module Ruflet
|
|
|
395
375
|
"progress_ring" => RufletComponents::ProgressRingControl,
|
|
396
376
|
"progressbar" => RufletComponents::ProgressBarControl,
|
|
397
377
|
"progressring" => RufletComponents::ProgressRingControl,
|
|
378
|
+
"spinkit" => RufletComponents::SpinkitControl,
|
|
398
379
|
"radio" => RufletComponents::RadioControl,
|
|
399
380
|
"radio_group" => RufletComponents::RadioGroupControl,
|
|
400
381
|
"radiogroup" => RufletComponents::RadioGroupControl,
|
|
@@ -413,12 +394,14 @@ module Ruflet
|
|
|
413
394
|
"reorderable_list_view" => RufletComponents::ReorderableListViewControl,
|
|
414
395
|
"reorderabledraghandle" => RufletComponents::ReorderableDragHandleControl,
|
|
415
396
|
"reorderablelistview" => RufletComponents::ReorderableListViewControl,
|
|
416
|
-
"rive" => RufletComponents::RiveControl,
|
|
417
397
|
"responsive_row" => RufletComponents::ResponsiveRowControl,
|
|
418
398
|
"responsiverow" => RufletComponents::ResponsiveRowControl,
|
|
419
399
|
"row" => RufletComponents::RowControl,
|
|
400
|
+
"rotated_box" => RufletComponents::RotatedBoxControl,
|
|
401
|
+
"rotatedbox" => RufletComponents::RotatedBoxControl,
|
|
420
402
|
"safe_area" => RufletComponents::SafeAreaControl,
|
|
421
403
|
"safearea" => RufletComponents::SafeAreaControl,
|
|
404
|
+
"screenshot" => RufletComponents::ScreenshotControl,
|
|
422
405
|
"search_bar" => RufletComponents::SearchBarControl,
|
|
423
406
|
"searchbar" => RufletComponents::SearchBarControl,
|
|
424
407
|
"segment" => RufletComponents::SegmentControl,
|
|
@@ -439,6 +422,8 @@ module Ruflet
|
|
|
439
422
|
"shimmer" => RufletComponents::ShimmerControl,
|
|
440
423
|
"slider" => RufletComponents::SliderControl,
|
|
441
424
|
"snack_bar" => RufletComponents::SnackBarControl,
|
|
425
|
+
"snack_bar_action" => RufletComponents::SnackBarActionControl,
|
|
426
|
+
"snackbaraction" => RufletComponents::SnackBarActionControl,
|
|
442
427
|
"snackbar" => RufletComponents::SnackBarControl,
|
|
443
428
|
"stack" => RufletComponents::StackControl,
|
|
444
429
|
"submenu_button" => RufletComponents::SubmenuButtonControl,
|
|
@@ -470,7 +455,7 @@ module Ruflet
|
|
|
470
455
|
"window" => RufletComponents::WindowControl,
|
|
471
456
|
"window_drag_area" => RufletComponents::WindowDragAreaControl,
|
|
472
457
|
"windowdragarea" => RufletComponents::WindowDragAreaControl,
|
|
473
|
-
}.
|
|
458
|
+
}.freeze
|
|
474
459
|
end
|
|
475
460
|
end
|
|
476
461
|
end
|
|
@@ -8,10 +8,52 @@ module Ruflet
|
|
|
8
8
|
TYPE = "animatedswitcher".freeze
|
|
9
9
|
WIRE = "AnimatedSwitcher".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :content, :data, :disabled, :duration, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :reverse_duration, :right, :rotate, :rtl, :scale, :size_change_interval, :switch_in_curve, :switch_out_curve, :tooltip, :top, :transition, :visible, :width, :on_animation_end, :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
|
+
content = props[:content]
|
|
30
|
+
data = props[:data]
|
|
31
|
+
disabled = props[:disabled]
|
|
32
|
+
duration = props[:duration]
|
|
33
|
+
expand = props[:expand]
|
|
34
|
+
expand_loose = props[:expand_loose]
|
|
35
|
+
height = props[:height]
|
|
36
|
+
key = props[:key]
|
|
37
|
+
left = props[:left]
|
|
38
|
+
margin = props[:margin]
|
|
39
|
+
offset = props[:offset]
|
|
40
|
+
opacity = props[:opacity]
|
|
41
|
+
reverse_duration = props[:reverse_duration]
|
|
42
|
+
right = props[:right]
|
|
43
|
+
rotate = props[:rotate]
|
|
44
|
+
rtl = props[:rtl]
|
|
45
|
+
scale = props[:scale]
|
|
46
|
+
size_change_interval = props[:size_change_interval]
|
|
47
|
+
switch_in_curve = props[:switch_in_curve]
|
|
48
|
+
switch_out_curve = props[:switch_out_curve]
|
|
49
|
+
tooltip = props[:tooltip]
|
|
50
|
+
top = props[:top]
|
|
51
|
+
transition = props[:transition]
|
|
52
|
+
visible = props[:visible]
|
|
53
|
+
width = props[:width]
|
|
54
|
+
on_animation_end = props[:on_animation_end]
|
|
55
|
+
on_size_change = props[:on_size_change]
|
|
56
|
+
raise ArgumentError, "animated_switcher requires content" if content.nil?
|
|
15
57
|
|
|
16
58
|
duration = 1000 if duration.nil?
|
|
17
59
|
reverse_duration = 1000 if reverse_duration.nil?
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class ArcControl < Ruflet::Control
|
|
8
8
|
TYPE = "arc".freeze
|
|
9
9
|
WIRE = "Arc".freeze
|
|
10
|
+
KEYWORDS = [:data, :height, :key, :paint, :start_angle, :sweep_angle, :use_center, :width, :x, :y].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, height: nil, key: nil, paint: nil, start_angle: nil, sweep_angle: nil, use_center: nil, width: nil, x: nil, y: nil)
|
|
12
13
|
props = {}
|