ruflet_core 0.0.17 → 0.0.19
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/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 +313 -523
- 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 +3 -4
- 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 +62 -18
- 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 +25 -2
- 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,41 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "text".freeze
|
|
9
9
|
WIRE = "Text".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:font_family_fallback] = font_family_fallback unless font_family_fallback.nil?
|
|
21
|
-
props[:italic] = italic unless italic.nil?
|
|
22
|
-
props[:key] = key unless key.nil?
|
|
23
|
-
props[:max_lines] = max_lines unless max_lines.nil?
|
|
24
|
-
props[:max_width] = max_width unless max_width.nil?
|
|
25
|
-
props[:no_wrap] = no_wrap unless no_wrap.nil?
|
|
26
|
-
props[:overflow] = overflow unless overflow.nil?
|
|
27
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
28
|
-
props[:selectable] = selectable unless selectable.nil?
|
|
29
|
-
props[:selection_cursor_color] = selection_cursor_color unless selection_cursor_color.nil?
|
|
30
|
-
props[:selection_cursor_height] = selection_cursor_height unless selection_cursor_height.nil?
|
|
31
|
-
props[:selection_cursor_width] = selection_cursor_width unless selection_cursor_width.nil?
|
|
32
|
-
props[:semantics_label] = semantics_label unless semantics_label.nil?
|
|
33
|
-
props[:show_selection_cursor] = show_selection_cursor unless show_selection_cursor.nil?
|
|
34
|
-
props[:size] = size unless size.nil?
|
|
35
|
-
props[:spans] = spans unless spans.nil?
|
|
36
|
-
props[:style] = style unless style.nil?
|
|
37
|
-
props[:text_align] = text_align unless text_align.nil?
|
|
38
|
-
props[:theme_style] = theme_style unless theme_style.nil?
|
|
39
|
-
props[:value] = value unless value.nil?
|
|
40
|
-
props[:weight] = weight unless weight.nil?
|
|
41
|
-
props[:x] = x unless x.nil?
|
|
42
|
-
props[:y] = y unless y.nil?
|
|
43
|
-
props[:on_selection_change] = on_selection_change unless on_selection_change.nil?
|
|
44
|
-
props[:on_tap] = on_tap unless on_tap.nil?
|
|
45
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:alignment, :bgcolor, :color, :data, :ellipsis, :enable_interactive_selection, :font_family, :font_family_fallback, :italic, :key, :max_lines, :max_width, :no_wrap, :overflow, :rotate, :selectable, :selection_cursor_color, :selection_cursor_height, :selection_cursor_width, :semantics_label, :show_selection_cursor, :size, :spans, :style, :text_align, :theme_style, :value, :weight, :x, :y, :on_selection_change, :on_tap].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)
|
|
46
20
|
end
|
|
47
21
|
end
|
|
48
22
|
end
|
|
@@ -8,44 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "transparentpointer".freeze
|
|
9
9
|
WIRE = "TransparentPointer".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
23
|
-
props[:badge] = badge unless badge.nil?
|
|
24
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
25
|
-
props[:col] = col unless col.nil?
|
|
26
|
-
props[:content] = content unless content.nil?
|
|
27
|
-
props[:data] = data unless data.nil?
|
|
28
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
29
|
-
props[:expand] = expand unless expand.nil?
|
|
30
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
31
|
-
props[:height] = height unless height.nil?
|
|
32
|
-
props[:key] = key unless key.nil?
|
|
33
|
-
props[:left] = left unless left.nil?
|
|
34
|
-
props[:margin] = margin unless margin.nil?
|
|
35
|
-
props[:offset] = offset unless offset.nil?
|
|
36
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
37
|
-
props[:right] = right unless right.nil?
|
|
38
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
39
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
40
|
-
props[:scale] = scale unless scale.nil?
|
|
41
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
42
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
43
|
-
props[:top] = top unless top.nil?
|
|
44
|
-
props[:visible] = visible unless visible.nil?
|
|
45
|
-
props[:width] = width unless width.nil?
|
|
46
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
47
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
48
|
-
super(type: TYPE, id: id, **props)
|
|
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, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
49
20
|
end
|
|
50
21
|
end
|
|
51
22
|
end
|
|
@@ -8,7 +8,69 @@ module Ruflet
|
|
|
8
8
|
TYPE = "view".freeze
|
|
9
9
|
WIRE = "View".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :appbar, :aspect_ratio, :auto_scroll, :badge, :bgcolor, :bottom, :bottom_appbar, :can_pop, :col, :controls, :data, :decoration, :disabled, :drawer, :end_drawer, :expand, :expand_loose, :floating_action_button, :floating_action_button_location, :foreground_decoration, :fullscreen_dialog, :height, :horizontal_alignment, :key, :left, :margin, :navigation_bar, :offset, :opacity, :padding, :right, :rotate, :route, :rtl, :scale, :scroll, :scroll_interval, :services, :size_change_interval, :spacing, :tooltip, :top, :vertical_alignment, :visible, :width, :on_animation_end, :on_confirm_pop, :on_scroll, :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
|
+
appbar = props[:appbar]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
auto_scroll = props[:auto_scroll]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bgcolor = props[:bgcolor]
|
|
30
|
+
bottom = props[:bottom]
|
|
31
|
+
bottom_appbar = props[:bottom_appbar]
|
|
32
|
+
can_pop = props[:can_pop]
|
|
33
|
+
col = props[:col]
|
|
34
|
+
controls = props[:controls]
|
|
35
|
+
data = props[:data]
|
|
36
|
+
decoration = props[:decoration]
|
|
37
|
+
disabled = props[:disabled]
|
|
38
|
+
drawer = props[:drawer]
|
|
39
|
+
end_drawer = props[:end_drawer]
|
|
40
|
+
expand = props[:expand]
|
|
41
|
+
expand_loose = props[:expand_loose]
|
|
42
|
+
floating_action_button = props[:floating_action_button]
|
|
43
|
+
floating_action_button_location = props[:floating_action_button_location]
|
|
44
|
+
foreground_decoration = props[:foreground_decoration]
|
|
45
|
+
fullscreen_dialog = props[:fullscreen_dialog]
|
|
46
|
+
height = props[:height]
|
|
47
|
+
horizontal_alignment = props[:horizontal_alignment]
|
|
48
|
+
key = props[:key]
|
|
49
|
+
left = props[:left]
|
|
50
|
+
margin = props[:margin]
|
|
51
|
+
navigation_bar = props[:navigation_bar]
|
|
52
|
+
offset = props[:offset]
|
|
53
|
+
opacity = props[:opacity]
|
|
54
|
+
padding = props[:padding]
|
|
55
|
+
right = props[:right]
|
|
56
|
+
rotate = props[:rotate]
|
|
57
|
+
route = props[:route]
|
|
58
|
+
rtl = props[:rtl]
|
|
59
|
+
scale = props[:scale]
|
|
60
|
+
scroll = props[:scroll]
|
|
61
|
+
scroll_interval = props[:scroll_interval]
|
|
62
|
+
services = props[:services]
|
|
63
|
+
size_change_interval = props[:size_change_interval]
|
|
64
|
+
spacing = props[:spacing]
|
|
65
|
+
tooltip = props[:tooltip]
|
|
66
|
+
top = props[:top]
|
|
67
|
+
vertical_alignment = props[:vertical_alignment]
|
|
68
|
+
visible = props[:visible]
|
|
69
|
+
width = props[:width]
|
|
70
|
+
on_animation_end = props[:on_animation_end]
|
|
71
|
+
on_confirm_pop = props[:on_confirm_pop]
|
|
72
|
+
on_scroll = props[:on_scroll]
|
|
73
|
+
on_size_change = props[:on_size_change]
|
|
12
74
|
can_pop = true if can_pop.nil?
|
|
13
75
|
fullscreen_dialog = false if fullscreen_dialog.nil?
|
|
14
76
|
horizontal_alignment = "start" if horizontal_alignment.nil?
|
|
@@ -7,78 +7,46 @@ module Ruflet
|
|
|
7
7
|
class WindowControl < Ruflet::Control
|
|
8
8
|
TYPE = "window".freeze
|
|
9
9
|
WIRE = "Window".freeze
|
|
10
|
+
RESIZE_EDGES = {
|
|
11
|
+
"top" => "top",
|
|
12
|
+
"left" => "left",
|
|
13
|
+
"right" => "right",
|
|
14
|
+
"bottom" => "bottom",
|
|
15
|
+
"top_left" => "topLeft",
|
|
16
|
+
"bottom_left" => "bottomLeft",
|
|
17
|
+
"top_right" => "topRight",
|
|
18
|
+
"bottom_right" => "bottomRight"
|
|
19
|
+
}.freeze
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
props = {}
|
|
13
|
-
props[:alignment] = alignment unless alignment.nil?
|
|
14
|
-
props[:always_on_bottom] = always_on_bottom unless always_on_bottom.nil?
|
|
15
|
-
props[:always_on_top] = always_on_top unless always_on_top.nil?
|
|
16
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
17
|
-
props[:badge_label] = badge_label unless badge_label.nil?
|
|
18
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
19
|
-
props[:brightness] = brightness unless brightness.nil?
|
|
20
|
-
props[:data] = data unless data.nil?
|
|
21
|
-
props[:focused] = focused unless focused.nil?
|
|
22
|
-
props[:frameless] = frameless unless frameless.nil?
|
|
23
|
-
props[:full_screen] = full_screen unless full_screen.nil?
|
|
24
|
-
props[:height] = height unless height.nil?
|
|
25
|
-
props[:icon] = icon unless icon.nil?
|
|
26
|
-
props[:ignore_mouse_events] = ignore_mouse_events unless ignore_mouse_events.nil?
|
|
27
|
-
props[:key] = key unless key.nil?
|
|
28
|
-
props[:left] = left unless left.nil?
|
|
29
|
-
props[:max_height] = max_height unless max_height.nil?
|
|
30
|
-
props[:max_width] = max_width unless max_width.nil?
|
|
31
|
-
props[:maximizable] = maximizable unless maximizable.nil?
|
|
32
|
-
props[:maximized] = maximized unless maximized.nil?
|
|
33
|
-
props[:min_height] = min_height unless min_height.nil?
|
|
34
|
-
props[:min_width] = min_width unless min_width.nil?
|
|
35
|
-
props[:minimizable] = minimizable unless minimizable.nil?
|
|
36
|
-
props[:minimized] = minimized unless minimized.nil?
|
|
37
|
-
props[:movable] = movable unless movable.nil?
|
|
38
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
39
|
-
props[:prevent_close] = prevent_close unless prevent_close.nil?
|
|
40
|
-
props[:progress_bar] = progress_bar unless progress_bar.nil?
|
|
41
|
-
props[:resizable] = resizable unless resizable.nil?
|
|
42
|
-
props[:shadow] = shadow unless shadow.nil?
|
|
43
|
-
props[:skip_task_bar] = skip_task_bar unless skip_task_bar.nil?
|
|
44
|
-
props[:title_bar_buttons_hidden] = title_bar_buttons_hidden unless title_bar_buttons_hidden.nil?
|
|
45
|
-
props[:title_bar_hidden] = title_bar_hidden unless title_bar_hidden.nil?
|
|
46
|
-
props[:top] = top unless top.nil?
|
|
47
|
-
props[:visible] = visible unless visible.nil?
|
|
48
|
-
props[:width] = width unless width.nil?
|
|
49
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
50
|
-
super(type: TYPE, id: id, **props)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def wait_until_ready_to_show(timeout: 10, on_result: nil)
|
|
54
|
-
invoke_window_method("wait_until_ready_to_show", timeout: timeout, on_result: on_result)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def to_front(timeout: 10, on_result: nil)
|
|
58
|
-
invoke_window_method("to_front", timeout: timeout, on_result: on_result)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def center(timeout: 10, on_result: nil)
|
|
62
|
-
invoke_window_method("center", timeout: timeout, on_result: on_result)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def close(timeout: 10, on_result: nil)
|
|
66
|
-
invoke_window_method("close", timeout: timeout, on_result: on_result)
|
|
67
|
-
end
|
|
21
|
+
KEYWORDS = [:alignment, :always_on_bottom, :always_on_top, :aspect_ratio, :badge_label, :bgcolor, :brightness, :data, :focused, :frameless, :full_screen, :height, :icon, :ignore_mouse_events, :key, :left, :max_height, :max_width, :maximizable, :maximized, :min_height, :min_width, :minimizable, :minimized, :movable, :opacity, :prevent_close, :progress_bar, :resizable, :shadow, :skip_task_bar, :title_bar_buttons_hidden, :title_bar_hidden, :top, :visible, :width, :on_event].freeze
|
|
68
22
|
|
|
69
|
-
def
|
|
70
|
-
|
|
23
|
+
def initialize(id: nil, **props)
|
|
24
|
+
compact = {}
|
|
25
|
+
props.each do |key, value|
|
|
26
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
27
|
+
compact[key] = value unless value.nil?
|
|
28
|
+
end
|
|
29
|
+
super(type: TYPE, id: id, **compact)
|
|
71
30
|
end
|
|
72
31
|
|
|
73
|
-
|
|
74
|
-
|
|
32
|
+
%w[
|
|
33
|
+
wait_until_ready_to_show
|
|
34
|
+
destroy
|
|
35
|
+
center
|
|
36
|
+
close
|
|
37
|
+
to_front
|
|
38
|
+
start_dragging
|
|
39
|
+
].each do |method_name|
|
|
40
|
+
define_method(method_name) do |timeout: 10, on_result: nil|
|
|
41
|
+
invoke_window(method_name, timeout: timeout, on_result: on_result)
|
|
42
|
+
end
|
|
75
43
|
end
|
|
76
44
|
|
|
77
45
|
def start_resizing(edge, timeout: 10, on_result: nil)
|
|
78
|
-
|
|
79
|
-
|
|
46
|
+
edge_value = RESIZE_EDGES.fetch(edge.to_s, edge.to_s)
|
|
47
|
+
invoke_window(
|
|
80
48
|
"start_resizing",
|
|
81
|
-
args: { "edge" =>
|
|
49
|
+
args: { "edge" => edge_value },
|
|
82
50
|
timeout: timeout,
|
|
83
51
|
on_result: on_result
|
|
84
52
|
)
|
|
@@ -86,8 +54,14 @@ module Ruflet
|
|
|
86
54
|
|
|
87
55
|
private
|
|
88
56
|
|
|
89
|
-
def
|
|
90
|
-
runtime_page&.invoke(
|
|
57
|
+
def invoke_window(method_name, args: nil, timeout:, on_result:)
|
|
58
|
+
runtime_page&.invoke(
|
|
59
|
+
self,
|
|
60
|
+
method_name,
|
|
61
|
+
args: args,
|
|
62
|
+
timeout: timeout,
|
|
63
|
+
on_result: on_result
|
|
64
|
+
)
|
|
91
65
|
end
|
|
92
66
|
end
|
|
93
67
|
end
|
|
@@ -8,10 +8,51 @@ module Ruflet
|
|
|
8
8
|
TYPE = "windowdragarea".freeze
|
|
9
9
|
WIRE = "WindowDragArea".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, :expand, :expand_loose, :height, :key, :left, :margin, :maximizable, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_double_tap, :on_drag_end, :on_drag_start, :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
|
+
expand = props[:expand]
|
|
33
|
+
expand_loose = props[:expand_loose]
|
|
34
|
+
height = props[:height]
|
|
35
|
+
key = props[:key]
|
|
36
|
+
left = props[:left]
|
|
37
|
+
margin = props[:margin]
|
|
38
|
+
maximizable = props[:maximizable]
|
|
39
|
+
offset = props[:offset]
|
|
40
|
+
opacity = props[:opacity]
|
|
41
|
+
right = props[:right]
|
|
42
|
+
rotate = props[:rotate]
|
|
43
|
+
rtl = props[:rtl]
|
|
44
|
+
scale = props[:scale]
|
|
45
|
+
size_change_interval = props[:size_change_interval]
|
|
46
|
+
tooltip = props[:tooltip]
|
|
47
|
+
top = props[:top]
|
|
48
|
+
visible = props[:visible]
|
|
49
|
+
width = props[:width]
|
|
50
|
+
on_animation_end = props[:on_animation_end]
|
|
51
|
+
on_double_tap = props[:on_double_tap]
|
|
52
|
+
on_drag_end = props[:on_drag_end]
|
|
53
|
+
on_drag_start = props[:on_drag_start]
|
|
54
|
+
on_size_change = props[:on_size_change]
|
|
55
|
+
raise ArgumentError, "window_drag_area requires content" if content.nil?
|
|
15
56
|
|
|
16
57
|
maximizable = true if maximizable.nil?
|
|
17
58
|
|
|
@@ -3,9 +3,25 @@
|
|
|
3
3
|
module Ruflet
|
|
4
4
|
module UI
|
|
5
5
|
module MaterialControlMethods
|
|
6
|
+
def map_coordinates(value)
|
|
7
|
+
case value
|
|
8
|
+
when Array
|
|
9
|
+
return { "latitude" => value[0], "longitude" => value[1] } if value.length >= 2
|
|
10
|
+
when Hash
|
|
11
|
+
latitude = value["latitude"] || value[:latitude] || value["lat"] || value[:lat]
|
|
12
|
+
longitude = value["longitude"] || value[:longitude] || value["lon"] || value[:lon] || value["lng"] || value[:lng]
|
|
13
|
+
return { "latitude" => latitude, "longitude" => longitude } unless latitude.nil? || longitude.nil?
|
|
14
|
+
end
|
|
15
|
+
value.respond_to?(:to_h) ? map_coordinates(value.to_h) : value
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def map_coordinate_list(value)
|
|
19
|
+
Array(value).map { |coordinates| map_coordinates(coordinates) }
|
|
20
|
+
end
|
|
21
|
+
|
|
6
22
|
def view(children = nil, **props, &block)
|
|
7
23
|
mapped = props.dup
|
|
8
|
-
mapped[:
|
|
24
|
+
mapped[:controls] = children unless children.nil?
|
|
9
25
|
build_widget(:view, **mapped, &block)
|
|
10
26
|
end
|
|
11
27
|
def column(children = nil, **props, &block)
|
|
@@ -174,6 +190,7 @@ module Ruflet
|
|
|
174
190
|
def listtile(**props) = list_tile(**props)
|
|
175
191
|
def map(layers = nil, **props)
|
|
176
192
|
mapped = props.dup
|
|
193
|
+
mapped[:initial_center] = map_coordinates(mapped[:initial_center]) if mapped.key?(:initial_center)
|
|
177
194
|
mapped[:layers] = layers unless layers.nil?
|
|
178
195
|
build_widget(:map, **mapped)
|
|
179
196
|
end
|
|
@@ -187,6 +204,7 @@ module Ruflet
|
|
|
187
204
|
def markerlayer(markers = nil, **props) = marker_layer(markers, **props)
|
|
188
205
|
def marker(content = nil, **props)
|
|
189
206
|
mapped = props.dup
|
|
207
|
+
mapped[:coordinates] = map_coordinates(mapped[:coordinates]) if mapped.key?(:coordinates)
|
|
190
208
|
mapped[:content] = content unless content.nil?
|
|
191
209
|
build_widget(:marker, **mapped)
|
|
192
210
|
end
|
|
@@ -196,7 +214,11 @@ module Ruflet
|
|
|
196
214
|
build_widget(:circlelayer, **mapped)
|
|
197
215
|
end
|
|
198
216
|
def circlelayer(circles = nil, **props) = circle_layer(circles, **props)
|
|
199
|
-
def circle_marker(**props)
|
|
217
|
+
def circle_marker(**props)
|
|
218
|
+
mapped = props.dup
|
|
219
|
+
mapped[:coordinates] = map_coordinates(mapped[:coordinates]) if mapped.key?(:coordinates)
|
|
220
|
+
build_widget(:circlemarker, **mapped)
|
|
221
|
+
end
|
|
200
222
|
def circlemarker(**props) = circle_marker(**props)
|
|
201
223
|
def polyline_layer(polylines = nil, **props)
|
|
202
224
|
mapped = props.dup
|
|
@@ -204,7 +226,11 @@ module Ruflet
|
|
|
204
226
|
build_widget(:polylinelayer, **mapped)
|
|
205
227
|
end
|
|
206
228
|
def polylinelayer(polylines = nil, **props) = polyline_layer(polylines, **props)
|
|
207
|
-
def polyline_marker(**props)
|
|
229
|
+
def polyline_marker(**props)
|
|
230
|
+
mapped = props.dup
|
|
231
|
+
mapped[:coordinates] = map_coordinate_list(mapped[:coordinates]) if mapped.key?(:coordinates)
|
|
232
|
+
build_widget(:polylinemarker, **mapped)
|
|
233
|
+
end
|
|
208
234
|
def polylinemarker(**props) = polyline_marker(**props)
|
|
209
235
|
def polygon_layer(polygons = nil, **props)
|
|
210
236
|
mapped = props.dup
|
|
@@ -212,7 +238,11 @@ module Ruflet
|
|
|
212
238
|
build_widget(:polygonlayer, **mapped)
|
|
213
239
|
end
|
|
214
240
|
def polygonlayer(polygons = nil, **props) = polygon_layer(polygons, **props)
|
|
215
|
-
def polygon_marker(**props)
|
|
241
|
+
def polygon_marker(**props)
|
|
242
|
+
mapped = props.dup
|
|
243
|
+
mapped[:coordinates] = map_coordinate_list(mapped[:coordinates]) if mapped.key?(:coordinates)
|
|
244
|
+
build_widget(:polygonmarker, **mapped)
|
|
245
|
+
end
|
|
216
246
|
def polygonmarker(**props) = polygon_marker(**props)
|
|
217
247
|
def simple_attribution(**props) = build_widget(:simpleattribution, **props)
|
|
218
248
|
def simpleattribution(**props) = simple_attribution(**props)
|
|
@@ -329,6 +359,17 @@ module Ruflet
|
|
|
329
359
|
def pageview(children = nil, **props) = page_view(children, **props)
|
|
330
360
|
def progress_ring(**props) = build_widget(:progressring, **props)
|
|
331
361
|
def progressring(**props) = progress_ring(**props)
|
|
362
|
+
SPINKIT_VARIANTS = [:rotating_circle, :rotating_plain, :double_bounce, :wave, :wandering_cubes, :fading_four, :fading_cube, :pulse, :chasing_dots, :three_bounce, :circle, :cube_grid, :fading_circle, :folding_cube, :pumping_heart, :hour_glass, :pouring_hour_glass, :pouring_hour_glass_refined, :fading_grid, :ring, :ripple, :dual_ring, :spinning_circle, :spinning_lines, :square_circle, :three_in_out, :dancing_square, :piano_wave, :pulsing_grid, :wave_spinner].freeze
|
|
363
|
+
|
|
364
|
+
def spinkit(**variants)
|
|
365
|
+
selected = variants.select { |name, _value| SPINKIT_VARIANTS.include?(name) }
|
|
366
|
+
raise ArgumentError, "spinkit requires exactly one variant" unless selected.length == 1 && selected.length == variants.length
|
|
367
|
+
|
|
368
|
+
variant, options = selected.first
|
|
369
|
+
raise ArgumentError, "spinkit variant options must be a Hash" unless options.is_a?(Hash)
|
|
370
|
+
|
|
371
|
+
build_widget(:spinkit, variant: variant.to_s, **options)
|
|
372
|
+
end
|
|
332
373
|
def range_slider(**props) = build_widget(:rangeslider, **props)
|
|
333
374
|
def rangeslider(**props) = range_slider(**props)
|
|
334
375
|
def responsive_row(children = nil, **props, &block)
|
|
@@ -509,6 +550,17 @@ module Ruflet
|
|
|
509
550
|
build_widget(:transparentpointer, **mapped)
|
|
510
551
|
end
|
|
511
552
|
def transparentpointer(content = nil, **props) = transparent_pointer(content, **props)
|
|
553
|
+
def rotated_box(content = nil, **props)
|
|
554
|
+
mapped = props.dup
|
|
555
|
+
mapped[:content] = content unless content.nil?
|
|
556
|
+
build_widget(:rotatedbox, **mapped)
|
|
557
|
+
end
|
|
558
|
+
def rotatedbox(content = nil, **props) = rotated_box(content, **props)
|
|
559
|
+
def screenshot(content = nil, **props)
|
|
560
|
+
mapped = props.dup
|
|
561
|
+
mapped[:content] = content unless content.nil?
|
|
562
|
+
build_widget(:screenshot, **mapped)
|
|
563
|
+
end
|
|
512
564
|
def radio(**props) = build_widget(:radio, **props)
|
|
513
565
|
def radio_group(content = nil, **props)
|
|
514
566
|
mapped = props.dup
|
|
@@ -524,6 +576,12 @@ module Ruflet
|
|
|
524
576
|
build_widget(:snackbar, **mapped)
|
|
525
577
|
end
|
|
526
578
|
def snackbar(content = nil, **props) = snack_bar(content, **props)
|
|
579
|
+
def snack_bar_action(label = nil, **props)
|
|
580
|
+
mapped = props.dup
|
|
581
|
+
mapped[:label] = label unless label.nil?
|
|
582
|
+
build_widget(:snackbaraction, **mapped)
|
|
583
|
+
end
|
|
584
|
+
def snackbaraction(label = nil, **props) = snack_bar_action(label, **props)
|
|
527
585
|
def bottom_sheet(content = nil, **props)
|
|
528
586
|
mapped = props.dup
|
|
529
587
|
mapped[:content] = content unless content.nil?
|
|
@@ -638,26 +696,12 @@ module Ruflet
|
|
|
638
696
|
def web_view(**props) = build_widget(:webview, **props)
|
|
639
697
|
def webview(**props) = web_view(**props)
|
|
640
698
|
def video(**props) = build_widget(:video, **props)
|
|
641
|
-
|
|
642
|
-
# spinkit(wave: { color: "red", size: 50 }) — one variant keyword whose
|
|
643
|
-
# value is the props hash. See https://flet.dev/docs/controls/spinkit/
|
|
644
|
-
def spinkit(**variant)
|
|
645
|
-
raise ArgumentError, "spinkit expects exactly one variant, e.g. spinkit(wave: { color: ... })" unless variant.size == 1
|
|
646
|
-
|
|
647
|
-
name, props = variant.first
|
|
648
|
-
props ||= {}
|
|
649
|
-
raise ArgumentError, "spinkit #{name} options must be a Hash" unless props.is_a?(Hash)
|
|
650
|
-
|
|
651
|
-
build_widget(:"spinkit_#{name}", **props)
|
|
652
|
-
end
|
|
653
|
-
|
|
654
699
|
def code_editor(value = nil, **props)
|
|
655
700
|
mapped = props.dup
|
|
656
701
|
mapped[:value] = value unless value.nil?
|
|
657
702
|
build_widget(:codeeditor, **mapped)
|
|
658
703
|
end
|
|
659
704
|
def codeeditor(value = nil, **props) = code_editor(value, **props)
|
|
660
|
-
|
|
661
705
|
def rive(src = nil, **props)
|
|
662
706
|
mapped = props.dup
|
|
663
707
|
mapped[:src] = src unless src.nil?
|
|
@@ -94,6 +94,28 @@ module Ruflet
|
|
|
94
94
|
"clipboard" => "Clipboard",
|
|
95
95
|
"audio" => "Audio",
|
|
96
96
|
"video" => "Video",
|
|
97
|
+
"map" => "Map",
|
|
98
|
+
"tilelayer" => "TileLayer",
|
|
99
|
+
"tile_layer" => "TileLayer",
|
|
100
|
+
"markerlayer" => "MarkerLayer",
|
|
101
|
+
"marker_layer" => "MarkerLayer",
|
|
102
|
+
"marker" => "Marker",
|
|
103
|
+
"circlelayer" => "CircleLayer",
|
|
104
|
+
"circle_layer" => "CircleLayer",
|
|
105
|
+
"circlemarker" => "CircleMarker",
|
|
106
|
+
"circle_marker" => "CircleMarker",
|
|
107
|
+
"polylinelayer" => "PolylineLayer",
|
|
108
|
+
"polyline_layer" => "PolylineLayer",
|
|
109
|
+
"polylinemarker" => "PolylineMarker",
|
|
110
|
+
"polyline_marker" => "PolylineMarker",
|
|
111
|
+
"polygonlayer" => "PolygonLayer",
|
|
112
|
+
"polygon_layer" => "PolygonLayer",
|
|
113
|
+
"polygonmarker" => "PolygonMarker",
|
|
114
|
+
"polygon_marker" => "PolygonMarker",
|
|
115
|
+
"simpleattribution" => "SimpleAttribution",
|
|
116
|
+
"simple_attribution" => "SimpleAttribution",
|
|
117
|
+
"codeeditor" => "CodeEditor",
|
|
118
|
+
"code_editor" => "CodeEditor",
|
|
97
119
|
"flashlight" => "Flashlight",
|
|
98
120
|
"barchart" => "BarChart",
|
|
99
121
|
"barchartgroup" => "group",
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class AccelerometerControl < Ruflet::Control
|
|
8
8
|
TYPE = "accelerometer".freeze
|
|
9
9
|
WIRE = "Accelerometer".freeze
|
|
10
|
+
KEYWORDS = [:cancel_on_error, :data, :enabled, :interval, :key, :on_error, :on_reading].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, cancel_on_error: nil, data: nil, enabled: nil, interval: nil, key: nil, on_error: nil, on_reading: nil)
|
|
12
13
|
props = {}
|