ruflet_core 0.0.12 → 0.0.13
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_protocol/ruflet/protocol.rb +50 -4
- data/lib/ruflet_ui/ruflet/control.rb +11 -4
- data/lib/ruflet_ui/ruflet/dsl.rb +229 -37
- data/lib/ruflet_ui/ruflet/events/gesture_events.rb +113 -9
- data/lib/ruflet_ui/ruflet/page.rb +820 -145
- data/lib/ruflet_ui/ruflet/types/animation.rb +110 -0
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +13 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +17 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoappbar_control.rb +3 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobottomsheet_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +11 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +14 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +12 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +11 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +18 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +7 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +3 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +7 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +7 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +18 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb +35 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocompletesuggestion_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/badge_control.rb +7 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/banner_control.rb +11 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomappbar_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomsheet_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/button_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/card_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb +11 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb +12 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb +34 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb +18 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb +20 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdown_control.rb +11 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownoption_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanel_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanellist_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansiontile_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledbutton_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/fillediconbutton_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonalbutton_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonaliconbutton_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb +20 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_controls.rb +240 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menubar_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb +11 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbardestination_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawer_control.rb +12 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawerdestination_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationrail_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationraildestination_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinedbutton_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinediconbutton_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenubutton_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenuitem_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressbar_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressring_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb +13 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +24 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb +28 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segmentedbutton_control.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb +7 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbar_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbarview_control.rb +7 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabs_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textbutton_control.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +86 -1
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +24 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/animatedswitcher_control.rb +10 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +12 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/canvas_control.rb +14 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dismissible_control.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/draggable_control.rb +9 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dragtarget_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gridview_control.rb +20 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/image_control.rb +19 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/interactiveviewer_control.rb +37 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/listview_control.rb +17 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pageview_control.rb +13 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/placeholder_control.rb +12 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb +11 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/stack_control.rb +3 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb +20 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/view_control.rb +8 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/window_control.rb +16 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/windowdragarea_control.rb +6 -0
- data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +83 -6
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +513 -33
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/audio_recorder_control.rb +87 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/geolocator_control.rb +85 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/permissionhandler_control.rb +53 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/securestorage_control.rb +89 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb +28 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/tester_control.rb +126 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +16 -0
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +230 -38
- data/lib/ruflet_ui.rb +4 -0
- metadata +9 -1
|
@@ -9,6 +9,10 @@ module Ruflet
|
|
|
9
9
|
WIRE = "SelectionArea".freeze
|
|
10
10
|
|
|
11
11
|
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, on_change: nil)
|
|
12
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
+
raise ArgumentError, "selection_area requires visible content"
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
props = {}
|
|
13
17
|
props[:badge] = badge unless badge.nil?
|
|
14
18
|
props[:col] = col unless col.nil?
|
|
@@ -9,6 +9,11 @@ module Ruflet
|
|
|
9
9
|
WIRE = "SnackBar".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, action: nil, action_overflow_threshold: nil, adaptive: nil, badge: nil, behavior: nil, bgcolor: nil, clip_behavior: nil, close_icon_color: nil, col: nil, content: nil, data: nil, disabled: nil, dismiss_direction: nil, duration: nil, elevation: nil, expand: nil, expand_loose: nil, key: nil, margin: nil, opacity: nil, open: nil, padding: nil, persist: nil, rtl: nil, shape: nil, show_close_icon: nil, tooltip: nil, visible: nil, width: nil, on_action: nil, on_dismiss: nil, on_visible: nil)
|
|
12
|
+
raise ArgumentError, "snack_bar requires content" if content.nil?
|
|
13
|
+
unless action_overflow_threshold.nil? || (0.0..1.0).cover?(action_overflow_threshold)
|
|
14
|
+
raise ArgumentError, "snack_bar action_overflow_threshold must be between 0.0 and 1.0"
|
|
15
|
+
end
|
|
16
|
+
|
|
12
17
|
props = {}
|
|
13
18
|
props[:action] = action unless action.nil?
|
|
14
19
|
props[:action_overflow_threshold] = action_overflow_threshold unless action_overflow_threshold.nil?
|
|
@@ -9,6 +9,14 @@ module Ruflet
|
|
|
9
9
|
WIRE = "SubmenuButton".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, align: nil, alignment_offset: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, clip_behavior: nil, col: nil, content: nil, controls: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, leading: nil, left: nil, margin: nil, menu_style: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, style: nil, tooltip: nil, top: nil, trailing: nil, visible: nil, width: nil, on_animation_end: nil, on_blur: nil, on_close: nil, on_focus: nil, on_hover: nil, on_open: nil, on_size_change: nil)
|
|
12
|
+
clip_behavior = "none" if clip_behavior.nil?
|
|
13
|
+
|
|
14
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
15
|
+
raise ArgumentError, "submenu_button requires visible content"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
raise ArgumentError, "submenu_button height must be greater than or equal to 0" unless height.nil? || height >= 0
|
|
19
|
+
|
|
12
20
|
props = {}
|
|
13
21
|
props[:align] = align unless align.nil?
|
|
14
22
|
props[:alignment_offset] = alignment_offset unless alignment_offset.nil?
|
|
@@ -9,6 +9,13 @@ module Ruflet
|
|
|
9
9
|
WIRE = "Tab".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, badge: nil, col: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, icon: nil, icon_margin: nil, key: nil, label: nil, opacity: nil, rtl: nil, tooltip: nil, visible: nil)
|
|
12
|
+
raise ArgumentError, "tab requires label or icon" if label.nil? && icon.nil?
|
|
13
|
+
|
|
14
|
+
min_height = icon.nil? || label.nil? ? 46.0 : 72.0
|
|
15
|
+
unless height.nil? || height >= min_height
|
|
16
|
+
raise ArgumentError, "tab height cannot be lower than #{min_height.to_i}"
|
|
17
|
+
end
|
|
18
|
+
|
|
12
19
|
props = {}
|
|
13
20
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
21
|
props[:badge] = badge unless badge.nil?
|
|
@@ -9,6 +9,10 @@ module Ruflet
|
|
|
9
9
|
WIRE = "TabBar".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, col: nil, data: nil, disabled: nil, divider_color: nil, divider_height: nil, enable_feedback: nil, expand: nil, expand_loose: nil, height: nil, indicator: nil, indicator_animation: nil, indicator_color: nil, indicator_size: nil, indicator_thickness: nil, key: nil, label_color: nil, label_padding: nil, label_text_style: nil, left: nil, margin: nil, mouse_cursor: nil, offset: nil, opacity: nil, overlay_color: nil, padding: nil, right: nil, rotate: nil, rtl: nil, scale: nil, scrollable: nil, secondary: nil, size_change_interval: nil, splash_border_radius: nil, tab_alignment: nil, tabs: nil, tooltip: nil, top: nil, unselected_label_color: nil, unselected_label_text_style: nil, visible: nil, width: nil, on_animation_end: nil, on_click: nil, on_hover: nil, on_size_change: nil)
|
|
12
|
+
{ divider_height: divider_height, indicator_thickness: indicator_thickness }.each do |name, value|
|
|
13
|
+
raise ArgumentError, "tab_bar #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
props = {}
|
|
13
17
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
18
|
props[:align] = align unless align.nil?
|
|
@@ -9,6 +9,13 @@ module Ruflet
|
|
|
9
9
|
WIRE = "TabBarView".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, clip_behavior: nil, col: nil, controls: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, tooltip: nil, top: nil, viewport_fraction: nil, visible: nil, width: nil, on_animation_end: nil, on_size_change: nil)
|
|
12
|
+
clip_behavior = "hardEdge" if clip_behavior.nil?
|
|
13
|
+
viewport_fraction = 1.0 if viewport_fraction.nil?
|
|
14
|
+
|
|
15
|
+
unless viewport_fraction.nil? || viewport_fraction > 0
|
|
16
|
+
raise ArgumentError, "tab_bar_view viewport_fraction must be greater than 0"
|
|
17
|
+
end
|
|
18
|
+
|
|
12
19
|
props = {}
|
|
13
20
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
21
|
props[:align] = align unless align.nil?
|
|
@@ -9,6 +9,12 @@ module Ruflet
|
|
|
9
9
|
WIRE = "Tabs".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, animation_duration: nil, aspect_ratio: nil, badge: nil, bottom: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, length: nil, margin: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, selected_index: nil, size_change_interval: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_change: nil, on_size_change: nil)
|
|
12
|
+
raise ArgumentError, "tabs length must be greater than or equal to 0" unless length.nil? || length >= 0
|
|
13
|
+
|
|
14
|
+
unless selected_index.nil? || length.nil? || (-length...length).cover?(selected_index)
|
|
15
|
+
raise IndexError, "tabs selected_index is out of range"
|
|
16
|
+
end
|
|
17
|
+
|
|
12
18
|
props = {}
|
|
13
19
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
20
|
props[:align] = align unless align.nil?
|
|
@@ -9,6 +9,11 @@ module Ruflet
|
|
|
9
9
|
WIRE = "TextButton".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, autofocus: nil, badge: nil, bottom: nil, clip_behavior: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, icon: nil, icon_color: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, style: nil, tooltip: nil, top: nil, url: nil, visible: nil, width: nil, on_animation_end: nil, on_blur: nil, on_click: nil, on_focus: nil, on_hover: nil, on_long_press: nil, on_size_change: nil)
|
|
12
|
+
raise ArgumentError, "text_button requires content or icon" if content.nil? && icon.nil?
|
|
13
|
+
|
|
14
|
+
autofocus = false if autofocus.nil?
|
|
15
|
+
clip_behavior = "none" if clip_behavior.nil?
|
|
16
|
+
|
|
12
17
|
props = {}
|
|
13
18
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
19
|
props[:align] = align unless align.nil?
|
|
@@ -9,6 +9,15 @@ 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
|
+
|
|
12
21
|
props = {}
|
|
13
22
|
props[:badge] = badge unless badge.nil?
|
|
14
23
|
props[:col] = col unless col.nil?
|
|
@@ -8,30 +8,115 @@ module Ruflet
|
|
|
8
8
|
TYPE = "video".freeze
|
|
9
9
|
WIRE = "Video".freeze
|
|
10
10
|
|
|
11
|
-
def initialize(id: nil, aspect_ratio: nil, autoplay: nil, data: nil, fullscreen: nil, height: nil, key: nil, opacity: nil, playlist: nil, playlist_mode: nil, playback_rate: nil, rtl: nil, tooltip: nil, visible: nil, volume: nil, width: nil, on_enter_fullscreen: nil, on_error: nil, on_exit_fullscreen: nil, on_load: nil, on_state_change: nil)
|
|
11
|
+
def initialize(id: nil, alignment: nil, aspect_ratio: nil, autoplay: nil, configuration: nil, data: nil, fill_color: nil, filter_quality: nil, fit: nil, fullscreen: nil, height: nil, key: nil, muted: nil, opacity: nil, pause_upon_entering_background_mode: nil, pitch: nil, playlist: nil, playlist_mode: nil, playback_rate: nil, resume_upon_entering_foreground_mode: nil, rtl: nil, show_controls: nil, shuffle_playlist: nil, subtitle_configuration: nil, title: nil, tooltip: nil, visible: nil, volume: nil, wakelock: nil, width: nil, on_completed: nil, on_complete: nil, on_enter_fullscreen: nil, on_error: nil, on_exit_fullscreen: nil, on_load: nil, on_loaded: nil, on_state_change: nil, on_track_change: nil, on_track_changed: nil)
|
|
12
12
|
props = {}
|
|
13
|
+
props[:alignment] = alignment unless alignment.nil?
|
|
13
14
|
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
14
15
|
props[:autoplay] = autoplay unless autoplay.nil?
|
|
16
|
+
props[:configuration] = configuration unless configuration.nil?
|
|
15
17
|
props[:data] = data unless data.nil?
|
|
18
|
+
props[:fill_color] = fill_color unless fill_color.nil?
|
|
19
|
+
props[:filter_quality] = filter_quality unless filter_quality.nil?
|
|
20
|
+
props[:fit] = fit unless fit.nil?
|
|
16
21
|
props[:fullscreen] = fullscreen unless fullscreen.nil?
|
|
17
22
|
props[:height] = height unless height.nil?
|
|
18
23
|
props[:key] = key unless key.nil?
|
|
24
|
+
props[:muted] = muted unless muted.nil?
|
|
19
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?
|
|
20
28
|
props[:playlist] = playlist unless playlist.nil?
|
|
21
29
|
props[:playlist_mode] = playlist_mode unless playlist_mode.nil?
|
|
22
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?
|
|
23
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?
|
|
24
37
|
props[:tooltip] = tooltip unless tooltip.nil?
|
|
25
38
|
props[:visible] = visible unless visible.nil?
|
|
26
39
|
props[:volume] = volume unless volume.nil?
|
|
40
|
+
props[:wakelock] = wakelock unless wakelock.nil?
|
|
27
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?
|
|
28
44
|
props[:on_enter_fullscreen] = on_enter_fullscreen unless on_enter_fullscreen.nil?
|
|
29
45
|
props[:on_error] = on_error unless on_error.nil?
|
|
30
46
|
props[:on_exit_fullscreen] = on_exit_fullscreen unless on_exit_fullscreen.nil?
|
|
31
47
|
props[:on_load] = on_load unless on_load.nil?
|
|
48
|
+
props[:on_loaded] = on_loaded unless on_loaded.nil?
|
|
32
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?
|
|
33
52
|
super(type: TYPE, id: id, **props)
|
|
34
53
|
end
|
|
54
|
+
|
|
55
|
+
def get_current_position(timeout: 10, on_result: nil)
|
|
56
|
+
runtime_page&.invoke(self, "get_current_position", timeout: timeout, on_result: on_result)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def get_duration(timeout: 10, on_result: nil)
|
|
60
|
+
runtime_page&.invoke(self, "get_duration", timeout: timeout, on_result: on_result)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def is_completed(timeout: 10, on_result: nil)
|
|
64
|
+
runtime_page&.invoke(self, "is_completed", timeout: timeout, on_result: on_result)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def is_playing(timeout: 10, on_result: nil)
|
|
68
|
+
runtime_page&.invoke(self, "is_playing", timeout: timeout, on_result: on_result)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def jump_to(media_index, timeout: 10, on_result: nil)
|
|
72
|
+
runtime_page&.invoke(self, "jump_to", args: { "media_index" => media_index }, timeout: timeout, on_result: on_result)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def next(timeout: 10, on_result: nil)
|
|
76
|
+
runtime_page&.invoke(self, "next", timeout: timeout, on_result: on_result)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def pause(timeout: 10, on_result: nil)
|
|
80
|
+
runtime_page&.invoke(self, "pause", timeout: timeout, on_result: on_result)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def play(timeout: 10, on_result: nil)
|
|
84
|
+
runtime_page&.invoke(self, "play", timeout: timeout, on_result: on_result)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def play_or_pause(timeout: 10, on_result: nil)
|
|
88
|
+
runtime_page&.invoke(self, "play_or_pause", timeout: timeout, on_result: on_result)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def playlist_add(media = nil, timeout: 10, on_result: nil, **props)
|
|
92
|
+
item = media || props
|
|
93
|
+
runtime_page&.invoke(self, "playlist_add", args: { "media" => stringify_hash_keys(item) }, timeout: timeout, on_result: on_result)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def playlist_remove(media_index, timeout: 10, on_result: nil)
|
|
97
|
+
runtime_page&.invoke(self, "playlist_remove", args: { "media_index" => media_index }, timeout: timeout, on_result: on_result)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def previous(timeout: 10, on_result: nil)
|
|
101
|
+
runtime_page&.invoke(self, "previous", timeout: timeout, on_result: on_result)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def seek(position_milliseconds, timeout: 10, on_result: nil)
|
|
105
|
+
runtime_page&.invoke(self, "seek", args: { "position" => position_milliseconds }, timeout: timeout, on_result: on_result)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def stop(timeout: 10, on_result: nil)
|
|
109
|
+
runtime_page&.invoke(self, "stop", timeout: timeout, on_result: on_result)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
private
|
|
113
|
+
|
|
114
|
+
def stringify_hash_keys(value)
|
|
115
|
+
return value.map { |item| stringify_hash_keys(item) } if value.is_a?(Array)
|
|
116
|
+
return value.each_with_object({}) { |(key, child), result| result[key.to_s] = stringify_hash_keys(child) } if value.is_a?(Hash)
|
|
117
|
+
|
|
118
|
+
value
|
|
119
|
+
end
|
|
35
120
|
end
|
|
36
121
|
end
|
|
37
122
|
end
|
|
@@ -28,6 +28,7 @@ require_relative "materials/alertdialog_control"
|
|
|
28
28
|
require_relative "materials/audio_control"
|
|
29
29
|
require_relative "materials/appbar_control"
|
|
30
30
|
require_relative "materials/autocomplete_control"
|
|
31
|
+
require_relative "materials/autocompletesuggestion_control"
|
|
31
32
|
require_relative "materials/badge_control"
|
|
32
33
|
require_relative "materials/banner_control"
|
|
33
34
|
require_relative "materials/chart_controls"
|
|
@@ -60,6 +61,7 @@ require_relative "materials/filledtonaliconbutton_control"
|
|
|
60
61
|
require_relative "materials/floatingactionbutton_control"
|
|
61
62
|
require_relative "materials/iconbutton_control"
|
|
62
63
|
require_relative "materials/listtile_control"
|
|
64
|
+
require_relative "materials/map_controls"
|
|
63
65
|
require_relative "materials/menubar_control"
|
|
64
66
|
require_relative "materials/menuitembutton_control"
|
|
65
67
|
require_relative "materials/navigationbar_control"
|
|
@@ -165,7 +167,9 @@ module Ruflet
|
|
|
165
167
|
"appbar" => RufletComponents::AppBarControl,
|
|
166
168
|
"arc" => RufletComponents::ArcControl,
|
|
167
169
|
"auto_complete" => RufletComponents::AutoCompleteControl,
|
|
170
|
+
"auto_complete_suggestion" => RufletComponents::AutoCompleteSuggestionControl,
|
|
168
171
|
"autocomplete" => RufletComponents::AutoCompleteControl,
|
|
172
|
+
"autocompletesuggestion" => RufletComponents::AutoCompleteSuggestionControl,
|
|
169
173
|
"autofill_group" => RufletComponents::AutofillGroupControl,
|
|
170
174
|
"autofillgroup" => RufletComponents::AutofillGroupControl,
|
|
171
175
|
"badge" => RufletComponents::BadgeControl,
|
|
@@ -321,6 +325,26 @@ module Ruflet
|
|
|
321
325
|
"list_view" => RufletComponents::ListViewControl,
|
|
322
326
|
"listtile" => RufletComponents::ListTileControl,
|
|
323
327
|
"listview" => RufletComponents::ListViewControl,
|
|
328
|
+
"map" => RufletComponents::MapControl,
|
|
329
|
+
"tile_layer" => RufletComponents::TileLayerControl,
|
|
330
|
+
"tilelayer" => RufletComponents::TileLayerControl,
|
|
331
|
+
"marker_layer" => RufletComponents::MarkerLayerControl,
|
|
332
|
+
"markerlayer" => RufletComponents::MarkerLayerControl,
|
|
333
|
+
"marker" => RufletComponents::MarkerControl,
|
|
334
|
+
"circle_layer" => RufletComponents::CircleLayerControl,
|
|
335
|
+
"circlelayer" => RufletComponents::CircleLayerControl,
|
|
336
|
+
"circle_marker" => RufletComponents::CircleMarkerControl,
|
|
337
|
+
"circlemarker" => RufletComponents::CircleMarkerControl,
|
|
338
|
+
"polyline_layer" => RufletComponents::PolylineLayerControl,
|
|
339
|
+
"polylinelayer" => RufletComponents::PolylineLayerControl,
|
|
340
|
+
"polyline_marker" => RufletComponents::PolylineMarkerControl,
|
|
341
|
+
"polylinemarker" => RufletComponents::PolylineMarkerControl,
|
|
342
|
+
"polygon_layer" => RufletComponents::PolygonLayerControl,
|
|
343
|
+
"polygonlayer" => RufletComponents::PolygonLayerControl,
|
|
344
|
+
"polygon_marker" => RufletComponents::PolygonMarkerControl,
|
|
345
|
+
"polygonmarker" => RufletComponents::PolygonMarkerControl,
|
|
346
|
+
"simple_attribution" => RufletComponents::SimpleAttributionControl,
|
|
347
|
+
"simpleattribution" => RufletComponents::SimpleAttributionControl,
|
|
324
348
|
"markdown" => RufletComponents::MarkdownControl,
|
|
325
349
|
"menu_bar" => RufletComponents::MenuBarControl,
|
|
326
350
|
"menu_item_button" => RufletComponents::MenuItemButtonControl,
|
|
@@ -9,6 +9,16 @@ module Ruflet
|
|
|
9
9
|
WIRE = "AnimatedSwitcher".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, col: nil, content: nil, data: nil, disabled: nil, duration: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, reverse_duration: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, switch_in_curve: nil, switch_out_curve: nil, tooltip: nil, top: nil, transition: nil, visible: nil, width: nil, on_animation_end: nil, on_size_change: nil)
|
|
12
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
+
raise ArgumentError, "animated_switcher requires visible content"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
duration = 1000 if duration.nil?
|
|
17
|
+
reverse_duration = 1000 if reverse_duration.nil?
|
|
18
|
+
switch_in_curve = "linear" if switch_in_curve.nil?
|
|
19
|
+
switch_out_curve = "linear" if switch_out_curve.nil?
|
|
20
|
+
transition = "fade" if transition.nil?
|
|
21
|
+
|
|
12
22
|
props = {}
|
|
13
23
|
props[:align] = align unless align.nil?
|
|
14
24
|
props[:animate_align] = animate_align unless animate_align.nil?
|
|
@@ -8,12 +8,23 @@ module Ruflet
|
|
|
8
8
|
TYPE = "browsercontextmenu".freeze
|
|
9
9
|
WIRE = "BrowserContextMenu".freeze
|
|
10
10
|
|
|
11
|
-
def initialize(id: nil, data: nil, key: nil)
|
|
11
|
+
def initialize(id: nil, data: nil, disabled: nil, key: nil)
|
|
12
12
|
props = {}
|
|
13
13
|
props[:data] = data unless data.nil?
|
|
14
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
14
15
|
props[:key] = key unless key.nil?
|
|
15
16
|
super(type: TYPE, id: id, **props)
|
|
16
17
|
end
|
|
18
|
+
|
|
19
|
+
def disable(timeout: 10, on_result: nil)
|
|
20
|
+
props["disabled"] = true
|
|
21
|
+
runtime_page&.invoke(self, "disable_menu", timeout: timeout, on_result: on_result)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def enable(timeout: 10, on_result: nil)
|
|
25
|
+
props["disabled"] = false
|
|
26
|
+
runtime_page&.invoke(self, "enable_menu", timeout: timeout, on_result: on_result)
|
|
27
|
+
end
|
|
17
28
|
end
|
|
18
29
|
end
|
|
19
30
|
end
|
|
@@ -50,6 +50,20 @@ module Ruflet
|
|
|
50
50
|
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
51
51
|
super(type: TYPE, id: id, **props)
|
|
52
52
|
end
|
|
53
|
+
|
|
54
|
+
def capture(pixel_ratio: nil, timeout: 10, on_result: nil)
|
|
55
|
+
args = {}
|
|
56
|
+
args["pixel_ratio"] = pixel_ratio unless pixel_ratio.nil?
|
|
57
|
+
runtime_page&.invoke(self, "capture", args: args.empty? ? nil : args, timeout: timeout, on_result: on_result)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def get_capture(timeout: 10, on_result: nil)
|
|
61
|
+
runtime_page&.invoke(self, "get_capture", timeout: timeout, on_result: on_result)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def clear_capture(timeout: 10, on_result: nil)
|
|
65
|
+
runtime_page&.invoke(self, "clear_capture", timeout: timeout, on_result: on_result)
|
|
66
|
+
end
|
|
53
67
|
end
|
|
54
68
|
end
|
|
55
69
|
end
|
|
@@ -9,6 +9,25 @@ module Ruflet
|
|
|
9
9
|
WIRE = "Dismissible".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, background: nil, badge: nil, bottom: nil, col: nil, content: nil, cross_axis_end_offset: nil, data: nil, disabled: nil, dismiss_direction: nil, dismiss_thresholds: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, movement_duration: nil, offset: nil, opacity: nil, resize_duration: nil, right: nil, rotate: nil, rtl: nil, scale: nil, secondary_background: nil, size_change_interval: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_confirm_dismiss: nil, on_dismiss: nil, on_resize: nil, on_size_change: nil, on_update: nil)
|
|
12
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
+
raise ArgumentError, "dismissible requires visible content"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
if secondary_background && (background.nil? || (background.respond_to?(:props) && background.props["visible"] == false))
|
|
17
|
+
raise ArgumentError, "dismissible secondary_background requires visible background"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
cross_axis_end_offset = 0.0 if cross_axis_end_offset.nil?
|
|
21
|
+
dismiss_direction = "horizontal" if dismiss_direction.nil?
|
|
22
|
+
dismiss_thresholds = {} if dismiss_thresholds.nil?
|
|
23
|
+
movement_duration = 200 if movement_duration.nil?
|
|
24
|
+
resize_duration = 300 if resize_duration.nil?
|
|
25
|
+
|
|
26
|
+
dismiss_thresholds.each_value do |threshold|
|
|
27
|
+
next if threshold.nil?
|
|
28
|
+
raise ArgumentError, "dismissible dismiss_thresholds values must be between 0.0 and 1.0" unless (0.0..1.0).cover?(threshold)
|
|
29
|
+
end
|
|
30
|
+
|
|
12
31
|
props = {}
|
|
13
32
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
33
|
props[:align] = align unless align.nil?
|
|
@@ -9,6 +9,15 @@ module Ruflet
|
|
|
9
9
|
WIRE = "Draggable".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, affinity: nil, axis: nil, badge: nil, col: nil, content: nil, content_feedback: nil, content_when_dragging: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, group: nil, key: nil, max_simultaneous_drags: nil, opacity: nil, rtl: nil, tooltip: nil, visible: nil, on_drag_complete: nil, on_drag_start: nil)
|
|
12
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
+
raise ArgumentError, "draggable requires visible content"
|
|
14
|
+
end
|
|
15
|
+
if !max_simultaneous_drags.nil? && max_simultaneous_drags.negative?
|
|
16
|
+
raise ArgumentError, "draggable max_simultaneous_drags must be greater than or equal to 0"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
group = "default" if group.nil?
|
|
20
|
+
|
|
12
21
|
props = {}
|
|
13
22
|
props[:affinity] = affinity unless affinity.nil?
|
|
14
23
|
props[:axis] = axis unless axis.nil?
|
|
@@ -9,6 +9,12 @@ module Ruflet
|
|
|
9
9
|
WIRE = "DragTarget".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, badge: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, group: nil, key: nil, opacity: nil, rtl: nil, tooltip: nil, visible: nil, on_accept: nil, on_leave: nil, on_move: nil, on_will_accept: nil)
|
|
12
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
+
raise ArgumentError, "drag_target requires visible content"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
group = "default" if group.nil?
|
|
17
|
+
|
|
12
18
|
props = {}
|
|
13
19
|
props[:badge] = badge unless badge.nil?
|
|
14
20
|
props[:col] = col unless col.nil?
|
|
@@ -9,6 +9,26 @@ module Ruflet
|
|
|
9
9
|
WIRE = "GridView".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, auto_scroll: nil, badge: nil, bottom: nil, build_controls_on_demand: nil, cache_extent: nil, child_aspect_ratio: nil, clip_behavior: nil, col: nil, controls: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, horizontal: nil, key: nil, left: nil, margin: nil, max_extent: nil, offset: nil, opacity: nil, padding: nil, reverse: nil, right: nil, rotate: nil, rtl: nil, run_spacing: nil, runs_count: nil, scale: nil, scroll: nil, scroll_interval: nil, semantic_child_count: nil, size_change_interval: nil, spacing: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_scroll: nil, on_size_change: nil)
|
|
12
|
+
build_controls_on_demand = true if build_controls_on_demand.nil?
|
|
13
|
+
child_aspect_ratio = 1.0 if child_aspect_ratio.nil?
|
|
14
|
+
horizontal = false if horizontal.nil?
|
|
15
|
+
reverse = false if reverse.nil?
|
|
16
|
+
run_spacing = 10 if run_spacing.nil?
|
|
17
|
+
runs_count = 1 if runs_count.nil?
|
|
18
|
+
spacing = 10 if spacing.nil?
|
|
19
|
+
|
|
20
|
+
{
|
|
21
|
+
child_aspect_ratio: child_aspect_ratio,
|
|
22
|
+
max_extent: max_extent,
|
|
23
|
+
run_spacing: run_spacing,
|
|
24
|
+
runs_count: runs_count,
|
|
25
|
+
semantic_child_count: semantic_child_count,
|
|
26
|
+
spacing: spacing
|
|
27
|
+
}.each do |name, value|
|
|
28
|
+
next if value.nil?
|
|
29
|
+
raise ArgumentError, "grid_view #{name} must be greater than or equal to 0" if value.negative?
|
|
30
|
+
end
|
|
31
|
+
|
|
12
32
|
props = {}
|
|
13
33
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
34
|
props[:align] = align unless align.nil?
|
|
@@ -8,13 +8,31 @@ module Ruflet
|
|
|
8
8
|
TYPE = "image".freeze
|
|
9
9
|
WIRE = "Image".freeze
|
|
10
10
|
|
|
11
|
-
def initialize(id: nil, data: nil, height: nil, key: nil, paint: nil, src: nil, width: nil, x: nil, y: nil)
|
|
11
|
+
def initialize(id: nil, anti_alias: nil, border_radius: nil, cache_height: nil, cache_width: nil, color: nil, color_blend_mode: nil, data: nil, error_content: nil, exclude_from_semantics: nil, fade_in_animation: nil, filter_quality: nil, fit: nil, gapless_playback: nil, height: nil, key: nil, paint: nil, placeholder_fade_out_animation: nil, placeholder_fit: nil, placeholder_src: nil, repeat: nil, semantics_label: nil, src: nil, src_base64: nil, width: nil, x: nil, y: nil)
|
|
12
12
|
props = {}
|
|
13
|
+
props[:anti_alias] = anti_alias unless anti_alias.nil?
|
|
14
|
+
props[:border_radius] = border_radius unless border_radius.nil?
|
|
15
|
+
props[:cache_height] = cache_height unless cache_height.nil?
|
|
16
|
+
props[:cache_width] = cache_width unless cache_width.nil?
|
|
17
|
+
props[:color] = color unless color.nil?
|
|
18
|
+
props[:color_blend_mode] = color_blend_mode unless color_blend_mode.nil?
|
|
13
19
|
props[:data] = data unless data.nil?
|
|
20
|
+
props[:error_content] = error_content unless error_content.nil?
|
|
21
|
+
props[:exclude_from_semantics] = exclude_from_semantics unless exclude_from_semantics.nil?
|
|
22
|
+
props[:fade_in_animation] = fade_in_animation unless fade_in_animation.nil?
|
|
23
|
+
props[:filter_quality] = filter_quality unless filter_quality.nil?
|
|
24
|
+
props[:fit] = fit unless fit.nil?
|
|
25
|
+
props[:gapless_playback] = gapless_playback unless gapless_playback.nil?
|
|
14
26
|
props[:height] = height unless height.nil?
|
|
15
27
|
props[:key] = key unless key.nil?
|
|
16
28
|
props[:paint] = paint unless paint.nil?
|
|
29
|
+
props[:placeholder_fade_out_animation] = placeholder_fade_out_animation unless placeholder_fade_out_animation.nil?
|
|
30
|
+
props[:placeholder_fit] = placeholder_fit unless placeholder_fit.nil?
|
|
31
|
+
props[:placeholder_src] = placeholder_src unless placeholder_src.nil?
|
|
32
|
+
props[:repeat] = repeat unless repeat.nil?
|
|
33
|
+
props[:semantics_label] = semantics_label unless semantics_label.nil?
|
|
17
34
|
props[:src] = src unless src.nil?
|
|
35
|
+
props[:src_base64] = src_base64 unless src_base64.nil?
|
|
18
36
|
props[:width] = width unless width.nil?
|
|
19
37
|
props[:x] = x unless x.nil?
|
|
20
38
|
props[:y] = y unless y.nil?
|
|
@@ -62,6 +62,43 @@ module Ruflet
|
|
|
62
62
|
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
63
63
|
super(type: TYPE, id: id, **props)
|
|
64
64
|
end
|
|
65
|
+
|
|
66
|
+
def pan(dx, dy: 0, dz: 0, timeout: 10, on_result: nil)
|
|
67
|
+
runtime_page&.invoke(
|
|
68
|
+
self,
|
|
69
|
+
"pan",
|
|
70
|
+
args: { "dx" => dx, "dy" => dy, "dz" => dz },
|
|
71
|
+
timeout: timeout,
|
|
72
|
+
on_result: on_result
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def reset(animation_duration: nil, timeout: 10, on_result: nil)
|
|
77
|
+
args = {}
|
|
78
|
+
args["animation_duration"] = stringify_hash_keys(animation_duration) unless animation_duration.nil?
|
|
79
|
+
runtime_page&.invoke(self, "reset", args: args.empty? ? nil : args, timeout: timeout, on_result: on_result)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def restore_state(timeout: 10, on_result: nil)
|
|
83
|
+
runtime_page&.invoke(self, "restore_state", timeout: timeout, on_result: on_result)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def save_state(timeout: 10, on_result: nil)
|
|
87
|
+
runtime_page&.invoke(self, "save_state", timeout: timeout, on_result: on_result)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def zoom(factor, timeout: 10, on_result: nil)
|
|
91
|
+
runtime_page&.invoke(self, "zoom", args: { "factor" => factor }, timeout: timeout, on_result: on_result)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
private
|
|
95
|
+
|
|
96
|
+
def stringify_hash_keys(value)
|
|
97
|
+
return value.map { |item| stringify_hash_keys(item) } if value.is_a?(Array)
|
|
98
|
+
return value.each_with_object({}) { |(key, child), result| result[key.to_s] = stringify_hash_keys(child) } if value.is_a?(Hash)
|
|
99
|
+
|
|
100
|
+
value
|
|
101
|
+
end
|
|
65
102
|
end
|
|
66
103
|
end
|
|
67
104
|
end
|
|
@@ -9,6 +9,23 @@ module Ruflet
|
|
|
9
9
|
WIRE = "ListView".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, auto_scroll: nil, badge: nil, bottom: nil, build_controls_on_demand: nil, cache_extent: nil, clip_behavior: nil, col: nil, controls: nil, data: nil, disabled: nil, divider_thickness: nil, expand: nil, expand_loose: nil, first_item_prototype: nil, height: nil, horizontal: nil, item_extent: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, padding: nil, prototype_item: nil, reverse: nil, right: nil, rotate: nil, rtl: nil, scale: nil, scroll: nil, scroll_interval: nil, semantic_child_count: nil, size_change_interval: nil, spacing: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_scroll: nil, on_size_change: nil)
|
|
12
|
+
build_controls_on_demand = true if build_controls_on_demand.nil?
|
|
13
|
+
divider_thickness = 0 if divider_thickness.nil?
|
|
14
|
+
first_item_prototype = false if first_item_prototype.nil?
|
|
15
|
+
horizontal = false if horizontal.nil?
|
|
16
|
+
reverse = false if reverse.nil?
|
|
17
|
+
spacing = 0 if spacing.nil?
|
|
18
|
+
|
|
19
|
+
{
|
|
20
|
+
divider_thickness: divider_thickness,
|
|
21
|
+
item_extent: item_extent,
|
|
22
|
+
semantic_child_count: semantic_child_count,
|
|
23
|
+
spacing: spacing
|
|
24
|
+
}.each do |name, value|
|
|
25
|
+
next if value.nil?
|
|
26
|
+
raise ArgumentError, "list_view #{name} must be greater than or equal to 0" if value.negative?
|
|
27
|
+
end
|
|
28
|
+
|
|
12
29
|
props = {}
|
|
13
30
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
31
|
props[:align] = align unless align.nil?
|
|
@@ -9,6 +9,19 @@ module Ruflet
|
|
|
9
9
|
WIRE = "PageView".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, clip_behavior: nil, col: nil, controls: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, horizontal: nil, implicit_scrolling: nil, keep_page: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, pad_ends: nil, reverse: nil, right: nil, rotate: nil, rtl: nil, scale: nil, selected_index: nil, size_change_interval: nil, snap: nil, tooltip: nil, top: nil, viewport_fraction: nil, visible: nil, width: nil, on_animation_end: nil, on_change: nil, on_size_change: nil)
|
|
12
|
+
clip_behavior = "hardEdge" if clip_behavior.nil?
|
|
13
|
+
horizontal = true if horizontal.nil?
|
|
14
|
+
implicit_scrolling = false if implicit_scrolling.nil?
|
|
15
|
+
keep_page = true if keep_page.nil?
|
|
16
|
+
pad_ends = true if pad_ends.nil?
|
|
17
|
+
reverse = false if reverse.nil?
|
|
18
|
+
selected_index = 0 if selected_index.nil?
|
|
19
|
+
snap = true if snap.nil?
|
|
20
|
+
viewport_fraction = 1.0 if viewport_fraction.nil?
|
|
21
|
+
|
|
22
|
+
raise ArgumentError, "page_view selected_index must be greater than or equal to 0" if selected_index.negative?
|
|
23
|
+
raise ArgumentError, "page_view viewport_fraction must be greater than 0" unless viewport_fraction.positive?
|
|
24
|
+
|
|
12
25
|
props = {}
|
|
13
26
|
props[:align] = align unless align.nil?
|
|
14
27
|
props[:animate_align] = animate_align unless animate_align.nil?
|
|
@@ -9,6 +9,18 @@ module Ruflet
|
|
|
9
9
|
WIRE = "Placeholder".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, col: nil, color: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, fallback_height: nil, fallback_width: nil, height: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, stroke_width: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_size_change: nil)
|
|
12
|
+
fallback_height = 400.0 if fallback_height.nil?
|
|
13
|
+
fallback_width = 400.0 if fallback_width.nil?
|
|
14
|
+
stroke_width = 2.0 if stroke_width.nil?
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
fallback_height: fallback_height,
|
|
18
|
+
fallback_width: fallback_width,
|
|
19
|
+
stroke_width: stroke_width
|
|
20
|
+
}.each do |name, value|
|
|
21
|
+
raise ArgumentError, "placeholder #{name} must be greater than or equal to 0" if value.negative?
|
|
22
|
+
end
|
|
23
|
+
|
|
12
24
|
props = {}
|
|
13
25
|
props[:align] = align unless align.nil?
|
|
14
26
|
props[:animate_align] = animate_align unless animate_align.nil?
|
|
@@ -9,6 +9,10 @@ module Ruflet
|
|
|
9
9
|
WIRE = "ReorderableDragHandle".freeze
|
|
10
10
|
|
|
11
11
|
def initialize(id: nil, adaptive: nil, align: nil, animate_align: nil, animate_margin: nil, animate_offset: nil, animate_opacity: nil, animate_position: nil, animate_rotation: nil, animate_scale: nil, animate_size: nil, aspect_ratio: nil, badge: nil, bottom: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, mouse_cursor: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_size_change: nil)
|
|
12
|
+
if content.nil? || (content.respond_to?(:props) && content.props["visible"] == false)
|
|
13
|
+
raise ArgumentError, "reorderable_drag_handle requires visible content"
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
props = {}
|
|
13
17
|
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
18
|
props[:align] = align unless align.nil?
|