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,7 +8,53 @@ module Ruflet
|
|
|
8
8
|
TYPE = "responsiverow".freeze
|
|
9
9
|
WIRE = "ResponsiveRow".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :breakpoints, :col, :columns, :controls, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :run_spacing, :scale, :size_change_interval, :spacing, :tooltip, :top, :vertical_alignment, :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
|
+
adaptive = props[:adaptive]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
alignment = props[:alignment]
|
|
19
|
+
animate_align = props[:animate_align]
|
|
20
|
+
animate_margin = props[:animate_margin]
|
|
21
|
+
animate_offset = props[:animate_offset]
|
|
22
|
+
animate_opacity = props[:animate_opacity]
|
|
23
|
+
animate_position = props[:animate_position]
|
|
24
|
+
animate_rotation = props[:animate_rotation]
|
|
25
|
+
animate_scale = props[:animate_scale]
|
|
26
|
+
animate_size = props[:animate_size]
|
|
27
|
+
aspect_ratio = props[:aspect_ratio]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bottom = props[:bottom]
|
|
30
|
+
breakpoints = props[:breakpoints]
|
|
31
|
+
col = props[:col]
|
|
32
|
+
columns = props[:columns]
|
|
33
|
+
controls = props[:controls]
|
|
34
|
+
data = props[:data]
|
|
35
|
+
disabled = props[:disabled]
|
|
36
|
+
expand = props[:expand]
|
|
37
|
+
expand_loose = props[:expand_loose]
|
|
38
|
+
height = props[:height]
|
|
39
|
+
key = props[:key]
|
|
40
|
+
left = props[:left]
|
|
41
|
+
margin = props[:margin]
|
|
42
|
+
offset = props[:offset]
|
|
43
|
+
opacity = props[:opacity]
|
|
44
|
+
right = props[:right]
|
|
45
|
+
rotate = props[:rotate]
|
|
46
|
+
rtl = props[:rtl]
|
|
47
|
+
run_spacing = props[:run_spacing]
|
|
48
|
+
scale = props[:scale]
|
|
49
|
+
size_change_interval = props[:size_change_interval]
|
|
50
|
+
spacing = props[:spacing]
|
|
51
|
+
tooltip = props[:tooltip]
|
|
52
|
+
top = props[:top]
|
|
53
|
+
vertical_alignment = props[:vertical_alignment]
|
|
54
|
+
visible = props[:visible]
|
|
55
|
+
width = props[:width]
|
|
56
|
+
on_animation_end = props[:on_animation_end]
|
|
57
|
+
on_size_change = props[:on_size_change]
|
|
12
58
|
alignment = "start" if alignment.nil?
|
|
13
59
|
breakpoints = { "xs" => 0, "sm" => 576, "md" => 768, "lg" => 992, "xl" => 1200, "xxl" => 1400 } if breakpoints.nil?
|
|
14
60
|
columns = 12 if columns.nil?
|
|
@@ -16,11 +62,6 @@ module Ruflet
|
|
|
16
62
|
spacing = 10 if spacing.nil?
|
|
17
63
|
vertical_alignment = "start" if vertical_alignment.nil?
|
|
18
64
|
|
|
19
|
-
validate_non_negative(:columns, columns)
|
|
20
|
-
validate_non_negative(:run_spacing, run_spacing)
|
|
21
|
-
validate_non_negative(:spacing, spacing)
|
|
22
|
-
validate_non_negative(:breakpoints, breakpoints)
|
|
23
|
-
|
|
24
65
|
props = {}
|
|
25
66
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
26
67
|
props[:align] = align unless align.nil?
|
|
@@ -67,15 +108,6 @@ module Ruflet
|
|
|
67
108
|
super(type: TYPE, id: id, **props)
|
|
68
109
|
end
|
|
69
110
|
|
|
70
|
-
private
|
|
71
|
-
|
|
72
|
-
def validate_non_negative(name, value)
|
|
73
|
-
values = value.is_a?(Hash) ? value.values : [value]
|
|
74
|
-
values.each do |entry|
|
|
75
|
-
next if entry.nil?
|
|
76
|
-
raise ArgumentError, "responsive_row #{name} must be greater than or equal to 0" if entry.negative?
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
111
|
end
|
|
80
112
|
end
|
|
81
113
|
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class RotatedBoxControl < Ruflet::Control
|
|
8
|
+
TYPE = "rotatedbox".freeze
|
|
9
|
+
WIRE = "RotatedBox".freeze
|
|
10
|
+
|
|
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, :quarter_turns, :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
|
+
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
|
+
offset = props[:offset]
|
|
39
|
+
opacity = props[:opacity]
|
|
40
|
+
quarter_turns = props[:quarter_turns]
|
|
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_size_change = props[:on_size_change]
|
|
52
|
+
quarter_turns = 0 if quarter_turns.nil?
|
|
53
|
+
|
|
54
|
+
props = {}
|
|
55
|
+
props[:align] = align unless align.nil?
|
|
56
|
+
props[:animate_align] = animate_align unless animate_align.nil?
|
|
57
|
+
props[:animate_margin] = animate_margin unless animate_margin.nil?
|
|
58
|
+
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
59
|
+
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
60
|
+
props[:animate_position] = animate_position unless animate_position.nil?
|
|
61
|
+
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
62
|
+
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
63
|
+
props[:animate_size] = animate_size unless animate_size.nil?
|
|
64
|
+
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
65
|
+
props[:badge] = badge unless badge.nil?
|
|
66
|
+
props[:bottom] = bottom unless bottom.nil?
|
|
67
|
+
props[:col] = col unless col.nil?
|
|
68
|
+
props[:content] = content unless content.nil?
|
|
69
|
+
props[:data] = data unless data.nil?
|
|
70
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
71
|
+
props[:expand] = expand unless expand.nil?
|
|
72
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
73
|
+
props[:height] = height unless height.nil?
|
|
74
|
+
props[:key] = key unless key.nil?
|
|
75
|
+
props[:left] = left unless left.nil?
|
|
76
|
+
props[:margin] = margin unless margin.nil?
|
|
77
|
+
props[:offset] = offset unless offset.nil?
|
|
78
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
79
|
+
props[:quarter_turns] = quarter_turns unless quarter_turns.nil?
|
|
80
|
+
props[:right] = right unless right.nil?
|
|
81
|
+
props[:rotate] = rotate unless rotate.nil?
|
|
82
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
83
|
+
props[:scale] = scale unless scale.nil?
|
|
84
|
+
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
85
|
+
props[:tooltip] = tooltip unless tooltip.nil?
|
|
86
|
+
props[:top] = top unless top.nil?
|
|
87
|
+
props[:visible] = visible unless visible.nil?
|
|
88
|
+
props[:width] = width unless width.nil?
|
|
89
|
+
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
90
|
+
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
91
|
+
super(type: TYPE, id: id, **props)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -8,57 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "row".freeze
|
|
9
9
|
WIRE = "Row".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_position] = animate_position unless animate_position.nil?
|
|
21
|
-
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
22
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
23
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
24
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
25
|
-
props[:auto_scroll] = auto_scroll unless auto_scroll.nil?
|
|
26
|
-
props[:badge] = badge unless badge.nil?
|
|
27
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
28
|
-
props[:col] = col unless col.nil?
|
|
29
|
-
props[:controls] = controls unless controls.nil?
|
|
30
|
-
props[:data] = data unless data.nil?
|
|
31
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
32
|
-
props[:expand] = expand unless expand.nil?
|
|
33
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
34
|
-
props[:height] = height unless height.nil?
|
|
35
|
-
props[:intrinsic_height] = intrinsic_height unless intrinsic_height.nil?
|
|
36
|
-
props[:key] = key unless key.nil?
|
|
37
|
-
props[:left] = left unless left.nil?
|
|
38
|
-
props[:margin] = margin unless margin.nil?
|
|
39
|
-
props[:offset] = offset unless offset.nil?
|
|
40
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
41
|
-
props[:right] = right unless right.nil?
|
|
42
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
43
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
44
|
-
props[:run_alignment] = run_alignment unless run_alignment.nil?
|
|
45
|
-
props[:run_spacing] = run_spacing unless run_spacing.nil?
|
|
46
|
-
props[:scale] = scale unless scale.nil?
|
|
47
|
-
props[:scroll] = scroll unless scroll.nil?
|
|
48
|
-
props[:scroll_interval] = scroll_interval unless scroll_interval.nil?
|
|
49
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
50
|
-
props[:spacing] = spacing unless spacing.nil?
|
|
51
|
-
props[:tight] = tight unless tight.nil?
|
|
52
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
53
|
-
props[:top] = top unless top.nil?
|
|
54
|
-
props[:vertical_alignment] = vertical_alignment unless vertical_alignment.nil?
|
|
55
|
-
props[:visible] = visible unless visible.nil?
|
|
56
|
-
props[:width] = width unless width.nil?
|
|
57
|
-
props[:wrap] = wrap unless wrap.nil?
|
|
58
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
59
|
-
props[:on_scroll] = on_scroll unless on_scroll.nil?
|
|
60
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
61
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :auto_scroll, :badge, :bottom, :col, :controls, :data, :disabled, :expand, :expand_loose, :height, :intrinsic_height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :run_alignment, :run_spacing, :scale, :scroll, :scroll_interval, :size_change_interval, :spacing, :tight, :tooltip, :top, :vertical_alignment, :visible, :width, :wrap, :on_animation_end, :on_scroll, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
62
20
|
end
|
|
63
21
|
end
|
|
64
22
|
end
|
|
@@ -38,7 +38,9 @@ require_relative "rect_control"
|
|
|
38
38
|
require_relative "reorderabledraghandle_control"
|
|
39
39
|
require_relative "responsiverow_control"
|
|
40
40
|
require_relative "row_control"
|
|
41
|
+
require_relative "rotatedbox_control"
|
|
41
42
|
require_relative "safearea_control"
|
|
43
|
+
require_relative "screenshot_control"
|
|
42
44
|
require_relative "semantics_control"
|
|
43
45
|
require_relative "serviceregistry_control"
|
|
44
46
|
require_relative "shadermask_control"
|
|
@@ -113,8 +115,11 @@ module Ruflet
|
|
|
113
115
|
"responsive_row" => RufletComponents::ResponsiveRowControl,
|
|
114
116
|
"responsiverow" => RufletComponents::ResponsiveRowControl,
|
|
115
117
|
"row" => RufletComponents::RowControl,
|
|
118
|
+
"rotated_box" => RufletComponents::RotatedBoxControl,
|
|
119
|
+
"rotatedbox" => RufletComponents::RotatedBoxControl,
|
|
116
120
|
"safe_area" => RufletComponents::SafeAreaControl,
|
|
117
121
|
"safearea" => RufletComponents::SafeAreaControl,
|
|
122
|
+
"screenshot" => RufletComponents::ScreenshotControl,
|
|
118
123
|
"semantics" => RufletComponents::SemanticsControl,
|
|
119
124
|
"service_registry" => RufletComponents::ServiceRegistryControl,
|
|
120
125
|
"serviceregistry" => RufletComponents::ServiceRegistryControl,
|
|
@@ -8,10 +8,54 @@ module Ruflet
|
|
|
8
8
|
TYPE = "safearea".freeze
|
|
9
9
|
WIRE = "SafeArea".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :avoid_intrusions_bottom, :avoid_intrusions_left, :avoid_intrusions_right, :avoid_intrusions_top, :badge, :bottom, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :maintain_bottom_view_padding, :margin, :minimum_padding, :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
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
adaptive = props[:adaptive]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
animate_align = props[:animate_align]
|
|
19
|
+
animate_margin = props[:animate_margin]
|
|
20
|
+
animate_offset = props[:animate_offset]
|
|
21
|
+
animate_opacity = props[:animate_opacity]
|
|
22
|
+
animate_position = props[:animate_position]
|
|
23
|
+
animate_rotation = props[:animate_rotation]
|
|
24
|
+
animate_scale = props[:animate_scale]
|
|
25
|
+
animate_size = props[:animate_size]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
avoid_intrusions_bottom = props[:avoid_intrusions_bottom]
|
|
28
|
+
avoid_intrusions_left = props[:avoid_intrusions_left]
|
|
29
|
+
avoid_intrusions_right = props[:avoid_intrusions_right]
|
|
30
|
+
avoid_intrusions_top = props[:avoid_intrusions_top]
|
|
31
|
+
badge = props[:badge]
|
|
32
|
+
bottom = props[:bottom]
|
|
33
|
+
col = props[:col]
|
|
34
|
+
content = props[:content]
|
|
35
|
+
data = props[:data]
|
|
36
|
+
disabled = props[:disabled]
|
|
37
|
+
expand = props[:expand]
|
|
38
|
+
expand_loose = props[:expand_loose]
|
|
39
|
+
height = props[:height]
|
|
40
|
+
key = props[:key]
|
|
41
|
+
left = props[:left]
|
|
42
|
+
maintain_bottom_view_padding = props[:maintain_bottom_view_padding]
|
|
43
|
+
margin = props[:margin]
|
|
44
|
+
minimum_padding = props[:minimum_padding]
|
|
45
|
+
offset = props[:offset]
|
|
46
|
+
opacity = props[:opacity]
|
|
47
|
+
right = props[:right]
|
|
48
|
+
rotate = props[:rotate]
|
|
49
|
+
rtl = props[:rtl]
|
|
50
|
+
scale = props[:scale]
|
|
51
|
+
size_change_interval = props[:size_change_interval]
|
|
52
|
+
tooltip = props[:tooltip]
|
|
53
|
+
top = props[:top]
|
|
54
|
+
visible = props[:visible]
|
|
55
|
+
width = props[:width]
|
|
56
|
+
on_animation_end = props[:on_animation_end]
|
|
57
|
+
on_size_change = props[:on_size_change]
|
|
58
|
+
raise ArgumentError, "safe_area requires content" if content.nil?
|
|
15
59
|
|
|
16
60
|
avoid_intrusions_bottom = true if avoid_intrusions_bottom.nil?
|
|
17
61
|
avoid_intrusions_left = true if avoid_intrusions_left.nil?
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module Ruflet
|
|
4
4
|
module UI
|
|
5
|
-
module
|
|
6
|
-
module
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
7
|
class ScreenshotControl < Ruflet::Control
|
|
8
8
|
TYPE = "screenshot".freeze
|
|
9
9
|
WIRE = "Screenshot".freeze
|
|
10
|
+
KEYWORDS = [:badge, :col, :content, :data, :disabled, :expand, :expand_loose, :key, :opacity, :rtl, :tooltip, :visible].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, badge: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, opacity: nil, rtl: nil, tooltip: nil, visible: nil)
|
|
13
|
+
raise ArgumentError, "missing keyword: :content" if content.nil?
|
|
14
|
+
|
|
12
15
|
props = {}
|
|
13
16
|
props[:badge] = badge unless badge.nil?
|
|
14
17
|
props[:col] = col unless col.nil?
|
|
@@ -24,6 +27,19 @@ module Ruflet
|
|
|
24
27
|
props[:visible] = visible unless visible.nil?
|
|
25
28
|
super(type: TYPE, id: id, **props)
|
|
26
29
|
end
|
|
30
|
+
|
|
31
|
+
def capture(pixel_ratio: nil, delay: nil, timeout: 10, on_result: nil)
|
|
32
|
+
args = {}
|
|
33
|
+
args["pixel_ratio"] = pixel_ratio unless pixel_ratio.nil?
|
|
34
|
+
args["delay"] = delay unless delay.nil?
|
|
35
|
+
runtime_page&.invoke(
|
|
36
|
+
self,
|
|
37
|
+
"capture",
|
|
38
|
+
args: args.empty? ? nil : args,
|
|
39
|
+
timeout: timeout,
|
|
40
|
+
on_result: on_result
|
|
41
|
+
)
|
|
42
|
+
end
|
|
27
43
|
end
|
|
28
44
|
end
|
|
29
45
|
end
|
|
@@ -8,7 +8,71 @@ module Ruflet
|
|
|
8
8
|
TYPE = "semantics".freeze
|
|
9
9
|
WIRE = "Semantics".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:badge, :button, :checked, :col, :container, :content, :current_value_length, :data, :decreased_value, :disabled, :exclude_semantics, :expand, :expand_loose, :expanded, :focus, :focusable, :header, :heading_level, :hidden, :hint_text, :image, :increased_value, :key, :label, :link, :live_region, :max_value_length, :mixed, :multiline, :obscured, :opacity, :read_only, :rtl, :selected, :slider, :textfield, :toggled, :tooltip, :value, :visible, :on_copy, :on_cut, :on_decrease, :on_did_gain_accessibility_focus, :on_did_lose_accessibility_focus, :on_dismiss, :on_double_tap, :on_increase, :on_long_press, :on_long_press_hint_text, :on_move_cursor_backward_by_character, :on_move_cursor_forward_by_character, :on_paste, :on_scroll_down, :on_scroll_left, :on_scroll_right, :on_scroll_up, :on_set_text, :on_tap, :on_tap_hint_text].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
|
+
badge = props[:badge]
|
|
17
|
+
button = props[:button]
|
|
18
|
+
checked = props[:checked]
|
|
19
|
+
col = props[:col]
|
|
20
|
+
container = props[:container]
|
|
21
|
+
content = props[:content]
|
|
22
|
+
current_value_length = props[:current_value_length]
|
|
23
|
+
data = props[:data]
|
|
24
|
+
decreased_value = props[:decreased_value]
|
|
25
|
+
disabled = props[:disabled]
|
|
26
|
+
exclude_semantics = props[:exclude_semantics]
|
|
27
|
+
expand = props[:expand]
|
|
28
|
+
expand_loose = props[:expand_loose]
|
|
29
|
+
expanded = props[:expanded]
|
|
30
|
+
focus = props[:focus]
|
|
31
|
+
focusable = props[:focusable]
|
|
32
|
+
header = props[:header]
|
|
33
|
+
heading_level = props[:heading_level]
|
|
34
|
+
hidden = props[:hidden]
|
|
35
|
+
hint_text = props[:hint_text]
|
|
36
|
+
image = props[:image]
|
|
37
|
+
increased_value = props[:increased_value]
|
|
38
|
+
key = props[:key]
|
|
39
|
+
label = props[:label]
|
|
40
|
+
link = props[:link]
|
|
41
|
+
live_region = props[:live_region]
|
|
42
|
+
max_value_length = props[:max_value_length]
|
|
43
|
+
mixed = props[:mixed]
|
|
44
|
+
multiline = props[:multiline]
|
|
45
|
+
obscured = props[:obscured]
|
|
46
|
+
opacity = props[:opacity]
|
|
47
|
+
read_only = props[:read_only]
|
|
48
|
+
rtl = props[:rtl]
|
|
49
|
+
selected = props[:selected]
|
|
50
|
+
slider = props[:slider]
|
|
51
|
+
textfield = props[:textfield]
|
|
52
|
+
toggled = props[:toggled]
|
|
53
|
+
tooltip = props[:tooltip]
|
|
54
|
+
value = props[:value]
|
|
55
|
+
visible = props[:visible]
|
|
56
|
+
on_copy = props[:on_copy]
|
|
57
|
+
on_cut = props[:on_cut]
|
|
58
|
+
on_decrease = props[:on_decrease]
|
|
59
|
+
on_did_gain_accessibility_focus = props[:on_did_gain_accessibility_focus]
|
|
60
|
+
on_did_lose_accessibility_focus = props[:on_did_lose_accessibility_focus]
|
|
61
|
+
on_dismiss = props[:on_dismiss]
|
|
62
|
+
on_double_tap = props[:on_double_tap]
|
|
63
|
+
on_increase = props[:on_increase]
|
|
64
|
+
on_long_press = props[:on_long_press]
|
|
65
|
+
on_long_press_hint_text = props[:on_long_press_hint_text]
|
|
66
|
+
on_move_cursor_backward_by_character = props[:on_move_cursor_backward_by_character]
|
|
67
|
+
on_move_cursor_forward_by_character = props[:on_move_cursor_forward_by_character]
|
|
68
|
+
on_paste = props[:on_paste]
|
|
69
|
+
on_scroll_down = props[:on_scroll_down]
|
|
70
|
+
on_scroll_left = props[:on_scroll_left]
|
|
71
|
+
on_scroll_right = props[:on_scroll_right]
|
|
72
|
+
on_scroll_up = props[:on_scroll_up]
|
|
73
|
+
on_set_text = props[:on_set_text]
|
|
74
|
+
on_tap = props[:on_tap]
|
|
75
|
+
on_tap_hint_text = props[:on_tap_hint_text]
|
|
12
76
|
exclude_semantics = false if exclude_semantics.nil?
|
|
13
77
|
|
|
14
78
|
props = {}
|
|
@@ -8,47 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "shadermask".freeze
|
|
9
9
|
WIRE = "ShaderMask".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[:blend_mode] = blend_mode unless blend_mode.nil?
|
|
25
|
-
props[:border_radius] = border_radius unless border_radius.nil?
|
|
26
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
27
|
-
props[:col] = col unless col.nil?
|
|
28
|
-
props[:content] = content unless content.nil?
|
|
29
|
-
props[:data] = data unless data.nil?
|
|
30
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
31
|
-
props[:expand] = expand unless expand.nil?
|
|
32
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
33
|
-
props[:height] = height unless height.nil?
|
|
34
|
-
props[:key] = key unless key.nil?
|
|
35
|
-
props[:left] = left unless left.nil?
|
|
36
|
-
props[:margin] = margin unless margin.nil?
|
|
37
|
-
props[:offset] = offset unless offset.nil?
|
|
38
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
39
|
-
props[:right] = right unless right.nil?
|
|
40
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
41
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
42
|
-
props[:scale] = scale unless scale.nil?
|
|
43
|
-
props[:shader] = shader unless shader.nil?
|
|
44
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
45
|
-
props[:tooltip] = tooltip unless tooltip.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_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
50
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
51
|
-
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, :blend_mode, :border_radius, :bottom, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :shader, :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)
|
|
52
20
|
end
|
|
53
21
|
end
|
|
54
22
|
end
|
|
@@ -8,50 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "shimmer".freeze
|
|
9
9
|
WIRE = "Shimmer".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[:base_color] = base_color unless base_color.nil?
|
|
25
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
26
|
-
props[:col] = col unless col.nil?
|
|
27
|
-
props[:content] = content unless content.nil?
|
|
28
|
-
props[:data] = data unless data.nil?
|
|
29
|
-
props[:direction] = direction unless direction.nil?
|
|
30
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
31
|
-
props[:expand] = expand unless expand.nil?
|
|
32
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
33
|
-
props[:gradient] = gradient unless gradient.nil?
|
|
34
|
-
props[:height] = height unless height.nil?
|
|
35
|
-
props[:highlight_color] = highlight_color unless highlight_color.nil?
|
|
36
|
-
props[:key] = key unless key.nil?
|
|
37
|
-
props[:left] = left unless left.nil?
|
|
38
|
-
props[:loop] = loop unless loop.nil?
|
|
39
|
-
props[:margin] = margin unless margin.nil?
|
|
40
|
-
props[:offset] = offset unless offset.nil?
|
|
41
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
42
|
-
props[:period] = period unless period.nil?
|
|
43
|
-
props[:right] = right unless right.nil?
|
|
44
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
45
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
46
|
-
props[:scale] = scale unless scale.nil?
|
|
47
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
48
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
49
|
-
props[:top] = top unless top.nil?
|
|
50
|
-
props[:visible] = visible unless visible.nil?
|
|
51
|
-
props[:width] = width unless width.nil?
|
|
52
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
53
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
54
|
-
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, :base_color, :bottom, :col, :content, :data, :direction, :disabled, :expand, :expand_loose, :gradient, :height, :highlight_color, :key, :left, :loop, :margin, :offset, :opacity, :period, :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)
|
|
55
20
|
end
|
|
56
21
|
end
|
|
57
22
|
end
|
|
@@ -8,7 +8,50 @@ module Ruflet
|
|
|
8
8
|
TYPE = "stack".freeze
|
|
9
9
|
WIRE = "Stack".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :clip_behavior, :col, :controls, :data, :disabled, :expand, :expand_loose, :fit, :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
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
adaptive = props[:adaptive]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
alignment = props[:alignment]
|
|
19
|
+
animate_align = props[:animate_align]
|
|
20
|
+
animate_margin = props[:animate_margin]
|
|
21
|
+
animate_offset = props[:animate_offset]
|
|
22
|
+
animate_opacity = props[:animate_opacity]
|
|
23
|
+
animate_position = props[:animate_position]
|
|
24
|
+
animate_rotation = props[:animate_rotation]
|
|
25
|
+
animate_scale = props[:animate_scale]
|
|
26
|
+
animate_size = props[:animate_size]
|
|
27
|
+
aspect_ratio = props[:aspect_ratio]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bottom = props[:bottom]
|
|
30
|
+
clip_behavior = props[:clip_behavior]
|
|
31
|
+
col = props[:col]
|
|
32
|
+
controls = props[:controls]
|
|
33
|
+
data = props[:data]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
expand = props[:expand]
|
|
36
|
+
expand_loose = props[:expand_loose]
|
|
37
|
+
fit = props[:fit]
|
|
38
|
+
height = props[:height]
|
|
39
|
+
key = props[:key]
|
|
40
|
+
left = props[:left]
|
|
41
|
+
margin = props[:margin]
|
|
42
|
+
offset = props[:offset]
|
|
43
|
+
opacity = props[:opacity]
|
|
44
|
+
right = props[:right]
|
|
45
|
+
rotate = props[:rotate]
|
|
46
|
+
rtl = props[:rtl]
|
|
47
|
+
scale = props[:scale]
|
|
48
|
+
size_change_interval = props[:size_change_interval]
|
|
49
|
+
tooltip = props[:tooltip]
|
|
50
|
+
top = props[:top]
|
|
51
|
+
visible = props[:visible]
|
|
52
|
+
width = props[:width]
|
|
53
|
+
on_animation_end = props[:on_animation_end]
|
|
54
|
+
on_size_change = props[:on_size_change]
|
|
12
55
|
clip_behavior = "hardEdge" if clip_behavior.nil?
|
|
13
56
|
fit = "loose" if fit.nil?
|
|
14
57
|
|