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,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class ViewControl < Ruflet::Control
|
|
8
|
+
TYPE = "view".freeze
|
|
9
|
+
WIRE = "View".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, appbar: nil, aspect_ratio: nil, auto_scroll: nil, badge: nil, bgcolor: nil, bottom: nil, bottom_appbar: nil, can_pop: nil, col: nil, controls: nil, data: nil, decoration: nil, disabled: nil, drawer: nil, end_drawer: nil, expand: nil, expand_loose: nil, floating_action_button: nil, floating_action_button_location: nil, foreground_decoration: nil, fullscreen_dialog: nil, height: nil, horizontal_alignment: nil, key: nil, left: nil, margin: nil, navigation_bar: nil, offset: nil, opacity: nil, padding: nil, right: nil, rotate: nil, route: nil, rtl: nil, scale: nil, scroll: nil, scroll_interval: nil, services: nil, size_change_interval: nil, spacing: nil, tooltip: nil, top: nil, vertical_alignment: nil, visible: nil, width: nil, on_animation_end: nil, on_confirm_pop: nil, on_scroll: 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[:appbar] = appbar unless appbar.nil?
|
|
23
|
+
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
24
|
+
props[:auto_scroll] = auto_scroll unless auto_scroll.nil?
|
|
25
|
+
props[:badge] = badge unless badge.nil?
|
|
26
|
+
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
27
|
+
props[:bottom] = bottom unless bottom.nil?
|
|
28
|
+
props[:bottom_appbar] = bottom_appbar unless bottom_appbar.nil?
|
|
29
|
+
props[:can_pop] = can_pop unless can_pop.nil?
|
|
30
|
+
props[:col] = col unless col.nil?
|
|
31
|
+
props[:controls] = controls unless controls.nil?
|
|
32
|
+
props[:data] = data unless data.nil?
|
|
33
|
+
props[:decoration] = decoration unless decoration.nil?
|
|
34
|
+
props[:disabled] = disabled unless disabled.nil?
|
|
35
|
+
props[:drawer] = drawer unless drawer.nil?
|
|
36
|
+
props[:end_drawer] = end_drawer unless end_drawer.nil?
|
|
37
|
+
props[:expand] = expand unless expand.nil?
|
|
38
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
39
|
+
props[:floating_action_button] = floating_action_button unless floating_action_button.nil?
|
|
40
|
+
props[:floating_action_button_location] = floating_action_button_location unless floating_action_button_location.nil?
|
|
41
|
+
props[:foreground_decoration] = foreground_decoration unless foreground_decoration.nil?
|
|
42
|
+
props[:fullscreen_dialog] = fullscreen_dialog unless fullscreen_dialog.nil?
|
|
43
|
+
props[:height] = height unless height.nil?
|
|
44
|
+
props[:horizontal_alignment] = horizontal_alignment unless horizontal_alignment.nil?
|
|
45
|
+
props[:key] = key unless key.nil?
|
|
46
|
+
props[:left] = left unless left.nil?
|
|
47
|
+
props[:margin] = margin unless margin.nil?
|
|
48
|
+
props[:navigation_bar] = navigation_bar unless navigation_bar.nil?
|
|
49
|
+
props[:offset] = offset unless offset.nil?
|
|
50
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
51
|
+
props[:padding] = padding unless padding.nil?
|
|
52
|
+
props[:right] = right unless right.nil?
|
|
53
|
+
props[:rotate] = rotate unless rotate.nil?
|
|
54
|
+
props[:route] = route unless route.nil?
|
|
55
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
56
|
+
props[:scale] = scale unless scale.nil?
|
|
57
|
+
props[:scroll] = scroll unless scroll.nil?
|
|
58
|
+
props[:scroll_interval] = scroll_interval unless scroll_interval.nil?
|
|
59
|
+
props[:services] = services unless services.nil?
|
|
60
|
+
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
61
|
+
props[:spacing] = spacing unless spacing.nil?
|
|
62
|
+
props[:tooltip] = tooltip unless tooltip.nil?
|
|
63
|
+
props[:top] = top unless top.nil?
|
|
64
|
+
props[:vertical_alignment] = vertical_alignment unless vertical_alignment.nil?
|
|
65
|
+
props[:visible] = visible unless visible.nil?
|
|
66
|
+
props[:width] = width unless width.nil?
|
|
67
|
+
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
68
|
+
props[:on_confirm_pop] = on_confirm_pop unless on_confirm_pop.nil?
|
|
69
|
+
props[:on_scroll] = on_scroll unless on_scroll.nil?
|
|
70
|
+
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
71
|
+
super(type: TYPE, id: id, **props)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class WindowControl < Ruflet::Control
|
|
8
|
+
TYPE = "window".freeze
|
|
9
|
+
WIRE = "Window".freeze
|
|
10
|
+
|
|
11
|
+
def initialize(id: nil, alignment: nil, always_on_bottom: nil, always_on_top: nil, aspect_ratio: nil, badge_label: nil, bgcolor: nil, brightness: nil, data: nil, focused: nil, frameless: nil, full_screen: nil, height: nil, icon: nil, ignore_mouse_events: nil, key: nil, left: nil, max_height: nil, max_width: nil, maximizable: nil, maximized: nil, min_height: nil, min_width: nil, minimizable: nil, minimized: nil, movable: nil, opacity: nil, prevent_close: nil, progress_bar: nil, resizable: nil, shadow: nil, skip_task_bar: nil, title_bar_buttons_hidden: nil, title_bar_hidden: nil, top: nil, visible: nil, width: nil, on_event: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:alignment] = alignment unless alignment.nil?
|
|
14
|
+
props[:always_on_bottom] = always_on_bottom unless always_on_bottom.nil?
|
|
15
|
+
props[:always_on_top] = always_on_top unless always_on_top.nil?
|
|
16
|
+
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
17
|
+
props[:badge_label] = badge_label unless badge_label.nil?
|
|
18
|
+
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
19
|
+
props[:brightness] = brightness unless brightness.nil?
|
|
20
|
+
props[:data] = data unless data.nil?
|
|
21
|
+
props[:focused] = focused unless focused.nil?
|
|
22
|
+
props[:frameless] = frameless unless frameless.nil?
|
|
23
|
+
props[:full_screen] = full_screen unless full_screen.nil?
|
|
24
|
+
props[:height] = height unless height.nil?
|
|
25
|
+
props[:icon] = icon unless icon.nil?
|
|
26
|
+
props[:ignore_mouse_events] = ignore_mouse_events unless ignore_mouse_events.nil?
|
|
27
|
+
props[:key] = key unless key.nil?
|
|
28
|
+
props[:left] = left unless left.nil?
|
|
29
|
+
props[:max_height] = max_height unless max_height.nil?
|
|
30
|
+
props[:max_width] = max_width unless max_width.nil?
|
|
31
|
+
props[:maximizable] = maximizable unless maximizable.nil?
|
|
32
|
+
props[:maximized] = maximized unless maximized.nil?
|
|
33
|
+
props[:min_height] = min_height unless min_height.nil?
|
|
34
|
+
props[:min_width] = min_width unless min_width.nil?
|
|
35
|
+
props[:minimizable] = minimizable unless minimizable.nil?
|
|
36
|
+
props[:minimized] = minimized unless minimized.nil?
|
|
37
|
+
props[:movable] = movable unless movable.nil?
|
|
38
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
39
|
+
props[:prevent_close] = prevent_close unless prevent_close.nil?
|
|
40
|
+
props[:progress_bar] = progress_bar unless progress_bar.nil?
|
|
41
|
+
props[:resizable] = resizable unless resizable.nil?
|
|
42
|
+
props[:shadow] = shadow unless shadow.nil?
|
|
43
|
+
props[:skip_task_bar] = skip_task_bar unless skip_task_bar.nil?
|
|
44
|
+
props[:title_bar_buttons_hidden] = title_bar_buttons_hidden unless title_bar_buttons_hidden.nil?
|
|
45
|
+
props[:title_bar_hidden] = title_bar_hidden unless title_bar_hidden.nil?
|
|
46
|
+
props[:top] = top unless top.nil?
|
|
47
|
+
props[:visible] = visible unless visible.nil?
|
|
48
|
+
props[:width] = width unless width.nil?
|
|
49
|
+
props[:on_event] = on_event unless on_event.nil?
|
|
50
|
+
super(type: TYPE, id: id, **props)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
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 WindowDragAreaControl < Ruflet::Control
|
|
8
|
+
TYPE = "windowdragarea".freeze
|
|
9
|
+
WIRE = "WindowDragArea".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, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, left: nil, margin: nil, maximizable: 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_double_tap: nil, on_drag_end: nil, on_drag_start: 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[:disabled] = disabled unless disabled.nil?
|
|
29
|
+
props[:expand] = expand unless expand.nil?
|
|
30
|
+
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
31
|
+
props[:height] = height unless height.nil?
|
|
32
|
+
props[:key] = key unless key.nil?
|
|
33
|
+
props[:left] = left unless left.nil?
|
|
34
|
+
props[:margin] = margin unless margin.nil?
|
|
35
|
+
props[:maximizable] = maximizable unless maximizable.nil?
|
|
36
|
+
props[:offset] = offset unless offset.nil?
|
|
37
|
+
props[:opacity] = opacity unless opacity.nil?
|
|
38
|
+
props[:right] = right unless right.nil?
|
|
39
|
+
props[:rotate] = rotate unless rotate.nil?
|
|
40
|
+
props[:rtl] = rtl unless rtl.nil?
|
|
41
|
+
props[:scale] = scale unless scale.nil?
|
|
42
|
+
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
43
|
+
props[:tooltip] = tooltip unless tooltip.nil?
|
|
44
|
+
props[:top] = top unless top.nil?
|
|
45
|
+
props[:visible] = visible unless visible.nil?
|
|
46
|
+
props[:width] = width unless width.nil?
|
|
47
|
+
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
48
|
+
props[:on_double_tap] = on_double_tap unless on_double_tap.nil?
|
|
49
|
+
props[:on_drag_end] = on_drag_end unless on_drag_end.nil?
|
|
50
|
+
props[:on_drag_start] = on_drag_start unless on_drag_start.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,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "controls/cupertinos/ruflet_controls"
|
|
4
|
+
|
|
5
|
+
module Ruflet
|
|
6
|
+
module UI
|
|
7
|
+
module CupertinoControlFactory
|
|
8
|
+
module_function
|
|
9
|
+
|
|
10
|
+
CLASS_MAP = Controls::Cupertinos::RufletControls::CLASS_MAP.freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module CupertinoControlMethods
|
|
6
|
+
def cupertino_button(**props) = build_widget(:cupertino_button, **props)
|
|
7
|
+
def cupertinobutton(**props) = cupertino_button(**props)
|
|
8
|
+
def cupertino_filled_button(**props) = build_widget(:cupertino_filled_button, **props)
|
|
9
|
+
def cupertinofilledbutton(**props) = cupertino_filled_button(**props)
|
|
10
|
+
def cupertino_text_field(**props) = build_widget(:cupertino_text_field, **props)
|
|
11
|
+
def cupertinotextfield(**props) = cupertino_text_field(**props)
|
|
12
|
+
def cupertino_switch(**props) = build_widget(:cupertino_switch, **props)
|
|
13
|
+
def cupertinoswitch(**props) = cupertino_switch(**props)
|
|
14
|
+
def cupertino_slider(**props) = build_widget(:cupertino_slider, **props)
|
|
15
|
+
def cupertinoslider(**props) = cupertino_slider(**props)
|
|
16
|
+
def cupertino_alert_dialog(**props) = build_widget(:cupertino_alert_dialog, **props)
|
|
17
|
+
def cupertinoalertdialog(**props) = cupertino_alert_dialog(**props)
|
|
18
|
+
def cupertino_action_sheet(**props) = build_widget(:cupertino_action_sheet, **props)
|
|
19
|
+
def cupertinoactionsheet(**props) = cupertino_action_sheet(**props)
|
|
20
|
+
def cupertino_dialog_action(**props) = build_widget(:cupertino_dialog_action, **props)
|
|
21
|
+
def cupertinodialogaction(**props) = cupertino_dialog_action(**props)
|
|
22
|
+
def cupertino_navigation_bar(**props) = build_widget(:cupertino_navigation_bar, **props)
|
|
23
|
+
def cupertinonavigationbar(**props) = cupertino_navigation_bar(**props)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module CupertinoControlRegistry
|
|
6
|
+
TYPE_MAP = {
|
|
7
|
+
"cupertino_button" => "CupertinoButton",
|
|
8
|
+
"cupertinobutton" => "CupertinoButton",
|
|
9
|
+
"cupertino_filled_button" => "CupertinoFilledButton",
|
|
10
|
+
"cupertinofilledbutton" => "CupertinoFilledButton",
|
|
11
|
+
"cupertino_tinted_button" => "CupertinoTintedButton",
|
|
12
|
+
"cupertinotintedbutton" => "CupertinoTintedButton",
|
|
13
|
+
"cupertino_text_field" => "CupertinoTextField",
|
|
14
|
+
"cupertinotextfield" => "CupertinoTextField",
|
|
15
|
+
"cupertino_checkbox" => "CupertinoCheckbox",
|
|
16
|
+
"cupertinocheckbox" => "CupertinoCheckbox",
|
|
17
|
+
"cupertino_switch" => "CupertinoSwitch",
|
|
18
|
+
"cupertinoswitch" => "CupertinoSwitch",
|
|
19
|
+
"cupertino_slider" => "CupertinoSlider",
|
|
20
|
+
"cupertinoslider" => "CupertinoSlider",
|
|
21
|
+
"cupertino_radio" => "CupertinoRadio",
|
|
22
|
+
"cupertinoradio" => "CupertinoRadio",
|
|
23
|
+
"cupertino_alert_dialog" => "CupertinoAlertDialog",
|
|
24
|
+
"cupertinoalertdialog" => "CupertinoAlertDialog",
|
|
25
|
+
"cupertino_action_sheet" => "CupertinoActionSheet",
|
|
26
|
+
"cupertinoactionsheet" => "CupertinoActionSheet",
|
|
27
|
+
"cupertino_dialog_action" => "CupertinoDialogAction",
|
|
28
|
+
"cupertinodialogaction" => "CupertinoDialogAction",
|
|
29
|
+
"cupertino_bottom_sheet" => "CupertinoBottomSheet",
|
|
30
|
+
"cupertinobottomsheet" => "CupertinoBottomSheet",
|
|
31
|
+
"cupertino_picker" => "CupertinoPicker",
|
|
32
|
+
"cupertinopicker" => "CupertinoPicker",
|
|
33
|
+
"cupertino_date_picker" => "CupertinoDatePicker",
|
|
34
|
+
"cupertinodatepicker" => "CupertinoDatePicker",
|
|
35
|
+
"cupertino_timer_picker" => "CupertinoTimerPicker",
|
|
36
|
+
"cupertinotimerpicker" => "CupertinoTimerPicker",
|
|
37
|
+
"cupertino_navigation_bar" => "CupertinoNavigationBar",
|
|
38
|
+
"cupertinonavigationbar" => "CupertinoNavigationBar"
|
|
39
|
+
}.freeze
|
|
40
|
+
|
|
41
|
+
EVENT_PROPS = {
|
|
42
|
+
on_click: "click",
|
|
43
|
+
on_change: "change",
|
|
44
|
+
on_submit: "submit",
|
|
45
|
+
on_dismiss: "dismiss"
|
|
46
|
+
}.freeze
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "controls/materials/ruflet_controls"
|
|
4
|
+
|
|
5
|
+
module Ruflet
|
|
6
|
+
module UI
|
|
7
|
+
module MaterialControlFactory
|
|
8
|
+
module_function
|
|
9
|
+
|
|
10
|
+
CLASS_MAP = Controls::Materials::RufletControls::CLASS_MAP.freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module MaterialControlMethods
|
|
6
|
+
def view(**props, &block) = build_widget(:view, **props, &block)
|
|
7
|
+
def column(**props, &block) = build_widget(:column, **props, &block)
|
|
8
|
+
|
|
9
|
+
def center(**props, &block)
|
|
10
|
+
mapped = props.dup
|
|
11
|
+
defaults = { expand: true, alignment: { x: 0, y: 0 } }
|
|
12
|
+
|
|
13
|
+
if block
|
|
14
|
+
nested = WidgetBuilder.new
|
|
15
|
+
block_result = nested.instance_eval(&block)
|
|
16
|
+
child =
|
|
17
|
+
if nested.children.any?
|
|
18
|
+
nested.children.first
|
|
19
|
+
elsif block_result.is_a?(Ruflet::Control)
|
|
20
|
+
block_result
|
|
21
|
+
end
|
|
22
|
+
mapped[:content] = child if child
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
build_widget(:container, **normalize_container_props(defaults.merge(mapped)))
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def row(**props, &block) = build_widget(:row, **props, &block)
|
|
29
|
+
def stack(**props, &block) = build_widget(:stack, **props, &block)
|
|
30
|
+
def grid_view(**props, &block) = build_widget(:gridview, **props, &block)
|
|
31
|
+
def gridview(**props, &block) = grid_view(**props, &block)
|
|
32
|
+
def container(**props, &block) = build_widget(:container, **normalize_container_props(props), &block)
|
|
33
|
+
def gesture_detector(**props, &block) = build_widget(:gesturedetector, **props, &block)
|
|
34
|
+
def gesturedetector(**props, &block) = gesture_detector(**props, &block)
|
|
35
|
+
def draggable(**props, &block) = build_widget(:draggable, **props, &block)
|
|
36
|
+
def drag_target(**props, &block) = build_widget(:dragtarget, **props, &block)
|
|
37
|
+
def dragtarget(**props, &block) = drag_target(**props, &block)
|
|
38
|
+
|
|
39
|
+
def text(value = nil, **props)
|
|
40
|
+
mapped = props.dup
|
|
41
|
+
mapped[:value] = value unless value.nil?
|
|
42
|
+
build_widget(:text, **mapped)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def button(**props) = build_widget(:button, **props)
|
|
46
|
+
# Ruflet currently uses a single Material button control schema.
|
|
47
|
+
# Keep elevated_button DSL available by routing to :button.
|
|
48
|
+
def elevated_button(**props) = build_widget(:button, **props)
|
|
49
|
+
def text_button(**props) = build_widget(:textbutton, **props)
|
|
50
|
+
def textbutton(**props) = text_button(**props)
|
|
51
|
+
def filled_button(**props) = build_widget(:filledbutton, **props)
|
|
52
|
+
def filledbutton(**props) = filled_button(**props)
|
|
53
|
+
|
|
54
|
+
def icon_button(**props) = build_widget(:iconbutton, **props)
|
|
55
|
+
def iconbutton(**props) = icon_button(**props)
|
|
56
|
+
def text_field(**props) = build_widget(:textfield, **props)
|
|
57
|
+
def textfield(**props) = text_field(**props)
|
|
58
|
+
def checkbox(**props) = build_widget(:checkbox, **props)
|
|
59
|
+
def radio(**props) = build_widget(:radio, **props)
|
|
60
|
+
def radio_group(**props) = build_widget(:radiogroup, **props)
|
|
61
|
+
def radiogroup(**props) = radio_group(**props)
|
|
62
|
+
def alert_dialog(**props) = build_widget(:alertdialog, **props)
|
|
63
|
+
def alertdialog(**props) = alert_dialog(**props)
|
|
64
|
+
def snack_bar(**props) = build_widget(:snackbar, **props)
|
|
65
|
+
def snackbar(**props) = snack_bar(**props)
|
|
66
|
+
def bottom_sheet(**props) = build_widget(:bottomsheet, **props)
|
|
67
|
+
def bottomsheet(**props) = bottom_sheet(**props)
|
|
68
|
+
|
|
69
|
+
def markdown(value = nil, **props)
|
|
70
|
+
mapped = props.dup
|
|
71
|
+
mapped[:value] = value unless value.nil?
|
|
72
|
+
build_widget(:markdown, **mapped)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def icon(**props) = build_widget(:icon, **props)
|
|
76
|
+
|
|
77
|
+
def image(src = nil, src_base64: nil, placeholder_src: nil, **props)
|
|
78
|
+
mapped = props.dup
|
|
79
|
+
mapped[:src] = normalize_image_source(src) unless src.nil?
|
|
80
|
+
mapped[:src] = normalize_image_source(src_base64) if mapped[:src].nil? && !src_base64.nil?
|
|
81
|
+
mapped[:placeholder_src] = normalize_image_source(placeholder_src) unless placeholder_src.nil?
|
|
82
|
+
build_widget(:image, **mapped)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def app_bar(**props) = build_widget(:appbar, **props)
|
|
86
|
+
def appbar(**props) = app_bar(**props)
|
|
87
|
+
def url_launcher(**props) = build_widget(:url_launcher, **props)
|
|
88
|
+
def clipboard(**props) = build_widget(:clipboard, **props)
|
|
89
|
+
def floating_action_button(**props) = build_widget(:floatingactionbutton, **props)
|
|
90
|
+
def floatingactionbutton(**props) = floating_action_button(**props)
|
|
91
|
+
def tabs(**props, &block) = build_widget(:tabs, **props, &block)
|
|
92
|
+
def tab(**props, &block) = build_widget(:tab, **props, &block)
|
|
93
|
+
def tab_bar(**props, &block) = build_widget(:tabbar, **props, &block)
|
|
94
|
+
def tabbar(**props, &block) = tab_bar(**props, &block)
|
|
95
|
+
def tab_bar_view(**props, &block) = build_widget(:tabbarview, **props, &block)
|
|
96
|
+
def tabbarview(**props, &block) = tab_bar_view(**props, &block)
|
|
97
|
+
def navigation_bar(**props, &block) = build_widget(:navigationbar, **props, &block)
|
|
98
|
+
def navigationbar(**props, &block) = navigation_bar(**props, &block)
|
|
99
|
+
def navigation_bar_destination(**props, &block) = build_widget(:navigationbardestination, **props, &block)
|
|
100
|
+
def navigationbardestination(**props, &block) = navigation_bar_destination(**props, &block)
|
|
101
|
+
def bar_chart(**props) = build_widget(:barchart, **props)
|
|
102
|
+
def barchart(**props) = bar_chart(**props)
|
|
103
|
+
def bar_chart_group(**props) = build_widget(:barchartgroup, **props)
|
|
104
|
+
def barchartgroup(**props) = bar_chart_group(**props)
|
|
105
|
+
def bar_chart_rod(**props) = build_widget(:barchartrod, **props)
|
|
106
|
+
def barchartrod(**props) = bar_chart_rod(**props)
|
|
107
|
+
def bar_chart_rod_stack_item(**props) = build_widget(:barchartrodstackitem, **props)
|
|
108
|
+
def barchartrodstackitem(**props) = bar_chart_rod_stack_item(**props)
|
|
109
|
+
def line_chart(**props) = build_widget(:linechart, **props)
|
|
110
|
+
def linechart(**props) = line_chart(**props)
|
|
111
|
+
def line_chart_data(**props) = build_widget(:linechartdata, **props)
|
|
112
|
+
def linechartdata(**props) = line_chart_data(**props)
|
|
113
|
+
def line_chart_data_point(**props) = build_widget(:linechartdatapoint, **props)
|
|
114
|
+
def linechartdatapoint(**props) = line_chart_data_point(**props)
|
|
115
|
+
def pie_chart(**props) = build_widget(:piechart, **props)
|
|
116
|
+
def piechart(**props) = pie_chart(**props)
|
|
117
|
+
def pie_chart_section(**props) = build_widget(:piechartsection, **props)
|
|
118
|
+
def piechartsection(**props) = pie_chart_section(**props)
|
|
119
|
+
def candlestick_chart(**props) = build_widget(:candlestickchart, **props)
|
|
120
|
+
def candlestickchart(**props) = candlestick_chart(**props)
|
|
121
|
+
def candlestick_chart_spot(**props) = build_widget(:candlestickchartspot, **props)
|
|
122
|
+
def candlestickchartspot(**props) = candlestick_chart_spot(**props)
|
|
123
|
+
def radar_chart(**props) = build_widget(:radarchart, **props)
|
|
124
|
+
def radarchart(**props) = radar_chart(**props)
|
|
125
|
+
def radar_chart_title(**props) = build_widget(:radarcharttitle, **props)
|
|
126
|
+
def radarcharttitle(**props) = radar_chart_title(**props)
|
|
127
|
+
def radar_data_set(**props) = build_widget(:radardataset, **props)
|
|
128
|
+
def radardataset(**props) = radar_data_set(**props)
|
|
129
|
+
def radar_data_set_entry(**props) = build_widget(:radardatasetentry, **props)
|
|
130
|
+
def radardatasetentry(**props) = radar_data_set_entry(**props)
|
|
131
|
+
def scatter_chart(**props) = build_widget(:scatterchart, **props)
|
|
132
|
+
def scatterchart(**props) = scatter_chart(**props)
|
|
133
|
+
def scatter_chart_spot(**props) = build_widget(:scatterchartspot, **props)
|
|
134
|
+
def scatterchartspot(**props) = scatter_chart_spot(**props)
|
|
135
|
+
def chart_axis(**props) = build_widget(:chartaxis, **props)
|
|
136
|
+
def chartaxis(**props) = chart_axis(**props)
|
|
137
|
+
def chart_axis_label(**props) = build_widget(:chartaxislabel, **props)
|
|
138
|
+
def chartaxislabel(**props) = chart_axis_label(**props)
|
|
139
|
+
def web_view(**props) = build_widget(:webview, **props)
|
|
140
|
+
def webview(**props) = web_view(**props)
|
|
141
|
+
|
|
142
|
+
def fab(content = nil, **props)
|
|
143
|
+
mapped = props.dup
|
|
144
|
+
mapped[:content] = content unless content.nil?
|
|
145
|
+
build_widget(:floatingactionbutton, **mapped)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
private
|
|
149
|
+
|
|
150
|
+
def normalize_image_source(value)
|
|
151
|
+
return value unless value.is_a?(Array)
|
|
152
|
+
return value.pack("C*") if value.all? { |v| v.is_a?(Integer) }
|
|
153
|
+
value
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Flet container alignment expects a vector-like object ({x:, y:}),
|
|
157
|
+
# not a plain string. Keep common shorthand compatible.
|
|
158
|
+
def normalize_container_props(props)
|
|
159
|
+
mapped = props.dup
|
|
160
|
+
alignment = mapped[:alignment] || mapped["alignment"]
|
|
161
|
+
if alignment == "center" || alignment == :center
|
|
162
|
+
mapped[:alignment] = { x: 0, y: 0 }
|
|
163
|
+
mapped.delete("alignment")
|
|
164
|
+
end
|
|
165
|
+
mapped
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module MaterialControlRegistry
|
|
6
|
+
TYPE_MAP = {
|
|
7
|
+
"text" => "Text",
|
|
8
|
+
"column" => "Column",
|
|
9
|
+
"row" => "Row",
|
|
10
|
+
"stack" => "Stack",
|
|
11
|
+
"gridview" => "GridView",
|
|
12
|
+
"grid_view" => "GridView",
|
|
13
|
+
"view" => "View",
|
|
14
|
+
"container" => "Container",
|
|
15
|
+
"checkbox" => "Checkbox",
|
|
16
|
+
"radio" => "Radio",
|
|
17
|
+
"radiogroup" => "RadioGroup",
|
|
18
|
+
"radio_group" => "RadioGroup",
|
|
19
|
+
"alertdialog" => "AlertDialog",
|
|
20
|
+
"alert_dialog" => "AlertDialog",
|
|
21
|
+
"snackbar" => "SnackBar",
|
|
22
|
+
"snack_bar" => "SnackBar",
|
|
23
|
+
"bottomsheet" => "BottomSheet",
|
|
24
|
+
"bottom_sheet" => "BottomSheet",
|
|
25
|
+
"markdown" => "Markdown",
|
|
26
|
+
"textbutton" => "TextButton",
|
|
27
|
+
"text_button" => "TextButton",
|
|
28
|
+
"filledbutton" => "FilledButton",
|
|
29
|
+
"filled_button" => "FilledButton",
|
|
30
|
+
"gesturedetector" => "GestureDetector",
|
|
31
|
+
"gesture_detector" => "GestureDetector",
|
|
32
|
+
"autocomplete" => "AutoComplete",
|
|
33
|
+
"auto_complete" => "AutoComplete",
|
|
34
|
+
"draggable" => "Draggable",
|
|
35
|
+
"dragtarget" => "DragTarget",
|
|
36
|
+
"drag_target" => "DragTarget",
|
|
37
|
+
"filepicker" => "FilePicker",
|
|
38
|
+
"file_picker" => "FilePicker",
|
|
39
|
+
"camera" => "Camera",
|
|
40
|
+
"textfield" => "TextField",
|
|
41
|
+
"text_field" => "TextField",
|
|
42
|
+
"button" => "Button",
|
|
43
|
+
"elevatedbutton" => "ElevatedButton",
|
|
44
|
+
"elevated_button" => "ElevatedButton",
|
|
45
|
+
"iconbutton" => "IconButton",
|
|
46
|
+
"icon_button" => "IconButton",
|
|
47
|
+
"icon" => "Icon",
|
|
48
|
+
"image" => "Image",
|
|
49
|
+
"appbar" => "AppBar",
|
|
50
|
+
"app_bar" => "AppBar",
|
|
51
|
+
"floatingactionbutton" => "FloatingActionButton",
|
|
52
|
+
"floating_action_button" => "FloatingActionButton",
|
|
53
|
+
"tabs" => "Tabs",
|
|
54
|
+
"tab" => "Tab",
|
|
55
|
+
"tabbar" => "TabBar",
|
|
56
|
+
"tab_bar" => "TabBar",
|
|
57
|
+
"tabbarview" => "TabBarView",
|
|
58
|
+
"tab_bar_view" => "TabBarView",
|
|
59
|
+
"navigationbar" => "NavigationBar",
|
|
60
|
+
"navigation_bar" => "NavigationBar",
|
|
61
|
+
"navigationbardestination" => "NavigationBarDestination",
|
|
62
|
+
"navigation_bar_destination" => "NavigationBarDestination",
|
|
63
|
+
"switch" => "Switch",
|
|
64
|
+
"slider" => "Slider",
|
|
65
|
+
"dropdown" => "Dropdown",
|
|
66
|
+
"dropdownm2" => "DropdownM2",
|
|
67
|
+
"dropdown_m2" => "DropdownM2",
|
|
68
|
+
"option" => "dropdownoption",
|
|
69
|
+
"dropdownoption" => "dropdownoption",
|
|
70
|
+
"card" => "Card",
|
|
71
|
+
"banner" => "Banner",
|
|
72
|
+
"datepicker" => "DatePicker",
|
|
73
|
+
"date_picker" => "DatePicker",
|
|
74
|
+
"timepicker" => "TimePicker",
|
|
75
|
+
"time_picker" => "TimePicker",
|
|
76
|
+
"filledtonalbutton" => "FilledTonalButton",
|
|
77
|
+
"filled_tonal_button" => "FilledTonalButton",
|
|
78
|
+
"outlinedbutton" => "OutlinedButton",
|
|
79
|
+
"outlined_button" => "OutlinedButton",
|
|
80
|
+
"listtile" => "ListTile",
|
|
81
|
+
"list_tile" => "ListTile",
|
|
82
|
+
"progressbar" => "ProgressBar",
|
|
83
|
+
"progress_bar" => "ProgressBar",
|
|
84
|
+
"safearea" => "SafeArea",
|
|
85
|
+
"safe_area" => "SafeArea",
|
|
86
|
+
"canvas" => "Canvas",
|
|
87
|
+
"line" => "Line",
|
|
88
|
+
"overlay" => "Overlay",
|
|
89
|
+
"dialogs" => "Dialogs",
|
|
90
|
+
"service_registry" => "ServiceRegistry",
|
|
91
|
+
"url_launcher" => "UrlLauncher",
|
|
92
|
+
"clipboard" => "Clipboard",
|
|
93
|
+
"audio" => "Audio",
|
|
94
|
+
"video" => "Video",
|
|
95
|
+
"flashlight" => "Flashlight",
|
|
96
|
+
"barchart" => "BarChart",
|
|
97
|
+
"barchartgroup" => "group",
|
|
98
|
+
"barchartrod" => "rod",
|
|
99
|
+
"barchartrodstackitem" => "stack_item",
|
|
100
|
+
"linechart" => "LineChart",
|
|
101
|
+
"linechartdata" => "data",
|
|
102
|
+
"linechartdatapoint" => "p",
|
|
103
|
+
"piechart" => "PieChart",
|
|
104
|
+
"piechartsection" => "section",
|
|
105
|
+
"candlestickchart" => "CandlestickChart",
|
|
106
|
+
"candlestickchartspot" => "CandlestickChartSpot",
|
|
107
|
+
"radarchart" => "RadarChart",
|
|
108
|
+
"radarcharttitle" => "RadarChartTitle",
|
|
109
|
+
"radardataset" => "RadarDataSet",
|
|
110
|
+
"radardatasetentry" => "RadarDataSetEntry",
|
|
111
|
+
"scatterchart" => "ScatterChart",
|
|
112
|
+
"scatterchartspot" => "ScatterChartSpot",
|
|
113
|
+
"chartaxis" => "axis",
|
|
114
|
+
"chartaxislabel" => "l",
|
|
115
|
+
"datacell" => "c",
|
|
116
|
+
"datacolumn" => "c",
|
|
117
|
+
"datarow" => "r",
|
|
118
|
+
"windowdragarea" => "windowDragArea"
|
|
119
|
+
}.freeze
|
|
120
|
+
|
|
121
|
+
EVENT_PROPS = {
|
|
122
|
+
on_click: "click",
|
|
123
|
+
on_change: "change",
|
|
124
|
+
on_action: "action",
|
|
125
|
+
on_submit: "submit",
|
|
126
|
+
on_dismiss: "dismiss",
|
|
127
|
+
on_tap: "tap",
|
|
128
|
+
on_double_tap: "double_tap",
|
|
129
|
+
on_long_press: "long_press",
|
|
130
|
+
on_hover: "hover",
|
|
131
|
+
on_pan_start: "pan_start",
|
|
132
|
+
on_pan_update: "pan_update",
|
|
133
|
+
on_pan_end: "pan_end",
|
|
134
|
+
on_scale_start: "scale_start",
|
|
135
|
+
on_scale_update: "scale_update",
|
|
136
|
+
on_scale_end: "scale_end",
|
|
137
|
+
on_vertical_drag_start: "vertical_drag_start",
|
|
138
|
+
on_vertical_drag_update: "vertical_drag_update",
|
|
139
|
+
on_vertical_drag_end: "vertical_drag_end",
|
|
140
|
+
on_horizontal_drag_start: "horizontal_drag_start",
|
|
141
|
+
on_horizontal_drag_update: "horizontal_drag_update",
|
|
142
|
+
on_horizontal_drag_end: "horizontal_drag_end",
|
|
143
|
+
on_tap_down: "tap_down",
|
|
144
|
+
on_long_press_start: "long_press_start",
|
|
145
|
+
on_right_pan_start: "right_pan_start",
|
|
146
|
+
on_event: "event",
|
|
147
|
+
on_load: "load",
|
|
148
|
+
on_loaded: "loaded",
|
|
149
|
+
on_enter_fullscreen: "enter_fullscreen",
|
|
150
|
+
on_exit_fullscreen: "exit_fullscreen",
|
|
151
|
+
on_duration_change: "duration_change",
|
|
152
|
+
on_position_change: "position_change",
|
|
153
|
+
on_state_change: "state_change",
|
|
154
|
+
on_seek_complete: "seek_complete",
|
|
155
|
+
on_complete: "complete",
|
|
156
|
+
on_track_change: "track_change",
|
|
157
|
+
on_error: "error",
|
|
158
|
+
on_result: "result",
|
|
159
|
+
on_upload: "upload",
|
|
160
|
+
on_accept: "accept",
|
|
161
|
+
on_will_accept: "will_accept",
|
|
162
|
+
on_accept_with_details: "accept_with_details",
|
|
163
|
+
on_move: "move",
|
|
164
|
+
on_leave: "leave"
|
|
165
|
+
}.freeze
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Services
|
|
6
|
+
module RufletServicesComponents
|
|
7
|
+
class AccelerometerControl < Ruflet::Control
|
|
8
|
+
TYPE = "accelerometer".freeze
|
|
9
|
+
WIRE = "Accelerometer".freeze
|
|
10
|
+
|
|
11
|
+
def initialize(id: nil, cancel_on_error: nil, data: nil, enabled: nil, interval: nil, key: nil, on_error: nil, on_reading: nil)
|
|
12
|
+
props = {}
|
|
13
|
+
props[:cancel_on_error] = cancel_on_error unless cancel_on_error.nil?
|
|
14
|
+
props[:data] = data unless data.nil?
|
|
15
|
+
props[:enabled] = enabled unless enabled.nil?
|
|
16
|
+
props[:interval] = interval unless interval.nil?
|
|
17
|
+
props[:key] = key unless key.nil?
|
|
18
|
+
props[:on_error] = on_error unless on_error.nil?
|
|
19
|
+
props[:on_reading] = on_reading unless on_reading.nil?
|
|
20
|
+
super(type: TYPE, id: id, **props)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|