ruflet 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruflet/version.rb +1 -1
- data/lib/ruflet_ui/ruflet/app.rb +10 -14
- data/lib/ruflet_ui/ruflet/control.rb +120 -7
- data/lib/ruflet_ui/ruflet/dsl.rb +68 -4
- data/lib/ruflet_ui/ruflet/event.rb +15 -1
- data/lib/ruflet_ui/ruflet/events/gesture_events.rb +552 -0
- data/lib/ruflet_ui/ruflet/page.rb +600 -73
- 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 +35 -5
- data/lib/ruflet_ui/ruflet/ui/control_methods.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +22 -2
- 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 +3 -30
- data/lib/ruflet_ui/ruflet/ui/material_control_factory.rb +3 -87
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +44 -2
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +26 -12
- 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 +41 -1
- data/lib/ruflet_ui/ruflet/ui/widget_builder.rb +9 -0
- data/lib/ruflet_ui.rb +14 -1
- metadata +178 -44
- data/lib/ruflet/manifest_compiler.rb +0 -62
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_action_sheet_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_alert_dialog_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_button_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_dialog_action_control.rb +0 -24
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_filled_button_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_navigation_bar_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_slider_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_switch_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/cupertino/cupertino_text_field_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/alert_dialog_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/app_bar_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/bottom_sheet_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/button_control.rb +0 -24
- data/lib/ruflet_ui/ruflet/ui/controls/material/checkbox_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/column_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/container_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/drag_target_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/draggable_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/elevated_button_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/filled_button_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/floating_action_button_control.rb +0 -28
- data/lib/ruflet_ui/ruflet/ui/controls/material/gesture_detector_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/grid_view_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/icon_button_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/icon_control.rb +0 -24
- data/lib/ruflet_ui/ruflet/ui/controls/material/image_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/markdown_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/navigation_bar_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/navigation_bar_destination_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/radio_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/radio_group_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/row_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/snack_bar_control.rb +0 -68
- data/lib/ruflet_ui/ruflet/ui/controls/material/stack_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/tab_bar_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/tab_bar_view_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/tab_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/tabs_control.rb +0 -63
- data/lib/ruflet_ui/ruflet/ui/controls/material/text_button_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/text_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/text_field_control.rb +0 -13
- data/lib/ruflet_ui/ruflet/ui/controls/material/view_control.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 383b294c6573d456634109721dbf8b8ba8394f45fa869e57e3114a6d74c883fe
|
|
4
|
+
data.tar.gz: b17888f9fe0d083f0ca0a008de04d486bbe483ef74213e09ab1cdbc626ceeba1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1960be12808dcc6b7d36335e4fe1e59496017392efeb59af8135d2a25558f6b1c5dfedd31bd0b594a3cd445483ca5ba64fa7d59a250da8070e2401763c561fb
|
|
7
|
+
data.tar.gz: c0c09817075879c5ac9c767cdf5c9a6ef1725340961cc0488fb72bc76a8a405152c5b6e836e215a01063731c67740ba27cd769fe0145c17d5935b56386b927af
|
data/lib/ruflet/version.rb
CHANGED
data/lib/ruflet_ui/ruflet/app.rb
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
require_relative "../../ruflet/manifest_compiler"
|
|
3
2
|
|
|
4
3
|
module Ruflet
|
|
5
4
|
class App
|
|
6
|
-
def initialize(host:
|
|
7
|
-
@host = host
|
|
8
|
-
@port = port
|
|
5
|
+
def initialize(host: nil, port: nil)
|
|
6
|
+
@host = (host || ENV["RUFLET_HOST"] || "0.0.0.0")
|
|
7
|
+
@port = normalize_port(port || ENV["RUFLET_PORT"] || 8550)
|
|
9
8
|
end
|
|
10
9
|
|
|
11
10
|
def run
|
|
12
|
-
manifest_out = ENV["RUFLET_MANIFEST_OUT"].to_s
|
|
13
|
-
unless manifest_out.empty?
|
|
14
|
-
route = ENV["RUFLET_MANIFEST_ROUTE"].to_s
|
|
15
|
-
route = "/" if route.empty?
|
|
16
|
-
manifest = Ruflet::ManifestCompiler.compile_app(self, route: route)
|
|
17
|
-
Ruflet::ManifestCompiler.write_file(manifest_out, manifest)
|
|
18
|
-
puts manifest_out
|
|
19
|
-
return manifest_out
|
|
20
|
-
end
|
|
21
|
-
|
|
22
11
|
Ruflet.run(host: @host, port: @port) do |page|
|
|
23
12
|
view(page)
|
|
24
13
|
end
|
|
@@ -27,5 +16,12 @@ module Ruflet
|
|
|
27
16
|
def view(_page)
|
|
28
17
|
raise NotImplementedError, "#{self.class} must implement #view(page)"
|
|
29
18
|
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def normalize_port(value)
|
|
23
|
+
port = value.to_i
|
|
24
|
+
port > 0 ? port : 8550
|
|
25
|
+
end
|
|
30
26
|
end
|
|
31
27
|
end
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
begin
|
|
4
|
-
|
|
4
|
+
require "securerandom"
|
|
5
5
|
rescue LoadError
|
|
6
6
|
nil
|
|
7
7
|
end
|
|
8
|
-
require_relative "ui/control_registry"
|
|
9
8
|
require_relative "icon_data"
|
|
10
9
|
require_relative "icons/material_icon_lookup"
|
|
11
10
|
require_relative "icons/cupertino_icon_lookup"
|
|
11
|
+
require "set"
|
|
12
12
|
|
|
13
13
|
module Ruflet
|
|
14
14
|
class Control
|
|
15
|
-
TYPE_MAP = UI::ControlRegistry::TYPE_MAP
|
|
16
|
-
EVENT_PROPS = UI::ControlRegistry::EVENT_PROPS
|
|
17
15
|
HOST_EXPANDED_TYPES = %w[view row column].freeze
|
|
18
16
|
|
|
19
17
|
attr_reader :type, :id, :props, :children
|
|
@@ -30,6 +28,7 @@ module Ruflet
|
|
|
30
28
|
|
|
31
29
|
def on(event_name, &block)
|
|
32
30
|
name = normalized_event_name(event_name)
|
|
31
|
+
validate_event_name!(name)
|
|
33
32
|
@handlers[name] = block
|
|
34
33
|
@props["on_#{name}"] = true
|
|
35
34
|
runtime_page&.update(self, "on_#{name}": true) if wire_id
|
|
@@ -49,8 +48,14 @@ module Ruflet
|
|
|
49
48
|
end
|
|
50
49
|
|
|
51
50
|
def to_patch
|
|
51
|
+
wire_type = schema_wire_type_for_class
|
|
52
|
+
if wire_type.nil?
|
|
53
|
+
compact_type_key = type.delete("_")
|
|
54
|
+
wire_type = type_map[type] || type_map[compact_type_key]
|
|
55
|
+
end
|
|
56
|
+
raise ArgumentError, "Unknown control type: #{type}" unless wire_type
|
|
52
57
|
patch = {
|
|
53
|
-
"_c" =>
|
|
58
|
+
"_c" => wire_type,
|
|
54
59
|
"_i" => wire_id
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -87,16 +92,33 @@ module Ruflet
|
|
|
87
92
|
when Hash
|
|
88
93
|
value.transform_values { |v| serialize_value(v) }
|
|
89
94
|
else
|
|
90
|
-
value
|
|
95
|
+
value.respond_to?(:to_h) ? serialize_value(value.to_h) : value
|
|
91
96
|
end
|
|
92
97
|
end
|
|
93
98
|
|
|
94
99
|
def extract_handlers(input)
|
|
95
100
|
output = input.dup
|
|
101
|
+
allowed_events = event_names
|
|
102
|
+
allowed_events_set = allowed_events.to_set
|
|
103
|
+
|
|
104
|
+
output.keys.each do |key|
|
|
105
|
+
key_string = key.to_s
|
|
106
|
+
next unless key_string.start_with?("on_")
|
|
107
|
+
|
|
108
|
+
event_name = normalized_event_name(key_string)
|
|
109
|
+
if allowed_events.any? && !allowed_events_set.include?(event_name)
|
|
110
|
+
raise ArgumentError, "Unknown event `#{key_string}` for control type `#{type}`"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
handler = output.delete(key)
|
|
114
|
+
@handlers[event_name] = handler if handler.respond_to?(:call)
|
|
115
|
+
output["on_#{event_name}"] = true
|
|
116
|
+
end
|
|
96
117
|
|
|
97
|
-
|
|
118
|
+
event_props.each do |prop, event_name|
|
|
98
119
|
string_prop = prop.to_s
|
|
99
120
|
next unless output.key?(prop) || output.key?(string_prop)
|
|
121
|
+
next if allowed_events.any? && !allowed_events_set.include?(event_name)
|
|
100
122
|
|
|
101
123
|
handler = output.key?(prop) ? output.delete(prop) : output.delete(string_prop)
|
|
102
124
|
@handlers[event_name] = handler if handler.respond_to?(:call)
|
|
@@ -107,9 +129,19 @@ module Ruflet
|
|
|
107
129
|
end
|
|
108
130
|
|
|
109
131
|
def normalize_props(hash)
|
|
132
|
+
allowed_props = property_names
|
|
133
|
+
normalized_allowed = allowed_props.to_set
|
|
134
|
+
|
|
110
135
|
hash.each_with_object({}) do |(k, v), result|
|
|
111
136
|
key = k.to_s
|
|
112
137
|
mapped_key = key
|
|
138
|
+
if strict_schema_enforced?(allowed_props) &&
|
|
139
|
+
!mapped_key.start_with?("_") &&
|
|
140
|
+
!mapped_key.start_with?("on_") &&
|
|
141
|
+
!normalized_allowed.include?(mapped_key)
|
|
142
|
+
raise ArgumentError, "Unknown attribute `#{mapped_key}` for control type `#{type}`"
|
|
143
|
+
end
|
|
144
|
+
|
|
113
145
|
value =
|
|
114
146
|
if v.is_a?(Symbol)
|
|
115
147
|
v.to_s
|
|
@@ -164,5 +196,86 @@ module Ruflet
|
|
|
164
196
|
def normalized_event_name(event_name)
|
|
165
197
|
event_name.to_s.sub(/\Aon_/, "")
|
|
166
198
|
end
|
|
199
|
+
|
|
200
|
+
def validate_event_name!(event_name)
|
|
201
|
+
events = event_names
|
|
202
|
+
return if events.empty? || events.include?(event_name)
|
|
203
|
+
|
|
204
|
+
raise ArgumentError, "Unknown event `on_#{event_name}` for control type `#{type}`"
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def strict_schema_enforced?(allowed_props)
|
|
208
|
+
!allowed_props.empty?
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def property_names
|
|
212
|
+
constructor_keywords_for_schema_class
|
|
213
|
+
.reject { |name| name.to_s.start_with?("on_") }
|
|
214
|
+
.map(&:to_s)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
def event_names
|
|
218
|
+
constructor_keywords_for_schema_class
|
|
219
|
+
.select { |name| name.to_s.start_with?("on_") }
|
|
220
|
+
.map { |name| name.to_s.sub(/\Aon_/, "") }
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
def schema_wire_type_for_class
|
|
224
|
+
return nil unless self.class.const_defined?(:WIRE)
|
|
225
|
+
|
|
226
|
+
self.class::WIRE.to_s
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def schema_class_for_validation
|
|
230
|
+
if self.class != Ruflet::Control && has_explicit_initialize_keywords?(self.class)
|
|
231
|
+
return self.class
|
|
232
|
+
end
|
|
233
|
+
begin
|
|
234
|
+
require_relative "ui/control_factory"
|
|
235
|
+
mapped = UI::ControlFactory::CLASS_MAP[type]
|
|
236
|
+
return mapped if mapped && has_explicit_initialize_keywords?(mapped)
|
|
237
|
+
rescue LoadError
|
|
238
|
+
nil
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
begin
|
|
242
|
+
require_relative "ui/controls/ruflet_controls"
|
|
243
|
+
mapped = UI::Controls::RufletControls::CLASS_MAP[type]
|
|
244
|
+
return mapped if mapped && has_explicit_initialize_keywords?(mapped)
|
|
245
|
+
rescue LoadError
|
|
246
|
+
nil
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
nil
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def constructor_keywords_for_schema_class
|
|
253
|
+
schema_class = schema_class_for_validation
|
|
254
|
+
return [] unless schema_class
|
|
255
|
+
|
|
256
|
+
schema_class.instance_method(:initialize).parameters
|
|
257
|
+
.select { |kind, _| kind == :key || kind == :keyreq }
|
|
258
|
+
.map { |_, name| name }
|
|
259
|
+
.reject { |name| name == :id }
|
|
260
|
+
rescue StandardError
|
|
261
|
+
[]
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def has_explicit_initialize_keywords?(klass)
|
|
265
|
+
params = klass.instance_method(:initialize).parameters
|
|
266
|
+
params.any? { |kind, _| kind == :key || kind == :keyreq }
|
|
267
|
+
rescue StandardError
|
|
268
|
+
false
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
def type_map
|
|
272
|
+
require_relative "ui/control_registry"
|
|
273
|
+
UI::ControlRegistry::TYPE_MAP
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def event_props
|
|
277
|
+
require_relative "ui/control_registry"
|
|
278
|
+
UI::ControlRegistry::EVENT_PROPS
|
|
279
|
+
end
|
|
167
280
|
end
|
|
168
281
|
end
|
data/lib/ruflet_ui/ruflet/dsl.rb
CHANGED
|
@@ -16,15 +16,27 @@ module Ruflet
|
|
|
16
16
|
|
|
17
17
|
module_function
|
|
18
18
|
|
|
19
|
+
def default_host
|
|
20
|
+
ENV["RUFLET_HOST"].to_s.strip.empty? ? "0.0.0.0" : ENV["RUFLET_HOST"].to_s
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def default_port
|
|
24
|
+
raw = ENV["RUFLET_PORT"].to_s
|
|
25
|
+
value = raw.to_i
|
|
26
|
+
value > 0 ? value : 8550
|
|
27
|
+
end
|
|
28
|
+
|
|
19
29
|
def _pending_app
|
|
20
|
-
@_pending_app ||= App.new(host:
|
|
30
|
+
@_pending_app ||= App.new(host: default_host, port: default_port)
|
|
21
31
|
end
|
|
22
32
|
|
|
23
33
|
def _reset_pending_app!
|
|
24
|
-
@_pending_app = App.new(host:
|
|
34
|
+
@_pending_app = App.new(host: default_host, port: default_port)
|
|
25
35
|
end
|
|
26
36
|
|
|
27
|
-
def app(host:
|
|
37
|
+
def app(host: nil, port: nil, &block)
|
|
38
|
+
host ||= default_host
|
|
39
|
+
port ||= default_port
|
|
28
40
|
return App.new(host: host, port: port).tap { |a| a.instance_eval(&block) } if block
|
|
29
41
|
|
|
30
42
|
pending = _pending_app
|
|
@@ -36,6 +48,7 @@ module Ruflet
|
|
|
36
48
|
def page(**props, &block) = _pending_app.page(**props, &block)
|
|
37
49
|
def control(type, **props, &block) = _pending_app.control(type, **props, &block)
|
|
38
50
|
def widget(type, **props, &block) = _pending_app.widget(type, **props, &block)
|
|
51
|
+
def service(type, **props, &block) = _pending_app.service(type, **props, &block)
|
|
39
52
|
def column(**props, &block) = _pending_app.column(**props, &block)
|
|
40
53
|
def center(**props, &block) = _pending_app.center(**props, &block)
|
|
41
54
|
def row(**props, &block) = _pending_app.row(**props, &block)
|
|
@@ -51,7 +64,6 @@ module Ruflet
|
|
|
51
64
|
def text(value = nil, **props) = _pending_app.text(value, **props)
|
|
52
65
|
def button(**props) = _pending_app.button(**props)
|
|
53
66
|
def elevated_button(**props) = _pending_app.elevated_button(**props)
|
|
54
|
-
def elevatedbutton(**props) = _pending_app.elevatedbutton(**props)
|
|
55
67
|
def text_field(**props) = _pending_app.text_field(**props)
|
|
56
68
|
def textfield(**props) = _pending_app.textfield(**props)
|
|
57
69
|
def icon(**props) = _pending_app.icon(**props)
|
|
@@ -88,6 +100,46 @@ module Ruflet
|
|
|
88
100
|
def navigationbar(**props, &block) = _pending_app.navigationbar(**props, &block)
|
|
89
101
|
def navigation_bar_destination(**props, &block) = _pending_app.navigation_bar_destination(**props, &block)
|
|
90
102
|
def navigationbardestination(**props, &block) = _pending_app.navigationbardestination(**props, &block)
|
|
103
|
+
def bar_chart(**props) = _pending_app.bar_chart(**props)
|
|
104
|
+
def barchart(**props) = _pending_app.barchart(**props)
|
|
105
|
+
def bar_chart_group(**props) = _pending_app.bar_chart_group(**props)
|
|
106
|
+
def barchartgroup(**props) = _pending_app.barchartgroup(**props)
|
|
107
|
+
def bar_chart_rod(**props) = _pending_app.bar_chart_rod(**props)
|
|
108
|
+
def barchartrod(**props) = _pending_app.barchartrod(**props)
|
|
109
|
+
def bar_chart_rod_stack_item(**props) = _pending_app.bar_chart_rod_stack_item(**props)
|
|
110
|
+
def barchartrodstackitem(**props) = _pending_app.barchartrodstackitem(**props)
|
|
111
|
+
def line_chart(**props) = _pending_app.line_chart(**props)
|
|
112
|
+
def linechart(**props) = _pending_app.linechart(**props)
|
|
113
|
+
def line_chart_data(**props) = _pending_app.line_chart_data(**props)
|
|
114
|
+
def linechartdata(**props) = _pending_app.linechartdata(**props)
|
|
115
|
+
def line_chart_data_point(**props) = _pending_app.line_chart_data_point(**props)
|
|
116
|
+
def linechartdatapoint(**props) = _pending_app.linechartdatapoint(**props)
|
|
117
|
+
def pie_chart(**props) = _pending_app.pie_chart(**props)
|
|
118
|
+
def piechart(**props) = _pending_app.piechart(**props)
|
|
119
|
+
def pie_chart_section(**props) = _pending_app.pie_chart_section(**props)
|
|
120
|
+
def piechartsection(**props) = _pending_app.piechartsection(**props)
|
|
121
|
+
def candlestick_chart(**props) = _pending_app.candlestick_chart(**props)
|
|
122
|
+
def candlestickchart(**props) = _pending_app.candlestickchart(**props)
|
|
123
|
+
def candlestick_chart_spot(**props) = _pending_app.candlestick_chart_spot(**props)
|
|
124
|
+
def candlestickchartspot(**props) = _pending_app.candlestickchartspot(**props)
|
|
125
|
+
def radar_chart(**props) = _pending_app.radar_chart(**props)
|
|
126
|
+
def radarchart(**props) = _pending_app.radarchart(**props)
|
|
127
|
+
def radar_chart_title(**props) = _pending_app.radar_chart_title(**props)
|
|
128
|
+
def radarcharttitle(**props) = _pending_app.radarcharttitle(**props)
|
|
129
|
+
def radar_data_set(**props) = _pending_app.radar_data_set(**props)
|
|
130
|
+
def radardataset(**props) = _pending_app.radardataset(**props)
|
|
131
|
+
def radar_data_set_entry(**props) = _pending_app.radar_data_set_entry(**props)
|
|
132
|
+
def radardatasetentry(**props) = _pending_app.radardatasetentry(**props)
|
|
133
|
+
def scatter_chart(**props) = _pending_app.scatter_chart(**props)
|
|
134
|
+
def scatterchart(**props) = _pending_app.scatterchart(**props)
|
|
135
|
+
def scatter_chart_spot(**props) = _pending_app.scatter_chart_spot(**props)
|
|
136
|
+
def scatterchartspot(**props) = _pending_app.scatterchartspot(**props)
|
|
137
|
+
def chart_axis(**props) = _pending_app.chart_axis(**props)
|
|
138
|
+
def chartaxis(**props) = _pending_app.chartaxis(**props)
|
|
139
|
+
def chart_axis_label(**props) = _pending_app.chart_axis_label(**props)
|
|
140
|
+
def chartaxislabel(**props) = _pending_app.chartaxislabel(**props)
|
|
141
|
+
def web_view(**props) = _pending_app.web_view(**props)
|
|
142
|
+
def webview(**props) = _pending_app.webview(**props)
|
|
91
143
|
def fab(content = nil, **props) = _pending_app.fab(content, **props)
|
|
92
144
|
def cupertino_button(**props) = _pending_app.cupertino_button(**props)
|
|
93
145
|
def cupertinobutton(**props) = _pending_app.cupertinobutton(**props)
|
|
@@ -118,6 +170,7 @@ module Ruflet
|
|
|
118
170
|
@host = host
|
|
119
171
|
@port = port
|
|
120
172
|
@roots = []
|
|
173
|
+
@services = []
|
|
121
174
|
@stack = []
|
|
122
175
|
@page_props = { "route" => "/" }
|
|
123
176
|
@seq = 0
|
|
@@ -159,16 +212,26 @@ module Ruflet
|
|
|
159
212
|
c
|
|
160
213
|
end
|
|
161
214
|
|
|
215
|
+
def service(type, **props, &block)
|
|
216
|
+
mapped_props = props.dup
|
|
217
|
+
id = mapped_props.delete(:id)&.to_s || next_id(type)
|
|
218
|
+
svc = Ruflet::UI::ControlFactory.build(type.to_s, id: id, **normalize_props(mapped_props))
|
|
219
|
+
@services << svc unless @services.include?(svc)
|
|
220
|
+
svc
|
|
221
|
+
end
|
|
222
|
+
|
|
162
223
|
def duration(**parts)
|
|
163
224
|
DSL.duration(**parts)
|
|
164
225
|
end
|
|
165
226
|
|
|
166
227
|
def run
|
|
167
228
|
app_roots = @roots
|
|
229
|
+
app_services = @services
|
|
168
230
|
page_props = @page_props.dup
|
|
169
231
|
|
|
170
232
|
Ruflet::Server.new(host: host, port: port) do |runtime_page|
|
|
171
233
|
runtime_page.set_view_props(page_props)
|
|
234
|
+
runtime_page.add_service(*app_services) if app_services.any?
|
|
172
235
|
runtime_page.add(*app_roots)
|
|
173
236
|
end.start
|
|
174
237
|
end
|
|
@@ -176,6 +239,7 @@ module Ruflet
|
|
|
176
239
|
private
|
|
177
240
|
|
|
178
241
|
def build_widget(type, **props, &block) = control(type.to_s, **props, &block)
|
|
242
|
+
def build_service(type, **props, &block) = service(type.to_s, **props, &block)
|
|
179
243
|
|
|
180
244
|
def attach(control)
|
|
181
245
|
if @stack.empty?
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "json"
|
|
4
|
+
require_relative "events/gesture_events"
|
|
4
5
|
|
|
5
6
|
module Ruflet
|
|
6
7
|
class Event
|
|
7
|
-
attr_reader :name, :target, :raw_data, :data, :page, :control
|
|
8
|
+
attr_reader :name, :target, :raw_data, :data, :typed_data, :page, :control
|
|
8
9
|
|
|
9
10
|
def initialize(name:, target:, raw_data:, page:, control:)
|
|
10
11
|
@name = name
|
|
11
12
|
@target = target
|
|
12
13
|
@raw_data = raw_data
|
|
13
14
|
@data = parse_data(raw_data)
|
|
15
|
+
@typed_data = Events::GestureEventFactory.build(name, @data)
|
|
14
16
|
@page = page
|
|
15
17
|
@control = control
|
|
16
18
|
end
|
|
@@ -24,5 +26,17 @@ module Ruflet
|
|
|
24
26
|
rescue JSON::ParserError
|
|
25
27
|
raw
|
|
26
28
|
end
|
|
29
|
+
|
|
30
|
+
public
|
|
31
|
+
|
|
32
|
+
def method_missing(name, *args, &block)
|
|
33
|
+
return typed_data.public_send(name, *args, &block) if typed_data && typed_data.respond_to?(name)
|
|
34
|
+
|
|
35
|
+
super
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def respond_to_missing?(name, include_private = false)
|
|
39
|
+
(typed_data && typed_data.respond_to?(name, include_private)) || super
|
|
40
|
+
end
|
|
27
41
|
end
|
|
28
42
|
end
|