ruflet_core 0.0.9
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 +7 -0
- data/README.md +3 -0
- data/lib/ruflet/version.rb +5 -0
- data/lib/ruflet.rb +3 -0
- data/lib/ruflet_core.rb +40 -0
- data/lib/ruflet_protocol/ruflet/protocol.rb +62 -0
- data/lib/ruflet_protocol.rb +4 -0
- data/lib/ruflet_ui/ruflet/app.rb +27 -0
- data/lib/ruflet_ui/ruflet/colors.rb +234 -0
- data/lib/ruflet_ui/ruflet/control.rb +281 -0
- data/lib/ruflet_ui/ruflet/dsl.rb +291 -0
- data/lib/ruflet_ui/ruflet/event.rb +42 -0
- data/lib/ruflet_ui/ruflet/events/gesture_events.rb +552 -0
- data/lib/ruflet_ui/ruflet/icon_data.rb +62 -0
- data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +54 -0
- data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +70 -0
- data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +55 -0
- data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +70 -0
- data/lib/ruflet_ui/ruflet/page.rb +1222 -0
- data/lib/ruflet_ui/ruflet/types/geometry.rb +65 -0
- data/lib/ruflet_ui/ruflet/types/text_style.rb +191 -0
- data/lib/ruflet_ui/ruflet/ui/control_factory.rb +53 -0
- data/lib/ruflet_ui/ruflet/ui/control_methods.rb +17 -0
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +33 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +57 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +57 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +39 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoappbar_control.rb +44 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobottomsheet_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +73 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +70 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +34 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +73 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +61 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +63 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +64 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +60 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +73 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +159 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +61 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +73 -0
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/ruflet_controls.rb +89 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb +53 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/badge_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/banner_control.rb +47 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomappbar_control.rb +62 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomsheet_control.rb +48 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/button_control.rb +69 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/card_control.rb +63 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +321 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb +76 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb +88 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb +62 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb +81 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb +63 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb +34 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datarow_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb +78 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb +55 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb +57 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdown_control.rb +99 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +119 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownoption_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanel_control.rb +61 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanellist_control.rb +60 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansiontile_control.rb +82 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledbutton_control.rb +69 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/fillediconbutton_control.rb +81 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonalbutton_control.rb +69 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonaliconbutton_control.rb +81 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb +73 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb +81 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb +87 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menubar_control.rb +33 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbardestination_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawer_control.rb +41 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawerdestination_control.rb +34 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationrail_control.rb +70 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationraildestination_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/option_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinedbutton_control.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinediconbutton_control.rb +81 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenubutton_control.rb +74 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenuitem_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressbar_control.rb +64 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressring_control.rb +65 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/radio_control.rb +70 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/radiogroup_control.rb +33 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/reorderablelistview_control.rb +80 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +252 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb +94 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb +33 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segmentedbutton_control.rb +63 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb +32 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/slider_control.rb +76 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb +51 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/switch_control.rb +77 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbar_control.rb +77 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbarview_control.rb +57 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabs_control.rb +59 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textbutton_control.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textfield_control.rb +148 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/timepicker_control.rb +50 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +39 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +447 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/animatedswitcher_control.rb +59 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/arc_control.rb +29 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/autofillgroup_control.rb +32 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/basepage_control.rb +44 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/canvas_control.rb +57 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/circle_control.rb +25 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/color_control.rb +23 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/column_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dialogs_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dismissible_control.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/draggable_control.rb +39 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dragtarget_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/fill_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/fletapp_control.rb +62 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gesturedetector_control.rb +129 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gridview_control.rb +71 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/hero_control.rb +56 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/icon_control.rb +64 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/image_control.rb +27 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/interactiveviewer_control.rb +69 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/keyboardlistener_control.rb +36 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/listview_control.rb +71 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/markdown_control.rb +70 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/mergesemantics_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/oval_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/overlay_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb +74 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pagelet_control.rb +64 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pageview_control.rb +64 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/path_control.rb +23 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/placeholder_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/points_control.rb +24 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rect_control.rb +27 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb +56 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb +61 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/row_control.rb +67 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_controls.rb +140 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb +61 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb +79 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/serviceregistry_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shadermask_control.rb +57 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shadow_control.rb +25 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shimmer_control.rb +60 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/stack_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb +32 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/textspan_control.rb +39 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/transparentpointer_control.rb +54 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/view_control.rb +77 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/window_control.rb +56 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/windowdragarea_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/cupertino_control_factory.rb +13 -0
- data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/cupertino_control_registry.rb +49 -0
- data/lib/ruflet_ui/ruflet/ui/material_control_factory.rb +13 -0
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +170 -0
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +168 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/accelerometer_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/barometer_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +58 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/clipboard_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/connectivity_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/filepicker_control.rb +23 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/flashlight_control.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/gyroscope_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/hapticfeedback_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/magnetometer_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/screenbrightness_control.rb +23 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/screenshot_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/shakedetector_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/share_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/sharedpreferences_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/storagepaths_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/urllauncher_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/useraccelerometer_control.rb +26 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/wakelock_control.rb +21 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +66 -0
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +129 -0
- data/lib/ruflet_ui/ruflet/ui/widget_builder.rb +64 -0
- data/lib/ruflet_ui.rb +160 -0
- metadata +245 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Types
|
|
6
|
+
class Offset
|
|
7
|
+
attr_reader :x, :y
|
|
8
|
+
|
|
9
|
+
def initialize(x:, y:)
|
|
10
|
+
@x = x
|
|
11
|
+
@y = y
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.from_wire(value)
|
|
15
|
+
case value
|
|
16
|
+
when Offset
|
|
17
|
+
value
|
|
18
|
+
when Array
|
|
19
|
+
return nil unless value.size >= 2
|
|
20
|
+
|
|
21
|
+
new(x: value[0], y: value[1])
|
|
22
|
+
when Hash
|
|
23
|
+
x = value["x"] || value[:x] || value[0]
|
|
24
|
+
y = value["y"] || value[:y] || value[1]
|
|
25
|
+
return nil if x.nil? || y.nil?
|
|
26
|
+
|
|
27
|
+
new(x: x, y: y)
|
|
28
|
+
else
|
|
29
|
+
nil
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def to_h
|
|
34
|
+
{ "x" => x, "y" => y }
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class Duration
|
|
39
|
+
attr_reader :milliseconds
|
|
40
|
+
|
|
41
|
+
def initialize(milliseconds:)
|
|
42
|
+
@milliseconds = milliseconds
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def self.from_wire(value)
|
|
46
|
+
return value if value.is_a?(Duration)
|
|
47
|
+
return nil if value.nil?
|
|
48
|
+
|
|
49
|
+
if value.is_a?(Hash)
|
|
50
|
+
ms = value["milliseconds"] || value[:milliseconds] || value["ms"] || value[:ms]
|
|
51
|
+
return nil if ms.nil?
|
|
52
|
+
|
|
53
|
+
return new(milliseconds: ms)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
new(milliseconds: value)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def to_h
|
|
60
|
+
{ "milliseconds" => milliseconds }
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Types
|
|
6
|
+
module TextOverflow
|
|
7
|
+
CLIP = "clip"
|
|
8
|
+
ELLIPSIS = "ellipsis"
|
|
9
|
+
FADE = "fade"
|
|
10
|
+
VISIBLE = "visible"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
module TextBaseline
|
|
14
|
+
ALPHABETIC = "alphabetic"
|
|
15
|
+
IDEOGRAPHIC = "ideographic"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
module TextThemeStyle
|
|
19
|
+
DISPLAY_LARGE = "displayLarge"
|
|
20
|
+
DISPLAY_MEDIUM = "displayMedium"
|
|
21
|
+
DISPLAY_SMALL = "displaySmall"
|
|
22
|
+
HEADLINE_LARGE = "headlineLarge"
|
|
23
|
+
HEADLINE_MEDIUM = "headlineMedium"
|
|
24
|
+
HEADLINE_SMALL = "headlineSmall"
|
|
25
|
+
TITLE_LARGE = "titleLarge"
|
|
26
|
+
TITLE_MEDIUM = "titleMedium"
|
|
27
|
+
TITLE_SMALL = "titleSmall"
|
|
28
|
+
LABEL_LARGE = "labelLarge"
|
|
29
|
+
LABEL_MEDIUM = "labelMedium"
|
|
30
|
+
LABEL_SMALL = "labelSmall"
|
|
31
|
+
BODY_LARGE = "bodyLarge"
|
|
32
|
+
BODY_MEDIUM = "bodyMedium"
|
|
33
|
+
BODY_SMALL = "bodySmall"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
module TextDecoration
|
|
37
|
+
NONE = 0
|
|
38
|
+
UNDERLINE = 1
|
|
39
|
+
OVERLINE = 2
|
|
40
|
+
LINE_THROUGH = 4
|
|
41
|
+
|
|
42
|
+
module_function
|
|
43
|
+
|
|
44
|
+
def combine(decorations)
|
|
45
|
+
Array(decorations).compact.reduce(NONE) { |acc, item| acc | item.to_i }
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
module TextDecorationStyle
|
|
50
|
+
SOLID = "solid"
|
|
51
|
+
DOUBLE = "double"
|
|
52
|
+
DOTTED = "dotted"
|
|
53
|
+
DASHED = "dashed"
|
|
54
|
+
WAVY = "wavy"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class TextStyle
|
|
58
|
+
ATTRS = %i[
|
|
59
|
+
size
|
|
60
|
+
height
|
|
61
|
+
weight
|
|
62
|
+
italic
|
|
63
|
+
decoration
|
|
64
|
+
decoration_color
|
|
65
|
+
decoration_thickness
|
|
66
|
+
decoration_style
|
|
67
|
+
font_family
|
|
68
|
+
font_family_fallback
|
|
69
|
+
color
|
|
70
|
+
bgcolor
|
|
71
|
+
shadow
|
|
72
|
+
foreground
|
|
73
|
+
letter_spacing
|
|
74
|
+
word_spacing
|
|
75
|
+
overflow
|
|
76
|
+
baseline
|
|
77
|
+
].freeze
|
|
78
|
+
|
|
79
|
+
attr_reader(*ATTRS)
|
|
80
|
+
|
|
81
|
+
def initialize(
|
|
82
|
+
size: nil,
|
|
83
|
+
height: nil,
|
|
84
|
+
weight: nil,
|
|
85
|
+
italic: false,
|
|
86
|
+
decoration: nil,
|
|
87
|
+
decoration_color: nil,
|
|
88
|
+
decoration_thickness: nil,
|
|
89
|
+
decoration_style: nil,
|
|
90
|
+
font_family: nil,
|
|
91
|
+
font_family_fallback: nil,
|
|
92
|
+
color: nil,
|
|
93
|
+
bgcolor: nil,
|
|
94
|
+
shadow: nil,
|
|
95
|
+
foreground: nil,
|
|
96
|
+
letter_spacing: nil,
|
|
97
|
+
word_spacing: nil,
|
|
98
|
+
overflow: nil,
|
|
99
|
+
baseline: nil
|
|
100
|
+
)
|
|
101
|
+
@size = size
|
|
102
|
+
@height = height
|
|
103
|
+
@weight = weight
|
|
104
|
+
@italic = italic
|
|
105
|
+
@decoration = decoration
|
|
106
|
+
@decoration_color = decoration_color
|
|
107
|
+
@decoration_thickness = decoration_thickness
|
|
108
|
+
@decoration_style = decoration_style
|
|
109
|
+
@font_family = font_family
|
|
110
|
+
@font_family_fallback = font_family_fallback
|
|
111
|
+
@color = color
|
|
112
|
+
@bgcolor = bgcolor
|
|
113
|
+
@shadow = shadow
|
|
114
|
+
@foreground = foreground
|
|
115
|
+
@letter_spacing = letter_spacing
|
|
116
|
+
@word_spacing = word_spacing
|
|
117
|
+
@overflow = overflow
|
|
118
|
+
@baseline = baseline
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def copy(**overrides)
|
|
122
|
+
self.class.new(**ATTRS.each_with_object({}) do |attr, out|
|
|
123
|
+
out[attr] = overrides.key?(attr) ? overrides[attr] : public_send(attr)
|
|
124
|
+
end)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def to_h
|
|
128
|
+
hash = {}
|
|
129
|
+
ATTRS.each do |attr|
|
|
130
|
+
value = public_send(attr)
|
|
131
|
+
next if value.nil?
|
|
132
|
+
next if attr == :italic && value == false
|
|
133
|
+
|
|
134
|
+
hash[attr.to_s] = value
|
|
135
|
+
end
|
|
136
|
+
hash
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
class StrutStyle
|
|
141
|
+
ATTRS = %i[
|
|
142
|
+
size
|
|
143
|
+
height
|
|
144
|
+
weight
|
|
145
|
+
italic
|
|
146
|
+
font_family
|
|
147
|
+
leading
|
|
148
|
+
force_strut_height
|
|
149
|
+
].freeze
|
|
150
|
+
|
|
151
|
+
attr_reader(*ATTRS)
|
|
152
|
+
|
|
153
|
+
def initialize(
|
|
154
|
+
size: nil,
|
|
155
|
+
height: nil,
|
|
156
|
+
weight: nil,
|
|
157
|
+
italic: false,
|
|
158
|
+
font_family: nil,
|
|
159
|
+
leading: nil,
|
|
160
|
+
force_strut_height: nil
|
|
161
|
+
)
|
|
162
|
+
@size = size
|
|
163
|
+
@height = height
|
|
164
|
+
@weight = weight
|
|
165
|
+
@italic = italic
|
|
166
|
+
@font_family = font_family
|
|
167
|
+
@leading = leading
|
|
168
|
+
@force_strut_height = force_strut_height
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def copy(**overrides)
|
|
172
|
+
self.class.new(**ATTRS.each_with_object({}) do |attr, out|
|
|
173
|
+
out[attr] = overrides.key?(attr) ? overrides[attr] : public_send(attr)
|
|
174
|
+
end)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def to_h
|
|
178
|
+
hash = {}
|
|
179
|
+
ATTRS.each do |attr|
|
|
180
|
+
value = public_send(attr)
|
|
181
|
+
next if value.nil?
|
|
182
|
+
next if attr == :italic && value == false
|
|
183
|
+
|
|
184
|
+
hash[attr.to_s] = value
|
|
185
|
+
end
|
|
186
|
+
hash
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "controls/ruflet_controls"
|
|
4
|
+
require_relative "services/ruflet_services"
|
|
5
|
+
require_relative "../control"
|
|
6
|
+
|
|
7
|
+
module Ruflet
|
|
8
|
+
module UI
|
|
9
|
+
module ControlFactory
|
|
10
|
+
module_function
|
|
11
|
+
|
|
12
|
+
CLASS_MAP =
|
|
13
|
+
Controls::RufletControls::CLASS_MAP
|
|
14
|
+
.merge(Services::RufletServices::CLASS_MAP)
|
|
15
|
+
.freeze
|
|
16
|
+
|
|
17
|
+
def build(type, id: nil, **props)
|
|
18
|
+
normalized_type = type.to_s.downcase
|
|
19
|
+
klass = CLASS_MAP[normalized_type]
|
|
20
|
+
if klass
|
|
21
|
+
normalized_props = normalize_constructor_props(klass, props)
|
|
22
|
+
return klass.new(id: id, **normalized_props)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
raise ArgumentError, "Unknown control type: #{normalized_type}"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def normalize_constructor_props(klass, props)
|
|
29
|
+
keywords = constructor_keywords(klass)
|
|
30
|
+
return props if keywords.empty?
|
|
31
|
+
|
|
32
|
+
allowed = keywords.map(&:to_s)
|
|
33
|
+
mapped = props.each_with_object({}) { |(k, v), out| out[k.to_sym] = v }
|
|
34
|
+
if mapped.key?("value") && !allowed.include?("value") && allowed.include?("text") && !mapped.key?("text")
|
|
35
|
+
mapped["text"] = mapped.delete("value")
|
|
36
|
+
end
|
|
37
|
+
if mapped.key?(:value) && !allowed.include?("value") && allowed.include?("text") && !mapped.key?(:text)
|
|
38
|
+
mapped[:text] = mapped.delete(:value)
|
|
39
|
+
end
|
|
40
|
+
mapped
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def constructor_keywords(klass)
|
|
44
|
+
klass.instance_method(:initialize).parameters
|
|
45
|
+
.select { |kind, _| kind == :key || kind == :keyreq }
|
|
46
|
+
.map { |_, name| name }
|
|
47
|
+
.reject { |name| name == :id }
|
|
48
|
+
rescue StandardError
|
|
49
|
+
[]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "material_control_methods"
|
|
4
|
+
require_relative "cupertino_control_methods"
|
|
5
|
+
|
|
6
|
+
module Ruflet
|
|
7
|
+
module UI
|
|
8
|
+
module ControlMethods
|
|
9
|
+
include MaterialControlMethods
|
|
10
|
+
include CupertinoControlMethods
|
|
11
|
+
|
|
12
|
+
def control(type, **props, &block) = build_widget(type, **props, &block)
|
|
13
|
+
def widget(type, **props, &block) = build_widget(type, **props, &block)
|
|
14
|
+
def service(type, **props, &block) = build_service(type, **props, &block)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module ControlRegistry
|
|
6
|
+
require_relative "material_control_registry"
|
|
7
|
+
require_relative "cupertino_control_registry"
|
|
8
|
+
require_relative "controls/ruflet_controls"
|
|
9
|
+
require_relative "services/ruflet_services"
|
|
10
|
+
TYPE_MAP = MaterialControlRegistry::TYPE_MAP.merge(CupertinoControlRegistry::TYPE_MAP).freeze
|
|
11
|
+
SCHEMA_EVENT_PROPS =
|
|
12
|
+
Controls::RufletControls::CLASS_MAP
|
|
13
|
+
.merge(Services::RufletServices::CLASS_MAP)
|
|
14
|
+
.values
|
|
15
|
+
.uniq
|
|
16
|
+
.each_with_object({}) do |schema, events|
|
|
17
|
+
schema.instance_method(:initialize).parameters
|
|
18
|
+
.select { |kind, name| (kind == :key || kind == :keyreq) && name.to_s.start_with?("on_") }
|
|
19
|
+
.each do |_, name|
|
|
20
|
+
event_name = name.to_s.sub(/\Aon_/, "")
|
|
21
|
+
normalized = event_name.to_s.sub(/\Aon_/, "")
|
|
22
|
+
events[:"on_#{normalized}"] = normalized
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
.freeze
|
|
26
|
+
EVENT_PROPS =
|
|
27
|
+
MaterialControlRegistry::EVENT_PROPS
|
|
28
|
+
.merge(CupertinoControlRegistry::EVENT_PROPS)
|
|
29
|
+
.merge(SCHEMA_EVENT_PROPS)
|
|
30
|
+
.freeze
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CupertinoActionSheetControl < Ruflet::Control
|
|
8
|
+
TYPE = "cupertinoactionsheet".freeze
|
|
9
|
+
WIRE = "CupertinoActionSheet".freeze
|
|
10
|
+
|
|
11
|
+
def initialize(id: nil, actions: 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, cancel: nil, col: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, message: nil, offset: nil, opacity: nil, right: nil, rotate: nil, rtl: nil, scale: nil, size_change_interval: nil, title: nil, tooltip: nil, top: nil, visible: nil, width: nil, on_animation_end: nil, on_size_change: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:actions] = actions unless actions.nil?
|
|
14
|
+
props[:align] = align unless align.nil?
|
|
15
|
+
props[:animate_align] = animate_align unless animate_align.nil?
|
|
16
|
+
props[:animate_margin] = animate_margin unless animate_margin.nil?
|
|
17
|
+
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
18
|
+
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
19
|
+
props[:animate_position] = animate_position unless animate_position.nil?
|
|
20
|
+
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
21
|
+
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
22
|
+
props[:animate_size] = animate_size unless animate_size.nil?
|
|
23
|
+
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
24
|
+
props[:badge] = badge unless badge.nil?
|
|
25
|
+
props[:bottom] = bottom unless bottom.nil?
|
|
26
|
+
props[:cancel] = cancel unless cancel.nil?
|
|
27
|
+
props[:col] = col unless col.nil?
|
|
28
|
+
props[:data] = data unless data.nil?
|
|
29
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
30
|
+
props[:expand] = expand unless expand.nil?
|
|
31
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
32
|
+
props[:height] = height unless height.nil?
|
|
33
|
+
props[:key] = key unless key.nil?
|
|
34
|
+
props[:left] = left unless left.nil?
|
|
35
|
+
props[:margin] = margin unless margin.nil?
|
|
36
|
+
props[:message] = message unless message.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[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
44
|
+
props[:title] = title unless title.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)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CupertinoActionSheetActionControl < Ruflet::Control
|
|
8
|
+
TYPE = "cupertinoactionsheetaction".freeze
|
|
9
|
+
WIRE = "CupertinoActionSheetAction".freeze
|
|
10
|
+
|
|
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, default: nil, destructive: 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_click: nil, on_size_change: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:align] = align unless align.nil?
|
|
14
|
+
props[:animate_align] = animate_align unless animate_align.nil?
|
|
15
|
+
props[:animate_margin] = animate_margin unless animate_margin.nil?
|
|
16
|
+
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
17
|
+
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
18
|
+
props[:animate_position] = animate_position unless animate_position.nil?
|
|
19
|
+
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
20
|
+
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
+
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
+
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
23
|
+
props[:badge] = badge unless badge.nil?
|
|
24
|
+
props[:bottom] = bottom unless bottom.nil?
|
|
25
|
+
props[:col] = col unless col.nil?
|
|
26
|
+
props[:content] = content unless content.nil?
|
|
27
|
+
props[:data] = data unless data.nil?
|
|
28
|
+
props[:default] = default unless default.nil?
|
|
29
|
+
props[:destructive] = destructive unless destructive.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[:mouse_cursor] = mouse_cursor unless mouse_cursor.nil?
|
|
38
|
+
props[:offset] = offset unless offset.nil?
|
|
39
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
40
|
+
props[:right] = right unless right.nil?
|
|
41
|
+
props[:rotate] = rotate unless rotate.nil?
|
|
42
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
43
|
+
props[:scale] = scale unless scale.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_click] = on_click unless on_click.nil?
|
|
51
|
+
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
52
|
+
super(type: TYPE, id: id, **props)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CupertinoActivityIndicatorControl < Ruflet::Control
|
|
8
|
+
TYPE = "cupertinoactivityindicator".freeze
|
|
9
|
+
WIRE = "CupertinoActivityIndicator".freeze
|
|
10
|
+
|
|
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, animating: nil, aspect_ratio: nil, badge: nil, bottom: nil, col: nil, color: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, offset: nil, opacity: nil, progress: nil, radius: 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
|
+
props = {}
|
|
13
|
+
props[:align] = align unless align.nil?
|
|
14
|
+
props[:animate_align] = animate_align unless animate_align.nil?
|
|
15
|
+
props[:animate_margin] = animate_margin unless animate_margin.nil?
|
|
16
|
+
props[:animate_offset] = animate_offset unless animate_offset.nil?
|
|
17
|
+
props[:animate_opacity] = animate_opacity unless animate_opacity.nil?
|
|
18
|
+
props[:animate_position] = animate_position unless animate_position.nil?
|
|
19
|
+
props[:animate_rotation] = animate_rotation unless animate_rotation.nil?
|
|
20
|
+
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
+
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
+
props[:animating] = animating unless animating.nil?
|
|
23
|
+
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
24
|
+
props[:badge] = badge unless badge.nil?
|
|
25
|
+
props[:bottom] = bottom unless bottom.nil?
|
|
26
|
+
props[:col] = col unless col.nil?
|
|
27
|
+
props[:color] = color unless color.nil?
|
|
28
|
+
props[:data] = data unless data.nil?
|
|
29
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
30
|
+
props[:expand] = expand unless expand.nil?
|
|
31
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
32
|
+
props[:height] = height unless height.nil?
|
|
33
|
+
props[:key] = key unless key.nil?
|
|
34
|
+
props[:left] = left unless left.nil?
|
|
35
|
+
props[:margin] = margin unless margin.nil?
|
|
36
|
+
props[:offset] = offset unless offset.nil?
|
|
37
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
38
|
+
props[:progress] = progress unless progress.nil?
|
|
39
|
+
props[:radius] = radius unless radius.nil?
|
|
40
|
+
props[:right] = right unless right.nil?
|
|
41
|
+
props[:rotate] = rotate unless rotate.nil?
|
|
42
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
43
|
+
props[:scale] = scale unless scale.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)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CupertinoAlertDialogControl < Ruflet::Control
|
|
8
|
+
TYPE = "cupertinoalertdialog".freeze
|
|
9
|
+
WIRE = "CupertinoAlertDialog".freeze
|
|
10
|
+
|
|
11
|
+
def initialize(id: nil, actions: nil, adaptive: nil, badge: nil, barrier_color: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, inset_animation: nil, key: nil, modal: nil, opacity: nil, open: nil, rtl: nil, title: nil, tooltip: nil, visible: nil, on_dismiss: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:actions] = actions unless actions.nil?
|
|
14
|
+
props[:adaptive] = adaptive unless adaptive.nil?
|
|
15
|
+
props[:badge] = badge unless badge.nil?
|
|
16
|
+
props[:barrier_color] = barrier_color unless barrier_color.nil?
|
|
17
|
+
props[:col] = col unless col.nil?
|
|
18
|
+
props[:content] = content unless content.nil?
|
|
19
|
+
props[:data] = data unless data.nil?
|
|
20
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
21
|
+
props[:expand] = expand unless expand.nil?
|
|
22
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
23
|
+
props[:inset_animation] = inset_animation unless inset_animation.nil?
|
|
24
|
+
props[:key] = key unless key.nil?
|
|
25
|
+
props[:modal] = modal unless modal.nil?
|
|
26
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
27
|
+
props[:open] = open unless open.nil?
|
|
28
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
29
|
+
props[:title] = title unless title.nil?
|
|
30
|
+
props[:tooltip] = tooltip unless tooltip.nil?
|
|
31
|
+
props[:visible] = visible unless visible.nil?
|
|
32
|
+
props[:on_dismiss] = on_dismiss unless on_dismiss.nil?
|
|
33
|
+
super(type: TYPE, id: id, **props)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CupertinoAppBarControl < Ruflet::Control
|
|
8
|
+
TYPE = "cupertinoappbar".freeze
|
|
9
|
+
WIRE = "CupertinoAppBar".freeze
|
|
10
|
+
|
|
11
|
+
def initialize(id: nil, automatic_background_visibility: nil, automatically_imply_leading: nil, automatically_imply_title: nil, badge: nil, bgcolor: nil, border: nil, brightness: nil, col: nil, data: nil, disabled: nil, enable_background_filter_blur: nil, expand: nil, expand_loose: nil, key: nil, large: nil, leading: nil, opacity: nil, padding: nil, previous_page_title: nil, rtl: nil, title: nil, tooltip: nil, trailing: nil, transition_between_routes: nil, visible: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:automatic_background_visibility] = automatic_background_visibility unless automatic_background_visibility.nil?
|
|
14
|
+
props[:automatically_imply_leading] = automatically_imply_leading unless automatically_imply_leading.nil?
|
|
15
|
+
props[:automatically_imply_title] = automatically_imply_title unless automatically_imply_title.nil?
|
|
16
|
+
props[:badge] = badge unless badge.nil?
|
|
17
|
+
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
18
|
+
props[:border] = border unless border.nil?
|
|
19
|
+
props[:brightness] = brightness unless brightness.nil?
|
|
20
|
+
props[:col] = col unless col.nil?
|
|
21
|
+
props[:data] = data unless data.nil?
|
|
22
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
23
|
+
props[:enable_background_filter_blur] = enable_background_filter_blur unless enable_background_filter_blur.nil?
|
|
24
|
+
props[:expand] = expand unless expand.nil?
|
|
25
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
26
|
+
props[:key] = key unless key.nil?
|
|
27
|
+
props[:large] = large unless large.nil?
|
|
28
|
+
props[:leading] = leading unless leading.nil?
|
|
29
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
30
|
+
props[:padding] = padding unless padding.nil?
|
|
31
|
+
props[:previous_page_title] = previous_page_title unless previous_page_title.nil?
|
|
32
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
33
|
+
props[:title] = title unless title.nil?
|
|
34
|
+
props[:tooltip] = tooltip unless tooltip.nil?
|
|
35
|
+
props[:trailing] = trailing unless trailing.nil?
|
|
36
|
+
props[:transition_between_routes] = transition_between_routes unless transition_between_routes.nil?
|
|
37
|
+
props[:visible] = visible unless visible.nil?
|
|
38
|
+
super(type: TYPE, id: id, **props)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CupertinoBottomSheetControl < Ruflet::Control
|
|
8
|
+
TYPE = "cupertinobottomsheet".freeze
|
|
9
|
+
WIRE = "CupertinoBottomSheet".freeze
|
|
10
|
+
|
|
11
|
+
def initialize(id: nil, adaptive: nil, badge: nil, bgcolor: nil, col: nil, content: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, modal: nil, opacity: nil, open: nil, padding: nil, rtl: nil, tooltip: nil, visible: nil, on_dismiss: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:adaptive] = adaptive unless adaptive.nil?
|
|
14
|
+
props[:badge] = badge unless badge.nil?
|
|
15
|
+
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
16
|
+
props[:col] = col unless col.nil?
|
|
17
|
+
props[:content] = content unless content.nil?
|
|
18
|
+
props[:data] = data unless data.nil?
|
|
19
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
20
|
+
props[:expand] = expand unless expand.nil?
|
|
21
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
22
|
+
props[:height] = height unless height.nil?
|
|
23
|
+
props[:key] = key unless key.nil?
|
|
24
|
+
props[:modal] = modal unless modal.nil?
|
|
25
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
26
|
+
props[:open] = open unless open.nil?
|
|
27
|
+
props[:padding] = padding unless padding.nil?
|
|
28
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
29
|
+
props[:tooltip] = tooltip unless tooltip.nil?
|
|
30
|
+
props[:visible] = visible unless visible.nil?
|
|
31
|
+
props[:on_dismiss] = on_dismiss unless on_dismiss.nil?
|
|
32
|
+
super(type: TYPE, id: id, **props)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|