glib-web 4.42.4 → 4.43.0
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/app/helpers/glib/json_ui/action_builder/browsers.rb +10 -0
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +240 -174
- data/app/views/json_ui/garage/tables/bulk_edit.json.jbuilder +0 -24
- data/app/views/json_ui/garage/test_page/_header.json.jbuilder +25 -15
- data/app/views/json_ui/garage/test_page/auth.json.jbuilder +113 -0
- data/app/views/json_ui/garage/test_page/browsers.json.jbuilder +44 -0
- data/app/views/json_ui/garage/test_page/commands.json.jbuilder +30 -0
- data/app/views/json_ui/garage/test_page/cookies.json.jbuilder +12 -4
- data/app/views/json_ui/garage/test_page/fields.json.jbuilder +160 -0
- data/app/views/json_ui/garage/test_page/fields_dynamicSelect.json.jbuilder +177 -0
- data/app/views/json_ui/garage/test_page/fields_select.json.jbuilder +152 -0
- data/app/views/json_ui/garage/test_page/fields_sign.json.jbuilder +153 -0
- data/app/views/json_ui/garage/test_page/fields_timer.json.jbuilder +148 -0
- data/app/views/json_ui/garage/test_page/fields_upload.json.jbuilder +129 -0
- data/app/views/json_ui/garage/test_page/forms.json.jbuilder +6 -2
- data/app/views/json_ui/garage/test_page/list.json.jbuilder +110 -69
- data/app/views/json_ui/garage/test_page/panels_bulkEdit2.json.jbuilder +240 -0
- data/app/views/json_ui/garage/test_page/popovers.json.jbuilder +6 -2
- data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +74 -65
- data/app/views/json_ui/garage/test_page/table.json.jbuilder +157 -88
- metadata +9 -2
- data/app/views/json_ui/garage/test_page/file_upload_new.json.jbuilder +0 -158
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db591bcb286cb6cbc0b6f8d036dc33632bfabe83e5b066f7dc0e24de9267cd37
|
|
4
|
+
data.tar.gz: 84fd46bb7f734f1d66548b885bf129dc716d8fd575fee606d4272e0e5d39140c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb3a999815d9c8e5f09c3fd76e66199e961fb232b02e115471aee887ede2e86e427464a89fa34a1674f9eb8fa8bbe9bf1a40ba0659934eab355824a897cf954e
|
|
7
|
+
data.tar.gz: bb9d26d2660054524bc578f1ba39a238a1c4eea5522dc553fb5803ff47f88b3955abfcb32a128d3d816c42c522c86e4c7f9f54529ceb2cc7d34102fcf4b553d0
|
|
@@ -8,5 +8,15 @@ class Glib::JsonUi::ActionBuilder
|
|
|
8
8
|
class DetectTimezone < Action
|
|
9
9
|
action :onDetect
|
|
10
10
|
end
|
|
11
|
+
|
|
12
|
+
class SetLocation < Action
|
|
13
|
+
string :url
|
|
14
|
+
action :onSet
|
|
15
|
+
bool :replace, cache: true
|
|
16
|
+
|
|
17
|
+
def created
|
|
18
|
+
replace(true) unless instance_variable_defined?(:@replace)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
11
21
|
end
|
|
12
22
|
end
|
|
@@ -4,71 +4,87 @@ page = json_ui_page json
|
|
|
4
4
|
|
|
5
5
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
6
6
|
|
|
7
|
-
page.form
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
page.form(
|
|
8
|
+
id: 'form',
|
|
9
|
+
url: json_ui_garage_url(path: 'forms/generic_post'),
|
|
10
|
+
method: 'post',
|
|
11
|
+
padding: glib_json_padding_body,
|
|
12
|
+
childViews: ->(form) do
|
|
13
|
+
form.spacer height: 20
|
|
14
|
+
form.h2 text: 'Basic select fields'
|
|
15
|
+
form.spacer height: 6
|
|
16
|
+
languages = {
|
|
13
17
|
'brisbane' => 'Brisbane',
|
|
14
18
|
'canberra' => 'Canberra',
|
|
15
19
|
'melbourne' => 'Melbourne',
|
|
16
20
|
'sydney' => 'Sydney',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
21
|
+
}
|
|
22
|
+
form.panels_responsive(
|
|
23
|
+
childViews: ->(column) do
|
|
24
|
+
options = languages.map do |k, v|
|
|
25
|
+
{ value: k, text: v }
|
|
26
|
+
end
|
|
27
|
+
column.fields_select(
|
|
28
|
+
name: 'user[city]',
|
|
29
|
+
width: 'matchParent',
|
|
30
|
+
clearable: true,
|
|
31
|
+
label: 'City1',
|
|
32
|
+
placeholder: 'This is a placeholder',
|
|
33
|
+
options: options,
|
|
34
|
+
value: 'canberra',
|
|
35
|
+
disabled: true,
|
|
36
|
+
leftIcon: { name: 'info', styleClasses: ['success'] },
|
|
37
|
+
onChange: ->(action) do
|
|
38
|
+
action.components_findClosest(
|
|
39
|
+
view: 'panels/responsive',
|
|
40
|
+
onFind: ->(find) do
|
|
41
|
+
# This is to demonstrate that `components_set` can be a more flexible version
|
|
42
|
+
# of `components_replace`.
|
|
43
|
+
find.components_set(
|
|
44
|
+
dataBuilder: ->(set) do
|
|
45
|
+
# Don't update the childViews, just update the footer
|
|
46
|
+
set.panels_responsive(
|
|
47
|
+
accessory: ->(accessory) do
|
|
48
|
+
accessory.footer(
|
|
49
|
+
childViews: ->(footer) do
|
|
50
|
+
footer.label text: 'New footer'
|
|
51
|
+
end
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
)
|
|
42
57
|
end
|
|
43
|
-
|
|
58
|
+
)
|
|
44
59
|
end
|
|
45
|
-
|
|
60
|
+
)
|
|
61
|
+
end,
|
|
62
|
+
accessory: ->(accessory) do
|
|
63
|
+
accessory.footer(
|
|
64
|
+
childViews: ->(footer) do
|
|
65
|
+
footer.label text: 'Original footer'
|
|
66
|
+
end
|
|
67
|
+
)
|
|
46
68
|
end
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
form.spacer height: 6
|
|
54
|
-
|
|
55
|
-
options = languages.map { |k, v| { value: k, text: v } }
|
|
56
|
-
options << { value: 'none_of_above', text: 'None of the above' }
|
|
57
|
-
form.fields_select \
|
|
58
|
-
valueForDisableAll: 'none_of_above',
|
|
69
|
+
)
|
|
70
|
+
form.spacer height: 6
|
|
71
|
+
options = languages.map { |k, v| { value: k, text: v } }
|
|
72
|
+
options << { value: 'none_of_above', text: 'None of the above' }
|
|
73
|
+
form.fields_select(
|
|
74
|
+
valueForDisableAll: 'none_of_above',
|
|
59
75
|
name: 'user[cities][]',
|
|
60
76
|
width: 'matchParent',
|
|
61
77
|
label: 'Cities',
|
|
62
78
|
options: options,
|
|
63
79
|
value: ['melbourne', 'sydney'],
|
|
64
80
|
multiple: true,
|
|
65
|
-
|
|
81
|
+
onChange: ->(action) do
|
|
66
82
|
action.dialogs_alert message: 'Options selected'
|
|
67
83
|
end
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
84
|
+
)
|
|
85
|
+
form.spacer height: 6
|
|
86
|
+
form.fields_select(
|
|
87
|
+
valueForDisableAll: 'none_of_above',
|
|
72
88
|
prependSelectAll: true,
|
|
73
89
|
name: 'user[cities2][]',
|
|
74
90
|
width: 'matchParent',
|
|
@@ -76,143 +92,193 @@ page.form id: 'form', url: json_ui_garage_url(path: 'forms/generic_post'), metho
|
|
|
76
92
|
options: options[0..-2],
|
|
77
93
|
value: ['melbourne', 'sydney'],
|
|
78
94
|
multiple: true
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
languages = {
|
|
95
|
+
)
|
|
96
|
+
form.spacer height: 20
|
|
97
|
+
form.h2 text: 'Select fields with grouping'
|
|
98
|
+
form.spacer height: 6
|
|
99
|
+
form.label text: 'Applicable to select fields with many options'
|
|
100
|
+
form.spacer height: 6
|
|
101
|
+
languages = {
|
|
87
102
|
'East Asia' => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
103
|
+
'cn' => 'Chinese',
|
|
104
|
+
'jp' => 'Japanese',
|
|
105
|
+
'kr' => 'Korean',
|
|
91
106
|
},
|
|
92
107
|
'Middle East' => {
|
|
93
|
-
|
|
94
|
-
|
|
108
|
+
'sa' => 'Arabic',
|
|
109
|
+
'in' => 'Hindi',
|
|
95
110
|
},
|
|
96
111
|
'Europe' => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
'an' => 'Dutch',
|
|
113
|
+
'en' => 'English',
|
|
114
|
+
'fr' => 'French',
|
|
115
|
+
'de' => 'German',
|
|
116
|
+
'it' => 'Italian',
|
|
117
|
+
'pt' => 'Portuguese',
|
|
118
|
+
'es' => 'Spanish',
|
|
104
119
|
},
|
|
105
120
|
'Eastern Europe' => {
|
|
106
|
-
|
|
121
|
+
'ru' => 'Russian',
|
|
107
122
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
footer.h3 text: 'Footer'
|
|
128
|
-
# footer.spacer height: 4
|
|
129
|
-
footer.p styleClass: 'select-footer-paragraph', text: %(
|
|
130
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tortor consequat id porta nibh venenatis cras sed. Amet consectetur adipiscing elit duis tristique sollicitudin nibh. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Velit egestas dui id ornare arcu odio. Pretium nibh ipsum consequat nisl vel pretium. Bibendum at varius vel pharetra. Leo duis ut diam quam nulla porttitor massa id. Consectetur libero id faucibus nisl tincidunt eget nullam non. Eu facilisis sed odio morbi quis. Eu volutpat odio facilisis mauris sit amet massa vitae tortor. Sed odio morbi quis commodo odio aenean sed. Sit amet justo donec enim diam. Ullamcorper a lacus vestibulum sed arcu non odio euismod.
|
|
123
|
+
}
|
|
124
|
+
options = []
|
|
125
|
+
languages.each do |group, sub|
|
|
126
|
+
options << { type: 'label', text: group }
|
|
127
|
+
options.concat(sub.map { |k, v| { value: k, text: v, subtitle: 'Country', imageUrl: "https://flagsapi.com/#{k.upcase}/flat/24.png" } })
|
|
128
|
+
options << { type: 'divider' }
|
|
129
|
+
end
|
|
130
|
+
form.fields_select(
|
|
131
|
+
name: 'user[language]',
|
|
132
|
+
width: 'matchParent',
|
|
133
|
+
label: 'Primary Language',
|
|
134
|
+
options: options,
|
|
135
|
+
value: 'an',
|
|
136
|
+
accessory: ->(accessory) do
|
|
137
|
+
accessory.header(
|
|
138
|
+
padding: { x: 16, y: 10 },
|
|
139
|
+
childViews: ->(header) do
|
|
140
|
+
header.label text: 'Header'
|
|
141
|
+
end
|
|
131
142
|
)
|
|
132
|
-
footer
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
143
|
+
accessory.footer(
|
|
144
|
+
styleClass: 'select-footer',
|
|
145
|
+
padding: { x: 16, y: 10 },
|
|
146
|
+
childViews: ->(footer) do
|
|
147
|
+
footer.h3 text: 'Footer'
|
|
148
|
+
# footer.spacer height: 4
|
|
149
|
+
footer.p(
|
|
150
|
+
styleClass: 'select-footer-paragraph',
|
|
151
|
+
text: %(
|
|
152
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tortor consequat id porta nibh venenatis cras sed. Amet consectetur adipiscing elit duis tristique sollicitudin nibh. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Velit egestas dui id ornare arcu odio. Pretium nibh ipsum consequat nisl vel pretium. Bibendum at varius vel pharetra. Leo duis ut diam quam nulla porttitor massa id. Consectetur libero id faucibus nisl tincidunt eget nullam non. Eu facilisis sed odio morbi quis. Eu volutpat odio facilisis mauris sit amet massa vitae tortor. Sed odio morbi quis commodo odio aenean sed. Sit amet justo donec enim diam. Ullamcorper a lacus vestibulum sed arcu non odio euismod.
|
|
153
|
+
)
|
|
154
|
+
)
|
|
155
|
+
footer.spacer height: 14
|
|
156
|
+
footer.label(
|
|
157
|
+
text: 'Click me',
|
|
158
|
+
onClick: ->(action) do
|
|
159
|
+
action.components_findClosest(
|
|
160
|
+
view: 'fields/select',
|
|
161
|
+
onFind: ->(subaction) do
|
|
162
|
+
subaction.components_set(
|
|
163
|
+
data: { value: 'pt' },
|
|
164
|
+
onSet: ->(subsubaction) do
|
|
165
|
+
subsubaction.fields_blur
|
|
166
|
+
end
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
)
|
|
170
|
+
end
|
|
171
|
+
)
|
|
138
172
|
end
|
|
139
|
-
|
|
173
|
+
)
|
|
140
174
|
end
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
175
|
+
)
|
|
176
|
+
form.fields_select(
|
|
177
|
+
id: 'lang',
|
|
178
|
+
name: 'user[languages][]',
|
|
179
|
+
width: 'matchParent',
|
|
180
|
+
label: 'Primary Language',
|
|
181
|
+
options: options,
|
|
182
|
+
value: ['jp', 'de'],
|
|
183
|
+
accessory: ->(view) do
|
|
184
|
+
view.footer(
|
|
185
|
+
padding: { x: 16, y: 10 },
|
|
186
|
+
width: 'matchParent',
|
|
187
|
+
styleClass: 'sticky-footer',
|
|
188
|
+
childViews: ->(footer) do
|
|
189
|
+
footer.panels_flow(
|
|
190
|
+
width: 'matchParent',
|
|
191
|
+
styleClass: 'justify-end',
|
|
192
|
+
childViews: ->(hori) do
|
|
193
|
+
hori.label(
|
|
194
|
+
text: 'Reset',
|
|
195
|
+
styleClass: 'text-primary',
|
|
196
|
+
onClick: ->(action) do
|
|
197
|
+
action.components_set targetId: 'lang', data: { value: [] }
|
|
198
|
+
end
|
|
199
|
+
)
|
|
200
|
+
hori.spacer width: 16
|
|
201
|
+
hori.label(
|
|
202
|
+
text: 'Apply',
|
|
203
|
+
styleClass: 'text-primary',
|
|
204
|
+
onClick: ->(action) do
|
|
205
|
+
action.forms_submit targetId: 'form'
|
|
206
|
+
end
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
)
|
|
160
210
|
end
|
|
161
|
-
|
|
211
|
+
)
|
|
162
212
|
end,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
languages = {
|
|
213
|
+
multiple: true
|
|
214
|
+
)
|
|
215
|
+
form.spacer height: 6
|
|
216
|
+
form.label text: 'Options from http/get'
|
|
217
|
+
form.spacer height: 6
|
|
218
|
+
form.fields_select(
|
|
219
|
+
name: 'user[animal_or_plant]',
|
|
220
|
+
width: 'matchParent',
|
|
221
|
+
label: 'Animal or Plant',
|
|
222
|
+
options: [{ icon: { name: 'pets' }, text: 'Animal', value: 'animal' }, { icon: { name: 'forest' }, text: 'Plant', value: 'plant' }],
|
|
223
|
+
value: 'animal',
|
|
224
|
+
onChangeAndLoad: ->(action) do
|
|
225
|
+
action.http_get url: json_ui_garage_url(path: 'forms/update_options')
|
|
226
|
+
end
|
|
227
|
+
)
|
|
228
|
+
form.fields_select(
|
|
229
|
+
id: 'options',
|
|
230
|
+
name: 'user[choose_animal_or_plant]',
|
|
231
|
+
width: 'matchParent',
|
|
232
|
+
label: 'Choose',
|
|
233
|
+
options: []
|
|
234
|
+
)
|
|
235
|
+
form.spacer height: 20
|
|
236
|
+
form.h2 text: 'Select fields with empty values'
|
|
237
|
+
form.spacer height: 6
|
|
238
|
+
form.label text: 'It is not recommended to use nil because when the value gets submitted, it is not distinguishable from an empty string.'
|
|
239
|
+
form.spacer height: 6
|
|
240
|
+
languages = {
|
|
192
241
|
nil => 'Nil',
|
|
193
242
|
'' => 'Unspecified',
|
|
194
243
|
'specified' => 'Specified',
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
244
|
+
}
|
|
245
|
+
form.fields_select name: 'user[empty_default]', width: 'matchParent', label: 'Unspecified Default', options: languages.map { |k, v| { value: k, text: v } }, value: ''
|
|
246
|
+
form.fields_select name: 'user[nil_default]', width: 'matchParent', label: 'Nil Default', options: languages.map { |k, v| { value: k, text: v } }
|
|
247
|
+
form.fields_select name: 'user[mixed_default][]', width: 'matchParent', label: 'Mixed Default', options: languages.map { |k, v| { value: k, text: v } }, value: ['', 'specified', nil], multiple: true
|
|
248
|
+
form.spacer height: 20
|
|
249
|
+
form.h2 text: 'Timezone selection'
|
|
250
|
+
form.spacer height: 6
|
|
251
|
+
form.label text: 'The select field defaults to the device\'s time zone.'
|
|
252
|
+
form.spacer height: 6
|
|
253
|
+
form.fields_timeZone name: 'user[time_zone]', width: 'matchParent', label: 'Time Zone', clearable: true
|
|
254
|
+
form.spacer height: 6
|
|
255
|
+
form.fields_timeZone(
|
|
256
|
+
name: 'user[new_time_zone]',
|
|
257
|
+
width: 'matchParent',
|
|
258
|
+
label: 'Time Zone',
|
|
259
|
+
clearable: true,
|
|
260
|
+
value: 'America/Chicago'
|
|
261
|
+
)
|
|
262
|
+
# value: 'Australia/Melbourne'
|
|
263
|
+
form.spacer height: 20
|
|
264
|
+
form.h2 text: 'Update spec.options'
|
|
265
|
+
form.spacer height: 6
|
|
266
|
+
spec_options = ['alpha', 'beta', 'gamma'].map { |v| { text: v.humanize, value: v } }
|
|
267
|
+
spec_options_alt = ['delta', 'epsilon', 'zeta'].map { |v| { text: v.humanize, value: v } }
|
|
268
|
+
form.fields_select(
|
|
269
|
+
id: 'spec_options_select',
|
|
270
|
+
name: 'user[spec_options]',
|
|
271
|
+
width: 'matchParent',
|
|
272
|
+
label: 'Spec options select',
|
|
273
|
+
options: spec_options,
|
|
274
|
+
value: 'alpha'
|
|
275
|
+
)
|
|
276
|
+
form.button(
|
|
277
|
+
text: 'Swap spec options',
|
|
278
|
+
onClick: ->(action) do
|
|
279
|
+
action.components_set targetId: 'spec_options_select', data: { 'spec.options' => spec_options_alt }
|
|
280
|
+
end
|
|
281
|
+
)
|
|
282
|
+
form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
283
|
+
end
|
|
284
|
+
)
|
|
@@ -6,30 +6,6 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
|
6
6
|
# submit_button_id = 'save_button_top'
|
|
7
7
|
|
|
8
8
|
page.scroll childViews: ->(scroll) do
|
|
9
|
-
# scroll.panels_bulkEdit \
|
|
10
|
-
# import: { submitUrl: json_ui_garage_url(path: 'forms/bulk_edit_post'), paramName: 'user' },
|
|
11
|
-
# statusViewIdPrefix: 'row_status_',
|
|
12
|
-
# firstSection: ->(section) do
|
|
13
|
-
# section.header cellViews: ->(header) do
|
|
14
|
-
# header.label text: 'month'
|
|
15
|
-
# header.label text: 'electricity_usage'
|
|
16
|
-
# header.label text: 'gas_usage'
|
|
17
|
-
# end
|
|
18
|
-
# end,
|
|
19
|
-
# accessory: ->(accessory) do
|
|
20
|
-
# accessory.header childViews: ->(header) do
|
|
21
|
-
# header.button \
|
|
22
|
-
# text: 'Save',
|
|
23
|
-
# id: submit_button_id,
|
|
24
|
-
# displayed: false,
|
|
25
|
-
# onClick: ->(action) do
|
|
26
|
-
# action.forms_submit
|
|
27
|
-
# end
|
|
28
|
-
# end
|
|
29
|
-
# end,
|
|
30
|
-
# onLoadRows: ->(action) do
|
|
31
|
-
# action.components_set targetId: submit_button_id, data: { displayed: true }
|
|
32
|
-
# end
|
|
33
9
|
|
|
34
10
|
options = [{ text: 'yes', value: 'yes' }, { text: 'no', value: 'no' }]
|
|
35
11
|
source_options = ['Generators', 'Power Station', 'Solar Panels'].map do |o|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
nav_groups = {
|
|
2
2
|
'Actions' => [
|
|
3
3
|
'browsers',
|
|
4
|
+
'auth',
|
|
4
5
|
'commands',
|
|
5
6
|
'components',
|
|
6
7
|
'cookies',
|
|
7
8
|
'dialog',
|
|
9
|
+
'fields',
|
|
8
10
|
'forms',
|
|
9
11
|
'http',
|
|
10
12
|
'lifecycle',
|
|
@@ -22,7 +24,11 @@ nav_groups = {
|
|
|
22
24
|
'Forms' => [
|
|
23
25
|
'auto_validate',
|
|
24
26
|
'dirty_state',
|
|
25
|
-
'
|
|
27
|
+
'fields_select',
|
|
28
|
+
'fields_dynamicSelect',
|
|
29
|
+
'fields_sign',
|
|
30
|
+
'fields_timer',
|
|
31
|
+
'fields_upload',
|
|
26
32
|
'form',
|
|
27
33
|
'form_dynamic',
|
|
28
34
|
'multiupload',
|
|
@@ -39,6 +45,7 @@ nav_groups = {
|
|
|
39
45
|
'flow',
|
|
40
46
|
'grid',
|
|
41
47
|
'horizontal',
|
|
48
|
+
'panels_bulkEdit2',
|
|
42
49
|
'pagination',
|
|
43
50
|
'responsive',
|
|
44
51
|
'scroll',
|
|
@@ -67,25 +74,28 @@ view.panels_vertical(
|
|
|
67
74
|
width: 'matchParent',
|
|
68
75
|
childViews: ->(res) do
|
|
69
76
|
nav_groups.each_with_index do |(group_name, items), group_index|
|
|
70
|
-
res.panels_flow
|
|
71
|
-
|
|
72
|
-
flow
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
res.panels_flow(
|
|
78
|
+
innerPadding: { bottom: 0 },
|
|
79
|
+
childViews: ->(flow) do
|
|
80
|
+
flow.label text: "#{group_name}:"
|
|
81
|
+
flow.spacer width: 6
|
|
82
|
+
items.each_with_index do |nav, index|
|
|
83
|
+
nav_path = "test_page/#{nav}"
|
|
84
|
+
is_current = current_path == nav_path
|
|
85
|
+
if index != 0
|
|
86
|
+
flow.spacer width: 8
|
|
87
|
+
end
|
|
88
|
+
label_options = {
|
|
80
89
|
text: nav,
|
|
81
90
|
onClick: ->(action) do
|
|
82
91
|
action.windows_open url: json_ui_garage_url(path: nav_path)
|
|
83
92
|
end
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
}
|
|
94
|
+
label_options[:styleClass] = 'font-weight-bold' if is_current
|
|
95
|
+
flow.label(**label_options)
|
|
96
|
+
end
|
|
87
97
|
end
|
|
88
|
-
|
|
98
|
+
)
|
|
89
99
|
res.spacer height: 4 if group_index < nav_groups.size - 1
|
|
90
100
|
end
|
|
91
101
|
end
|