glib-web 4.42.1 → 4.42.3

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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/libs.rb +4 -9
  3. data/app/controllers/concerns/glib/json/ui.rb +6 -8
  4. data/app/views/json_ui/garage/test_page/_header.json.jbuilder +84 -14
  5. data/app/views/json_ui/garage/test_page/browsers.json.jbuilder +101 -0
  6. data/app/views/json_ui/garage/test_page/calendar.json.jbuilder +109 -0
  7. data/app/views/json_ui/garage/test_page/calendar_empty_data.json.jbuilder +3 -0
  8. data/app/views/json_ui/garage/test_page/carousel.json.jbuilder +70 -0
  9. data/app/views/json_ui/garage/test_page/charts.json.jbuilder +370 -0
  10. data/app/views/json_ui/garage/test_page/column.json.jbuilder +121 -0
  11. data/app/views/json_ui/garage/test_page/commands.json.jbuilder +98 -0
  12. data/app/views/json_ui/garage/test_page/components.json.jbuilder +143 -0
  13. data/app/views/json_ui/garage/test_page/cookies.json.jbuilder +109 -0
  14. data/app/views/json_ui/garage/test_page/custom.json.jbuilder +56 -0
  15. data/app/views/json_ui/garage/test_page/flow.json.jbuilder +70 -0
  16. data/app/views/json_ui/garage/test_page/forms.json.jbuilder +105 -0
  17. data/app/views/json_ui/garage/test_page/grid.json.jbuilder +68 -0
  18. data/app/views/json_ui/garage/test_page/horizontal.json.jbuilder +68 -0
  19. data/app/views/json_ui/garage/test_page/http.json.jbuilder +87 -37
  20. data/app/views/json_ui/garage/test_page/image.json.jbuilder +145 -0
  21. data/app/views/json_ui/garage/test_page/list.json.jbuilder +75 -0
  22. data/app/views/json_ui/garage/test_page/lists_append.json.jbuilder +151 -0
  23. data/app/views/json_ui/garage/test_page/logics_set.json.jbuilder +7 -6
  24. data/app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder +118 -0
  25. data/app/views/json_ui/garage/test_page/pagination.json.jbuilder +64 -0
  26. data/app/views/json_ui/garage/test_page/panels.json.jbuilder +113 -0
  27. data/app/views/json_ui/garage/test_page/popovers.json.jbuilder +112 -0
  28. data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +119 -0
  29. data/app/views/json_ui/garage/test_page/responsive.json.jbuilder +100 -0
  30. data/app/views/json_ui/garage/test_page/scroll.json.jbuilder +77 -0
  31. data/app/views/json_ui/garage/test_page/split.json.jbuilder +82 -0
  32. data/app/views/json_ui/garage/test_page/storage_items.json.jbuilder +144 -0
  33. data/app/views/json_ui/garage/test_page/table.json.jbuilder +99 -0
  34. data/app/views/json_ui/garage/test_page/timeline.json.jbuilder +97 -0
  35. data/app/views/json_ui/garage/test_page/timeouts.json.jbuilder +86 -0
  36. data/app/views/json_ui/garage/test_page/ul.json.jbuilder +68 -0
  37. data/app/views/json_ui/garage/test_page/vertical.json.jbuilder +68 -0
  38. data/app/views/json_ui/garage/test_page/web.json.jbuilder +64 -0
  39. data/app/views/json_ui/garage/test_page/windows.json.jbuilder +129 -0
  40. data/lib/glib/rubocop/cops/multiline_method_call_style.rb +8 -0
  41. data/lib/tasks/db.rake +1 -0
  42. metadata +34 -1
