ruflet_core 0.0.21 → 0.0.23
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/dsl.rb +76 -0
- data/lib/ruflet_ui/ruflet/event.rb +3 -2
- data/lib/ruflet_ui/ruflet/events/gesture_events.rb +2 -1
- data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +46 -26
- data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +61 -26
- data/lib/ruflet_ui/ruflet/page.rb +242 -4
- data/lib/ruflet_ui/ruflet/ui/control_factory.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/control_methods.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +20 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoappbar_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobottomsheet_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ad_controls.rb +45 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/animation_extension_controls.rb +29 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +56 -279
- data/lib/ruflet_ui/ruflet/ui/controls/materials/code_editor_control.rb +42 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/color_picker_controls.rb +34 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable2_controls.rb +41 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +80 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +62 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +1 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +5 -30
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +60 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +17 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_app_control.rb +3 -3
- data/lib/ruflet_ui/ruflet/ui/controls/shared/serviceregistry_control.rb +5 -1
- data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +2 -0
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +110 -6
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +23 -8
- data/lib/ruflet_ui/ruflet/ui/platform_control_contracts.rb +392 -0
- data/lib/ruflet_ui/ruflet/ui/platform_control_methods.rb +35 -0
- data/lib/ruflet_ui/ruflet/ui/services/current_service_methods.rb +220 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +88 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +4 -0
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +75 -0
- data/lib/ruflet_ui.rb +6 -9
- metadata +9 -1
|
@@ -93,6 +93,86 @@ module Ruflet
|
|
|
93
93
|
end
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
|
+
|
|
97
|
+
class MapExtensionControl < Ruflet::Control
|
|
98
|
+
KEYWORDS = [].freeze
|
|
99
|
+
|
|
100
|
+
def initialize(type:, id: nil, **props)
|
|
101
|
+
compact = {}
|
|
102
|
+
props.each { |key, value| compact[key] = value unless value.nil? }
|
|
103
|
+
super(type: type, id: id, **compact)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class MapLayerControl < MapExtensionControl
|
|
108
|
+
WIRE = "MapLayer".freeze
|
|
109
|
+
def initialize(id: nil, **props) = super(type: "map_layer", id: id, **props)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class TileLayerControl < MapExtensionControl
|
|
113
|
+
WIRE = "TileLayer".freeze
|
|
114
|
+
def initialize(id: nil, **props) = super(type: "tile_layer", id: id, **props)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
class MarkerControl < MapExtensionControl
|
|
118
|
+
WIRE = "Marker".freeze
|
|
119
|
+
def initialize(id: nil, **props) = super(type: "marker", id: id, **props)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
class MarkerLayerControl < MapExtensionControl
|
|
123
|
+
WIRE = "MarkerLayer".freeze
|
|
124
|
+
def initialize(id: nil, **props) = super(type: "marker_layer", id: id, **props)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
class CircleMarkerControl < MapExtensionControl
|
|
128
|
+
WIRE = "CircleMarker".freeze
|
|
129
|
+
def initialize(id: nil, **props) = super(type: "circle_marker", id: id, **props)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
class CircleLayerControl < MapExtensionControl
|
|
133
|
+
WIRE = "CircleLayer".freeze
|
|
134
|
+
def initialize(id: nil, **props) = super(type: "circle_layer", id: id, **props)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
class PolylineMarkerControl < MapExtensionControl
|
|
138
|
+
WIRE = "PolylineMarker".freeze
|
|
139
|
+
def initialize(id: nil, **props) = super(type: "polyline_marker", id: id, **props)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
class PolylineLayerControl < MapExtensionControl
|
|
143
|
+
WIRE = "PolylineLayer".freeze
|
|
144
|
+
def initialize(id: nil, **props) = super(type: "polyline_layer", id: id, **props)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
class PolygonMarkerControl < MapExtensionControl
|
|
148
|
+
WIRE = "PolygonMarker".freeze
|
|
149
|
+
def initialize(id: nil, **props) = super(type: "polygon_marker", id: id, **props)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
class PolygonLayerControl < MapExtensionControl
|
|
153
|
+
WIRE = "PolygonLayer".freeze
|
|
154
|
+
def initialize(id: nil, **props) = super(type: "polygon_layer", id: id, **props)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
class SimpleAttributionControl < MapExtensionControl
|
|
158
|
+
WIRE = "SimpleAttribution".freeze
|
|
159
|
+
def initialize(id: nil, **props) = super(type: "simple_attribution", id: id, **props)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
class RichAttributionControl < MapExtensionControl
|
|
163
|
+
WIRE = "RichAttribution".freeze
|
|
164
|
+
def initialize(id: nil, **props) = super(type: "rich_attribution", id: id, **props)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
class ImageSourceAttributionControl < MapExtensionControl
|
|
168
|
+
WIRE = "ImageSourceAttribution".freeze
|
|
169
|
+
def initialize(id: nil, **props) = super(type: "image_source_attribution", id: id, **props)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
class TextSourceAttributionControl < MapExtensionControl
|
|
173
|
+
WIRE = "TextSourceAttribution".freeze
|
|
174
|
+
def initialize(id: nil, **props) = super(type: "text_source_attribution", id: id, **props)
|
|
175
|
+
end
|
|
96
176
|
end
|
|
97
177
|
end
|
|
98
178
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "alertdialog_control"
|
|
4
|
+
require_relative "ad_controls"
|
|
5
|
+
require_relative "animation_extension_controls"
|
|
4
6
|
require_relative "audio_control"
|
|
5
7
|
require_relative "appbar_control"
|
|
6
8
|
require_relative "autocomplete_control"
|
|
@@ -15,12 +17,15 @@ require_relative "card_control"
|
|
|
15
17
|
require_relative "checkbox_control"
|
|
16
18
|
require_relative "chip_control"
|
|
17
19
|
require_relative "circleavatar_control"
|
|
20
|
+
require_relative "code_editor_control"
|
|
21
|
+
require_relative "color_picker_controls"
|
|
18
22
|
require_relative "container_control"
|
|
19
23
|
require_relative "contextmenu_control"
|
|
20
24
|
require_relative "datacell_control"
|
|
21
25
|
require_relative "datacolumn_control"
|
|
22
26
|
require_relative "datarow_control"
|
|
23
27
|
require_relative "datatable_control"
|
|
28
|
+
require_relative "datatable2_controls"
|
|
24
29
|
require_relative "datepicker_control"
|
|
25
30
|
require_relative "daterangepicker_control"
|
|
26
31
|
require_relative "divider_control"
|
|
@@ -37,6 +42,7 @@ require_relative "filledtonaliconbutton_control"
|
|
|
37
42
|
require_relative "floatingactionbutton_control"
|
|
38
43
|
require_relative "iconbutton_control"
|
|
39
44
|
require_relative "listtile_control"
|
|
45
|
+
require_relative "map_control"
|
|
40
46
|
require_relative "menubar_control"
|
|
41
47
|
require_relative "menuitembutton_control"
|
|
42
48
|
require_relative "navigationbar_control"
|
|
@@ -84,6 +90,8 @@ module Ruflet
|
|
|
84
90
|
module_function
|
|
85
91
|
|
|
86
92
|
CLASS_MAP = {
|
|
93
|
+
"banner_ad" => RufletComponents::BannerAdControl,
|
|
94
|
+
"bannerad" => RufletComponents::BannerAdControl,
|
|
87
95
|
"alert_dialog" => RufletComponents::AlertDialogControl,
|
|
88
96
|
"alertdialog" => RufletComponents::AlertDialogControl,
|
|
89
97
|
"audio" => RufletComponents::AudioControl,
|
|
@@ -121,6 +129,12 @@ module Ruflet
|
|
|
121
129
|
"chip" => RufletComponents::ChipControl,
|
|
122
130
|
"circle_avatar" => RufletComponents::CircleAvatarControl,
|
|
123
131
|
"circleavatar" => RufletComponents::CircleAvatarControl,
|
|
132
|
+
"code_editor" => RufletComponents::CodeEditorControl,
|
|
133
|
+
"codeeditor" => RufletComponents::CodeEditorControl,
|
|
134
|
+
"block_picker" => RufletComponents::BlockPickerControl,
|
|
135
|
+
"blockpicker" => RufletComponents::BlockPickerControl,
|
|
136
|
+
"color_picker" => RufletComponents::ColorPickerControl,
|
|
137
|
+
"colorpicker" => RufletComponents::ColorPickerControl,
|
|
124
138
|
"container" => RufletComponents::ContainerControl,
|
|
125
139
|
"context_menu" => RufletComponents::ContextMenuControl,
|
|
126
140
|
"contextmenu" => RufletComponents::ContextMenuControl,
|
|
@@ -128,6 +142,12 @@ module Ruflet
|
|
|
128
142
|
"data_column" => RufletComponents::DataColumnControl,
|
|
129
143
|
"data_row" => RufletComponents::DataRowControl,
|
|
130
144
|
"data_table" => RufletComponents::DataTableControl,
|
|
145
|
+
"data_column2" => RufletComponents::DataColumn2Control,
|
|
146
|
+
"datacolumn2" => RufletComponents::DataColumn2Control,
|
|
147
|
+
"data_row2" => RufletComponents::DataRow2Control,
|
|
148
|
+
"datarow2" => RufletComponents::DataRow2Control,
|
|
149
|
+
"data_table2" => RufletComponents::DataTable2Control,
|
|
150
|
+
"datatable2" => RufletComponents::DataTable2Control,
|
|
131
151
|
"datacell" => RufletComponents::DataCellControl,
|
|
132
152
|
"datacolumn" => RufletComponents::DataColumnControl,
|
|
133
153
|
"datarow" => RufletComponents::DataRowControl,
|
|
@@ -159,6 +179,11 @@ module Ruflet
|
|
|
159
179
|
"floating_action_button" => RufletComponents::FloatingActionButtonControl,
|
|
160
180
|
"floatingactionbutton" => RufletComponents::FloatingActionButtonControl,
|
|
161
181
|
"icon_button" => RufletComponents::IconButtonControl,
|
|
182
|
+
"hue_ring_picker" => RufletComponents::HueRingPickerControl,
|
|
183
|
+
"hueringpicker" => RufletComponents::HueRingPickerControl,
|
|
184
|
+
"interstitial_ad" => RufletComponents::InterstitialAdControl,
|
|
185
|
+
"interstitialad" => RufletComponents::InterstitialAdControl,
|
|
186
|
+
"lottie" => RufletComponents::LottieControl,
|
|
162
187
|
"iconbutton" => RufletComponents::IconButtonControl,
|
|
163
188
|
"line_chart" => RufletComponents::LineChartControl,
|
|
164
189
|
"line_chart_data" => RufletComponents::LineChartDataControl,
|
|
@@ -168,8 +193,40 @@ module Ruflet
|
|
|
168
193
|
"linechartdatapoint" => RufletComponents::LineChartDataPointControl,
|
|
169
194
|
"list_tile" => RufletComponents::ListTileControl,
|
|
170
195
|
"listtile" => RufletComponents::ListTileControl,
|
|
196
|
+
"map" => RufletComponents::MapControl,
|
|
197
|
+
"map_layer" => RufletComponents::MapLayerControl,
|
|
198
|
+
"maplayer" => RufletComponents::MapLayerControl,
|
|
199
|
+
"tile_layer" => RufletComponents::TileLayerControl,
|
|
200
|
+
"tilelayer" => RufletComponents::TileLayerControl,
|
|
201
|
+
"marker" => RufletComponents::MarkerControl,
|
|
202
|
+
"marker_layer" => RufletComponents::MarkerLayerControl,
|
|
203
|
+
"markerlayer" => RufletComponents::MarkerLayerControl,
|
|
204
|
+
"circle_marker" => RufletComponents::CircleMarkerControl,
|
|
205
|
+
"circlemarker" => RufletComponents::CircleMarkerControl,
|
|
206
|
+
"circle_layer" => RufletComponents::CircleLayerControl,
|
|
207
|
+
"circlelayer" => RufletComponents::CircleLayerControl,
|
|
208
|
+
"polyline_marker" => RufletComponents::PolylineMarkerControl,
|
|
209
|
+
"polylinemarker" => RufletComponents::PolylineMarkerControl,
|
|
210
|
+
"polyline_layer" => RufletComponents::PolylineLayerControl,
|
|
211
|
+
"polylinelayer" => RufletComponents::PolylineLayerControl,
|
|
212
|
+
"polygon_marker" => RufletComponents::PolygonMarkerControl,
|
|
213
|
+
"polygonmarker" => RufletComponents::PolygonMarkerControl,
|
|
214
|
+
"polygon_layer" => RufletComponents::PolygonLayerControl,
|
|
215
|
+
"polygonlayer" => RufletComponents::PolygonLayerControl,
|
|
216
|
+
"simple_attribution" => RufletComponents::SimpleAttributionControl,
|
|
217
|
+
"simpleattribution" => RufletComponents::SimpleAttributionControl,
|
|
218
|
+
"rich_attribution" => RufletComponents::RichAttributionControl,
|
|
219
|
+
"richattribution" => RufletComponents::RichAttributionControl,
|
|
220
|
+
"image_source_attribution" => RufletComponents::ImageSourceAttributionControl,
|
|
221
|
+
"imagesourceattribution" => RufletComponents::ImageSourceAttributionControl,
|
|
222
|
+
"text_source_attribution" => RufletComponents::TextSourceAttributionControl,
|
|
223
|
+
"textsourceattribution" => RufletComponents::TextSourceAttributionControl,
|
|
171
224
|
"menu_bar" => RufletComponents::MenuBarControl,
|
|
172
225
|
"menu_item_button" => RufletComponents::MenuItemButtonControl,
|
|
226
|
+
"material_picker" => RufletComponents::MaterialPickerControl,
|
|
227
|
+
"materialpicker" => RufletComponents::MaterialPickerControl,
|
|
228
|
+
"multiple_choice_block_picker" => RufletComponents::MultipleChoiceBlockPickerControl,
|
|
229
|
+
"multiplechoiceblockpicker" => RufletComponents::MultipleChoiceBlockPickerControl,
|
|
173
230
|
"menubar" => RufletComponents::MenuBarControl,
|
|
174
231
|
"menuitembutton" => RufletComponents::MenuItemButtonControl,
|
|
175
232
|
"navigation_bar" => RufletComponents::NavigationBarControl,
|
|
@@ -178,6 +235,8 @@ module Ruflet
|
|
|
178
235
|
"navigation_drawer_destination" => RufletComponents::NavigationDrawerDestinationControl,
|
|
179
236
|
"navigation_rail" => RufletComponents::NavigationRailControl,
|
|
180
237
|
"navigation_rail_destination" => RufletComponents::NavigationRailDestinationControl,
|
|
238
|
+
"native_ad" => RufletComponents::NativeAdControl,
|
|
239
|
+
"nativead" => RufletComponents::NativeAdControl,
|
|
181
240
|
"navigationbar" => RufletComponents::NavigationBarControl,
|
|
182
241
|
"navigationbardestination" => RufletComponents::NavigationBarDestinationControl,
|
|
183
242
|
"navigationdrawer" => RufletComponents::NavigationDrawerControl,
|
|
@@ -204,6 +263,7 @@ module Ruflet
|
|
|
204
263
|
"spinkit" => RufletComponents::SpinkitControl,
|
|
205
264
|
"radio" => RufletComponents::RadioControl,
|
|
206
265
|
"radio_group" => RufletComponents::RadioGroupControl,
|
|
266
|
+
"rive" => RufletComponents::RiveControl,
|
|
207
267
|
"radiogroup" => RufletComponents::RadioGroupControl,
|
|
208
268
|
"radar_chart" => RufletComponents::RadarChartControl,
|
|
209
269
|
"radar_chart_title" => RufletComponents::RadarChartTitleControl,
|
|
@@ -229,6 +289,8 @@ module Ruflet
|
|
|
229
289
|
"scatterchart" => RufletComponents::ScatterChartControl,
|
|
230
290
|
"scatterchartspot" => RufletComponents::ScatterChartSpotControl,
|
|
231
291
|
"slider" => RufletComponents::SliderControl,
|
|
292
|
+
"slide_picker" => RufletComponents::SlidePickerControl,
|
|
293
|
+
"slidepicker" => RufletComponents::SlidePickerControl,
|
|
232
294
|
"snack_bar" => RufletComponents::SnackBarControl,
|
|
233
295
|
"snack_bar_action" => RufletComponents::SnackBarActionControl,
|
|
234
296
|
"snackbaraction" => RufletComponents::SnackBarActionControl,
|
|
@@ -8,12 +8,11 @@ module Ruflet
|
|
|
8
8
|
TYPE = "video".freeze
|
|
9
9
|
WIRE = "Video".freeze
|
|
10
10
|
|
|
11
|
-
KEYWORDS = [
|
|
11
|
+
KEYWORDS = [].freeze
|
|
12
12
|
|
|
13
13
|
def initialize(id: nil, **props)
|
|
14
14
|
compact = {}
|
|
15
15
|
props.each do |key, value|
|
|
16
|
-
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
16
|
compact[key] = value unless value.nil?
|
|
18
17
|
end
|
|
19
18
|
super(type: TYPE, id: id, **compact)
|
|
@@ -23,37 +23,12 @@ module Ruflet
|
|
|
23
23
|
class WebViewControl < Ruflet::Control
|
|
24
24
|
TYPE = "WebView".freeze
|
|
25
25
|
WIRE = "WebView".freeze
|
|
26
|
+
KEYWORDS = [].freeze
|
|
26
27
|
|
|
27
|
-
def initialize(id: nil,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
on_progress: nil, on_url_change: nil, on_scroll: nil,
|
|
32
|
-
on_console_message: nil, on_javascript_alert_dialog: nil)
|
|
33
|
-
props = {}
|
|
34
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
35
|
-
props[:data] = data unless data.nil?
|
|
36
|
-
props[:enable_javascript] = enable_javascript unless enable_javascript.nil?
|
|
37
|
-
props[:expand] = expand unless expand.nil?
|
|
38
|
-
props[:height] = height unless height.nil?
|
|
39
|
-
props[:key] = key unless key.nil?
|
|
40
|
-
props[:method] = method unless method.nil?
|
|
41
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
42
|
-
props[:prevent_links] = prevent_links unless prevent_links.nil?
|
|
43
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
44
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
45
|
-
props[:url] = url unless url.nil?
|
|
46
|
-
props[:visible] = visible unless visible.nil?
|
|
47
|
-
props[:width] = width unless width.nil?
|
|
48
|
-
props[:on_page_ended] = on_page_ended unless on_page_ended.nil?
|
|
49
|
-
props[:on_page_started] = on_page_started unless on_page_started.nil?
|
|
50
|
-
props[:on_web_resource_error] = on_web_resource_error unless on_web_resource_error.nil?
|
|
51
|
-
props[:on_progress] = on_progress unless on_progress.nil?
|
|
52
|
-
props[:on_url_change] = on_url_change unless on_url_change.nil?
|
|
53
|
-
props[:on_scroll] = on_scroll unless on_scroll.nil?
|
|
54
|
-
props[:on_console_message] = on_console_message unless on_console_message.nil?
|
|
55
|
-
props[:on_javascript_alert_dialog] = on_javascript_alert_dialog unless on_javascript_alert_dialog.nil?
|
|
56
|
-
super(type: TYPE, id: id, **props)
|
|
28
|
+
def initialize(id: nil, **props)
|
|
29
|
+
compact = {}
|
|
30
|
+
props.each { |key, value| compact[key] = value unless value.nil? }
|
|
31
|
+
super(type: TYPE, id: id, **compact)
|
|
57
32
|
end
|
|
58
33
|
|
|
59
34
|
# --- Navigation --------------------------------------------------
|
|
@@ -25,6 +25,8 @@ require_relative "cupertinos/cupertinotextfield_control"
|
|
|
25
25
|
require_relative "cupertinos/cupertinotimerpicker_control"
|
|
26
26
|
require_relative "cupertinos/cupertinotintedbutton_control"
|
|
27
27
|
require_relative "materials/alertdialog_control"
|
|
28
|
+
require_relative "materials/ad_controls"
|
|
29
|
+
require_relative "materials/animation_extension_controls"
|
|
28
30
|
require_relative "materials/audio_control"
|
|
29
31
|
require_relative "materials/appbar_control"
|
|
30
32
|
require_relative "materials/autocomplete_control"
|
|
@@ -39,12 +41,15 @@ require_relative "materials/card_control"
|
|
|
39
41
|
require_relative "materials/checkbox_control"
|
|
40
42
|
require_relative "materials/chip_control"
|
|
41
43
|
require_relative "materials/circleavatar_control"
|
|
44
|
+
require_relative "materials/code_editor_control"
|
|
45
|
+
require_relative "materials/color_picker_controls"
|
|
42
46
|
require_relative "materials/container_control"
|
|
43
47
|
require_relative "materials/contextmenu_control"
|
|
44
48
|
require_relative "materials/datacell_control"
|
|
45
49
|
require_relative "materials/datacolumn_control"
|
|
46
50
|
require_relative "materials/datarow_control"
|
|
47
51
|
require_relative "materials/datatable_control"
|
|
52
|
+
require_relative "materials/datatable2_controls"
|
|
48
53
|
require_relative "materials/datepicker_control"
|
|
49
54
|
require_relative "materials/daterangepicker_control"
|
|
50
55
|
require_relative "materials/divider_control"
|
|
@@ -162,6 +167,8 @@ module Ruflet
|
|
|
162
167
|
module_function
|
|
163
168
|
|
|
164
169
|
CLASS_MAP = {
|
|
170
|
+
"banner_ad" => RufletComponents::BannerAdControl,
|
|
171
|
+
"bannerad" => RufletComponents::BannerAdControl,
|
|
165
172
|
"alert_dialog" => RufletComponents::AlertDialogControl,
|
|
166
173
|
"alertdialog" => RufletComponents::AlertDialogControl,
|
|
167
174
|
"audio" => RufletComponents::AudioControl,
|
|
@@ -210,6 +217,12 @@ module Ruflet
|
|
|
210
217
|
"circle" => RufletComponents::CircleControl,
|
|
211
218
|
"circle_avatar" => RufletComponents::CircleAvatarControl,
|
|
212
219
|
"circleavatar" => RufletComponents::CircleAvatarControl,
|
|
220
|
+
"code_editor" => RufletComponents::CodeEditorControl,
|
|
221
|
+
"codeeditor" => RufletComponents::CodeEditorControl,
|
|
222
|
+
"block_picker" => RufletComponents::BlockPickerControl,
|
|
223
|
+
"blockpicker" => RufletComponents::BlockPickerControl,
|
|
224
|
+
"color_picker" => RufletComponents::ColorPickerControl,
|
|
225
|
+
"colorpicker" => RufletComponents::ColorPickerControl,
|
|
213
226
|
"color" => RufletComponents::ColorControl,
|
|
214
227
|
"column" => RufletComponents::ColumnControl,
|
|
215
228
|
"container" => RufletComponents::ContainerControl,
|
|
@@ -267,6 +280,12 @@ module Ruflet
|
|
|
267
280
|
"data_column" => RufletComponents::DataColumnControl,
|
|
268
281
|
"data_row" => RufletComponents::DataRowControl,
|
|
269
282
|
"data_table" => RufletComponents::DataTableControl,
|
|
283
|
+
"data_column2" => RufletComponents::DataColumn2Control,
|
|
284
|
+
"datacolumn2" => RufletComponents::DataColumn2Control,
|
|
285
|
+
"data_row2" => RufletComponents::DataRow2Control,
|
|
286
|
+
"datarow2" => RufletComponents::DataRow2Control,
|
|
287
|
+
"data_table2" => RufletComponents::DataTable2Control,
|
|
288
|
+
"datatable2" => RufletComponents::DataTable2Control,
|
|
270
289
|
"datacell" => RufletComponents::DataCellControl,
|
|
271
290
|
"datacolumn" => RufletComponents::DataColumnControl,
|
|
272
291
|
"datarow" => RufletComponents::DataRowControl,
|
|
@@ -310,6 +329,11 @@ module Ruflet
|
|
|
310
329
|
"hero" => RufletComponents::HeroControl,
|
|
311
330
|
"icon" => RufletComponents::IconControl,
|
|
312
331
|
"icon_button" => RufletComponents::IconButtonControl,
|
|
332
|
+
"hue_ring_picker" => RufletComponents::HueRingPickerControl,
|
|
333
|
+
"hueringpicker" => RufletComponents::HueRingPickerControl,
|
|
334
|
+
"interstitial_ad" => RufletComponents::InterstitialAdControl,
|
|
335
|
+
"interstitialad" => RufletComponents::InterstitialAdControl,
|
|
336
|
+
"lottie" => RufletComponents::LottieControl,
|
|
313
337
|
"iconbutton" => RufletComponents::IconButtonControl,
|
|
314
338
|
"image" => RufletComponents::ImageControl,
|
|
315
339
|
"interactive_viewer" => RufletComponents::InteractiveViewerControl,
|
|
@@ -327,10 +351,41 @@ module Ruflet
|
|
|
327
351
|
"list_view" => RufletComponents::ListViewControl,
|
|
328
352
|
"listtile" => RufletComponents::ListTileControl,
|
|
329
353
|
"map" => RufletComponents::MapControl,
|
|
354
|
+
"map_layer" => RufletComponents::MapLayerControl,
|
|
355
|
+
"maplayer" => RufletComponents::MapLayerControl,
|
|
356
|
+
"tile_layer" => RufletComponents::TileLayerControl,
|
|
357
|
+
"tilelayer" => RufletComponents::TileLayerControl,
|
|
358
|
+
"marker" => RufletComponents::MarkerControl,
|
|
359
|
+
"marker_layer" => RufletComponents::MarkerLayerControl,
|
|
360
|
+
"markerlayer" => RufletComponents::MarkerLayerControl,
|
|
361
|
+
"circle_marker" => RufletComponents::CircleMarkerControl,
|
|
362
|
+
"circlemarker" => RufletComponents::CircleMarkerControl,
|
|
363
|
+
"circle_layer" => RufletComponents::CircleLayerControl,
|
|
364
|
+
"circlelayer" => RufletComponents::CircleLayerControl,
|
|
365
|
+
"polyline_marker" => RufletComponents::PolylineMarkerControl,
|
|
366
|
+
"polylinemarker" => RufletComponents::PolylineMarkerControl,
|
|
367
|
+
"polyline_layer" => RufletComponents::PolylineLayerControl,
|
|
368
|
+
"polylinelayer" => RufletComponents::PolylineLayerControl,
|
|
369
|
+
"polygon_marker" => RufletComponents::PolygonMarkerControl,
|
|
370
|
+
"polygonmarker" => RufletComponents::PolygonMarkerControl,
|
|
371
|
+
"polygon_layer" => RufletComponents::PolygonLayerControl,
|
|
372
|
+
"polygonlayer" => RufletComponents::PolygonLayerControl,
|
|
373
|
+
"simple_attribution" => RufletComponents::SimpleAttributionControl,
|
|
374
|
+
"simpleattribution" => RufletComponents::SimpleAttributionControl,
|
|
375
|
+
"rich_attribution" => RufletComponents::RichAttributionControl,
|
|
376
|
+
"richattribution" => RufletComponents::RichAttributionControl,
|
|
377
|
+
"image_source_attribution" => RufletComponents::ImageSourceAttributionControl,
|
|
378
|
+
"imagesourceattribution" => RufletComponents::ImageSourceAttributionControl,
|
|
379
|
+
"text_source_attribution" => RufletComponents::TextSourceAttributionControl,
|
|
380
|
+
"textsourceattribution" => RufletComponents::TextSourceAttributionControl,
|
|
330
381
|
"listview" => RufletComponents::ListViewControl,
|
|
331
382
|
"markdown" => RufletComponents::MarkdownControl,
|
|
332
383
|
"menu_bar" => RufletComponents::MenuBarControl,
|
|
333
384
|
"menu_item_button" => RufletComponents::MenuItemButtonControl,
|
|
385
|
+
"material_picker" => RufletComponents::MaterialPickerControl,
|
|
386
|
+
"materialpicker" => RufletComponents::MaterialPickerControl,
|
|
387
|
+
"multiple_choice_block_picker" => RufletComponents::MultipleChoiceBlockPickerControl,
|
|
388
|
+
"multiplechoiceblockpicker" => RufletComponents::MultipleChoiceBlockPickerControl,
|
|
334
389
|
"menubar" => RufletComponents::MenuBarControl,
|
|
335
390
|
"menuitembutton" => RufletComponents::MenuItemButtonControl,
|
|
336
391
|
"merge_semantics" => RufletComponents::MergeSemanticsControl,
|
|
@@ -341,6 +396,8 @@ module Ruflet
|
|
|
341
396
|
"navigation_drawer_destination" => RufletComponents::NavigationDrawerDestinationControl,
|
|
342
397
|
"navigation_rail" => RufletComponents::NavigationRailControl,
|
|
343
398
|
"navigation_rail_destination" => RufletComponents::NavigationRailDestinationControl,
|
|
399
|
+
"native_ad" => RufletComponents::NativeAdControl,
|
|
400
|
+
"nativead" => RufletComponents::NativeAdControl,
|
|
344
401
|
"navigationbar" => RufletComponents::NavigationBarControl,
|
|
345
402
|
"navigationbardestination" => RufletComponents::NavigationBarDestinationControl,
|
|
346
403
|
"navigationdrawer" => RufletComponents::NavigationDrawerControl,
|
|
@@ -376,6 +433,7 @@ module Ruflet
|
|
|
376
433
|
"spinkit" => RufletComponents::SpinkitControl,
|
|
377
434
|
"radio" => RufletComponents::RadioControl,
|
|
378
435
|
"radio_group" => RufletComponents::RadioGroupControl,
|
|
436
|
+
"rive" => RufletComponents::RiveControl,
|
|
379
437
|
"radiogroup" => RufletComponents::RadioGroupControl,
|
|
380
438
|
"radar_chart" => RufletComponents::RadarChartControl,
|
|
381
439
|
"radar_chart_title" => RufletComponents::RadarChartTitleControl,
|
|
@@ -421,6 +479,8 @@ module Ruflet
|
|
|
421
479
|
"shadow" => RufletComponents::ShadowControl,
|
|
422
480
|
"shimmer" => RufletComponents::ShimmerControl,
|
|
423
481
|
"slider" => RufletComponents::SliderControl,
|
|
482
|
+
"slide_picker" => RufletComponents::SlidePickerControl,
|
|
483
|
+
"slidepicker" => RufletComponents::SlidePickerControl,
|
|
424
484
|
"snack_bar" => RufletComponents::SnackBarControl,
|
|
425
485
|
"snack_bar_action" => RufletComponents::SnackBarActionControl,
|
|
426
486
|
"snackbaraction" => RufletComponents::SnackBarActionControl,
|
|
@@ -7,13 +7,30 @@ module Ruflet
|
|
|
7
7
|
class BrowserContextMenuControl < Ruflet::Control
|
|
8
8
|
TYPE = "browsercontextmenu".freeze
|
|
9
9
|
WIRE = "BrowserContextMenu".freeze
|
|
10
|
+
KEYWORDS = [:data, :key].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil)
|
|
13
|
+
@disabled = false
|
|
12
14
|
props = {}
|
|
13
15
|
props[:data] = data unless data.nil?
|
|
14
16
|
props[:key] = key unless key.nil?
|
|
15
17
|
super(type: TYPE, id: id, **props)
|
|
16
18
|
end
|
|
19
|
+
|
|
20
|
+
def enable(timeout: 10, on_result: nil)
|
|
21
|
+
result = runtime_page&.invoke(self, "enable_menu", timeout: timeout, on_result: on_result)
|
|
22
|
+
@disabled = false
|
|
23
|
+
result
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def disable(timeout: 10, on_result: nil)
|
|
27
|
+
result = runtime_page&.invoke(self, "disable_menu", timeout: timeout, on_result: on_result)
|
|
28
|
+
@disabled = true
|
|
29
|
+
result
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def disabled = @disabled
|
|
33
|
+
def disabled? = @disabled
|
|
17
34
|
end
|
|
18
35
|
end
|
|
19
36
|
end
|
|
@@ -6,9 +6,9 @@ module Ruflet
|
|
|
6
6
|
module RufletComponents
|
|
7
7
|
class RufletAppControl < Ruflet::Control
|
|
8
8
|
TYPE = "ruflet_app".freeze
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
WIRE = "
|
|
9
|
+
# Ruflet owns its native renderer and protocol, so the public control
|
|
10
|
+
# keeps the Ruflet name all the way onto the wire.
|
|
11
|
+
WIRE = "RufletApp".freeze
|
|
12
12
|
|
|
13
13
|
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :app_error_message, :app_startup_screen_message, :args, :aspect_ratio, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :force_pyodide, :height, :key, :left, :margin, :offset, :opacity, :reconnect_interval_ms, :reconnect_timeout_ms, :right, :rotate, :rtl, :scale, :show_app_startup_screen, :size_change_interval, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_error, :on_size_change].freeze
|
|
14
14
|
|
|
@@ -8,8 +8,12 @@ module Ruflet
|
|
|
8
8
|
TYPE = "serviceregistry".freeze
|
|
9
9
|
WIRE = "ServiceRegistry".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:_services, :services, :data, :key].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, _services: nil, services: nil, data: nil, key: nil)
|
|
12
14
|
props = {}
|
|
15
|
+
mounted_services = _services.nil? ? services : _services
|
|
16
|
+
props[:_services] = mounted_services unless mounted_services.nil?
|
|
13
17
|
props[:data] = data unless data.nil?
|
|
14
18
|
props[:key] = key unless key.nil?
|
|
15
19
|
super(type: TYPE, id: id, **props)
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Ruflet
|
|
4
4
|
module UI
|
|
5
5
|
module CupertinoControlMethods
|
|
6
|
+
# Deprecated compatibility spellings. Platform selection now happens in
|
|
7
|
+
# Flet and every method below forwards to a canonical control entrypoint.
|
|
6
8
|
def cupertino_button(content = nil, **props)
|
|
7
9
|
mapped = props.dup
|
|
8
10
|
mapped[:content] = content unless content.nil?
|