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
|
@@ -2,98 +2,167 @@ json.title 'Test Page (Table)'
|
|
|
2
2
|
|
|
3
3
|
page = json_ui_page json
|
|
4
4
|
|
|
5
|
-
page.body
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
page.body(
|
|
6
|
+
childViews: ->(body) do
|
|
7
|
+
render 'json_ui/garage/test_page/header', view: body
|
|
8
|
+
body.panels_responsive(
|
|
9
|
+
padding: glib_json_padding_body,
|
|
10
|
+
childViews: ->(res) do
|
|
11
|
+
res.h2 text: 'Overview'
|
|
12
|
+
res.p text: 'Table panels render rows with columns and support pagination and bulk actions.'
|
|
13
|
+
res.spacer height: 12
|
|
14
|
+
res.hr width: 'matchParent'
|
|
15
|
+
res.h2 text: 'Basic'
|
|
16
|
+
res.spacer height: 8
|
|
17
|
+
res.panels_table(
|
|
18
|
+
id: 'table_main',
|
|
19
|
+
import: { submitUrl: json_ui_garage_url(path: 'forms/generic_post'), paramName: 'table' },
|
|
20
|
+
export: { label: 'Export', fileName: 'table_export.csv' },
|
|
21
|
+
sections: [
|
|
22
|
+
->(section) do
|
|
23
|
+
section.header(
|
|
24
|
+
cellViews: ->(header) do
|
|
25
|
+
header.label text: 'Name'
|
|
26
|
+
header.label text: 'Status'
|
|
27
|
+
end
|
|
28
|
+
)
|
|
29
|
+
items = ['Alpha', 'Bravo', 'Charlie']
|
|
30
|
+
section.rows(
|
|
31
|
+
objects: items,
|
|
32
|
+
builder: ->(row, item, index) do
|
|
33
|
+
status = index.even? ? 'Active' : 'Paused'
|
|
34
|
+
row.default(
|
|
35
|
+
cellViews: ->(cell) do
|
|
36
|
+
cell.label text: item
|
|
37
|
+
cell.label text: status
|
|
38
|
+
end
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
)
|
|
22
42
|
end
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
res.spacer height: 12
|
|
46
|
+
res.hr width: 'matchParent'
|
|
47
|
+
res.h2 text: 'Variants and Props'
|
|
48
|
+
res.spacer height: 8
|
|
49
|
+
res.panels_flow(
|
|
50
|
+
innerPadding: { bottom: 0 },
|
|
51
|
+
childViews: ->(flow) do
|
|
52
|
+
flow.button(
|
|
53
|
+
text: 'Compact style',
|
|
54
|
+
onClick: ->(action) do
|
|
55
|
+
action.components_set targetId: 'table_main', data: { styleClass: 'table--compact' }
|
|
56
|
+
end
|
|
57
|
+
)
|
|
58
|
+
flow.spacer width: 4
|
|
59
|
+
flow.button(
|
|
60
|
+
text: 'Striped style',
|
|
61
|
+
onClick: ->(action) do
|
|
62
|
+
action.components_set targetId: 'table_main', data: { styleClass: 'table--striped' }
|
|
63
|
+
end
|
|
64
|
+
)
|
|
65
|
+
flow.spacer width: 4
|
|
66
|
+
flow.button(
|
|
67
|
+
text: 'Clear style',
|
|
68
|
+
onClick: ->(action) do
|
|
69
|
+
action.components_set targetId: 'table_main', data: { styleClass: nil }
|
|
70
|
+
end
|
|
71
|
+
)
|
|
30
72
|
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
row.default cellViews: ->(cell) do
|
|
74
|
-
cell.label text: "Row #{index}"
|
|
75
|
-
cell.label text: "Value #{index}"
|
|
76
|
-
end
|
|
73
|
+
)
|
|
74
|
+
res.spacer height: 12
|
|
75
|
+
res.hr width: 'matchParent'
|
|
76
|
+
res.h2 text: 'Actions and Events'
|
|
77
|
+
res.spacer height: 8
|
|
78
|
+
res.label id: 'table_event_status', text: 'Scroll events: idle'
|
|
79
|
+
res.spacer height: 6
|
|
80
|
+
res.panels_scroll(
|
|
81
|
+
height: 160,
|
|
82
|
+
width: 'matchParent',
|
|
83
|
+
childViews: ->(scroll) do
|
|
84
|
+
scroll.panels_table(
|
|
85
|
+
height: 'matchParent',
|
|
86
|
+
onScrollToTop: ->(action) do
|
|
87
|
+
action.components_set targetId: 'table_event_status', data: { text: 'Scroll events: top reached' }
|
|
88
|
+
end,
|
|
89
|
+
onScrollToBottom: ->(action) do
|
|
90
|
+
action.components_set targetId: 'table_event_status', data: { text: 'Scroll events: bottom reached' }
|
|
91
|
+
end,
|
|
92
|
+
sections: [
|
|
93
|
+
->(section) do
|
|
94
|
+
section.header(
|
|
95
|
+
cellViews: ->(header) do
|
|
96
|
+
header.label text: 'Item'
|
|
97
|
+
header.label text: 'Value'
|
|
98
|
+
end
|
|
99
|
+
)
|
|
100
|
+
section.rows(
|
|
101
|
+
builder: ->(row) do
|
|
102
|
+
(1..12).each do |index|
|
|
103
|
+
row.default(
|
|
104
|
+
cellViews: ->(cell) do
|
|
105
|
+
cell.label text: "Row #{index}"
|
|
106
|
+
cell.label text: "Value #{index}"
|
|
107
|
+
end
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
]
|
|
114
|
+
)
|
|
77
115
|
end
|
|
116
|
+
)
|
|
117
|
+
res.spacer height: 12
|
|
118
|
+
res.hr width: 'matchParent'
|
|
119
|
+
res.h2 text: 'Autoload'
|
|
120
|
+
res.spacer height: 8
|
|
121
|
+
res.label text: 'Scroll to load more rows (asNeeded).'
|
|
122
|
+
res.spacer height: 8
|
|
123
|
+
column_indexes = (1..3)
|
|
124
|
+
res.panels_table(
|
|
125
|
+
id: 'table_autoload',
|
|
126
|
+
height: 220,
|
|
127
|
+
nextPage: {
|
|
128
|
+
url: json_ui_garage_url(path: 'tables/autoload_as_needed', page: 1, col: 0, section_only: 'v1'),
|
|
129
|
+
autoload: 'asNeeded'
|
|
130
|
+
},
|
|
131
|
+
sections: [
|
|
132
|
+
->(section) do
|
|
133
|
+
section.header(
|
|
134
|
+
cellViews: ->(header) do
|
|
135
|
+
header.label text: ''
|
|
136
|
+
column_indexes.each do |i|
|
|
137
|
+
header.label text: "Heading#{i}"
|
|
138
|
+
end
|
|
139
|
+
header.label text: ''
|
|
140
|
+
end
|
|
141
|
+
)
|
|
142
|
+
render 'json_ui/garage/tables/autoload_section', page: page, page_index: 0, column_indexes: column_indexes
|
|
78
143
|
end
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
144
|
+
]
|
|
145
|
+
)
|
|
146
|
+
res.h2 text: 'Edge and Advanced'
|
|
147
|
+
res.spacer height: 8
|
|
148
|
+
res.label text: 'Empty table (no rows)'
|
|
149
|
+
res.panels_table(
|
|
150
|
+
sections: [
|
|
151
|
+
->(section) do
|
|
152
|
+
section.header(
|
|
153
|
+
cellViews: ->(header) do
|
|
154
|
+
header.label text: 'Column A'
|
|
155
|
+
header.label text: 'Column B'
|
|
156
|
+
end
|
|
157
|
+
)
|
|
158
|
+
section.rows(
|
|
159
|
+
builder: ->(_row) do
|
|
160
|
+
end
|
|
161
|
+
)
|
|
95
162
|
end
|
|
163
|
+
]
|
|
164
|
+
)
|
|
96
165
|
end
|
|
97
|
-
|
|
166
|
+
)
|
|
98
167
|
end
|
|
99
|
-
|
|
168
|
+
)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: glib-web
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.43.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
@@ -372,6 +372,7 @@ files:
|
|
|
372
372
|
- app/views/json_ui/garage/tables/pagination.json.jbuilder
|
|
373
373
|
- app/views/json_ui/garage/tables/panel_content.json.jbuilder
|
|
374
374
|
- app/views/json_ui/garage/test_page/_header.json.jbuilder
|
|
375
|
+
- app/views/json_ui/garage/test_page/auth.json.jbuilder
|
|
375
376
|
- app/views/json_ui/garage/test_page/auto_validate.json.jbuilder
|
|
376
377
|
- app/views/json_ui/garage/test_page/browsers.json.jbuilder
|
|
377
378
|
- app/views/json_ui/garage/test_page/calendar.json.jbuilder
|
|
@@ -386,7 +387,12 @@ files:
|
|
|
386
387
|
- app/views/json_ui/garage/test_page/dialog.json.jbuilder
|
|
387
388
|
- app/views/json_ui/garage/test_page/dialog_open.json.jbuilder
|
|
388
389
|
- app/views/json_ui/garage/test_page/dirty_state.json.jbuilder
|
|
389
|
-
- app/views/json_ui/garage/test_page/
|
|
390
|
+
- app/views/json_ui/garage/test_page/fields.json.jbuilder
|
|
391
|
+
- app/views/json_ui/garage/test_page/fields_dynamicSelect.json.jbuilder
|
|
392
|
+
- app/views/json_ui/garage/test_page/fields_select.json.jbuilder
|
|
393
|
+
- app/views/json_ui/garage/test_page/fields_sign.json.jbuilder
|
|
394
|
+
- app/views/json_ui/garage/test_page/fields_timer.json.jbuilder
|
|
395
|
+
- app/views/json_ui/garage/test_page/fields_upload.json.jbuilder
|
|
390
396
|
- app/views/json_ui/garage/test_page/flow.json.jbuilder
|
|
391
397
|
- app/views/json_ui/garage/test_page/form.json.jbuilder
|
|
392
398
|
- app/views/json_ui/garage/test_page/form_dynamic.json.jbuilder
|
|
@@ -404,6 +410,7 @@ files:
|
|
|
404
410
|
- app/views/json_ui/garage/test_page/multiupload.json.jbuilder
|
|
405
411
|
- app/views/json_ui/garage/test_page/pagination.json.jbuilder
|
|
406
412
|
- app/views/json_ui/garage/test_page/panels.json.jbuilder
|
|
413
|
+
- app/views/json_ui/garage/test_page/panels_bulkEdit2.json.jbuilder
|
|
407
414
|
- app/views/json_ui/garage/test_page/popovers.json.jbuilder
|
|
408
415
|
- app/views/json_ui/garage/test_page/progressCircle.json.jbuilder
|
|
409
416
|
- app/views/json_ui/garage/test_page/responsive.json.jbuilder
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
json.title 'Forms'
|
|
2
|
-
page = json_ui_page json
|
|
3
|
-
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
4
|
-
|
|
5
|
-
params[:mode] ||= 'html'
|
|
6
|
-
|
|
7
|
-
image = OpenStruct.new(
|
|
8
|
-
url: 'https://picsum.photos/id/11/100/60',
|
|
9
|
-
signed_id: 'test',
|
|
10
|
-
filename: 'upload.png'
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
accepts = {
|
|
14
|
-
fileType: 'image',
|
|
15
|
-
maxFileSize: 10,
|
|
16
|
-
maxFileLength: 2
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if params[:mode] == 'html'
|
|
20
|
-
directUploadUrl = nil
|
|
21
|
-
else
|
|
22
|
-
directUploadUrl = glib_direct_uploads_url
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
properties = {
|
|
26
|
-
styleClass: 'pb-2',
|
|
27
|
-
directUploadUrl: params,
|
|
28
|
-
accepts: accepts,
|
|
29
|
-
directUploadUrl: directUploadUrl,
|
|
30
|
-
value: image&.signed_id
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
# properties[:onMaxFileLengthError] = ->(action) do
|
|
34
|
-
# action.snackbars_alert message: 'max file length exceeded'
|
|
35
|
-
# end
|
|
36
|
-
|
|
37
|
-
# properties[:onMaxFileSizeError] = ->(action) do
|
|
38
|
-
# action.snackbars_alert message: 'max file size exceeded'
|
|
39
|
-
# end
|
|
40
|
-
|
|
41
|
-
# properties[:onFileTypeError] = ->(action) do
|
|
42
|
-
# action.snackbars_alert message: 'file type invalid'
|
|
43
|
-
# end
|
|
44
|
-
|
|
45
|
-
properties[:onFinishUpload] = ->(action) do # rubocop:disable Glib/MultilineMethodCallStyle
|
|
46
|
-
action.snackbars_alert message: 'Get the signed ids!'
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
page.form(
|
|
50
|
-
url: json_ui_garage_url(path: 'forms/generic_post'),
|
|
51
|
-
method: 'post',
|
|
52
|
-
childViews: ->(form) do
|
|
53
|
-
render 'json_ui/garage/test_page/header', view: form
|
|
54
|
-
|
|
55
|
-
# form.panels_flow(
|
|
56
|
-
# styleClass: 'items-center justify-center gap-2 pb-4',
|
|
57
|
-
# childViews: ->(flow) do
|
|
58
|
-
# flow.label text: "MODE: #{params[:mode] || 'directUpload'}"
|
|
59
|
-
# change = params[:mode] == 'html' ? 'directUpload' : 'html'
|
|
60
|
-
# flow.button text: 'Change', onClick: ->(action) { action.windows_open url: json_ui_garage_current_url({ mode: change }) }
|
|
61
|
-
# end
|
|
62
|
-
# )
|
|
63
|
-
|
|
64
|
-
form.h2 text: 'Field Upload', styleClass: 'pb-4'
|
|
65
|
-
form.label text: 'placeholder image', styleClass: 'pb-1'
|
|
66
|
-
form.panels_flow(
|
|
67
|
-
styleClass: 'align-center',
|
|
68
|
-
xs: { gap: { all: 4 } },
|
|
69
|
-
childViews: ->(flow) do
|
|
70
|
-
flow.fields_upload(
|
|
71
|
-
properties.merge(
|
|
72
|
-
name: 'user[file_placeholderView]',
|
|
73
|
-
id: 'pv1',
|
|
74
|
-
placeholderView: { type: 'image', url: image&.url, width: 144, height: 144 }
|
|
75
|
-
)
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
flow.button(
|
|
79
|
-
text: 'Trigger',
|
|
80
|
-
onClick: ->(action) do
|
|
81
|
-
action.components_invoke targetId: 'pv1', name: 'trigger'
|
|
82
|
-
end
|
|
83
|
-
)
|
|
84
|
-
flow.button(
|
|
85
|
-
text: 'Reset',
|
|
86
|
-
onClick: ->(action) do
|
|
87
|
-
action.components_invoke targetId: 'pv1', name: 'reset'
|
|
88
|
-
end
|
|
89
|
-
)
|
|
90
|
-
end
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
form.label text: 'placeholder avatar', styleClass: 'pb-1'
|
|
94
|
-
form.panels_flow(
|
|
95
|
-
styleClass: 'align-center',
|
|
96
|
-
xs: { gap: { all: 4 } },
|
|
97
|
-
childViews: ->(flow) do
|
|
98
|
-
flow.fields_upload(
|
|
99
|
-
properties.merge(
|
|
100
|
-
name: 'user[file_placeholderView2]',
|
|
101
|
-
id: 'pv2',
|
|
102
|
-
placeholderView: { type: 'avatar', url: image&.url, width: 64, height: 64 }
|
|
103
|
-
)
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
end
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
form.label text: 'file input', styleClass: 'pb-1'
|
|
110
|
-
form.fields_upload(
|
|
111
|
-
properties.merge(
|
|
112
|
-
name: 'user[file_input1]',
|
|
113
|
-
id: 'fi1',
|
|
114
|
-
label: 'Upload file',
|
|
115
|
-
width: 300,
|
|
116
|
-
label: 'Choose file',
|
|
117
|
-
inputView: { variant: 'outlined' },
|
|
118
|
-
multiple: false
|
|
119
|
-
)
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
form.label text: 'multiprogress', styleClass: 'pb-1'
|
|
124
|
-
form.fields_upload(
|
|
125
|
-
properties.merge(
|
|
126
|
-
name: 'user[file_multiprogress1][]',
|
|
127
|
-
id: 'mp1',
|
|
128
|
-
width: 300,
|
|
129
|
-
label: 'Upload file',
|
|
130
|
-
multiple: true,
|
|
131
|
-
multiProgressView: { files: [] }
|
|
132
|
-
)
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
form.label text: 'Button file upload', styleClass: 'pb-1'
|
|
137
|
-
form.button(
|
|
138
|
-
text: 'click me to select file',
|
|
139
|
-
onClick: ->(action) do
|
|
140
|
-
action.components_invoke targetId: 'btn1', name: 'trigger'
|
|
141
|
-
end
|
|
142
|
-
)
|
|
143
|
-
form.fields_upload(
|
|
144
|
-
properties.merge(
|
|
145
|
-
name: 'user[file_btn1][]',
|
|
146
|
-
id: 'btn1',
|
|
147
|
-
width: 300,
|
|
148
|
-
label: 'Upload file',
|
|
149
|
-
multiple: true,
|
|
150
|
-
inputView: { files: [] },
|
|
151
|
-
styleClass: 'pb-4 d-none'
|
|
152
|
-
)
|
|
153
|
-
)
|
|
154
|
-
|
|
155
|
-
form.fields_submit text: 'submit'
|
|
156
|
-
|
|
157
|
-
end
|
|
158
|
-
)
|