ruflet_core 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruflet/version.rb +1 -1
- data/lib/ruflet_core.rb +9 -7
- data/lib/ruflet_protocol/ruflet/protocol.rb +28 -54
- data/lib/ruflet_ui/ruflet/app.rb +1 -1
- data/lib/ruflet_ui/ruflet/colors.rb +4 -50
- data/lib/ruflet_ui/ruflet/control.rb +69 -64
- data/lib/ruflet_ui/ruflet/dsl.rb +10 -3
- data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/icons/icon_constant_names.rb +29 -0
- data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/page.rb +313 -523
- data/lib/ruflet_ui/ruflet/ui/control_factory.rb +68 -12
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +13 -6
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +45 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +43 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +0 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +56 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +53 -8
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +54 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +47 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +52 -10
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +52 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +49 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +50 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +46 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +61 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +145 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +47 -12
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb +8 -40
- data/lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb +16 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/badge_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/banner_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomappbar_control.rb +8 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomsheet_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/button_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/card_control.rb +8 -50
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb +7 -81
- data/lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb +7 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb +9 -65
- data/lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb +7 -88
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb +9 -55
- data/lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb +8 -58
- data/lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdown_control.rb +8 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +9 -103
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownoption_control.rb +0 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanel_control.rb +7 -51
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanellist_control.rb +46 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansiontile_control.rb +69 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/fillediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonalbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonaliconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb +7 -69
- data/lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb +8 -68
- data/lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb +8 -74
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +99 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb +7 -59
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawer_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationrail_control.rb +7 -73
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinedbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenubutton_control.rb +8 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenuitem_control.rb +0 -6
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressbar_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressring_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/radio_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb +7 -62
- data/lib/ruflet_ui/ruflet/ui/controls/materials/reorderablelistview_control.rb +9 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +5 -26
- data/lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb +80 -11
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segmentedbutton_control.rb +7 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/slider_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb +37 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbaraction_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_control.rb +25 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb +52 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/switch_control.rb +9 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbar_control.rb +8 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbarview_control.rb +43 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabs_control.rb +7 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textfield_control.rb +9 -132
- data/lib/ruflet_ui/ruflet/ui/controls/materials/timepicker_control.rb +10 -34
- data/lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +3 -4
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +13 -28
- data/lib/ruflet_ui/ruflet/ui/controls/shared/animatedswitcher_control.rb +46 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/arc_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +1 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/canvas_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/circle_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/column_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dismissible_control.rb +52 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/draggable_control.rb +1 -7
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dragtarget_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/shared/fletapp_control.rb +9 -46
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gesturedetector_control.rb +9 -113
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gridview_control.rb +57 -13
- data/lib/ruflet_ui/ruflet/ui/controls/shared/hero_control.rb +9 -40
- data/lib/ruflet_ui/ruflet/ui/controls/shared/icon_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/interactiveviewer_control.rb +9 -53
- data/lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/listview_control.rb +57 -11
- data/lib/ruflet_ui/ruflet/ui/controls/shared/markdown_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/oval_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb +9 -58
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pagelet_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pageview_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/path_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/placeholder_control.rb +44 -9
- data/lib/ruflet_ui/ruflet/ui/controls/shared/points_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rect_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb +43 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb +47 -15
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rotatedbox_control.rb +97 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/row_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_controls.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb +48 -4
- data/lib/ruflet_ui/ruflet/ui/{services/ruflet → controls/shared}/screenshot_control.rb +18 -2
- data/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb +65 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shadermask_control.rb +9 -41
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shimmer_control.rb +9 -44
- data/lib/ruflet_ui/ruflet/ui/controls/shared/stack_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb +9 -35
- data/lib/ruflet_ui/ruflet/ui/controls/shared/transparentpointer_control.rb +9 -38
- data/lib/ruflet_ui/ruflet/ui/controls/shared/view_control.rb +63 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/window_control.rb +40 -66
- data/lib/ruflet_ui/ruflet/ui/controls/shared/windowdragarea_control.rb +45 -4
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +62 -18
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/accelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/audio_recorder_control.rb +14 -36
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/barometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/clipboard_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/connectivity_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/filepicker_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/flashlight_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/geolocator_control.rb +14 -30
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/gyroscope_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/hapticfeedback_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/magnetometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/permissionhandler_control.rb +5 -20
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/screenbrightness_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/securestorage_control.rb +22 -49
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb +20 -15
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/shakedetector_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/share_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/sharedpreferences_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/storagepaths_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/urllauncher_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/useraccelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/wakelock_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +25 -2
- data/lib/ruflet_ui.rb +12 -10
- metadata +7 -8
- data/lib/ruflet_ui/ruflet/types/animation.rb +0 -110
- data/lib/ruflet_ui/ruflet/ui/controls/materials/codeeditor_control.rb +0 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_controls.rb +0 -311
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rive_control.rb +0 -87
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_controls.rb +0 -109
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/tester_control.rb +0 -126
|
@@ -15,14 +15,12 @@ require_relative "ruflet/hapticfeedback_control"
|
|
|
15
15
|
require_relative "ruflet/magnetometer_control"
|
|
16
16
|
require_relative "ruflet/permissionhandler_control"
|
|
17
17
|
require_relative "ruflet/screenbrightness_control"
|
|
18
|
-
require_relative "ruflet/screenshot_control"
|
|
19
18
|
require_relative "ruflet/securestorage_control"
|
|
20
19
|
require_relative "ruflet/semanticsservice_control"
|
|
21
20
|
require_relative "ruflet/shakedetector_control"
|
|
22
21
|
require_relative "ruflet/share_control"
|
|
23
22
|
require_relative "ruflet/sharedpreferences_control"
|
|
24
23
|
require_relative "ruflet/storagepaths_control"
|
|
25
|
-
require_relative "ruflet/tester_control"
|
|
26
24
|
require_relative "ruflet/urllauncher_control"
|
|
27
25
|
require_relative "ruflet/useraccelerometer_control"
|
|
28
26
|
require_relative "ruflet/wakelock_control"
|
|
@@ -39,8 +37,6 @@ module Ruflet
|
|
|
39
37
|
"audiorecorder" => RufletServicesComponents::AudioRecorderControl,
|
|
40
38
|
"barometer" => RufletServicesComponents::BarometerControl,
|
|
41
39
|
"battery" => RufletServicesComponents::BatteryControl,
|
|
42
|
-
"browser_context_menu" => Ruflet::UI::Controls::RufletComponents::BrowserContextMenuControl,
|
|
43
|
-
"browsercontextmenu" => Ruflet::UI::Controls::RufletComponents::BrowserContextMenuControl,
|
|
44
40
|
"camera" => RufletServicesComponents::CameraControl,
|
|
45
41
|
"clipboard" => RufletServicesComponents::ClipboardControl,
|
|
46
42
|
"connectivity" => RufletServicesComponents::ConnectivityControl,
|
|
@@ -56,7 +52,6 @@ module Ruflet
|
|
|
56
52
|
"permissionhandler" => RufletServicesComponents::PermissionHandlerControl,
|
|
57
53
|
"screen_brightness" => RufletServicesComponents::ScreenBrightnessControl,
|
|
58
54
|
"screenbrightness" => RufletServicesComponents::ScreenBrightnessControl,
|
|
59
|
-
"screenshot" => RufletServicesComponents::ScreenshotControl,
|
|
60
55
|
"secure_storage" => RufletServicesComponents::SecureStorageControl,
|
|
61
56
|
"securestorage" => RufletServicesComponents::SecureStorageControl,
|
|
62
57
|
"semantics_service" => RufletServicesComponents::SemanticsServiceControl,
|
|
@@ -68,13 +63,11 @@ module Ruflet
|
|
|
68
63
|
"sharedpreferences" => RufletServicesComponents::SharedPreferencesControl,
|
|
69
64
|
"storage_paths" => RufletServicesComponents::StoragePathsControl,
|
|
70
65
|
"storagepaths" => RufletServicesComponents::StoragePathsControl,
|
|
71
|
-
"tester" => RufletServicesComponents::TesterControl,
|
|
72
66
|
"url_launcher" => RufletServicesComponents::UrlLauncherControl,
|
|
73
67
|
"urllauncher" => RufletServicesComponents::UrlLauncherControl,
|
|
74
68
|
"user_accelerometer" => RufletServicesComponents::UserAccelerometerControl,
|
|
75
69
|
"useraccelerometer" => RufletServicesComponents::UserAccelerometerControl,
|
|
76
70
|
"wakelock" => RufletServicesComponents::WakelockControl,
|
|
77
|
-
"window" => Ruflet::UI::Controls::RufletComponents::WindowControl,
|
|
78
71
|
}.freeze
|
|
79
72
|
end
|
|
80
73
|
end
|
|
@@ -6,7 +6,11 @@ module Ruflet
|
|
|
6
6
|
def control(type, **props, &block) = control_delegate.control(type, **props, &block)
|
|
7
7
|
def widget(type, **props, &block) = control_delegate.widget(type, **props, &block)
|
|
8
8
|
def service(type, **props, &block) = control_delegate.service(type, **props, &block)
|
|
9
|
-
def view(children = nil, **props, &block)
|
|
9
|
+
def view(children = nil, **props, &block)
|
|
10
|
+
mapped = props.dup
|
|
11
|
+
mapped[:controls] = children unless children.nil?
|
|
12
|
+
control_delegate.control(:view, **mapped, &block)
|
|
13
|
+
end
|
|
10
14
|
def column(children = nil, **props, &block) = control_delegate.column(children, **props, &block)
|
|
11
15
|
def center(**props, &block) = control_delegate.center(**props, &block)
|
|
12
16
|
def row(children = nil, **props, &block) = control_delegate.row(children, **props, &block)
|
|
@@ -134,6 +138,7 @@ module Ruflet
|
|
|
134
138
|
def pageview(children = nil, **props) = control_delegate.pageview(children, **props)
|
|
135
139
|
def progress_ring(**props) = control_delegate.progress_ring(**props)
|
|
136
140
|
def progressring(**props) = control_delegate.progressring(**props)
|
|
141
|
+
def spinkit(**props) = control_delegate.spinkit(**props)
|
|
137
142
|
def range_slider(**props) = control_delegate.range_slider(**props)
|
|
138
143
|
def rangeslider(**props) = control_delegate.rangeslider(**props)
|
|
139
144
|
def responsive_row(children = nil, **props, &block) = control_delegate.responsive_row(children, **props, &block)
|
|
@@ -191,6 +196,9 @@ module Ruflet
|
|
|
191
196
|
def slider(**props) = control_delegate.slider(**props)
|
|
192
197
|
def transparent_pointer(content = nil, **props) = control_delegate.transparent_pointer(content, **props)
|
|
193
198
|
def transparentpointer(content = nil, **props) = control_delegate.transparentpointer(content, **props)
|
|
199
|
+
def rotated_box(content = nil, **props) = control_delegate.rotated_box(content, **props)
|
|
200
|
+
def rotatedbox(content = nil, **props) = control_delegate.rotatedbox(content, **props)
|
|
201
|
+
def screenshot(content = nil, **props) = control_delegate.screenshot(content, **props)
|
|
194
202
|
def radio(**props) = control_delegate.radio(**props)
|
|
195
203
|
def radio_group(content = nil, **props) = control_delegate.radio_group(content, **props)
|
|
196
204
|
def radiogroup(content = nil, **props) = control_delegate.radiogroup(content, **props)
|
|
@@ -198,6 +206,8 @@ module Ruflet
|
|
|
198
206
|
def alertdialog(**props) = control_delegate.alertdialog(**props)
|
|
199
207
|
def snack_bar(content = nil, **props) = control_delegate.snack_bar(content, **props)
|
|
200
208
|
def snackbar(content = nil, **props) = control_delegate.snackbar(content, **props)
|
|
209
|
+
def snack_bar_action(label = nil, **props) = control_delegate.snack_bar_action(label, **props)
|
|
210
|
+
def snackbaraction(label = nil, **props) = control_delegate.snackbaraction(label, **props)
|
|
201
211
|
def bottom_sheet(content = nil, **props) = control_delegate.bottom_sheet(content, **props)
|
|
202
212
|
def bottomsheet(content = nil, **props) = control_delegate.bottomsheet(content, **props)
|
|
203
213
|
def markdown(value = nil, **props) = control_delegate.markdown(value, **props)
|
|
@@ -270,7 +280,6 @@ module Ruflet
|
|
|
270
280
|
def web_view(**props) = control_delegate.web_view(**props)
|
|
271
281
|
def webview(**props) = control_delegate.webview(**props)
|
|
272
282
|
def video(**props) = control_delegate.video(**props)
|
|
273
|
-
def spinkit(**variant) = control_delegate.spinkit(**variant)
|
|
274
283
|
def code_editor(value = nil, **props) = control_delegate.code_editor(value, **props)
|
|
275
284
|
def codeeditor(value = nil, **props) = control_delegate.codeeditor(value, **props)
|
|
276
285
|
def rive(src = nil, **props) = control_delegate.rive(src, **props)
|
|
@@ -324,6 +333,20 @@ module Ruflet
|
|
|
324
333
|
def cupertinoslidingsegmentedbutton(children = nil, **props) = control_delegate.cupertinoslidingsegmentedbutton(children, **props)
|
|
325
334
|
def duration(**parts) = control_delegate.duration(**parts)
|
|
326
335
|
|
|
336
|
+
# Client extensions are open-ended and cannot all be generated into this
|
|
337
|
+
# module. Unknown widget-style helpers with properties are forwarded as
|
|
338
|
+
# generic controls, allowing locally installed extensions to participate
|
|
339
|
+
# in the same Ruby DSL without VM or application-specific methods.
|
|
340
|
+
def method_missing(name, *args, **props, &block)
|
|
341
|
+
return super if name.to_s.end_with?("=") || (args.empty? && props.empty? && !block)
|
|
342
|
+
|
|
343
|
+
forwarded = props.dup
|
|
344
|
+
forwarded[:value] = args.shift unless args.empty?
|
|
345
|
+
return super unless args.empty?
|
|
346
|
+
|
|
347
|
+
control_delegate.control(name.to_s, **forwarded, &block)
|
|
348
|
+
end
|
|
349
|
+
|
|
327
350
|
private
|
|
328
351
|
|
|
329
352
|
def control_delegate
|
data/lib/ruflet_ui.rb
CHANGED
|
@@ -5,7 +5,6 @@ require_relative "ruflet_ui/ruflet/colors"
|
|
|
5
5
|
require_relative "ruflet_ui/ruflet/icon_data"
|
|
6
6
|
require_relative "ruflet_ui/ruflet/icons/material/material_icons"
|
|
7
7
|
require_relative "ruflet_ui/ruflet/icons/cupertino/cupertino_icons"
|
|
8
|
-
require_relative "ruflet_ui/ruflet/types/animation"
|
|
9
8
|
require_relative "ruflet_ui/ruflet/types/text_style"
|
|
10
9
|
require_relative "ruflet_ui/ruflet/types/geometry"
|
|
11
10
|
require_relative "ruflet_ui/ruflet/control"
|
|
@@ -27,9 +26,6 @@ module Ruflet
|
|
|
27
26
|
TextDecorationStyle = UI::Types::TextDecorationStyle
|
|
28
27
|
Offset = UI::Types::Offset
|
|
29
28
|
Duration = UI::Types::Duration
|
|
30
|
-
Animation = UI::Types::Animation
|
|
31
|
-
AnimationStyle = UI::Types::AnimationStyle
|
|
32
|
-
AnimationCurve = UI::Types::AnimationCurve
|
|
33
29
|
|
|
34
30
|
module MainAxisAlignment
|
|
35
31
|
CENTER = "center"
|
|
@@ -140,7 +136,7 @@ module Ruflet
|
|
|
140
136
|
private
|
|
141
137
|
|
|
142
138
|
def control_delegate
|
|
143
|
-
Ruflet::
|
|
139
|
+
Ruflet::DSL
|
|
144
140
|
end
|
|
145
141
|
end
|
|
146
142
|
end
|
|
@@ -154,12 +150,18 @@ module Kernel
|
|
|
154
150
|
def app(**opts, &block) = Ruflet::DSL.app(**opts, &block)
|
|
155
151
|
def page(**props, &block) = Ruflet::DSL.page(**props, &block)
|
|
156
152
|
|
|
157
|
-
# Bare widget helpers (view, text, container, …) build real controls anywhere
|
|
158
|
-
# — top-level scripts and Ruflet.run blocks — with no builder to instantiate.
|
|
159
|
-
# The framework owns this plumbing so dev code stays free of it; a fresh
|
|
160
|
-
# builder per call keeps the helpers stateless.
|
|
161
153
|
def control_delegate
|
|
162
|
-
Ruflet::
|
|
154
|
+
Ruflet::DSL
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def method_missing(name, *args, **props, &block)
|
|
158
|
+
return super if name.to_s.end_with?("=") || (args.empty? && props.empty? && !block)
|
|
159
|
+
|
|
160
|
+
forwarded = props.dup
|
|
161
|
+
forwarded[:value] = args.shift unless args.empty?
|
|
162
|
+
return super unless args.empty?
|
|
163
|
+
|
|
164
|
+
Ruflet::DSL.control(name.to_s, **forwarded, &block)
|
|
163
165
|
end
|
|
164
166
|
|
|
165
167
|
if Ruflet::UI::SharedControlForwarders.respond_to?(:instance_methods)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruflet_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- AdamMusa
|
|
@@ -33,11 +33,11 @@ files:
|
|
|
33
33
|
- lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.json
|
|
34
34
|
- lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb
|
|
35
35
|
- lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb
|
|
36
|
+
- lib/ruflet_ui/ruflet/icons/icon_constant_names.rb
|
|
36
37
|
- lib/ruflet_ui/ruflet/icons/material/icons.json
|
|
37
38
|
- lib/ruflet_ui/ruflet/icons/material/material_icons.rb
|
|
38
39
|
- lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb
|
|
39
40
|
- lib/ruflet_ui/ruflet/page.rb
|
|
40
|
-
- lib/ruflet_ui/ruflet/types/animation.rb
|
|
41
41
|
- lib/ruflet_ui/ruflet/types/geometry.rb
|
|
42
42
|
- lib/ruflet_ui/ruflet/types/text_style.rb
|
|
43
43
|
- lib/ruflet_ui/ruflet/ui/control_factory.rb
|
|
@@ -83,7 +83,6 @@ files:
|
|
|
83
83
|
- lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb
|
|
84
84
|
- lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb
|
|
85
85
|
- lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb
|
|
86
|
-
- lib/ruflet_ui/ruflet/ui/controls/materials/codeeditor_control.rb
|
|
87
86
|
- lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb
|
|
88
87
|
- lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb
|
|
89
88
|
- lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb
|
|
@@ -106,7 +105,7 @@ files:
|
|
|
106
105
|
- lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb
|
|
107
106
|
- lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb
|
|
108
107
|
- lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb
|
|
109
|
-
- lib/ruflet_ui/ruflet/ui/controls/materials/
|
|
108
|
+
- lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb
|
|
110
109
|
- lib/ruflet_ui/ruflet/ui/controls/materials/menubar_control.rb
|
|
111
110
|
- lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb
|
|
112
111
|
- lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb
|
|
@@ -126,7 +125,6 @@ files:
|
|
|
126
125
|
- lib/ruflet_ui/ruflet/ui/controls/materials/radiogroup_control.rb
|
|
127
126
|
- lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb
|
|
128
127
|
- lib/ruflet_ui/ruflet/ui/controls/materials/reorderablelistview_control.rb
|
|
129
|
-
- lib/ruflet_ui/ruflet/ui/controls/materials/rive_control.rb
|
|
130
128
|
- lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb
|
|
131
129
|
- lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb
|
|
132
130
|
- lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb
|
|
@@ -134,7 +132,8 @@ files:
|
|
|
134
132
|
- lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb
|
|
135
133
|
- lib/ruflet_ui/ruflet/ui/controls/materials/slider_control.rb
|
|
136
134
|
- lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb
|
|
137
|
-
- lib/ruflet_ui/ruflet/ui/controls/materials/
|
|
135
|
+
- lib/ruflet_ui/ruflet/ui/controls/materials/snackbaraction_control.rb
|
|
136
|
+
- lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_control.rb
|
|
138
137
|
- lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb
|
|
139
138
|
- lib/ruflet_ui/ruflet/ui/controls/materials/switch_control.rb
|
|
140
139
|
- lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb
|
|
@@ -185,9 +184,11 @@ files:
|
|
|
185
184
|
- lib/ruflet_ui/ruflet/ui/controls/shared/rect_control.rb
|
|
186
185
|
- lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb
|
|
187
186
|
- lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb
|
|
187
|
+
- lib/ruflet_ui/ruflet/ui/controls/shared/rotatedbox_control.rb
|
|
188
188
|
- lib/ruflet_ui/ruflet/ui/controls/shared/row_control.rb
|
|
189
189
|
- lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_controls.rb
|
|
190
190
|
- lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb
|
|
191
|
+
- lib/ruflet_ui/ruflet/ui/controls/shared/screenshot_control.rb
|
|
191
192
|
- lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb
|
|
192
193
|
- lib/ruflet_ui/ruflet/ui/controls/shared/serviceregistry_control.rb
|
|
193
194
|
- lib/ruflet_ui/ruflet/ui/controls/shared/shadermask_control.rb
|
|
@@ -221,14 +222,12 @@ files:
|
|
|
221
222
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/magnetometer_control.rb
|
|
222
223
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/permissionhandler_control.rb
|
|
223
224
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/screenbrightness_control.rb
|
|
224
|
-
- lib/ruflet_ui/ruflet/ui/services/ruflet/screenshot_control.rb
|
|
225
225
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/securestorage_control.rb
|
|
226
226
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb
|
|
227
227
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/shakedetector_control.rb
|
|
228
228
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/share_control.rb
|
|
229
229
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/sharedpreferences_control.rb
|
|
230
230
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/storagepaths_control.rb
|
|
231
|
-
- lib/ruflet_ui/ruflet/ui/services/ruflet/tester_control.rb
|
|
232
231
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/urllauncher_control.rb
|
|
233
232
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/useraccelerometer_control.rb
|
|
234
233
|
- lib/ruflet_ui/ruflet/ui/services/ruflet/wakelock_control.rb
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Ruflet
|
|
4
|
-
module UI
|
|
5
|
-
module Types
|
|
6
|
-
module AnimationCurve
|
|
7
|
-
BOUNCE_IN = "bounceIn"
|
|
8
|
-
BOUNCE_IN_OUT = "bounceInOut"
|
|
9
|
-
BOUNCE_OUT = "bounceOut"
|
|
10
|
-
DECELERATE = "decelerate"
|
|
11
|
-
EASE = "ease"
|
|
12
|
-
EASE_IN = "easeIn"
|
|
13
|
-
EASE_IN_BACK = "easeInBack"
|
|
14
|
-
EASE_IN_CIRC = "easeInCirc"
|
|
15
|
-
EASE_IN_CUBIC = "easeInCubic"
|
|
16
|
-
EASE_IN_EXPO = "easeInExpo"
|
|
17
|
-
EASE_IN_OUT = "easeInOut"
|
|
18
|
-
EASE_IN_OUT_BACK = "easeInOutBack"
|
|
19
|
-
EASE_IN_OUT_CIRC = "easeInOutCirc"
|
|
20
|
-
EASE_IN_OUT_CUBIC = "easeInOutCubic"
|
|
21
|
-
EASE_IN_OUT_CUBIC_EMPHASIZED = "easeInOutCubicEmphasized"
|
|
22
|
-
EASE_IN_OUT_EXPO = "easeInOutExpo"
|
|
23
|
-
EASE_IN_OUT_QUAD = "easeInOutQuad"
|
|
24
|
-
EASE_IN_OUT_QUART = "easeInOutQuart"
|
|
25
|
-
EASE_IN_OUT_QUINT = "easeInOutQuint"
|
|
26
|
-
EASE_IN_OUT_SINE = "easeInOutSine"
|
|
27
|
-
EASE_IN_QUAD = "easeInQuad"
|
|
28
|
-
EASE_IN_QUART = "easeInQuart"
|
|
29
|
-
EASE_IN_QUINT = "easeInQuint"
|
|
30
|
-
EASE_IN_SINE = "easeInSine"
|
|
31
|
-
EASE_IN_TO_LINEAR = "easeInToLinear"
|
|
32
|
-
EASE_OUT = "easeOut"
|
|
33
|
-
EASE_OUT_BACK = "easeOutBack"
|
|
34
|
-
EASE_OUT_CIRC = "easeOutCirc"
|
|
35
|
-
EASE_OUT_CUBIC = "easeOutCubic"
|
|
36
|
-
EASE_OUT_EXPO = "easeOutExpo"
|
|
37
|
-
EASE_OUT_QUAD = "easeOutQuad"
|
|
38
|
-
EASE_OUT_QUART = "easeOutQuart"
|
|
39
|
-
EASE_OUT_QUINT = "easeOutQuint"
|
|
40
|
-
EASE_OUT_SINE = "easeOutSine"
|
|
41
|
-
ELASTIC_IN = "elasticIn"
|
|
42
|
-
ELASTIC_IN_OUT = "elasticInOut"
|
|
43
|
-
ELASTIC_OUT = "elasticOut"
|
|
44
|
-
FAST_LINEAR_TO_SLOW_EASE_IN = "fastLinearToSlowEaseIn"
|
|
45
|
-
FAST_OUT_SLOWIN = "fastOutSlowIn"
|
|
46
|
-
LINEAR = "linear"
|
|
47
|
-
LINEAR_TO_EASE_OUT = "linearToEaseOut"
|
|
48
|
-
SLOW_MIDDLE = "slowMiddle"
|
|
49
|
-
|
|
50
|
-
module_function
|
|
51
|
-
|
|
52
|
-
def values
|
|
53
|
-
constants(false).map { |name| const_get(name) }
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
class Animation
|
|
58
|
-
attr_reader :duration, :curve
|
|
59
|
-
|
|
60
|
-
def initialize(duration: nil, curve: AnimationCurve::LINEAR)
|
|
61
|
-
@duration = duration
|
|
62
|
-
@curve = curve
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def copy(duration: nil, curve: nil)
|
|
66
|
-
self.class.new(
|
|
67
|
-
duration: duration.nil? ? @duration : duration,
|
|
68
|
-
curve: curve.nil? ? @curve : curve
|
|
69
|
-
)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def to_h
|
|
73
|
-
{}.tap do |hash|
|
|
74
|
-
hash["duration"] = duration unless duration.nil?
|
|
75
|
-
hash["curve"] = curve unless curve.nil?
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
class AnimationStyle
|
|
81
|
-
attr_reader :duration, :reverse_duration, :curve, :reverse_curve
|
|
82
|
-
|
|
83
|
-
def initialize(duration: nil, reverse_duration: nil, curve: nil, reverse_curve: nil)
|
|
84
|
-
@duration = duration
|
|
85
|
-
@reverse_duration = reverse_duration
|
|
86
|
-
@curve = curve
|
|
87
|
-
@reverse_curve = reverse_curve
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def copy(duration: nil, reverse_duration: nil, curve: nil, reverse_curve: nil)
|
|
91
|
-
self.class.new(
|
|
92
|
-
duration: duration.nil? ? @duration : duration,
|
|
93
|
-
reverse_duration: reverse_duration.nil? ? @reverse_duration : reverse_duration,
|
|
94
|
-
curve: curve.nil? ? @curve : curve,
|
|
95
|
-
reverse_curve: reverse_curve.nil? ? @reverse_curve : reverse_curve
|
|
96
|
-
)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
def to_h
|
|
100
|
-
{}.tap do |hash|
|
|
101
|
-
hash["duration"] = duration unless duration.nil?
|
|
102
|
-
hash["reverse_duration"] = reverse_duration unless reverse_duration.nil?
|
|
103
|
-
hash["curve"] = curve unless curve.nil?
|
|
104
|
-
hash["reverse_curve"] = reverse_curve unless reverse_curve.nil?
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Ruflet
|
|
4
|
-
module UI
|
|
5
|
-
module Controls
|
|
6
|
-
module RufletComponents
|
|
7
|
-
# CodeEditor control — parity with Flet's CodeEditor extension
|
|
8
|
-
# (https://flet.dev/docs/controls/codeeditor/).
|
|
9
|
-
#
|
|
10
|
-
# Properties: value, language, code_theme, text_style, padding, selection,
|
|
11
|
-
# gutter_style, autocomplete, autocomplete_words, issues, read_only,
|
|
12
|
-
# autofocus, plus the usual layout props.
|
|
13
|
-
# Events: on_change, on_selection_change, on_focus, on_blur.
|
|
14
|
-
# Methods (invoked over the wire on a mounted control): focus, fold_at,
|
|
15
|
-
# fold_comment_at_line_zero, fold_imports.
|
|
16
|
-
#
|
|
17
|
-
# `language` accepts a highlight.js identifier (e.g. "python", "ruby",
|
|
18
|
-
# "javascript"); `code_theme` accepts a highlight.js theme name shared
|
|
19
|
-
# with Markdown (e.g. "atom-one-light", "atom-one-dark", "monokai-sublime").
|
|
20
|
-
class CodeEditorControl < Ruflet::Control
|
|
21
|
-
TYPE = "CodeEditor".freeze
|
|
22
|
-
WIRE = "CodeEditor".freeze
|
|
23
|
-
|
|
24
|
-
def initialize(id: nil, adaptive: nil, autocomplete: nil, autocomplete_words: nil,
|
|
25
|
-
autofocus: nil, badge: nil, code_theme: nil, col: nil, data: nil,
|
|
26
|
-
disabled: nil, expand: nil, expand_loose: nil, gutter_style: nil,
|
|
27
|
-
height: nil, issues: nil, key: nil, language: nil, opacity: nil,
|
|
28
|
-
padding: nil, read_only: nil, rtl: nil, selection: nil,
|
|
29
|
-
text_style: nil, tooltip: nil, value: nil, visible: nil, width: nil,
|
|
30
|
-
on_blur: nil, on_change: nil, on_focus: nil, on_selection_change: nil)
|
|
31
|
-
props = {}
|
|
32
|
-
props[:adaptive] = adaptive unless adaptive.nil?
|
|
33
|
-
props[:autocomplete] = autocomplete unless autocomplete.nil?
|
|
34
|
-
props[:autocomplete_words] = autocomplete_words unless autocomplete_words.nil?
|
|
35
|
-
props[:autofocus] = autofocus unless autofocus.nil?
|
|
36
|
-
props[:badge] = badge unless badge.nil?
|
|
37
|
-
props[:code_theme] = code_theme unless code_theme.nil?
|
|
38
|
-
props[:col] = col unless col.nil?
|
|
39
|
-
props[:data] = data unless data.nil?
|
|
40
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
41
|
-
props[:expand] = expand unless expand.nil?
|
|
42
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
43
|
-
props[:gutter_style] = gutter_style unless gutter_style.nil?
|
|
44
|
-
props[:height] = height unless height.nil?
|
|
45
|
-
props[:issues] = issues unless issues.nil?
|
|
46
|
-
props[:key] = key unless key.nil?
|
|
47
|
-
props[:language] = language unless language.nil?
|
|
48
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
49
|
-
props[:padding] = padding unless padding.nil?
|
|
50
|
-
props[:read_only] = read_only unless read_only.nil?
|
|
51
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
52
|
-
props[:selection] = selection unless selection.nil?
|
|
53
|
-
props[:text_style] = text_style unless text_style.nil?
|
|
54
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
55
|
-
props[:value] = value unless value.nil?
|
|
56
|
-
props[:visible] = visible unless visible.nil?
|
|
57
|
-
props[:width] = width unless width.nil?
|
|
58
|
-
props[:on_blur] = on_blur unless on_blur.nil?
|
|
59
|
-
props[:on_change] = on_change unless on_change.nil?
|
|
60
|
-
props[:on_focus] = on_focus unless on_focus.nil?
|
|
61
|
-
props[:on_selection_change] = on_selection_change unless on_selection_change.nil?
|
|
62
|
-
super(type: TYPE, id: id, **props)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
# Request focus for the editor.
|
|
66
|
-
def focus = invoke_editor_method("focus")
|
|
67
|
-
|
|
68
|
-
# Fold the code block that starts at the given line number.
|
|
69
|
-
def fold_at(line_number)
|
|
70
|
-
invoke_editor_method("fold_at", { "line_number" => line_number.to_i })
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
# Fold the comment block at line 0 (e.g. a license header).
|
|
74
|
-
def fold_comment_at_line_zero = invoke_editor_method("fold_comment_at_line_zero")
|
|
75
|
-
|
|
76
|
-
# Fold all import sections.
|
|
77
|
-
def fold_imports = invoke_editor_method("fold_imports")
|
|
78
|
-
|
|
79
|
-
private
|
|
80
|
-
|
|
81
|
-
def invoke_editor_method(name, args = nil, timeout: 10, on_result: nil)
|
|
82
|
-
page = runtime_page
|
|
83
|
-
unless page && wire_id
|
|
84
|
-
raise "CodeEditor ##{id} is not mounted yet — add it to the page before calling #{name}."
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
page.invoke(self, name, args: args, timeout: timeout, on_result: on_result)
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|