@@ -0,0 +1,144 @@
1
+ json.title 'Test Page (Storage Items)'
2
+
3
+ page = json_ui_page json
4
+
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: 'Storage Items'
12
+ res.label text: 'Local storage set/get/remove/clear actions.'
13
+ res.spacer height: 12
14
+ res.hr width: 'matchParent'
15
+ res.spacer height: 12
16
+
17
+ res.h2 text: 'Overview'
18
+ res.label text: 'Use storage item actions for lightweight client persistence.'
19
+ res.spacer height: 12
20
+ res.hr width: 'matchParent'
21
+ res.spacer height: 12
22
+
23
+ res.h2 text: 'Basic example'
24
+ res.spacer height: 8
25
+ res.button(
26
+ text: 'storageItems/set',
27
+ onClick: ->(action) do
28
+ action.storageItems_set key: 'glib_storage', value: "test_storage_#{DateTime.current.to_i}"
29
+ end
30
+ )
31
+
32
+ res.spacer height: 16
33
+ res.hr width: 'matchParent'
34
+ res.spacer height: 16
35
+
36
+ res.h2 text: 'Variants/props'
37
+ res.spacer height: 8
38
+ res.panels_flow(
39
+ innerPadding: { bottom: 0 },
40
+ width: 'matchParent',
41
+ childViews: ->(flow) do
42
+ flow.button(
43
+ text: 'storageItems/get',
44
+ onClick: ->(action) do
45
+ action.storageItems_get key: 'glib_storage'
46
+ end
47
+ )
48
+ flow.spacer width: 8
49
+ flow.button(
50
+ text: 'storageItems/remove',
51
+ onClick: ->(action) do
52
+ action.storageItems_remove key: 'glib_storage'
53
+ end
54
+ )
55
+ end
56
+ )
57
+
58
+ res.spacer height: 16
59
+ res.hr width: 'matchParent'
60
+ res.spacer height: 16
61
+
62
+ res.h2 text: 'Actions/events'
63
+ res.spacer height: 8
64
+ res.label id: 'storage_status', text: 'Status: idle'
65
+ res.spacer height: 8
66
+ res.panels_flow(
67
+ innerPadding: { bottom: 0 },
68
+ width: 'matchParent',
69
+ childViews: ->(flow) do
70
+ flow.button(
71
+ text: 'storageItems/set (onSet)',
72
+ onClick: ->(action) do
73
+ action.storageItems_set(
74
+ key: 'glib_storage',
75
+ value: "event_storage_#{DateTime.current.to_i}",
76
+ onSet: ->(subaction) do
77
+ subaction.runMultiple(
78
+ childActions: ->(ssaction) do
79
+ ssaction.logics_set targetId: 'storage_status', data: { text: 'Status: saved' }
80
+ ssaction.snackbars_alert message: 'Saved'
81
+ end
82
+ )
83
+ end
84
+ )
85
+ end
86
+ )
87
+ flow.spacer width: 8
88
+ flow.button(
89
+ text: 'storageItems/get (onGet)',
90
+ onClick: ->(action) do
91
+ action.storageItems_get(
92
+ key: 'glib_storage',
93
+ onGet: ->(subaction) do
94
+ subaction.logics_set targetId: 'storage_status', data: { text: 'Status: fetched' }
95
+ end
96
+ )
97
+ end
98
+ )
99
+ flow.spacer width: 8
100
+ flow.button(
101
+ text: 'storageItems/remove (onRemove)',
102
+ onClick: ->(action) do
103
+ action.storageItems_remove(
104
+ key: 'glib_storage',
105
+ onRemove: ->(subaction) do
106
+ subaction.runMultiple(
107
+ childActions: ->(ssaction) do
108
+ ssaction.logics_set targetId: 'storage_status', data: { text: 'Status: removed' }
109
+ ssaction.snackbars_alert message: 'Removed'
110
+ end
111
+ )
112
+ end
113
+ )
114
+ end
115
+ )
116
+ end
117
+ )
118
+
119
+ res.spacer height: 16
120
+ res.hr width: 'matchParent'
121
+ res.spacer height: 16
122
+
123
+ res.h2 text: 'Edge/advanced'
124
+ res.spacer height: 8
125
+ res.button(
126
+ text: 'storageItems/clear',
127
+ onClick: ->(action) do
128
+ action.storageItems_clear(
129
+ key: 'glib_storage',
130
+ onClear: ->(subaction) do
131
+ subaction.runMultiple(
132
+ childActions: ->(ssaction) do
133
+ ssaction.logics_set targetId: 'storage_status', data: { text: 'Status: cleared' }
134
+ ssaction.snackbars_alert message: 'Cleared'
135
+ end
136
+ )
137
+ end
138
+ )
139
+ end
140
+ )
141
+ end
142
+ )
143
+ end
144
+ )
@@ -0,0 +1,99 @@
1
+ json.title 'Test Page (Table)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body childViews: ->(body) do
6
+ render 'json_ui/garage/test_page/header', view: body
7
+
8
+ body.panels_responsive padding: glib_json_padding_body, childViews: ->(res) do
9
+ res.h2 text: 'Overview'
10
+ res.p text: 'Table panels render rows with columns and support pagination and bulk actions.'
11
+
12
+ res.spacer height: 12
13
+ res.hr width: 'matchParent'
14
+
15
+ res.h2 text: 'Basic'
16
+ res.spacer height: 8
17
+ res.panels_table id: 'table_main', import: { submitUrl: json_ui_garage_url(path: 'forms/generic_post'), paramName: 'table' }, export: { label: 'Export', fileName: 'table_export.csv' }, sections: [
18
+ ->(section) do
19
+ section.header cellViews: ->(header) do
20
+ header.label text: 'Name'
21
+ header.label text: 'Status'
22
+ end
23
+
24
+ items = ['Alpha', 'Bravo', 'Charlie']
25
+ section.rows objects: items, builder: ->(row, item, index) do
26
+ status = index.even? ? 'Active' : 'Paused'
27
+ row.default cellViews: ->(cell) do
28
+ cell.label text: item
29
+ cell.label text: status
30
+ end
31
+ end
32
+ end
33
+ ]
34
+
35
+ res.spacer height: 12
36
+ res.hr width: 'matchParent'
37
+
38
+ res.h2 text: 'Variants and Props'
39
+ res.spacer height: 8
40
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
41
+ flow.button text: 'Compact style', onClick: ->(action) do
42
+ action.components_set targetId: 'table_main', data: { styleClass: 'table--compact' }
43
+ end
44
+ flow.spacer width: 4
45
+ flow.button text: 'Striped style', onClick: ->(action) do
46
+ action.components_set targetId: 'table_main', data: { styleClass: 'table--striped' }
47
+ end
48
+ flow.spacer width: 4
49
+ flow.button text: 'Clear style', onClick: ->(action) do
50
+ action.components_set targetId: 'table_main', data: { styleClass: nil }
51
+ end
52
+ end
53
+
54
+ res.spacer height: 12
55
+ res.hr width: 'matchParent'
56
+
57
+ res.h2 text: 'Actions and Events'
58
+ res.spacer height: 8
59
+ res.label id: 'table_event_status', text: 'Scroll events: idle'
60
+ res.spacer height: 6
61
+ res.panels_table height: 160, onScrollToTop: ->(action) do
62
+ action.components_set targetId: 'table_event_status', data: { text: 'Scroll events: top reached' }
63
+ end, onScrollToBottom: ->(action) do
64
+ action.components_set targetId: 'table_event_status', data: { text: 'Scroll events: bottom reached' }
65
+ end, sections: [
66
+ ->(section) do
67
+ section.header cellViews: ->(header) do
68
+ header.label text: 'Item'
69
+ header.label text: 'Value'
70
+ end
71
+ section.rows builder: ->(row) do
72
+ (1..12).each do |index|
73
+ row.default cellViews: ->(cell) do
74
+ cell.label text: "Row #{index}"
75
+ cell.label text: "Value #{index}"
76
+ end
77
+ end
78
+ end
79
+ end
80
+ ]
81
+
82
+ res.spacer height: 12
83
+ res.hr width: 'matchParent'
84
+
85
+ res.h2 text: 'Edge and Advanced'
86
+ res.spacer height: 8
87
+ res.label text: 'Empty table (no rows)'
88
+ res.panels_table sections: [
89
+ ->(section) do
90
+ section.header cellViews: ->(header) do
91
+ header.label text: 'Column A'
92
+ header.label text: 'Column B'
93
+ end
94
+ section.rows builder: ->(_row) do
95
+ end
96
+ end
97
+ ]
98
+ end
99
+ end
@@ -0,0 +1,97 @@
1
+ json.title 'Test Page (Timeline)'
2
+
3
+ page = json_ui_page json
4
+
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: 'Timeline panels render ordered events with optional icons and layout direction.'
13
+ timeline_events = [
14
+ { icon: 'check_circle', color: 'green' },
15
+ { icon: 'hourglass_empty', color: 'blue' },
16
+ { icon: 'flag', color: 'orange' }
17
+ ]
18
+ [
19
+ { icon: 'check_circle', color: 'green', styleClasses: ['outlined'] },
20
+ { icon: 'hourglass_empty', color: 'blue', styleClasses: ['outlined'] },
21
+ { icon: 'flag', color: 'orange', styleClasses: ['outlined'] }
22
+ ]
23
+ res.spacer height: 12
24
+ res.hr width: 'matchParent'
25
+ res.h2 text: 'Basic'
26
+ res.spacer height: 8
27
+ res.panels_timeline(
28
+ id: 'timeline_main',
29
+ events: timeline_events,
30
+ childViews: ->(timeline) do
31
+ timeline.label text: 'Submitted'
32
+ timeline.label text: 'Processing'
33
+ timeline.label text: 'Completed'
34
+ end
35
+ )
36
+ res.spacer height: 12
37
+ res.hr width: 'matchParent'
38
+ res.h2 text: 'Variants and Props'
39
+ res.spacer height: 8
40
+ res.panels_flow(
41
+ innerPadding: { bottom: 0 },
42
+ childViews: ->(flow) do
43
+ flow.button(
44
+ text: 'Vertical',
45
+ onClick: ->(action) do
46
+ action.components_set targetId: 'timeline_main', data: { direction: 'vertical', side: 'start', truncateLine: nil }
47
+ end
48
+ )
49
+ flow.spacer width: 4
50
+ flow.button(
51
+ text: 'Horizontal',
52
+ onClick: ->(action) do
53
+ action.components_set targetId: 'timeline_main', data: { direction: 'horizontal', side: 'end', truncateLine: nil }
54
+ end
55
+ )
56
+ flow.spacer width: 4
57
+ # flow.button text: 'Outlined dots', onClick: ->(action) do
58
+ # action.components_set targetId: 'timeline_main', data: { events: outline_events }
59
+ # end
60
+ # flow.spacer width: 4
61
+ flow.button(
62
+ text: 'Truncate both',
63
+ onClick: ->(action) do
64
+ action.components_set targetId: 'timeline_main', data: { truncateLine: 'both' }
65
+ end
66
+ )
67
+ end
68
+ )
69
+ res.spacer height: 12
70
+ res.hr width: 'matchParent'
71
+ res.h2 text: 'Actions and Events'
72
+ res.spacer height: 8
73
+ res.label id: 'timeline_action_status', text: 'Click a step'
74
+ res.spacer height: 6
75
+ res.panels_timeline(
76
+ events: timeline_events,
77
+ childViews: ->(timeline) do
78
+ ['Step A', 'Step B', 'Step C'].each do |step|
79
+ timeline.label(
80
+ text: step,
81
+ onClick: ->(action) do
82
+ action.components_set targetId: 'timeline_action_status', data: { text: "Clicked: #{step}" }
83
+ end
84
+ )
85
+ end
86
+ end
87
+ )
88
+ res.spacer height: 12
89
+ res.hr width: 'matchParent'
90
+ res.h2 text: 'Edge and Advanced'
91
+ res.spacer height: 8
92
+ res.label text: 'Timeline with no child views'
93
+ res.panels_timeline events: []
94
+ end
95
+ )
96
+ end
97
+ )
@@ -0,0 +1,86 @@
1
+ json.title 'Test Page (Timeouts)'
2
+
3
+ page = json_ui_page json
4
+
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: 'Timeouts'
12
+ res.label text: 'Schedule actions to run later or on an interval.'
13
+ res.spacer height: 12
14
+ res.hr width: 'matchParent'
15
+ res.spacer height: 12
16
+
17
+ res.h2 text: 'Timeouts (once)'
18
+ res.spacer height: 8
19
+ res.label id: 'timeout_once_status', text: 'Waiting for timeout...'
20
+ res.spacer height: 8
21
+ res.button(
22
+ text: 'timeouts/set (1s)',
23
+ onClick: ->(action) do
24
+ action.timeouts_set(
25
+ interval: 1000,
26
+ onTimeout: ->(subaction) do
27
+ subaction.runMultiple(
28
+ childActions: ->(multi) do
29
+ multi.logics_set targetId: 'timeout_once_status', data: { text: 'Timeout fired' }
30
+ multi.snackbars_alert message: 'Timeout elapsed'
31
+ end
32
+ )
33
+ end
34
+ )
35
+ end
36
+ )
37
+
38
+ res.spacer height: 16
39
+ res.hr width: 'matchParent'
40
+ res.spacer height: 16
41
+
42
+ res.h2 text: 'Timeouts (repeat)'
43
+ res.spacer height: 8
44
+ res.label id: 'timeout_repeat_status', text: 'Not running'
45
+ res.spacer height: 8
46
+ res.panels_flow(
47
+ innerPadding: { bottom: 0 },
48
+ width: 'matchParent',
49
+ childViews: ->(flow) do
50
+ flow.button(
51
+ text: 'timeouts/set repeat (2s)',
52
+ onClick: ->(action) do
53
+ action.runMultiple(
54
+ childActions: ->(multi) do
55
+ multi.logics_set targetId: 'timeout_repeat_status', data: { text: 'Running...' }
56
+ multi.timeouts_set(
57
+ timerId: 'timeout-repeat',
58
+ interval: 2000,
59
+ repeat: true,
60
+ onTimeout: ->(subaction) do
61
+ subaction.logics_set targetId: 'timeout_repeat_status', data: { text: 'Last tick fired' }
62
+ subaction.snackbars_alert message: 'Repeat timeout elapsed'
63
+ end
64
+ )
65
+ end
66
+ )
67
+ end
68
+ )
69
+ flow.spacer width: 8
70
+ flow.button(
71
+ text: 'timeouts/clear repeat',
72
+ onClick: ->(action) do
73
+ action.runMultiple(
74
+ childActions: ->(multi) do
75
+ multi.timeouts_clear timerId: 'timeout-repeat', repeat: true
76
+ multi.logics_set targetId: 'timeout_repeat_status', data: { text: 'Stopped' }
77
+ end
78
+ )
79
+ end
80
+ )
81
+ end
82
+ )
83
+ end
84
+ )
85
+ end
86
+ )
@@ -0,0 +1,68 @@
1
+ json.title 'Test Page (Ul)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body childViews: ->(body) do
6
+ render 'json_ui/garage/test_page/header', view: body
7
+
8
+ body.panels_responsive padding: glib_json_padding_body, childViews: ->(res) do
9
+ res.h2 text: 'Overview'
10
+ res.p text: 'Ul panels render unordered lists similar to HTML ul/li.'
11
+
12
+ res.spacer height: 12
13
+ res.hr width: 'matchParent'
14
+
15
+ res.h2 text: 'Basic'
16
+ res.spacer height: 8
17
+ res.panels_ul id: 'ul_main', childViews: ->(li) do
18
+ li.label text: 'First item'
19
+ li.label text: 'Second item'
20
+ li.label text: 'Third item'
21
+ end
22
+
23
+ res.spacer height: 12
24
+ res.hr width: 'matchParent'
25
+
26
+ res.h2 text: 'Variants and Props'
27
+ res.spacer height: 8
28
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
29
+ flow.button text: 'Card style', onClick: ->(action) do
30
+ action.components_set targetId: 'ul_main', data: { styleClasses: ['card'], padding: { all: 10 } }
31
+ end
32
+ flow.spacer width: 4
33
+ flow.button text: 'Clear style', onClick: ->(action) do
34
+ action.components_set targetId: 'ul_main', data: { styleClasses: nil, padding: nil }
35
+ end
36
+ end
37
+
38
+ res.spacer height: 12
39
+ res.hr width: 'matchParent'
40
+
41
+ res.h2 text: 'Actions and Events'
42
+ res.spacer height: 8
43
+ res.label id: 'ul_action_status', text: 'Hover status: idle'
44
+ res.spacer height: 6
45
+ res.panels_ul onMouseEnter: ->(action) do
46
+ action.components_set targetId: 'ul_action_status', data: { text: 'Hover status: entered' }
47
+ end, onMouseLeave: ->(action) do
48
+ action.components_set targetId: 'ul_action_status', data: { text: 'Hover status: left' }
49
+ end, childViews: ->(li) do
50
+ li.label text: 'Hover this list'
51
+ li.label text: 'Second item'
52
+ end
53
+
54
+ res.spacer height: 12
55
+ res.hr width: 'matchParent'
56
+
57
+ res.h2 text: 'Edge and Advanced'
58
+ res.spacer height: 8
59
+ res.label text: 'Nested list'
60
+ res.panels_ul childViews: ->(li) do
61
+ li.label text: 'Parent item'
62
+ li.panels_ul childViews: ->(inner) do
63
+ inner.label text: 'Child item A'
64
+ inner.label text: 'Child item B'
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,68 @@
1
+ json.title 'Test Page (Vertical)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body childViews: ->(body) do
6
+ render 'json_ui/garage/test_page/header', view: body
7
+
8
+ body.panels_responsive padding: glib_json_padding_body, childViews: ->(res) do
9
+ res.h2 text: 'Overview'
10
+ res.p text: 'Vertical panels stack child views from top to bottom with optional alignment and distribution.'
11
+
12
+ res.spacer height: 12
13
+ res.hr width: 'matchParent'
14
+
15
+ res.h2 text: 'Basic'
16
+ res.spacer height: 8
17
+ res.panels_vertical id: 'vertical_main', width: 200, backgroundColor: '#e6e6e6', childViews: ->(panel) do
18
+ panel.button text: 'One'
19
+ panel.button text: 'Two'
20
+ panel.button text: 'Three'
21
+ end
22
+
23
+ res.spacer height: 12
24
+ res.hr width: 'matchParent'
25
+
26
+ res.h2 text: 'Variants and Props'
27
+ res.spacer height: 8
28
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
29
+ flow.button text: 'Fill equally', onClick: ->(action) do
30
+ action.components_set targetId: 'vertical_main', data: { height: 180, distribution: 'fillEqually' }
31
+ end
32
+ flow.spacer width: 4
33
+ flow.button text: 'Space equally', onClick: ->(action) do
34
+ action.components_set targetId: 'vertical_main', data: { height: 180, distribution: 'spaceEqually' }
35
+ end
36
+ flow.spacer width: 4
37
+ flow.button text: 'Align center', onClick: ->(action) do
38
+ action.components_set targetId: 'vertical_main', data: { align: 'center' }
39
+ end
40
+ flow.spacer width: 4
41
+ flow.button text: 'Align right', onClick: ->(action) do
42
+ action.components_set targetId: 'vertical_main', data: { align: 'right' }
43
+ end
44
+ end
45
+
46
+ res.spacer height: 12
47
+ res.hr width: 'matchParent'
48
+
49
+ res.h2 text: 'Actions and Events'
50
+ res.spacer height: 8
51
+ res.label id: 'vertical_action_status', text: 'Click status: idle'
52
+ res.spacer height: 6
53
+ res.panels_vertical width: 160, height: 60, align: 'center', backgroundColor: '#e6e6e6', onClick: ->(action) do
54
+ action.components_set targetId: 'vertical_action_status', data: { text: 'Click status: clicked' }
55
+ end, childViews: ->(panel) do
56
+ panel.label text: 'Click panel'
57
+ end
58
+
59
+ res.spacer height: 12
60
+ res.hr width: 'matchParent'
61
+
62
+ res.h2 text: 'Edge and Advanced'
63
+ res.spacer height: 8
64
+ res.label text: 'Empty vertical panel'
65
+ res.panels_vertical width: 200, height: 80, backgroundColor: '#f2f2f2', childViews: ->(_panel) do
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,64 @@
1
+ json.title 'Test Page (Web)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body childViews: ->(body) do
6
+ render 'json_ui/garage/test_page/header', view: body
7
+
8
+ body.panels_responsive padding: glib_json_padding_body, childViews: ->(res) do
9
+ res.h2 text: 'Overview'
10
+ res.p text: 'Web panels embed external web content within a panel container.'
11
+
12
+ url_primary = 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'
13
+ url_alt = 'https://example.com'
14
+
15
+ res.spacer height: 12
16
+ res.hr width: 'matchParent'
17
+
18
+ res.h2 text: 'Basic'
19
+ res.spacer height: 8
20
+ res.panels_web id: 'web_main', width: 'matchParent', height: 300, url: url_primary
21
+
22
+ res.spacer height: 12
23
+ res.hr width: 'matchParent'
24
+
25
+ res.h2 text: 'Variants and Props'
26
+ res.spacer height: 8
27
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
28
+ flow.button text: 'PDF', onClick: ->(action) do
29
+ action.components_set targetId: 'web_main', data: { url: url_primary }
30
+ end
31
+ flow.spacer width: 4
32
+ flow.button text: 'Example.com', onClick: ->(action) do
33
+ action.components_set targetId: 'web_main', data: { url: url_alt }
34
+ end
35
+ flow.spacer width: 4
36
+ flow.button text: 'Short height', onClick: ->(action) do
37
+ action.components_set targetId: 'web_main', data: { height: 180 }
38
+ end
39
+ flow.spacer width: 4
40
+ flow.button text: 'Tall height', onClick: ->(action) do
41
+ action.components_set targetId: 'web_main', data: { height: 360 }
42
+ end
43
+ end
44
+
45
+ res.spacer height: 12
46
+ res.hr width: 'matchParent'
47
+
48
+ res.h2 text: 'Actions and Events'
49
+ res.spacer height: 8
50
+ res.label id: 'web_action_status', text: 'Load status: idle'
51
+ res.spacer height: 6
52
+ res.panels_web width: 'matchParent', height: 200, url: url_alt, onLoad: ->(action) do
53
+ action.components_set targetId: 'web_action_status', data: { text: 'Load status: loaded' }
54
+ end
55
+
56
+ res.spacer height: 12
57
+ res.hr width: 'matchParent'
58
+
59
+ res.h2 text: 'Edge and Advanced'
60
+ res.spacer height: 8
61
+ res.label text: 'Small viewport'
62
+ res.panels_web width: 'matchParent', height: 120, url: url_primary
63
+ end
64
+ end