glib-web 6.12.0 → 7.0.0.beta1
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/controllers/concerns/glib/auth/policy.rb +1 -5
- data/app/controllers/concerns/glib/json/libs.rb +0 -33
- data/app/helpers/glib/json_ui/action_builder/bottom_banners.rb +0 -1
- data/app/helpers/glib/json_ui/action_builder/components.rb +1 -16
- data/app/helpers/glib/json_ui/action_builder/logics.rb +1 -2
- data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -16
- data/app/helpers/glib/json_ui/response_helper.rb +0 -12
- data/app/helpers/glib/json_ui/view_builder/fields.rb +4 -133
- data/app/helpers/glib/json_ui/view_builder/panels.rb +144 -8
- data/app/views/json_ui/garage/actions/_components.json.jbuilder +2 -2
- data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +3 -3
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +5 -5
- data/app/views/json_ui/garage/forms/update_options.json.jbuilder +1 -1
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +6 -6
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +10 -10
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +10 -10
- data/app/views/json_ui/garage/panels/ul.json.jbuilder +2 -2
- data/app/views/json_ui/garage/panels/vertical.json.jbuilder +10 -10
- data/app/views/json_ui/garage/tables/bulk_edit.json.jbuilder +14 -14
- data/app/views/json_ui/garage/test_page/_header.json.jbuilder +1 -1
- data/app/views/json_ui/garage/test_page/calendar.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/carousel.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/charts.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/column.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/components.json.jbuilder +7 -7
- data/app/views/json_ui/garage/test_page/custom.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/dialog.json.jbuilder +0 -21
- data/app/views/json_ui/garage/test_page/fields_creditCard.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_date_time.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_dynamicSelect.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_location.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_otp.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_phone.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/fields_radio.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/fields_rating.json.jbuilder +10 -10
- data/app/views/json_ui/garage/test_page/fields_richText.json.jbuilder +10 -10
- data/app/views/json_ui/garage/test_page/fields_select.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/fields_sign.json.jbuilder +8 -56
- data/app/views/json_ui/garage/test_page/fields_stripeExternalAccount.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_stripeToken.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/fields_text.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/fields_timer.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/flow.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/form.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/grid.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/horizontal.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/image.json.jbuilder +9 -9
- data/app/views/json_ui/garage/test_page/lifecycle.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/list.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/multimedia_docx.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/pagination.json.jbuilder +6 -6
- data/app/views/json_ui/garage/test_page/panels_bulkEdit2.json.jbuilder +244 -0
- data/app/views/json_ui/garage/test_page/panels_bulkEdit3.json.jbuilder +3 -3
- data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +8 -8
- data/app/views/json_ui/garage/test_page/responsive.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/scroll.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/split.json.jbuilder +1 -1
- data/app/views/json_ui/garage/test_page/table.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/timeline.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/ul.json.jbuilder +4 -4
- data/app/views/json_ui/garage/test_page/vertical.json.jbuilder +5 -5
- data/app/views/json_ui/garage/test_page/web.json.jbuilder +5 -5
- data/app/views/json_ui/garage/views/_expand_shrink_ex.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/controls.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/{components_set.json.jbuilder → logics_set.json.jbuilder} +2 -2
- data/lib/glib/engine.rb +0 -32
- data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +1 -1
- data/lib/glib/json_crawler/router.rb +0 -24
- data/lib/glib/json_ui/config.rb +1 -1
- data/lib/glib/test/changed_files_rubocop.rb +55 -0
- data/lib/glib/test_helpers.rb +7 -9
- data/lib/glib-web.rb +2 -4
- metadata +6 -37
- data/app/controllers/concerns/glib/auth/token_authenticatable.rb +0 -37
- data/app/controllers/glib/api_controller.rb +0 -52
- data/app/jobs/glib/purge_unattached_job.rb +0 -32
- data/app/models/concerns/glib/snapshot_v2.rb +0 -514
- data/app/models/glib/model.rb +0 -40
- data/app/models/glib/plain_model.rb +0 -23
- data/app/models/snapshot_blob_reference.rb +0 -20
- data/app/views/json_ui/garage/test_page/fields_change_trigger.json.jbuilder +0 -128
- data/lib/generators/glib/snapshot_v2_generator.rb +0 -54
- data/lib/generators/templates/snapshot_v2/add_snapshot_v2_columns.rb +0 -18
- data/lib/generators/templates/snapshot_v2/create_snapshot_blob_references.rb +0 -10
- data/lib/glib/purge_unattached/config.rb +0 -38
- data/lib/glib/test/full_suite_rubocop.rb +0 -87
- data/lib/glib/test/rubocop_guards.rb +0 -42
|
@@ -42,7 +42,7 @@ page.body(
|
|
|
42
42
|
flow.button(
|
|
43
43
|
text: 'Sample',
|
|
44
44
|
onClick: ->(action) do
|
|
45
|
-
action.
|
|
45
|
+
action.logics_set(
|
|
46
46
|
targetId: 'multimedia_docx_main',
|
|
47
47
|
data: { url: sample_url }
|
|
48
48
|
)
|
|
@@ -52,7 +52,7 @@ page.body(
|
|
|
52
52
|
flow.button(
|
|
53
53
|
text: 'Reload same',
|
|
54
54
|
onClick: ->(action) do
|
|
55
|
-
action.
|
|
55
|
+
action.logics_set(
|
|
56
56
|
targetId: 'multimedia_docx_main',
|
|
57
57
|
data: { url: alt_url }
|
|
58
58
|
)
|
|
@@ -71,7 +71,7 @@ page.body(
|
|
|
71
71
|
flow.button(
|
|
72
72
|
text: 'No URL',
|
|
73
73
|
onClick: ->(action) do
|
|
74
|
-
action.
|
|
74
|
+
action.logics_set(
|
|
75
75
|
targetId: 'multimedia_docx_main',
|
|
76
76
|
data: { url: nil }
|
|
77
77
|
)
|
|
@@ -81,7 +81,7 @@ page.body(
|
|
|
81
81
|
flow.button(
|
|
82
82
|
text: 'Broken URL',
|
|
83
83
|
onClick: ->(action) do
|
|
84
|
-
action.
|
|
84
|
+
action.logics_set(
|
|
85
85
|
targetId: 'multimedia_docx_main',
|
|
86
86
|
data: { url: missing_url }
|
|
87
87
|
)
|
|
@@ -91,7 +91,7 @@ page.body(
|
|
|
91
91
|
flow.button(
|
|
92
92
|
text: 'Custom messages',
|
|
93
93
|
onClick: ->(action) do
|
|
94
|
-
action.
|
|
94
|
+
action.logics_set(
|
|
95
95
|
targetId: 'multimedia_docx_main',
|
|
96
96
|
data: {
|
|
97
97
|
url: missing_url,
|
|
@@ -36,7 +36,7 @@ page.body(
|
|
|
36
36
|
flow.button(
|
|
37
37
|
text: 'Default size',
|
|
38
38
|
onClick: ->(action) do
|
|
39
|
-
action.
|
|
39
|
+
action.logics_set(
|
|
40
40
|
targetId: 'multimedia_video_main',
|
|
41
41
|
data: {
|
|
42
42
|
width: 560,
|
|
@@ -50,7 +50,7 @@ page.body(
|
|
|
50
50
|
flow.button(
|
|
51
51
|
text: 'Short URL',
|
|
52
52
|
onClick: ->(action) do
|
|
53
|
-
action.
|
|
53
|
+
action.logics_set(
|
|
54
54
|
targetId: 'multimedia_video_main',
|
|
55
55
|
data: { url: 'https://youtu.be/ATnpEOo3GJA' }
|
|
56
56
|
)
|
|
@@ -60,7 +60,7 @@ page.body(
|
|
|
60
60
|
flow.button(
|
|
61
61
|
text: 'Match parent',
|
|
62
62
|
onClick: ->(action) do
|
|
63
|
-
action.
|
|
63
|
+
action.logics_set(
|
|
64
64
|
targetId: 'multimedia_video_main',
|
|
65
65
|
data: { width: 'matchParent', height: 240 }
|
|
66
66
|
)
|
|
@@ -70,7 +70,7 @@ page.body(
|
|
|
70
70
|
flow.button(
|
|
71
71
|
text: 'Compact',
|
|
72
72
|
onClick: ->(action) do
|
|
73
|
-
action.
|
|
73
|
+
action.logics_set(
|
|
74
74
|
targetId: 'multimedia_video_main',
|
|
75
75
|
data: { width: 360, height: 200 }
|
|
76
76
|
)
|
|
@@ -96,7 +96,7 @@ page.body(
|
|
|
96
96
|
flow.button(
|
|
97
97
|
text: 'Wide 16:9',
|
|
98
98
|
onClick: ->(action) do
|
|
99
|
-
action.
|
|
99
|
+
action.logics_set(
|
|
100
100
|
targetId: 'multimedia_video_main',
|
|
101
101
|
data: { width: 640, height: 360 }
|
|
102
102
|
)
|
|
@@ -106,7 +106,7 @@ page.body(
|
|
|
106
106
|
flow.button(
|
|
107
107
|
text: 'Tall',
|
|
108
108
|
onClick: ->(action) do
|
|
109
|
-
action.
|
|
109
|
+
action.logics_set(
|
|
110
110
|
targetId: 'multimedia_video_main',
|
|
111
111
|
data: { width: 360, height: 480 }
|
|
112
112
|
)
|
|
@@ -16,7 +16,7 @@ page.body childViews: ->(body) do
|
|
|
16
16
|
res.h2 text: 'Basic'
|
|
17
17
|
res.spacer height: 8
|
|
18
18
|
res.panels_pagination id: 'pagination_main', length: 10, value: 1, onChange: ->(action) do
|
|
19
|
-
action.
|
|
19
|
+
action.logics_set targetId: 'pagination_status', data: { text: 'Page changed' }
|
|
20
20
|
end
|
|
21
21
|
res.label id: 'pagination_status', text: 'Page status: idle'
|
|
22
22
|
|
|
@@ -27,19 +27,19 @@ page.body childViews: ->(body) do
|
|
|
27
27
|
res.spacer height: 8
|
|
28
28
|
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
29
29
|
flow.button text: 'Page 1', onClick: ->(action) do
|
|
30
|
-
action.
|
|
30
|
+
action.logics_set targetId: 'pagination_main', data: { value: 1 }
|
|
31
31
|
end
|
|
32
32
|
flow.spacer width: 4
|
|
33
33
|
flow.button text: 'Page 5', onClick: ->(action) do
|
|
34
|
-
action.
|
|
34
|
+
action.logics_set targetId: 'pagination_main', data: { value: 5 }
|
|
35
35
|
end
|
|
36
36
|
flow.spacer width: 4
|
|
37
37
|
flow.button text: 'Show 3', onClick: ->(action) do
|
|
38
|
-
action.
|
|
38
|
+
action.logics_set targetId: 'pagination_main', data: { totalVisible: 3 }
|
|
39
39
|
end
|
|
40
40
|
flow.spacer width: 4
|
|
41
41
|
flow.button text: 'Show 7', onClick: ->(action) do
|
|
42
|
-
action.
|
|
42
|
+
action.logics_set targetId: 'pagination_main', data: { totalVisible: 7 }
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -51,7 +51,7 @@ page.body childViews: ->(body) do
|
|
|
51
51
|
res.label id: 'pagination_action_status', text: 'Change status: idle'
|
|
52
52
|
res.spacer height: 6
|
|
53
53
|
res.panels_pagination length: 4, value: 1, onChange: ->(action) do
|
|
54
|
-
action.
|
|
54
|
+
action.logics_set targetId: 'pagination_action_status', data: { text: 'Change status: changed' }
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
res.spacer height: 12
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
json.title 'Test Page (Panels Bulk Edit 2)'
|
|
2
|
+
|
|
3
|
+
page = json_ui_page json
|
|
4
|
+
|
|
5
|
+
options = [{ text: 'yes', value: 'yes' }, { text: 'no', value: 'no' }]
|
|
6
|
+
source_options = ['Generators', 'Power Station', 'Solar Panels'].map do |source|
|
|
7
|
+
{ text: source, value: source }
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
default_headers = [
|
|
11
|
+
{ text: 'Month', id: 'month', importable: true, tooltip: { text: 'Month', placement: 'top' } },
|
|
12
|
+
{ text: 'Electricity usage', id: 'electricity_usage', importable: true },
|
|
13
|
+
{ text: 'Gas usage', id: 'gas_usage', importable: true },
|
|
14
|
+
{ text: 'Sources', id: 'sources', importable: true },
|
|
15
|
+
{ text: 'Compliant', id: 'compliant', importable: true }
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
default_cells = [
|
|
19
|
+
->(view) do
|
|
20
|
+
view.fields_number width: 'matchParent'
|
|
21
|
+
end,
|
|
22
|
+
->(view) do
|
|
23
|
+
view.fields_number width: 'matchParent'
|
|
24
|
+
end,
|
|
25
|
+
->(view) do
|
|
26
|
+
view.fields_number width: 'matchParent'
|
|
27
|
+
end,
|
|
28
|
+
->(view) do
|
|
29
|
+
view.fields_select width: 'matchParent', options: source_options, multiple: true
|
|
30
|
+
end,
|
|
31
|
+
->(view) do
|
|
32
|
+
view.fields_select width: 'matchParent', options: options
|
|
33
|
+
end
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[
|
|
37
|
+
{ text: 'Month', id: 'month', importable: true },
|
|
38
|
+
{ text: 'Usage (kWh)', id: 'electricity_usage', importable: true },
|
|
39
|
+
{ text: 'Usage (Therms)', id: 'gas_usage', importable: true }
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[
|
|
43
|
+
->(view) do
|
|
44
|
+
view.fields_number width: 120
|
|
45
|
+
end,
|
|
46
|
+
->(view) do
|
|
47
|
+
view.fields_number width: 140
|
|
48
|
+
end,
|
|
49
|
+
->(view) do
|
|
50
|
+
view.fields_number width: 140
|
|
51
|
+
end
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
import_settings = { submitUrl: json_ui_garage_url(path: 'forms/bulk_edit_post2'), paramName: 'user' }
|
|
55
|
+
|
|
56
|
+
render 'json_ui/garage/test_page/header', json: json, page: page
|
|
57
|
+
|
|
58
|
+
page.body(
|
|
59
|
+
childViews: ->(body) do
|
|
60
|
+
body.panels_responsive(
|
|
61
|
+
padding: glib_json_padding_body,
|
|
62
|
+
childViews: ->(res) do
|
|
63
|
+
res.h2 text: 'Overview'
|
|
64
|
+
res.p text: 'panels_bulkEdit2 renders an editable grid with import-backed rows and bulk submission events.'
|
|
65
|
+
res.spacer height: 12
|
|
66
|
+
res.hr width: 'matchParent'
|
|
67
|
+
res.h2 text: 'Basic example'
|
|
68
|
+
res.spacer height: 8
|
|
69
|
+
res.panels_horizontal(
|
|
70
|
+
align: 'middle',
|
|
71
|
+
childViews: ->(horizontal) do
|
|
72
|
+
horizontal.label text: 'Loaded: '
|
|
73
|
+
horizontal.label id: 'bulk_edit_loaded_count', text: '0'
|
|
74
|
+
horizontal.spacer width: 12
|
|
75
|
+
horizontal.label text: 'Selected: '
|
|
76
|
+
horizontal.label id: 'bulk_edit_selected_count', text: '0'
|
|
77
|
+
horizontal.spacer width: 12
|
|
78
|
+
horizontal.chip id: 'bulk_edit_succeeded_count', styleClass: 'success', text: 'Uploaded: 0', displayed: false
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
res.spacer height: 8
|
|
82
|
+
res.panels_bulkEdit2(
|
|
83
|
+
id: 'bulk_edit_main',
|
|
84
|
+
width: 'matchParent',
|
|
85
|
+
paramNameForRowId: 'row_id',
|
|
86
|
+
# Files with more data rows than this are rejected wholesale with an
|
|
87
|
+
# error dialog (the header row doesn't count).
|
|
88
|
+
maxRows: 3,
|
|
89
|
+
import: import_settings,
|
|
90
|
+
viewHeaders: default_headers,
|
|
91
|
+
viewCells: default_cells,
|
|
92
|
+
onCellChange: ->(action) do
|
|
93
|
+
action.snackbars_alert debug: true, paramName: 'message', fieldName: 'row'
|
|
94
|
+
end,
|
|
95
|
+
onSubmitStart: ->(action) do
|
|
96
|
+
action.runMultiple(
|
|
97
|
+
childActions: ->(multiple) do
|
|
98
|
+
multiple.logics_set targetId: 'bulk_edit_submit_top', data: { disabled: true }
|
|
99
|
+
multiple.logics_set targetId: 'bulk_edit_submit_bottom', data: { disabled: true }
|
|
100
|
+
multiple.logics_set targetId: 'bulk_edit_cancel', data: { displayed: true }
|
|
101
|
+
end
|
|
102
|
+
)
|
|
103
|
+
end,
|
|
104
|
+
onSubmitEnd: ->(action) do
|
|
105
|
+
action.runMultiple(
|
|
106
|
+
childActions: ->(multiple) do
|
|
107
|
+
multiple.logics_set targetId: 'bulk_edit_submit_top', data: { disabled: false }
|
|
108
|
+
multiple.logics_set targetId: 'bulk_edit_submit_bottom', data: { disabled: false }
|
|
109
|
+
multiple.logics_set targetId: 'bulk_edit_cancel', data: { displayed: false }
|
|
110
|
+
end
|
|
111
|
+
)
|
|
112
|
+
end,
|
|
113
|
+
onRowsLoad: ->(action) do
|
|
114
|
+
action.runMultiple(
|
|
115
|
+
debug: true,
|
|
116
|
+
fieldName: 'data',
|
|
117
|
+
childActions: ->(multiple) do
|
|
118
|
+
multiple.logics_set(
|
|
119
|
+
targetId: 'bulk_edit_loaded_count',
|
|
120
|
+
debug: true,
|
|
121
|
+
paramName: 'variables',
|
|
122
|
+
fieldName: 'data',
|
|
123
|
+
conditionalData: {
|
|
124
|
+
text: { "count": [{ "var": 'data.loadedRows' }] }
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
multiple.logics_set targetId: 'bulk_edit_submit_top', data: { displayed: true }
|
|
128
|
+
multiple.logics_set targetId: 'bulk_edit_submit_bottom', data: { displayed: true }
|
|
129
|
+
end
|
|
130
|
+
)
|
|
131
|
+
end,
|
|
132
|
+
onRowsSelect: ->(action) do
|
|
133
|
+
action.logics_set(
|
|
134
|
+
targetId: 'bulk_edit_selected_count',
|
|
135
|
+
debug: true,
|
|
136
|
+
paramName: 'variables',
|
|
137
|
+
fieldName: 'data',
|
|
138
|
+
conditionalData: {
|
|
139
|
+
text: { "count": [{ "var": 'data.selectedRows' }] }
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
end,
|
|
143
|
+
onRowsSucceed: ->(action) do
|
|
144
|
+
action.logics_set(
|
|
145
|
+
targetId: 'bulk_edit_succeeded_count',
|
|
146
|
+
debug: true,
|
|
147
|
+
paramName: 'variables',
|
|
148
|
+
fieldName: 'data',
|
|
149
|
+
conditionalData: {
|
|
150
|
+
text: {
|
|
151
|
+
"printf": [
|
|
152
|
+
'Uploaded: {0}',
|
|
153
|
+
{ "count": [{ "var": 'data.succeededRows' }] }
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
displayed: true
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
)
|
|
161
|
+
res.spacer height: 12
|
|
162
|
+
res.panels_flow(
|
|
163
|
+
innerPadding: { bottom: 0 },
|
|
164
|
+
childViews: ->(flow) do
|
|
165
|
+
flow.button(
|
|
166
|
+
id: 'bulk_edit_submit_top',
|
|
167
|
+
text: 'Submit (top)',
|
|
168
|
+
displayed: false,
|
|
169
|
+
onClick: ->(action) do
|
|
170
|
+
action.forms_submit targetId: 'bulk_edit_main'
|
|
171
|
+
end
|
|
172
|
+
)
|
|
173
|
+
flow.spacer width: 8
|
|
174
|
+
flow.button(
|
|
175
|
+
id: 'bulk_edit_submit_bottom',
|
|
176
|
+
text: 'Submit (bottom)',
|
|
177
|
+
displayed: false,
|
|
178
|
+
onClick: ->(action) do
|
|
179
|
+
action.forms_submit targetId: 'bulk_edit_main'
|
|
180
|
+
end
|
|
181
|
+
)
|
|
182
|
+
flow.spacer width: 8
|
|
183
|
+
flow.button(
|
|
184
|
+
id: 'bulk_edit_cancel',
|
|
185
|
+
text: 'Cancel import',
|
|
186
|
+
displayed: false,
|
|
187
|
+
onClick: ->(action) do
|
|
188
|
+
action.components_invoke targetId: 'bulk_edit_main', name: 'cancelImport'
|
|
189
|
+
end
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
)
|
|
193
|
+
res.spacer height: 12
|
|
194
|
+
res.hr width: 'matchParent'
|
|
195
|
+
# res.h2 text: 'Variants/props'
|
|
196
|
+
# res.spacer height: 8
|
|
197
|
+
# res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
198
|
+
# flow.button text: 'Default columns', onClick: ->(action) do
|
|
199
|
+
# action.logics_set targetId: 'bulk_edit_main', data: { viewHeaders: default_headers, viewCells: default_cells }
|
|
200
|
+
# end
|
|
201
|
+
# flow.spacer width: 8
|
|
202
|
+
# flow.button text: 'Compact columns', onClick: ->(action) do
|
|
203
|
+
# action.logics_set targetId: 'bulk_edit_main', data: { viewHeaders: compact_headers, viewCells: compact_cells }
|
|
204
|
+
# end
|
|
205
|
+
# flow.spacer width: 8
|
|
206
|
+
# flow.button text: 'Reset counts', onClick: ->(action) do
|
|
207
|
+
# action.runMultiple childActions: ->(multiple) do
|
|
208
|
+
# multiple.logics_set targetId: 'bulk_edit_loaded_count', data: { text: '0' }
|
|
209
|
+
# multiple.logics_set targetId: 'bulk_edit_selected_count', data: { text: '0' }
|
|
210
|
+
# multiple.logics_set targetId: 'bulk_edit_succeeded_count', data: { text: 'Uploaded: 0', displayed: false }
|
|
211
|
+
# end
|
|
212
|
+
# end
|
|
213
|
+
# end
|
|
214
|
+
# res.spacer height: 12
|
|
215
|
+
# res.hr width: 'matchParent'
|
|
216
|
+
res.h2 text: 'Actions/events'
|
|
217
|
+
res.spacer height: 8
|
|
218
|
+
res.panels_flow(
|
|
219
|
+
innerPadding: { bottom: 0 },
|
|
220
|
+
childViews: ->(flow) do
|
|
221
|
+
flow.button(
|
|
222
|
+
text: 'Submit (forms_submit)',
|
|
223
|
+
onClick: ->(action) do
|
|
224
|
+
action.forms_submit targetId: 'bulk_edit_main'
|
|
225
|
+
end
|
|
226
|
+
)
|
|
227
|
+
flow.spacer width: 8
|
|
228
|
+
flow.button(
|
|
229
|
+
text: 'Cancel import (invoke)',
|
|
230
|
+
onClick: ->(action) do
|
|
231
|
+
action.components_invoke targetId: 'bulk_edit_main', name: 'cancelImport'
|
|
232
|
+
end
|
|
233
|
+
)
|
|
234
|
+
end
|
|
235
|
+
)
|
|
236
|
+
res.spacer height: 12
|
|
237
|
+
res.hr width: 'matchParent'
|
|
238
|
+
res.h2 text: 'Edge/advanced'
|
|
239
|
+
res.spacer height: 8
|
|
240
|
+
res.label text: 'Swap to compact headers then try editing rows before submitting.'
|
|
241
|
+
end
|
|
242
|
+
)
|
|
243
|
+
end
|
|
244
|
+
)
|
|
@@ -83,13 +83,13 @@ page.body(
|
|
|
83
83
|
padding: glib_json_padding_body,
|
|
84
84
|
childViews: ->(res) do
|
|
85
85
|
res.h2 text: 'Overview'
|
|
86
|
-
res.p text: 'panels_bulkEdit3 is the generic bulk-edit table:
|
|
86
|
+
res.p text: 'panels_bulkEdit3 is the generic bulk-edit table: bulkEdit2’s skeleton plus config-driven file parsing, row gates, read-only columns, view chips and submission extras.'
|
|
87
87
|
res.spacer height: 12
|
|
88
88
|
res.hr width: 'matchParent'
|
|
89
89
|
|
|
90
90
|
res.h2 text: 'Basic example (plain CSV)'
|
|
91
91
|
res.spacer height: 8
|
|
92
|
-
res.p text: 'Without parse config the table takes plain CSVs: header row first, header names as field ids. maxRows 3 rejects oversized files whole.'
|
|
92
|
+
res.p text: 'Without parse config the table takes plain CSVs: header row first, header names as field ids (the bulkEdit2 shape). maxRows 3 rejects oversized files whole.'
|
|
93
93
|
res.spacer height: 8
|
|
94
94
|
res.panels_horizontal(
|
|
95
95
|
align: 'middle',
|
|
@@ -236,7 +236,7 @@ page.body(
|
|
|
236
236
|
action.runMultiple(
|
|
237
237
|
fieldName: 'data',
|
|
238
238
|
childActions: ->(multiple) do
|
|
239
|
-
multiple.
|
|
239
|
+
multiple.logics_set targetId: 'bulk_edit3_skipped_counter', data: { displayed: true }
|
|
240
240
|
multiple.logics_set(
|
|
241
241
|
targetId: 'bulk_edit3_skipped_count',
|
|
242
242
|
paramName: 'variables',
|
|
@@ -39,7 +39,7 @@ page.body(
|
|
|
39
39
|
flow.button(
|
|
40
40
|
text: '35% default',
|
|
41
41
|
onClick: ->(action) do
|
|
42
|
-
action.
|
|
42
|
+
action.logics_set(
|
|
43
43
|
targetId: 'progress_circle_main',
|
|
44
44
|
data: { value: 35, size: 160, width: 16, color: '#4B56D2', half: nil, text: nil }
|
|
45
45
|
)
|
|
@@ -49,21 +49,21 @@ page.body(
|
|
|
49
49
|
flow.button(
|
|
50
50
|
text: '65%',
|
|
51
51
|
onClick: ->(action) do
|
|
52
|
-
action.
|
|
52
|
+
action.logics_set targetId: 'progress_circle_main', data: { value: 65 }
|
|
53
53
|
end
|
|
54
54
|
)
|
|
55
55
|
flow.spacer width: 6
|
|
56
56
|
flow.button(
|
|
57
57
|
text: 'Thick stroke',
|
|
58
58
|
onClick: ->(action) do
|
|
59
|
-
action.
|
|
59
|
+
action.logics_set targetId: 'progress_circle_main', data: { width: 28 }
|
|
60
60
|
end
|
|
61
61
|
)
|
|
62
62
|
flow.spacer width: 6
|
|
63
63
|
flow.button(
|
|
64
64
|
text: 'Small size',
|
|
65
65
|
onClick: ->(action) do
|
|
66
|
-
action.
|
|
66
|
+
action.logics_set targetId: 'progress_circle_main', data: { size: 110 }
|
|
67
67
|
end
|
|
68
68
|
)
|
|
69
69
|
end
|
|
@@ -82,7 +82,7 @@ page.body(
|
|
|
82
82
|
flow.button(
|
|
83
83
|
text: 'Half circle + label',
|
|
84
84
|
onClick: ->(action) do
|
|
85
|
-
action.
|
|
85
|
+
action.logics_set(
|
|
86
86
|
targetId: 'progress_circle_main',
|
|
87
87
|
data: { value: 80, half: true, text: 'Section A', color: '#9E0A0A', width: 22 }
|
|
88
88
|
)
|
|
@@ -92,7 +92,7 @@ page.body(
|
|
|
92
92
|
flow.button(
|
|
93
93
|
text: 'Accent color',
|
|
94
94
|
onClick: ->(action) do
|
|
95
|
-
action.
|
|
95
|
+
action.logics_set targetId: 'progress_circle_main', data: { color: '#F9C80E', half: nil, text: nil }
|
|
96
96
|
end
|
|
97
97
|
)
|
|
98
98
|
end
|
|
@@ -111,14 +111,14 @@ page.body(
|
|
|
111
111
|
flow.button(
|
|
112
112
|
text: '0%',
|
|
113
113
|
onClick: ->(action) do
|
|
114
|
-
action.
|
|
114
|
+
action.logics_set targetId: 'progress_circle_main', data: { value: '0', half: nil, text: nil }
|
|
115
115
|
end
|
|
116
116
|
)
|
|
117
117
|
flow.spacer width: 6
|
|
118
118
|
flow.button(
|
|
119
119
|
text: '100%',
|
|
120
120
|
onClick: ->(action) do
|
|
121
|
-
action.
|
|
121
|
+
action.logics_set targetId: 'progress_circle_main', data: { value: 100, half: nil, text: nil }
|
|
122
122
|
end
|
|
123
123
|
)
|
|
124
124
|
end
|
|
@@ -32,21 +32,21 @@ page.body(
|
|
|
32
32
|
flow.button(
|
|
33
33
|
text: 'Align left',
|
|
34
34
|
onClick: ->(action) do
|
|
35
|
-
action.
|
|
35
|
+
action.logics_set targetId: 'responsive_main', data: { align: 'left' }
|
|
36
36
|
end
|
|
37
37
|
)
|
|
38
38
|
flow.spacer width: 4
|
|
39
39
|
flow.button(
|
|
40
40
|
text: 'Align center',
|
|
41
41
|
onClick: ->(action) do
|
|
42
|
-
action.
|
|
42
|
+
action.logics_set targetId: 'responsive_main', data: { align: 'center' }
|
|
43
43
|
end
|
|
44
44
|
)
|
|
45
45
|
flow.spacer width: 4
|
|
46
46
|
flow.button(
|
|
47
47
|
text: 'Align right',
|
|
48
48
|
onClick: ->(action) do
|
|
49
|
-
action.
|
|
49
|
+
action.logics_set targetId: 'responsive_main', data: { align: 'right' }
|
|
50
50
|
end
|
|
51
51
|
)
|
|
52
52
|
end
|
|
@@ -59,7 +59,7 @@ page.body(
|
|
|
59
59
|
res.spacer height: 6
|
|
60
60
|
res.panels_responsive(
|
|
61
61
|
onClick: ->(action) do
|
|
62
|
-
action.
|
|
62
|
+
action.logics_set targetId: 'responsive_action_status', data: { text: 'Click status: clicked' }
|
|
63
63
|
end,
|
|
64
64
|
styleClasses: ['card'],
|
|
65
65
|
padding: { all: 12 },
|
|
@@ -28,19 +28,19 @@ page.body childViews: ->(body) do
|
|
|
28
28
|
res.spacer height: 8
|
|
29
29
|
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
30
30
|
flow.button text: 'Short', onClick: ->(action) do
|
|
31
|
-
action.
|
|
31
|
+
action.logics_set targetId: 'scroll_main', data: { height: 120 }
|
|
32
32
|
end
|
|
33
33
|
flow.spacer width: 4
|
|
34
34
|
flow.button text: 'Tall', onClick: ->(action) do
|
|
35
|
-
action.
|
|
35
|
+
action.logics_set targetId: 'scroll_main', data: { height: 240 }
|
|
36
36
|
end
|
|
37
37
|
flow.spacer width: 4
|
|
38
38
|
flow.button text: 'Add padding', onClick: ->(action) do
|
|
39
|
-
action.
|
|
39
|
+
action.logics_set targetId: 'scroll_main', data: { padding: { all: 12 } }
|
|
40
40
|
end
|
|
41
41
|
flow.spacer width: 4
|
|
42
42
|
flow.button text: 'Clear padding', onClick: ->(action) do
|
|
43
|
-
action.
|
|
43
|
+
action.logics_set targetId: 'scroll_main', data: { padding: nil }
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
@@ -52,7 +52,7 @@ page.body childViews: ->(body) do
|
|
|
52
52
|
res.label id: 'scroll_status', text: 'Scroll status: idle'
|
|
53
53
|
res.spacer height: 6
|
|
54
54
|
res.panels_scroll height: 120, onLoad: ->(action) do
|
|
55
|
-
action.
|
|
55
|
+
action.logics_set targetId: 'scroll_status', data: { text: 'Scroll status: loaded' }
|
|
56
56
|
end, childViews: ->(scroll) do
|
|
57
57
|
(1..8).each do |index|
|
|
58
58
|
scroll.label text: "Load item #{index}"
|
|
@@ -50,7 +50,7 @@ page.body(
|
|
|
50
50
|
left.button(
|
|
51
51
|
text: 'Update status',
|
|
52
52
|
onClick: ->(action) do
|
|
53
|
-
action.
|
|
53
|
+
action.logics_set targetId: 'split_action_status', data: { text: 'Action status: clicked' }
|
|
54
54
|
end
|
|
55
55
|
)
|
|
56
56
|
end
|
|
@@ -53,21 +53,21 @@ page.body(
|
|
|
53
53
|
flow.button(
|
|
54
54
|
text: 'Compact style',
|
|
55
55
|
onClick: ->(action) do
|
|
56
|
-
action.
|
|
56
|
+
action.logics_set targetId: 'table_main', data: { styleClass: 'table--compact' }
|
|
57
57
|
end
|
|
58
58
|
)
|
|
59
59
|
flow.spacer width: 4
|
|
60
60
|
flow.button(
|
|
61
61
|
text: 'Striped style',
|
|
62
62
|
onClick: ->(action) do
|
|
63
|
-
action.
|
|
63
|
+
action.logics_set targetId: 'table_main', data: { styleClass: 'table--striped' }
|
|
64
64
|
end
|
|
65
65
|
)
|
|
66
66
|
flow.spacer width: 4
|
|
67
67
|
flow.button(
|
|
68
68
|
text: 'Clear style',
|
|
69
69
|
onClick: ->(action) do
|
|
70
|
-
action.
|
|
70
|
+
action.logics_set targetId: 'table_main', data: { styleClass: nil }
|
|
71
71
|
end
|
|
72
72
|
)
|
|
73
73
|
end
|
|
@@ -85,10 +85,10 @@ page.body(
|
|
|
85
85
|
scroll.panels_table(
|
|
86
86
|
height: 'matchParent',
|
|
87
87
|
onScrollToTop: ->(action) do
|
|
88
|
-
action.
|
|
88
|
+
action.logics_set targetId: 'table_event_status', data: { text: 'Scroll events: top reached' }
|
|
89
89
|
end,
|
|
90
90
|
onScrollToBottom: ->(action) do
|
|
91
|
-
action.
|
|
91
|
+
action.logics_set targetId: 'table_event_status', data: { text: 'Scroll events: bottom reached' }
|
|
92
92
|
end,
|
|
93
93
|
sections: [
|
|
94
94
|
->(section) do
|
|
@@ -44,25 +44,25 @@ page.body(
|
|
|
44
44
|
flow.button(
|
|
45
45
|
text: 'Vertical',
|
|
46
46
|
onClick: ->(action) do
|
|
47
|
-
action.
|
|
47
|
+
action.logics_set targetId: 'timeline_main', data: { direction: 'vertical', side: 'start', truncateLine: nil }
|
|
48
48
|
end
|
|
49
49
|
)
|
|
50
50
|
flow.spacer width: 4
|
|
51
51
|
flow.button(
|
|
52
52
|
text: 'Horizontal',
|
|
53
53
|
onClick: ->(action) do
|
|
54
|
-
action.
|
|
54
|
+
action.logics_set targetId: 'timeline_main', data: { direction: 'horizontal', side: 'end', truncateLine: nil }
|
|
55
55
|
end
|
|
56
56
|
)
|
|
57
57
|
flow.spacer width: 4
|
|
58
58
|
# flow.button text: 'Outlined dots', onClick: ->(action) do
|
|
59
|
-
# action.
|
|
59
|
+
# action.logics_set targetId: 'timeline_main', data: { events: outline_events }
|
|
60
60
|
# end
|
|
61
61
|
# flow.spacer width: 4
|
|
62
62
|
flow.button(
|
|
63
63
|
text: 'Truncate both',
|
|
64
64
|
onClick: ->(action) do
|
|
65
|
-
action.
|
|
65
|
+
action.logics_set targetId: 'timeline_main', data: { truncateLine: 'both' }
|
|
66
66
|
end
|
|
67
67
|
)
|
|
68
68
|
end
|
|
@@ -80,7 +80,7 @@ page.body(
|
|
|
80
80
|
timeline.label(
|
|
81
81
|
text: step,
|
|
82
82
|
onClick: ->(action) do
|
|
83
|
-
action.
|
|
83
|
+
action.logics_set targetId: 'timeline_action_status', data: { text: "Clicked: #{step}" }
|
|
84
84
|
end
|
|
85
85
|
)
|
|
86
86
|
end
|
|
@@ -28,11 +28,11 @@ page.body childViews: ->(body) do
|
|
|
28
28
|
res.spacer height: 8
|
|
29
29
|
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
30
30
|
flow.button text: 'Card style', onClick: ->(action) do
|
|
31
|
-
action.
|
|
31
|
+
action.logics_set targetId: 'ul_main', data: { styleClasses: ['card'], padding: { all: 10 } }
|
|
32
32
|
end
|
|
33
33
|
flow.spacer width: 4
|
|
34
34
|
flow.button text: 'Clear style', onClick: ->(action) do
|
|
35
|
-
action.
|
|
35
|
+
action.logics_set targetId: 'ul_main', data: { styleClasses: nil, padding: nil }
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@ page.body childViews: ->(body) do
|
|
|
44
44
|
res.label id: 'ul_action_status', text: 'Hover status: idle'
|
|
45
45
|
res.spacer height: 6
|
|
46
46
|
res.panels_ul onMouseEnter: ->(action) do
|
|
47
|
-
action.
|
|
47
|
+
action.logics_set targetId: 'ul_action_status', data: { text: 'Hover status: entered' }
|
|
48
48
|
end, onMouseLeave: ->(action) do
|
|
49
|
-
action.
|
|
49
|
+
action.logics_set targetId: 'ul_action_status', data: { text: 'Hover status: left' }
|
|
50
50
|
end, childViews: ->(li) do
|
|
51
51
|
li.label text: 'Hover this list'
|
|
52
52
|
li.label text: 'Second item'
|