glib-web 4.14.1 → 4.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/glib/json_ui/abstract_builder.rb +1 -1
- data/app/helpers/glib/json_ui/action_builder/components.rb +2 -0
- data/app/helpers/glib/json_ui/action_builder/popovers.rb +2 -2
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +12 -1
- data/app/helpers/glib/json_ui/page_helper.rb +1 -1
- data/app/helpers/glib/json_ui/view_builder/fields.rb +3 -2
- data/app/helpers/glib/json_ui/view_builder.rb +1 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +16 -0
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +18 -18
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +4 -4
- data/app/views/json_ui/garage/tables/panel_content.json.jbuilder +1 -1
- data/app/views/json_ui/garage/views/controls.json.jbuilder +27 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b09283a44453982b74ec17941ae1d9ba3d764beb0e5152671c25309c33b03ce
|
4
|
+
data.tar.gz: 67ccedb988fa1241b94224e4c0d452b002eec9056fb7b30cab761be68c59142b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce53046753706806f836a5278bd5a94e4ff27ac6b8fc32ee397448ac9fd12f609e58cc9356d0cebad24ba10e273c7512c08d29dce6f9d2ecf9ba1e6c5e18a087
|
7
|
+
data.tar.gz: 7f3a889e5a39f51fc79d4b85c396b253546ddd705294b020caaf5c1b820f262d0a690b2e72a764b5398a50ed3842de5c2b347ff62a4a231b1baa7aed0915c29f
|
@@ -289,7 +289,7 @@ module Glib
|
|
289
289
|
optional = options[:optional] || []
|
290
290
|
|
291
291
|
required.each do |req|
|
292
|
-
raise ArgumentError, "Hash property: '#{req}' is required" if value[req.to_s].
|
292
|
+
raise ArgumentError, "Hash property: '#{req}' is required" if value[req.to_s].nil?
|
293
293
|
end
|
294
294
|
|
295
295
|
if optional.present?
|
@@ -10,8 +10,8 @@ class Glib::JsonUi::ActionBuilder
|
|
10
10
|
int :offset
|
11
11
|
int :width
|
12
12
|
bool :persistent
|
13
|
-
|
14
|
-
|
13
|
+
hash :overlay, required: [:closeOnFocus]
|
14
|
+
singleton_array :styleClass, :styleClasses
|
15
15
|
end
|
16
16
|
|
17
17
|
class Close < Action
|
@@ -3,13 +3,24 @@ class Glib::JsonUi::ActionBuilder
|
|
3
3
|
|
4
4
|
class Select < Action
|
5
5
|
string :message
|
6
|
-
|
6
|
+
|
7
|
+
def overlay(value)
|
8
|
+
@overlay = value
|
9
|
+
end
|
7
10
|
|
8
11
|
def buttons(block)
|
9
12
|
json.buttons do
|
10
13
|
block.call page.menu_builder
|
11
14
|
end
|
12
15
|
end
|
16
|
+
|
17
|
+
def created
|
18
|
+
if @overlay.nil?
|
19
|
+
@overlay = true
|
20
|
+
end
|
21
|
+
|
22
|
+
json.overlay @overlay
|
23
|
+
end
|
13
24
|
end
|
14
25
|
|
15
26
|
end
|
@@ -169,7 +169,7 @@ module Glib
|
|
169
169
|
|
170
170
|
def leftDrawer(options = {})
|
171
171
|
json.leftDrawer do
|
172
|
-
[:styleClasses, :backgroundColor].each do |name|
|
172
|
+
[:styleClasses, :backgroundColor, :drawerWidth].each do |name|
|
173
173
|
if (value = options.delete(name))
|
174
174
|
json.set! name, value
|
175
175
|
end
|
@@ -12,6 +12,7 @@ class Glib::JsonUi::ViewBuilder
|
|
12
12
|
action :onChangeAndLoad
|
13
13
|
string :paramNameForFormData
|
14
14
|
string :paramNameForFieldName
|
15
|
+
bool :rounded
|
15
16
|
|
16
17
|
def default_url_options
|
17
18
|
{ only_path: true }
|
@@ -163,7 +164,7 @@ class Glib::JsonUi::ViewBuilder
|
|
163
164
|
class CheckGroup < AbstractField
|
164
165
|
views :childViews
|
165
166
|
string :uncheckValue
|
166
|
-
|
167
|
+
string :valueForDisableAll
|
167
168
|
end
|
168
169
|
|
169
170
|
class Check < Text
|
@@ -204,7 +205,7 @@ class Glib::JsonUi::ViewBuilder
|
|
204
205
|
|
205
206
|
panels_builder :accessory, :header, :footer
|
206
207
|
bool :clearable
|
207
|
-
|
208
|
+
string :valueForDisableAll
|
208
209
|
bool :prependSelectAll
|
209
210
|
# bool :csvMode
|
210
211
|
|
@@ -5,7 +5,7 @@ end
|
|
5
5
|
|
6
6
|
section.rows builder: ->(template) do
|
7
7
|
template.thumbnail title: 'sheets/select', onClick: ->(action) do
|
8
|
-
action.sheets_select
|
8
|
+
action.sheets_select message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rutrum vel nisi in pharetra. Aenean mollis feugiat elementum. Donec tempor arcu fringilla risus finibus cursus. Donec eleifend ex sit amet odio rutrum, vitae ornare nunc congue. In hac habitasse platea dictumst. Curabitur at velit et odio ornare vestibulum sit amet vitae ex. Proin tincidunt rutrum libero vitae tempus.', buttons: ->(menu) do
|
9
9
|
menu.button text: 'Option1', onClick: ->(subaction) do
|
10
10
|
subaction.dialogs_alert message: 'Option 1'
|
11
11
|
end
|
@@ -47,7 +47,7 @@ page.scroll childViews: ->(scroll) do
|
|
47
47
|
form.spacer height: 20
|
48
48
|
form.h2 text: 'Checkboxes with none_of_above'
|
49
49
|
form.fields_checkGroup \
|
50
|
-
|
50
|
+
valueForDisableAll: 'none_of_above',
|
51
51
|
name: 'user[favorite_fruits][]',
|
52
52
|
value: 'grape',
|
53
53
|
uncheckValue: 1,
|
@@ -16,15 +16,18 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
16
16
|
{ name: 'question', value: 'Quality of work' },
|
17
17
|
{ name: 'type', value: 'rating' },
|
18
18
|
{ name: 'enabled', value: '1' },
|
19
|
+
{ name: 'error_message', value: 'Wrong answer' }
|
19
20
|
],
|
20
21
|
[
|
21
22
|
{ name: 'question', value: 'Satisfied?' },
|
22
23
|
{ name: 'type', value: 'yes_no' },
|
24
|
+
{ name: 'error_message', value: 'Incompatible selection' }
|
23
25
|
]
|
24
26
|
]
|
25
27
|
form.fields_dynamicGroup id: 'form_dynamic_group', width: 'matchParent', name: 'user[evaluation]', groupFieldProperties: properties, titlePrefix: 'Entry', content: ->(group) do
|
26
28
|
group.template padding: { left: 32 }, childViews: ->(template) do
|
27
29
|
template.spacer height: 10
|
30
|
+
template.fields_hidden name: 'error_message'
|
28
31
|
template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
|
29
32
|
|
30
33
|
form.panels_responsive id: 'responsive_{{entry_index}}', childViews: ->(column) do
|
@@ -84,6 +87,19 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
84
87
|
end
|
85
88
|
end
|
86
89
|
|
90
|
+
template.icon \
|
91
|
+
id: 'error_icon_{{entry_index}}',
|
92
|
+
name: 'error',
|
93
|
+
onLoad: ->(action) do
|
94
|
+
action.logics_set debug: true, targetId: 'error_icon_{{entry_index}}', conditionalData: {
|
95
|
+
displayed: {
|
96
|
+
"!!": [
|
97
|
+
{ 'var': '{{entry_prefix}}[error_message]' }
|
98
|
+
]
|
99
|
+
},
|
100
|
+
'tooltip.text': { 'var': '{{entry_prefix}}[error_message]' }
|
101
|
+
}
|
102
|
+
end
|
87
103
|
template.panels_vertical id: 'choices_panel_{{entry_index}}', childViews: ->(vertical) do
|
88
104
|
(1..5).each do |i|
|
89
105
|
vertical.fields_text \
|
@@ -53,27 +53,27 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
53
53
|
options = languages.map { |k, v| { value: k, text: v } }
|
54
54
|
options << { value: 'none_of_above', text: 'None of the above' }
|
55
55
|
form.fields_select \
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
56
|
+
valueForDisableAll: 'none_of_above',
|
57
|
+
name: 'user[cities][]',
|
58
|
+
width: 'matchParent',
|
59
|
+
label: 'Cities',
|
60
|
+
options: options,
|
61
|
+
value: ['melbourne', 'sydney'],
|
62
|
+
multiple: true,
|
63
|
+
onChange: ->(action) do
|
64
|
+
action.dialogs_alert message: 'Options selected'
|
65
|
+
end
|
66
66
|
|
67
67
|
form.spacer height: 6
|
68
68
|
form.fields_select \
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
valueForDisableAll: 'none_of_above',
|
70
|
+
prependSelectAll: true,
|
71
|
+
name: 'user[cities2][]',
|
72
|
+
width: 'matchParent',
|
73
|
+
label: 'Cities',
|
74
|
+
options: options[0..-2],
|
75
|
+
value: ['melbourne', 'sydney'],
|
76
|
+
multiple: true
|
77
77
|
|
78
78
|
form.spacer height: 20
|
79
79
|
form.h2 text: 'Select fields with grouping'
|
@@ -126,19 +126,19 @@ page.form \
|
|
126
126
|
end,
|
127
127
|
childViews: ->(group) do
|
128
128
|
group.panels_responsive width: 'matchParent', childViews: ->(res) do
|
129
|
-
|
130
|
-
res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
|
129
|
+
res.panels_column width: 'matchParent', height: 'matchParent', lg: { cols: 4, padding: { x: 10 } }, childViews: ->(column) do
|
131
130
|
column.fields_radio\
|
132
131
|
width: 'matchParent',
|
132
|
+
height: 'matchParent',
|
133
133
|
value: 'yes', label: 'Yes', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' },
|
134
134
|
onClick: ->(action) do
|
135
135
|
action.windows_openWeb url: 'http://www.google.com'
|
136
136
|
end
|
137
137
|
end
|
138
|
-
res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
|
138
|
+
res.panels_column width: 'matchParent', lg: { cols: 4, padding: { x: 10 } }, childViews: ->(column) do
|
139
139
|
column.fields_radio\
|
140
140
|
width: 'matchParent',
|
141
|
-
value: 'no', label: 'No',
|
141
|
+
value: 'no', label: 'No (very very very very very very very very very very very long description)',
|
142
142
|
image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 },
|
143
143
|
onClick: ->(action) do
|
144
144
|
action.windows_openWeb url: 'http://www.google.com'
|
@@ -29,7 +29,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
29
29
|
header.label text: 'Unordered List'
|
30
30
|
end
|
31
31
|
|
32
|
-
items = [1
|
32
|
+
items = [1]
|
33
33
|
section.rows objects: items, builder: ->(row, item, index) do
|
34
34
|
row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
|
35
35
|
cell.panels_horizontal childViews: ->(horizontal) do
|
@@ -4,7 +4,7 @@ page = json_ui_page json
|
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
5
|
|
6
6
|
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
7
|
-
scroll.h2 text: 'Button'
|
7
|
+
scroll.h2 text: 'Button', id: 'button'
|
8
8
|
scroll.spacer height: 20
|
9
9
|
|
10
10
|
scroll.button text: 'Button', onClick: ->(action) do
|
@@ -34,10 +34,13 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
34
34
|
|
35
35
|
action.popovers_show \
|
36
36
|
key: 'menu',
|
37
|
-
|
37
|
+
targetId: '_self',
|
38
|
+
overlay: { closeOnFocus: false },
|
38
39
|
placement: 'left',
|
40
|
+
styleClass: 'popover-container',
|
41
|
+
offset: 24,
|
39
42
|
content: ->(dialog) do
|
40
|
-
dialog.body
|
43
|
+
dialog.body childViews: ->(view) do
|
41
44
|
view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
|
42
45
|
res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
43
46
|
saction.windows_open url: json_ui_garage_url(path: 'pages/index')
|
@@ -45,7 +48,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
45
48
|
res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
46
49
|
saction.windows_open url: json_ui_garage_url(path: 'home/blank')
|
47
50
|
end
|
48
|
-
res.label text: '
|
51
|
+
res.label text: 'close', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
49
52
|
saction.popovers_close key: 'menu'
|
50
53
|
end
|
51
54
|
end
|
@@ -59,20 +62,19 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
59
62
|
tooltip: { text: 'Tooltip 1' },
|
60
63
|
onClick: ->(action) do
|
61
64
|
action.popovers_show \
|
62
|
-
key: '
|
65
|
+
key: 'menu2',
|
63
66
|
placement: 'bottom-start',
|
64
|
-
overlay: true,
|
65
67
|
width: 200,
|
66
68
|
content: ->(dialog) do
|
67
69
|
dialog.body styleClass: 'popover-menu', padding: glib_json_padding_body, childViews: ->(res) do
|
68
70
|
res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
69
|
-
saction.popovers_close key: '
|
71
|
+
saction.popovers_close key: 'menu2'
|
70
72
|
end
|
71
73
|
res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
72
|
-
saction.popovers_close key: '
|
74
|
+
saction.popovers_close key: 'menu2'
|
73
75
|
end
|
74
76
|
res.label text: 'Item 3 with very very very very very long name', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
75
|
-
saction.popovers_close key: '
|
77
|
+
saction.popovers_close key: 'menu2'
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
@@ -127,5 +129,21 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
127
129
|
onDisabled: ->(action) do
|
128
130
|
action.dialogs_alert message: 'Disabled'
|
129
131
|
end
|
132
|
+
scroll.spacer height: 20
|
133
|
+
|
134
|
+
scroll.h2 text: 'Highlight'
|
135
|
+
scroll.button text: 'Highlight', onClick: ->(action) do
|
136
|
+
action.popovers_show \
|
137
|
+
targetId: 'button',
|
138
|
+
key: 'menu',
|
139
|
+
placement: 'right',
|
140
|
+
offset: 24,
|
141
|
+
overlay: { closeOnFocus: true },
|
142
|
+
content: ->(dialog) do
|
143
|
+
dialog.body padding: glib_json_padding_body, styleClass: 'popover-menu', childViews: ->(res) do
|
144
|
+
res.label text: 'Hello world'
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
130
148
|
|
131
149
|
end
|