ruflet_core 0.0.21 → 0.0.22
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/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
- metadata +9 -1
|
@@ -4,335 +4,112 @@ module Ruflet
|
|
|
4
4
|
module UI
|
|
5
5
|
module Controls
|
|
6
6
|
module RufletComponents
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
# Flet Charts evolves independently from core Flet. Keep its Ruby
|
|
8
|
+
# controls open to the extension's current property surface while
|
|
9
|
+
# retaining typed classes and exact wire names.
|
|
10
|
+
class ChartExtensionControl < Ruflet::Control
|
|
11
|
+
KEYWORDS = [].freeze
|
|
11
12
|
|
|
12
|
-
def initialize(id: nil,
|
|
13
|
-
|
|
14
|
-
props[
|
|
15
|
-
|
|
16
|
-
props[:label_size] = label_size unless label_size.nil?
|
|
17
|
-
props[:title_size] = title_size unless title_size.nil?
|
|
18
|
-
props[:show_labels] = show_labels unless show_labels.nil?
|
|
19
|
-
super(type: TYPE, id: id, **props)
|
|
13
|
+
def initialize(type:, id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each { |key, value| compact[key] = value unless value.nil? }
|
|
16
|
+
super(type: type, id: id, **compact)
|
|
20
17
|
end
|
|
21
18
|
end
|
|
22
19
|
|
|
23
|
-
class
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
class ChartAxisControl < ChartExtensionControl
|
|
21
|
+
WIRE = "ChartAxis".freeze
|
|
22
|
+
def initialize(id: nil, **props) = super(type: "chartaxis", id: id, **props)
|
|
23
|
+
end
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
props[:label] = label unless label.nil?
|
|
32
|
-
super(type: TYPE, id: id, **props)
|
|
33
|
-
end
|
|
25
|
+
class ChartAxisLabelControl < ChartExtensionControl
|
|
26
|
+
WIRE = "ChartAxisLabel".freeze
|
|
27
|
+
def initialize(id: nil, **props) = super(type: "chartaxislabel", id: id, **props)
|
|
34
28
|
end
|
|
35
29
|
|
|
36
|
-
class BarChartControl <
|
|
37
|
-
TYPE = "barchart".freeze
|
|
30
|
+
class BarChartControl < ChartExtensionControl
|
|
38
31
|
WIRE = "BarChart".freeze
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def initialize(id: nil, width: nil, height: nil, min_y: nil, max_y: nil, min_x: nil, max_x: nil, groups: nil, left_axis: nil, right_axis: nil, top_axis: nil, bottom_axis: nil, horizontal_grid_lines: nil, vertical_grid_lines: nil, border: nil, tooltip: nil, on_event: nil)
|
|
42
|
-
props = {}
|
|
43
|
-
props[:width] = width unless width.nil?
|
|
44
|
-
props[:height] = height unless height.nil?
|
|
45
|
-
props[:min_y] = min_y unless min_y.nil?
|
|
46
|
-
props[:max_y] = max_y unless max_y.nil?
|
|
47
|
-
props[:min_x] = min_x unless min_x.nil?
|
|
48
|
-
props[:max_x] = max_x unless max_x.nil?
|
|
49
|
-
props[:groups] = groups unless groups.nil?
|
|
50
|
-
props[:left_axis] = left_axis unless left_axis.nil?
|
|
51
|
-
props[:right_axis] = right_axis unless right_axis.nil?
|
|
52
|
-
props[:top_axis] = top_axis unless top_axis.nil?
|
|
53
|
-
props[:bottom_axis] = bottom_axis unless bottom_axis.nil?
|
|
54
|
-
props[:horizontal_grid_lines] = horizontal_grid_lines unless horizontal_grid_lines.nil?
|
|
55
|
-
props[:vertical_grid_lines] = vertical_grid_lines unless vertical_grid_lines.nil?
|
|
56
|
-
props[:border] = border unless border.nil?
|
|
57
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
58
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
59
|
-
super(type: TYPE, id: id, **props)
|
|
60
|
-
end
|
|
32
|
+
def initialize(id: nil, **props) = super(type: "barchart", id: id, **props)
|
|
61
33
|
end
|
|
62
34
|
|
|
63
|
-
class BarChartGroupControl <
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
KEYWORDS = [:x, :rods, :bars_space, :showing_tooltip_indicators].freeze
|
|
67
|
-
|
|
68
|
-
def initialize(id: nil, x: nil, rods: nil, bars_space: nil, showing_tooltip_indicators: nil)
|
|
69
|
-
props = {}
|
|
70
|
-
props[:x] = x unless x.nil?
|
|
71
|
-
props[:rods] = rods unless rods.nil?
|
|
72
|
-
props[:bars_space] = bars_space unless bars_space.nil?
|
|
73
|
-
props[:showing_tooltip_indicators] = showing_tooltip_indicators unless showing_tooltip_indicators.nil?
|
|
74
|
-
super(type: TYPE, id: id, **props)
|
|
75
|
-
end
|
|
35
|
+
class BarChartGroupControl < ChartExtensionControl
|
|
36
|
+
WIRE = "BarChartGroup".freeze
|
|
37
|
+
def initialize(id: nil, **props) = super(type: "barchartgroup", id: id, **props)
|
|
76
38
|
end
|
|
77
39
|
|
|
78
|
-
class BarChartRodControl <
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
KEYWORDS = [:from_y, :to_y, :width, :color, :gradient, :border_radius, :rod_stack_items].freeze
|
|
82
|
-
|
|
83
|
-
def initialize(id: nil, from_y: nil, to_y: nil, width: nil, color: nil, gradient: nil, border_radius: nil, rod_stack_items: nil)
|
|
84
|
-
props = {}
|
|
85
|
-
props[:from_y] = from_y unless from_y.nil?
|
|
86
|
-
props[:to_y] = to_y unless to_y.nil?
|
|
87
|
-
props[:width] = width unless width.nil?
|
|
88
|
-
props[:color] = color unless color.nil?
|
|
89
|
-
props[:gradient] = gradient unless gradient.nil?
|
|
90
|
-
props[:border_radius] = border_radius unless border_radius.nil?
|
|
91
|
-
props[:rod_stack_items] = rod_stack_items unless rod_stack_items.nil?
|
|
92
|
-
super(type: TYPE, id: id, **props)
|
|
93
|
-
end
|
|
40
|
+
class BarChartRodControl < ChartExtensionControl
|
|
41
|
+
WIRE = "BarChartRod".freeze
|
|
42
|
+
def initialize(id: nil, **props) = super(type: "barchartrod", id: id, **props)
|
|
94
43
|
end
|
|
95
44
|
|
|
96
|
-
class BarChartRodStackItemControl <
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
KEYWORDS = [:from_y, :to_y, :color, :border_side].freeze
|
|
100
|
-
|
|
101
|
-
def initialize(id: nil, from_y: nil, to_y: nil, color: nil, border_side: nil)
|
|
102
|
-
props = {}
|
|
103
|
-
props[:from_y] = from_y unless from_y.nil?
|
|
104
|
-
props[:to_y] = to_y unless to_y.nil?
|
|
105
|
-
props[:color] = color unless color.nil?
|
|
106
|
-
props[:border_side] = border_side unless border_side.nil?
|
|
107
|
-
super(type: TYPE, id: id, **props)
|
|
108
|
-
end
|
|
45
|
+
class BarChartRodStackItemControl < ChartExtensionControl
|
|
46
|
+
WIRE = "BarChartRodStackItem".freeze
|
|
47
|
+
def initialize(id: nil, **props) = super(type: "barchartrodstackitem", id: id, **props)
|
|
109
48
|
end
|
|
110
49
|
|
|
111
|
-
class LineChartControl <
|
|
112
|
-
TYPE = "linechart".freeze
|
|
50
|
+
class LineChartControl < ChartExtensionControl
|
|
113
51
|
WIRE = "LineChart".freeze
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def initialize(id: nil, width: nil, height: nil, min_y: nil, max_y: nil, min_x: nil, max_x: nil, data_series: nil, left_axis: nil, right_axis: nil, top_axis: nil, bottom_axis: nil, interactive: nil, tooltip: nil, on_event: nil)
|
|
117
|
-
props = {}
|
|
118
|
-
props[:width] = width unless width.nil?
|
|
119
|
-
props[:height] = height unless height.nil?
|
|
120
|
-
props[:min_y] = min_y unless min_y.nil?
|
|
121
|
-
props[:max_y] = max_y unless max_y.nil?
|
|
122
|
-
props[:min_x] = min_x unless min_x.nil?
|
|
123
|
-
props[:max_x] = max_x unless max_x.nil?
|
|
124
|
-
props[:data_series] = data_series unless data_series.nil?
|
|
125
|
-
props[:left_axis] = left_axis unless left_axis.nil?
|
|
126
|
-
props[:right_axis] = right_axis unless right_axis.nil?
|
|
127
|
-
props[:top_axis] = top_axis unless top_axis.nil?
|
|
128
|
-
props[:bottom_axis] = bottom_axis unless bottom_axis.nil?
|
|
129
|
-
props[:interactive] = interactive unless interactive.nil?
|
|
130
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
131
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
132
|
-
super(type: TYPE, id: id, **props)
|
|
133
|
-
end
|
|
52
|
+
def initialize(id: nil, **props) = super(type: "linechart", id: id, **props)
|
|
134
53
|
end
|
|
135
54
|
|
|
136
|
-
class LineChartDataControl <
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
KEYWORDS = [:points, :color, :gradient, :stroke_width, :curved, :rounded_stroke_cap].freeze
|
|
140
|
-
|
|
141
|
-
def initialize(id: nil, points: nil, color: nil, gradient: nil, stroke_width: nil, curved: nil, rounded_stroke_cap: nil)
|
|
142
|
-
props = {}
|
|
143
|
-
props[:points] = points unless points.nil?
|
|
144
|
-
props[:color] = color unless color.nil?
|
|
145
|
-
props[:gradient] = gradient unless gradient.nil?
|
|
146
|
-
props[:stroke_width] = stroke_width unless stroke_width.nil?
|
|
147
|
-
props[:curved] = curved unless curved.nil?
|
|
148
|
-
props[:rounded_stroke_cap] = rounded_stroke_cap unless rounded_stroke_cap.nil?
|
|
149
|
-
super(type: TYPE, id: id, **props)
|
|
150
|
-
end
|
|
55
|
+
class LineChartDataControl < ChartExtensionControl
|
|
56
|
+
WIRE = "LineChartData".freeze
|
|
57
|
+
def initialize(id: nil, **props) = super(type: "linechartdata", id: id, **props)
|
|
151
58
|
end
|
|
152
59
|
|
|
153
|
-
class LineChartDataPointControl <
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
KEYWORDS = [:x, :y].freeze
|
|
157
|
-
|
|
158
|
-
def initialize(id: nil, x: nil, y: nil)
|
|
159
|
-
props = {}
|
|
160
|
-
props[:x] = x unless x.nil?
|
|
161
|
-
props[:y] = y unless y.nil?
|
|
162
|
-
super(type: TYPE, id: id, **props)
|
|
163
|
-
end
|
|
60
|
+
class LineChartDataPointControl < ChartExtensionControl
|
|
61
|
+
WIRE = "LineChartDataPoint".freeze
|
|
62
|
+
def initialize(id: nil, **props) = super(type: "linechartdatapoint", id: id, **props)
|
|
164
63
|
end
|
|
165
64
|
|
|
166
|
-
class PieChartControl <
|
|
167
|
-
TYPE = "piechart".freeze
|
|
65
|
+
class PieChartControl < ChartExtensionControl
|
|
168
66
|
WIRE = "PieChart".freeze
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
def initialize(id: nil, width: nil, height: nil, sections: nil, sections_space: nil, center_space_radius: nil, tooltip: nil, on_event: nil)
|
|
172
|
-
props = {}
|
|
173
|
-
props[:width] = width unless width.nil?
|
|
174
|
-
props[:height] = height unless height.nil?
|
|
175
|
-
props[:sections] = sections unless sections.nil?
|
|
176
|
-
props[:sections_space] = sections_space unless sections_space.nil?
|
|
177
|
-
props[:center_space_radius] = center_space_radius unless center_space_radius.nil?
|
|
178
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
179
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
180
|
-
super(type: TYPE, id: id, **props)
|
|
181
|
-
end
|
|
67
|
+
def initialize(id: nil, **props) = super(type: "piechart", id: id, **props)
|
|
182
68
|
end
|
|
183
69
|
|
|
184
|
-
class PieChartSectionControl <
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
KEYWORDS = [:value, :title, :color, :radius, :title_style, :badge_widget, :badge_position_percentage_offset].freeze
|
|
188
|
-
|
|
189
|
-
def initialize(id: nil, value: nil, title: nil, color: nil, radius: nil, title_style: nil, badge_widget: nil, badge_position_percentage_offset: nil)
|
|
190
|
-
props = {}
|
|
191
|
-
props[:value] = value unless value.nil?
|
|
192
|
-
props[:title] = title unless title.nil?
|
|
193
|
-
props[:color] = color unless color.nil?
|
|
194
|
-
props[:radius] = radius unless radius.nil?
|
|
195
|
-
props[:title_style] = title_style unless title_style.nil?
|
|
196
|
-
props[:badge_widget] = badge_widget unless badge_widget.nil?
|
|
197
|
-
props[:badge_position_percentage_offset] = badge_position_percentage_offset unless badge_position_percentage_offset.nil?
|
|
198
|
-
super(type: TYPE, id: id, **props)
|
|
199
|
-
end
|
|
70
|
+
class PieChartSectionControl < ChartExtensionControl
|
|
71
|
+
WIRE = "PieChartSection".freeze
|
|
72
|
+
def initialize(id: nil, **props) = super(type: "piechartsection", id: id, **props)
|
|
200
73
|
end
|
|
201
74
|
|
|
202
|
-
class CandlestickChartControl <
|
|
203
|
-
TYPE = "candlestickchart".freeze
|
|
75
|
+
class CandlestickChartControl < ChartExtensionControl
|
|
204
76
|
WIRE = "CandlestickChart".freeze
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
def initialize(id: nil, width: nil, height: nil, min_x: nil, max_x: nil, min_y: nil, max_y: nil, spots: nil, left_axis: nil, right_axis: nil, top_axis: nil, bottom_axis: nil, tooltip: nil, on_event: nil)
|
|
208
|
-
props = {}
|
|
209
|
-
props[:width] = width unless width.nil?
|
|
210
|
-
props[:height] = height unless height.nil?
|
|
211
|
-
props[:min_x] = min_x unless min_x.nil?
|
|
212
|
-
props[:max_x] = max_x unless max_x.nil?
|
|
213
|
-
props[:min_y] = min_y unless min_y.nil?
|
|
214
|
-
props[:max_y] = max_y unless max_y.nil?
|
|
215
|
-
props[:spots] = spots unless spots.nil?
|
|
216
|
-
props[:left_axis] = left_axis unless left_axis.nil?
|
|
217
|
-
props[:right_axis] = right_axis unless right_axis.nil?
|
|
218
|
-
props[:top_axis] = top_axis unless top_axis.nil?
|
|
219
|
-
props[:bottom_axis] = bottom_axis unless bottom_axis.nil?
|
|
220
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
221
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
222
|
-
super(type: TYPE, id: id, **props)
|
|
223
|
-
end
|
|
77
|
+
def initialize(id: nil, **props) = super(type: "candlestickchart", id: id, **props)
|
|
224
78
|
end
|
|
225
79
|
|
|
226
|
-
class CandlestickChartSpotControl <
|
|
227
|
-
TYPE = "candlestickchartspot".freeze
|
|
80
|
+
class CandlestickChartSpotControl < ChartExtensionControl
|
|
228
81
|
WIRE = "CandlestickChartSpot".freeze
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
def initialize(id: nil, x: nil, open: nil, high: nil, low: nil, close: nil, selected: nil)
|
|
232
|
-
props = {}
|
|
233
|
-
props[:x] = x unless x.nil?
|
|
234
|
-
props[:open] = open unless open.nil?
|
|
235
|
-
props[:high] = high unless high.nil?
|
|
236
|
-
props[:low] = low unless low.nil?
|
|
237
|
-
props[:close] = close unless close.nil?
|
|
238
|
-
props[:selected] = selected unless selected.nil?
|
|
239
|
-
super(type: TYPE, id: id, **props)
|
|
240
|
-
end
|
|
82
|
+
def initialize(id: nil, **props) = super(type: "candlestickchartspot", id: id, **props)
|
|
241
83
|
end
|
|
242
84
|
|
|
243
|
-
class RadarChartControl <
|
|
244
|
-
TYPE = "radarchart".freeze
|
|
85
|
+
class RadarChartControl < ChartExtensionControl
|
|
245
86
|
WIRE = "RadarChart".freeze
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
def initialize(id: nil, width: nil, height: nil, titles: nil, data_sets: nil, on_event: nil)
|
|
249
|
-
props = {}
|
|
250
|
-
props[:width] = width unless width.nil?
|
|
251
|
-
props[:height] = height unless height.nil?
|
|
252
|
-
props[:titles] = titles unless titles.nil?
|
|
253
|
-
props[:data_sets] = data_sets unless data_sets.nil?
|
|
254
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
255
|
-
super(type: TYPE, id: id, **props)
|
|
256
|
-
end
|
|
87
|
+
def initialize(id: nil, **props) = super(type: "radarchart", id: id, **props)
|
|
257
88
|
end
|
|
258
89
|
|
|
259
|
-
class RadarChartTitleControl <
|
|
260
|
-
TYPE = "radarcharttitle".freeze
|
|
90
|
+
class RadarChartTitleControl < ChartExtensionControl
|
|
261
91
|
WIRE = "RadarChartTitle".freeze
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
def initialize(id: nil, text: nil, angle: nil, position_percentage_offset: nil)
|
|
265
|
-
props = {}
|
|
266
|
-
props[:text] = text unless text.nil?
|
|
267
|
-
props[:angle] = angle unless angle.nil?
|
|
268
|
-
props[:position_percentage_offset] = position_percentage_offset unless position_percentage_offset.nil?
|
|
269
|
-
super(type: TYPE, id: id, **props)
|
|
270
|
-
end
|
|
92
|
+
def initialize(id: nil, **props) = super(type: "radarcharttitle", id: id, **props)
|
|
271
93
|
end
|
|
272
94
|
|
|
273
|
-
class RadarDataSetControl <
|
|
274
|
-
TYPE = "radardataset".freeze
|
|
95
|
+
class RadarDataSetControl < ChartExtensionControl
|
|
275
96
|
WIRE = "RadarDataSet".freeze
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
def initialize(id: nil, entries: nil, border_color: nil, fill_color: nil, border_width: nil)
|
|
279
|
-
props = {}
|
|
280
|
-
props[:entries] = entries unless entries.nil?
|
|
281
|
-
props[:border_color] = border_color unless border_color.nil?
|
|
282
|
-
props[:fill_color] = fill_color unless fill_color.nil?
|
|
283
|
-
props[:border_width] = border_width unless border_width.nil?
|
|
284
|
-
super(type: TYPE, id: id, **props)
|
|
285
|
-
end
|
|
97
|
+
def initialize(id: nil, **props) = super(type: "radardataset", id: id, **props)
|
|
286
98
|
end
|
|
287
99
|
|
|
288
|
-
class RadarDataSetEntryControl <
|
|
289
|
-
TYPE = "radardatasetentry".freeze
|
|
100
|
+
class RadarDataSetEntryControl < ChartExtensionControl
|
|
290
101
|
WIRE = "RadarDataSetEntry".freeze
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
def initialize(id: nil, value: nil)
|
|
294
|
-
props = {}
|
|
295
|
-
props[:value] = value unless value.nil?
|
|
296
|
-
super(type: TYPE, id: id, **props)
|
|
297
|
-
end
|
|
102
|
+
def initialize(id: nil, **props) = super(type: "radardatasetentry", id: id, **props)
|
|
298
103
|
end
|
|
299
104
|
|
|
300
|
-
class ScatterChartControl <
|
|
301
|
-
TYPE = "scatterchart".freeze
|
|
105
|
+
class ScatterChartControl < ChartExtensionControl
|
|
302
106
|
WIRE = "ScatterChart".freeze
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
def initialize(id: nil, width: nil, height: nil, min_x: nil, max_x: nil, min_y: nil, max_y: nil, spots: nil, left_axis: nil, right_axis: nil, top_axis: nil, bottom_axis: nil, on_event: nil)
|
|
306
|
-
props = {}
|
|
307
|
-
props[:width] = width unless width.nil?
|
|
308
|
-
props[:height] = height unless height.nil?
|
|
309
|
-
props[:min_x] = min_x unless min_x.nil?
|
|
310
|
-
props[:max_x] = max_x unless max_x.nil?
|
|
311
|
-
props[:min_y] = min_y unless min_y.nil?
|
|
312
|
-
props[:max_y] = max_y unless max_y.nil?
|
|
313
|
-
props[:spots] = spots unless spots.nil?
|
|
314
|
-
props[:left_axis] = left_axis unless left_axis.nil?
|
|
315
|
-
props[:right_axis] = right_axis unless right_axis.nil?
|
|
316
|
-
props[:top_axis] = top_axis unless top_axis.nil?
|
|
317
|
-
props[:bottom_axis] = bottom_axis unless bottom_axis.nil?
|
|
318
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
319
|
-
super(type: TYPE, id: id, **props)
|
|
320
|
-
end
|
|
107
|
+
def initialize(id: nil, **props) = super(type: "scatterchart", id: id, **props)
|
|
321
108
|
end
|
|
322
109
|
|
|
323
|
-
class ScatterChartSpotControl <
|
|
324
|
-
TYPE = "scatterchartspot".freeze
|
|
110
|
+
class ScatterChartSpotControl < ChartExtensionControl
|
|
325
111
|
WIRE = "ScatterChartSpot".freeze
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
def initialize(id: nil, x: nil, y: nil, radius: nil, color: nil)
|
|
329
|
-
props = {}
|
|
330
|
-
props[:x] = x unless x.nil?
|
|
331
|
-
props[:y] = y unless y.nil?
|
|
332
|
-
props[:radius] = radius unless radius.nil?
|
|
333
|
-
props[:color] = color unless color.nil?
|
|
334
|
-
super(type: TYPE, id: id, **props)
|
|
335
|
-
end
|
|
112
|
+
def initialize(id: nil, **props) = super(type: "scatterchartspot", id: id, **props)
|
|
336
113
|
end
|
|
337
114
|
end
|
|
338
115
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class CodeEditorControl < Ruflet::Control
|
|
8
|
+
TYPE = "code_editor".freeze
|
|
9
|
+
WIRE = "CodeEditor".freeze
|
|
10
|
+
KEYWORDS = [].freeze
|
|
11
|
+
|
|
12
|
+
def initialize(id: nil, **props)
|
|
13
|
+
compact = {}
|
|
14
|
+
props.each { |key, value| compact[key] = value unless value.nil? }
|
|
15
|
+
super(type: TYPE, id: id, **compact)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
%w[focus fold_comment_at_line_zero fold_imports].each do |method_name|
|
|
19
|
+
define_method(method_name) do |timeout: 10, on_result: nil|
|
|
20
|
+
invoke_editor(method_name, timeout: timeout, on_result: on_result)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def fold_at(line_number, timeout: 10, on_result: nil)
|
|
25
|
+
invoke_editor(
|
|
26
|
+
"fold_at",
|
|
27
|
+
args: { "line_number" => line_number },
|
|
28
|
+
timeout: timeout,
|
|
29
|
+
on_result: on_result
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def invoke_editor(method_name, args: nil, timeout:, on_result:)
|
|
36
|
+
runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class ColorPickerExtensionControl < Ruflet::Control
|
|
8
|
+
def initialize(type:, id: nil, **props)
|
|
9
|
+
compact = {}
|
|
10
|
+
props.each { |key, value| compact[key] = value unless value.nil? }
|
|
11
|
+
super(type: type, id: id, **compact)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
BlockPickerControl: ["block_picker", "BlockPicker"],
|
|
17
|
+
ColorPickerControl: ["color_picker", "ColorPicker"],
|
|
18
|
+
HueRingPickerControl: ["hue_ring_picker", "HueRingPicker"],
|
|
19
|
+
MaterialPickerControl: ["material_picker", "MaterialPicker"],
|
|
20
|
+
MultipleChoiceBlockPickerControl: ["multiple_choice_block_picker", "MultipleChoiceBlockPicker"],
|
|
21
|
+
SlidePickerControl: ["slide_picker", "SlidePicker"]
|
|
22
|
+
}.each do |class_name, (type, wire)|
|
|
23
|
+
klass = Class.new(ColorPickerExtensionControl) do
|
|
24
|
+
const_set(:WIRE, wire.freeze)
|
|
25
|
+
define_method(:initialize) do |id: nil, **props|
|
|
26
|
+
super(type: type, id: id, **props)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
const_set(class_name, klass)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Ruflet
|
|
4
|
+
module UI
|
|
5
|
+
module Controls
|
|
6
|
+
module RufletComponents
|
|
7
|
+
class DataTable2ExtensionControl < Ruflet::Control
|
|
8
|
+
def initialize(type:, id: nil, **props)
|
|
9
|
+
compact = {}
|
|
10
|
+
props.each { |key, value| compact[key] = value unless value.nil? }
|
|
11
|
+
super(type: type, id: id, **compact)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class DataColumn2Control < DataTable2ExtensionControl
|
|
16
|
+
WIRE = "DataColumn2".freeze
|
|
17
|
+
|
|
18
|
+
def initialize(id: nil, **props)
|
|
19
|
+
super(type: "data_column2", id: id, **props)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class DataRow2Control < DataTable2ExtensionControl
|
|
24
|
+
WIRE = "DataRow2".freeze
|
|
25
|
+
|
|
26
|
+
def initialize(id: nil, **props)
|
|
27
|
+
super(type: "data_row2", id: id, **props)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class DataTable2Control < DataTable2ExtensionControl
|
|
32
|
+
WIRE = "DataTable2".freeze
|
|
33
|
+
|
|
34
|
+
def initialize(id: nil, **props)
|
|
35
|
+
super(type: "data_table2", id: id, **props)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -6,7 +6,7 @@ module Ruflet
|
|
|
6
6
|
module RufletComponents
|
|
7
7
|
class Dropdown2Control < Ruflet::Control
|
|
8
8
|
TYPE = "dropdownm2".freeze
|
|
9
|
-
WIRE = "
|
|
9
|
+
WIRE = "Dropdown".freeze
|
|
10
10
|
|
|
11
11
|
KEYWORDS = [:align, :align_label_with_hint, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :border, :border_color, :border_radius, :border_width, :bottom, :col, :collapsed, :color, :content_padding, :counter, :counter_style, :data, :dense, :disabled, :disabled_hint_content, :elevation, :enable_feedback, :error, :error_max_lines, :error_style, :expand, :expand_loose, :fill_color, :filled, :fit_parent_size, :focus_color, :focused_bgcolor, :focused_border_color, :focused_border_width, :focused_color, :height, :helper, :helper_max_lines, :helper_style, :hint_content, :hint_fade_duration, :hint_max_lines, :hint_style, :hint_text, :hover_color, :icon, :item_height, :key, :label, :label_style, :left, :margin, :max_menu_height, :offset, :opacity, :options, :options_fill_horizontally, :padding, :prefix, :prefix_icon, :prefix_icon_size_constraints, :prefix_style, :right, :rotate, :rtl, :scale, :select_icon, :select_icon_disabled_color, :select_icon_enabled_color, :select_icon_size, :size_change_interval, :size_constraints, :suffix, :suffix_icon, :suffix_icon_size_constraints, :suffix_style, :text_size, :text_style, :text_vertical_align, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_click, :on_focus, :on_size_change].freeze
|
|
12
12
|
|
|
@@ -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
|