glib-web 4.42.2 → 4.42.4
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/json/libs.rb +2 -2
- data/app/views/json_ui/garage/test_page/_header.json.jbuilder +84 -14
- data/app/views/json_ui/garage/test_page/browsers.json.jbuilder +101 -0
- data/app/views/json_ui/garage/test_page/calendar.json.jbuilder +109 -0
- data/app/views/json_ui/garage/test_page/calendar_empty_data.json.jbuilder +3 -0
- data/app/views/json_ui/garage/test_page/carousel.json.jbuilder +70 -0
- data/app/views/json_ui/garage/test_page/charts.json.jbuilder +370 -0
- data/app/views/json_ui/garage/test_page/column.json.jbuilder +121 -0
- data/app/views/json_ui/garage/test_page/commands.json.jbuilder +98 -0
- data/app/views/json_ui/garage/test_page/components.json.jbuilder +143 -0
- data/app/views/json_ui/garage/test_page/cookies.json.jbuilder +109 -0
- data/app/views/json_ui/garage/test_page/custom.json.jbuilder +56 -0
- data/app/views/json_ui/garage/test_page/flow.json.jbuilder +70 -0
- data/app/views/json_ui/garage/test_page/forms.json.jbuilder +105 -0
- data/app/views/json_ui/garage/test_page/grid.json.jbuilder +68 -0
- data/app/views/json_ui/garage/test_page/horizontal.json.jbuilder +68 -0
- data/app/views/json_ui/garage/test_page/http.json.jbuilder +87 -37
- data/app/views/json_ui/garage/test_page/image.json.jbuilder +145 -0
- data/app/views/json_ui/garage/test_page/list.json.jbuilder +75 -0
- data/app/views/json_ui/garage/test_page/lists_append.json.jbuilder +151 -0
- data/app/views/json_ui/garage/test_page/logics_set.json.jbuilder +7 -6
- data/app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder +118 -0
- data/app/views/json_ui/garage/test_page/pagination.json.jbuilder +64 -0
- data/app/views/json_ui/garage/test_page/panels.json.jbuilder +113 -0
- data/app/views/json_ui/garage/test_page/popovers.json.jbuilder +112 -0
- data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +119 -0
- data/app/views/json_ui/garage/test_page/responsive.json.jbuilder +100 -0
- data/app/views/json_ui/garage/test_page/scroll.json.jbuilder +77 -0
- data/app/views/json_ui/garage/test_page/split.json.jbuilder +82 -0
- data/app/views/json_ui/garage/test_page/storage_items.json.jbuilder +144 -0
- data/app/views/json_ui/garage/test_page/table.json.jbuilder +99 -0
- data/app/views/json_ui/garage/test_page/timeline.json.jbuilder +97 -0
- data/app/views/json_ui/garage/test_page/timeouts.json.jbuilder +86 -0
- data/app/views/json_ui/garage/test_page/ul.json.jbuilder +68 -0
- data/app/views/json_ui/garage/test_page/vertical.json.jbuilder +68 -0
- data/app/views/json_ui/garage/test_page/web.json.jbuilder +64 -0
- data/app/views/json_ui/garage/test_page/windows.json.jbuilder +129 -0
- data/lib/glib/rubocop/cops/multiline_method_call_style.rb +0 -8
- data/lib/tasks/db.rake +1 -1
- metadata +39 -7
- data/lib/glib/doc_generator.rb +0 -386
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
json.title 'Test Page (Pagination)'
|
|
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: 'Pagination panels render page controls with change events.'
|
|
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_pagination id: 'pagination_main', length: 10, value: 1, onChange: ->(action) do
|
|
18
|
+
action.components_set targetId: 'pagination_status', data: { text: 'Page changed' }
|
|
19
|
+
end
|
|
20
|
+
res.label id: 'pagination_status', text: 'Page status: idle'
|
|
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: 'Page 1', onClick: ->(action) do
|
|
29
|
+
action.components_set targetId: 'pagination_main', data: { value: 1 }
|
|
30
|
+
end
|
|
31
|
+
flow.spacer width: 4
|
|
32
|
+
flow.button text: 'Page 5', onClick: ->(action) do
|
|
33
|
+
action.components_set targetId: 'pagination_main', data: { value: 5 }
|
|
34
|
+
end
|
|
35
|
+
flow.spacer width: 4
|
|
36
|
+
flow.button text: 'Show 3', onClick: ->(action) do
|
|
37
|
+
action.components_set targetId: 'pagination_main', data: { totalVisible: 3 }
|
|
38
|
+
end
|
|
39
|
+
flow.spacer width: 4
|
|
40
|
+
flow.button text: 'Show 7', onClick: ->(action) do
|
|
41
|
+
action.components_set targetId: 'pagination_main', data: { totalVisible: 7 }
|
|
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: 'pagination_action_status', text: 'Change status: idle'
|
|
51
|
+
res.spacer height: 6
|
|
52
|
+
res.panels_pagination length: 4, value: 1, onChange: ->(action) do
|
|
53
|
+
action.components_set targetId: 'pagination_action_status', data: { text: 'Change status: changed' }
|
|
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: 'Single-page pagination'
|
|
62
|
+
res.panels_pagination length: 1, value: 1, totalVisible: 1
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
json.title 'Test Page (Panels Actions)'
|
|
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: 'Panels'
|
|
12
|
+
res.label text: 'Scroll-related panel 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 panels/scrollTo actions to bring content into view programmatically.'
|
|
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.panels_scroll id: 'panels_action_scroll', height: 180, width: 'matchParent', childViews: ->(scroll) do
|
|
26
|
+
scroll.label text: 'Top'
|
|
27
|
+
(1..8).each do |index|
|
|
28
|
+
scroll.label text: "Scrollable item #{index}"
|
|
29
|
+
end
|
|
30
|
+
scroll.label id: 'scroll_anchor', text: 'Scroll anchor'
|
|
31
|
+
(9..16).each do |index|
|
|
32
|
+
scroll.label text: "Scrollable item #{index}"
|
|
33
|
+
end
|
|
34
|
+
scroll.label text: 'Bottom'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
res.spacer height: 16
|
|
38
|
+
res.hr width: 'matchParent'
|
|
39
|
+
res.spacer height: 16
|
|
40
|
+
|
|
41
|
+
res.h2 text: 'Variants/props'
|
|
42
|
+
res.spacer height: 8
|
|
43
|
+
res.panels_flow(
|
|
44
|
+
innerPadding: { bottom: 0 },
|
|
45
|
+
width: 'matchParent',
|
|
46
|
+
childViews: ->(flow) do
|
|
47
|
+
flow.button(
|
|
48
|
+
text: 'panels/scrollToBottom (no animate)',
|
|
49
|
+
onClick: ->(action) do
|
|
50
|
+
action.panels_scrollToBottom animate: false
|
|
51
|
+
end
|
|
52
|
+
)
|
|
53
|
+
flow.spacer width: 8
|
|
54
|
+
flow.button(
|
|
55
|
+
text: 'panels/scrollTo (placement: top)',
|
|
56
|
+
onClick: ->(action) do
|
|
57
|
+
action.panels_scrollTo viewId: 'scroll_anchor', placement: 'top'
|
|
58
|
+
end
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
res.spacer height: 16
|
|
64
|
+
res.hr width: 'matchParent'
|
|
65
|
+
res.spacer height: 16
|
|
66
|
+
|
|
67
|
+
res.h2 text: 'Actions/events'
|
|
68
|
+
res.spacer height: 8
|
|
69
|
+
res.panels_flow(
|
|
70
|
+
innerPadding: { bottom: 0 },
|
|
71
|
+
width: 'matchParent',
|
|
72
|
+
childViews: ->(flow) do
|
|
73
|
+
flow.button(
|
|
74
|
+
text: 'panels/scrollToBottom',
|
|
75
|
+
onClick: ->(action) do
|
|
76
|
+
action.panels_scrollToBottom animate: true, onScroll: ->(subaction) do
|
|
77
|
+
subaction.dialogs_alert message: 'Bottom reached'
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
flow.spacer width: 8
|
|
82
|
+
flow.button(
|
|
83
|
+
text: 'panels/scrollTo anchor',
|
|
84
|
+
onClick: ->(action) do
|
|
85
|
+
action.panels_scrollTo \
|
|
86
|
+
viewId: 'scroll_anchor',
|
|
87
|
+
force: true,
|
|
88
|
+
animate: true,
|
|
89
|
+
placement: 'top',
|
|
90
|
+
onScroll: ->(subaction) do
|
|
91
|
+
subaction.dialogs_alert message: 'Anchor in view'
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
res.spacer height: 16
|
|
99
|
+
res.hr width: 'matchParent'
|
|
100
|
+
res.spacer height: 16
|
|
101
|
+
|
|
102
|
+
res.h2 text: 'Edge/advanced'
|
|
103
|
+
res.spacer height: 8
|
|
104
|
+
res.button(
|
|
105
|
+
text: 'panels/scrollTo (force + no animate)',
|
|
106
|
+
onClick: ->(action) do
|
|
107
|
+
action.panels_scrollTo viewId: 'scroll_anchor', force: true, animate: false, placement: 'top'
|
|
108
|
+
end
|
|
109
|
+
)
|
|
110
|
+
end
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
json.title 'Test Page (Popovers)'
|
|
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: 'Popovers'
|
|
12
|
+
res.label text: 'Inline and server-driven popover 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: 'Popovers can be built inline or loaded from the server and anchored to a target.'
|
|
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.label id: 'popover_target', text: 'Popover anchor'
|
|
26
|
+
res.spacer height: 8
|
|
27
|
+
res.button(
|
|
28
|
+
text: 'popovers/show menu',
|
|
29
|
+
onClick: ->(action) do
|
|
30
|
+
action.popovers_show \
|
|
31
|
+
key: 'popover_menu',
|
|
32
|
+
placement: 'bottom-start',
|
|
33
|
+
targetId: 'popover_target',
|
|
34
|
+
content: ->(dialog) do
|
|
35
|
+
dialog.body styleClass: 'popover-menu', padding: glib_json_padding_body, childViews: ->(menu) do
|
|
36
|
+
menu.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(subaction) do
|
|
37
|
+
subaction.popovers_close key: 'popover_menu'
|
|
38
|
+
end
|
|
39
|
+
menu.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(subaction) do
|
|
40
|
+
subaction.popovers_close key: 'popover_menu'
|
|
41
|
+
end
|
|
42
|
+
menu.label text: 'Item 3', styleClass: 'popover-menu-item', onClick: ->(subaction) do
|
|
43
|
+
subaction.popovers_close key: 'popover_menu'
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
res.spacer height: 16
|
|
51
|
+
res.hr width: 'matchParent'
|
|
52
|
+
res.spacer height: 16
|
|
53
|
+
|
|
54
|
+
res.h2 text: 'Variants/props'
|
|
55
|
+
res.spacer height: 8
|
|
56
|
+
res.button(
|
|
57
|
+
text: 'popovers/open (server)',
|
|
58
|
+
onClick: ->(action) do
|
|
59
|
+
action.popovers_open url: json_ui_garage_url(path: 'views/popovers_open', key: 'server_popover'), key: 'server_popover'
|
|
60
|
+
end
|
|
61
|
+
)
|
|
62
|
+
res.spacer height: 4
|
|
63
|
+
res.button(
|
|
64
|
+
text: 'popovers/open (updateExisting)',
|
|
65
|
+
onClick: ->(action) do
|
|
66
|
+
action.popovers_open \
|
|
67
|
+
url: json_ui_garage_url(path: 'views/popovers_open', key: 'server_popover'),
|
|
68
|
+
key: 'server_popover',
|
|
69
|
+
updateExisting: true
|
|
70
|
+
end
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
res.spacer height: 16
|
|
74
|
+
res.hr width: 'matchParent'
|
|
75
|
+
res.spacer height: 16
|
|
76
|
+
|
|
77
|
+
res.h2 text: 'Actions/events'
|
|
78
|
+
res.spacer height: 8
|
|
79
|
+
res.label id: 'popovers_status', text: 'Status: open'
|
|
80
|
+
res.spacer height: 8
|
|
81
|
+
res.button(
|
|
82
|
+
text: 'popovers/close menu',
|
|
83
|
+
onClick: ->(action) do
|
|
84
|
+
action.popovers_close key: 'popover_menu'
|
|
85
|
+
action.logics_set targetId: 'popovers_status', data: { text: 'Status: closed' }
|
|
86
|
+
end
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
res.spacer height: 16
|
|
90
|
+
res.hr width: 'matchParent'
|
|
91
|
+
res.spacer height: 16
|
|
92
|
+
|
|
93
|
+
res.h2 text: 'Edge/advanced'
|
|
94
|
+
res.spacer height: 8
|
|
95
|
+
res.button(
|
|
96
|
+
text: 'popovers/show (top-end)',
|
|
97
|
+
onClick: ->(action) do
|
|
98
|
+
action.popovers_show \
|
|
99
|
+
key: 'popover_note',
|
|
100
|
+
placement: 'top-end',
|
|
101
|
+
targetId: 'popover_target',
|
|
102
|
+
content: ->(dialog) do
|
|
103
|
+
dialog.body padding: glib_json_padding_body, childViews: ->(menu) do
|
|
104
|
+
menu.label text: 'Pinned note'
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
json.title 'Test Page (Progress Circle)'
|
|
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
|
+
|
|
9
|
+
body.panels_responsive(
|
|
10
|
+
padding: glib_json_padding_body,
|
|
11
|
+
childViews: ->(res) do
|
|
12
|
+
res.h2 text: 'Overview'
|
|
13
|
+
res.p text: 'ProgressCircle visualizes progress with configurable size, stroke width, and optional text.'
|
|
14
|
+
res.spacer height: 12
|
|
15
|
+
res.hr width: 'matchParent'
|
|
16
|
+
res.spacer height: 12
|
|
17
|
+
|
|
18
|
+
res.h2 text: 'Basic example'
|
|
19
|
+
res.spacer height: 8
|
|
20
|
+
res.progressCircle(
|
|
21
|
+
id: 'progress_circle_main',
|
|
22
|
+
size: 160,
|
|
23
|
+
value: 35,
|
|
24
|
+
width: 16,
|
|
25
|
+
color: '#4B56D2'
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
res.spacer height: 12
|
|
29
|
+
res.hr width: 'matchParent'
|
|
30
|
+
res.spacer height: 12
|
|
31
|
+
|
|
32
|
+
res.h2 text: 'Variants and props'
|
|
33
|
+
res.label text: 'Adjust value, size, and stroke width.'
|
|
34
|
+
res.spacer height: 8
|
|
35
|
+
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
36
|
+
flow.button(
|
|
37
|
+
text: '35% default',
|
|
38
|
+
onClick: ->(action) do
|
|
39
|
+
action.components_set(
|
|
40
|
+
targetId: 'progress_circle_main',
|
|
41
|
+
data: { value: 35, size: 160, width: 16, color: '#4B56D2', half: nil, text: nil }
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
)
|
|
45
|
+
flow.spacer width: 6
|
|
46
|
+
flow.button(
|
|
47
|
+
text: '65%',
|
|
48
|
+
onClick: ->(action) do
|
|
49
|
+
action.components_set targetId: 'progress_circle_main', data: { value: 65 }
|
|
50
|
+
end
|
|
51
|
+
)
|
|
52
|
+
flow.spacer width: 6
|
|
53
|
+
flow.button(
|
|
54
|
+
text: 'Thick stroke',
|
|
55
|
+
onClick: ->(action) do
|
|
56
|
+
action.components_set targetId: 'progress_circle_main', data: { width: 28 }
|
|
57
|
+
end
|
|
58
|
+
)
|
|
59
|
+
flow.spacer width: 6
|
|
60
|
+
flow.button(
|
|
61
|
+
text: 'Small size',
|
|
62
|
+
onClick: ->(action) do
|
|
63
|
+
action.components_set targetId: 'progress_circle_main', data: { size: 110 }
|
|
64
|
+
end
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
res.spacer height: 12
|
|
69
|
+
res.hr width: 'matchParent'
|
|
70
|
+
res.spacer height: 12
|
|
71
|
+
|
|
72
|
+
res.h2 text: 'Actions and events'
|
|
73
|
+
res.label text: 'Swap color and label to confirm metadata rendering.'
|
|
74
|
+
res.spacer height: 8
|
|
75
|
+
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
76
|
+
flow.button(
|
|
77
|
+
text: 'Half circle + label',
|
|
78
|
+
onClick: ->(action) do
|
|
79
|
+
action.components_set(
|
|
80
|
+
targetId: 'progress_circle_main',
|
|
81
|
+
data: { value: 80, half: true, text: 'Section A', color: '#9E0A0A', width: 22 }
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
)
|
|
85
|
+
flow.spacer width: 6
|
|
86
|
+
flow.button(
|
|
87
|
+
text: 'Accent color',
|
|
88
|
+
onClick: ->(action) do
|
|
89
|
+
action.components_set targetId: 'progress_circle_main', data: { color: '#F9C80E', half: nil, text: nil }
|
|
90
|
+
end
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
res.spacer height: 12
|
|
95
|
+
res.hr width: 'matchParent'
|
|
96
|
+
res.spacer height: 12
|
|
97
|
+
|
|
98
|
+
res.h2 text: 'Edge and advanced'
|
|
99
|
+
res.label text: 'Confirm 0% and 100% values render correctly.'
|
|
100
|
+
res.spacer height: 8
|
|
101
|
+
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
102
|
+
flow.button(
|
|
103
|
+
text: '0%',
|
|
104
|
+
onClick: ->(action) do
|
|
105
|
+
action.components_set targetId: 'progress_circle_main', data: { value: 0, half: nil, text: nil }
|
|
106
|
+
end
|
|
107
|
+
)
|
|
108
|
+
flow.spacer width: 6
|
|
109
|
+
flow.button(
|
|
110
|
+
text: '100%',
|
|
111
|
+
onClick: ->(action) do
|
|
112
|
+
action.components_set targetId: 'progress_circle_main', data: { value: 100, half: nil, text: nil }
|
|
113
|
+
end
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
json.title 'Test Page (Responsive)'
|
|
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: 'Responsive panels arrange columns based on breakpoints and alignment.'
|
|
13
|
+
res.spacer height: 12
|
|
14
|
+
res.hr width: 'matchParent'
|
|
15
|
+
res.h2 text: 'Basic'
|
|
16
|
+
res.spacer height: 8
|
|
17
|
+
res.panels_responsive(
|
|
18
|
+
id: 'responsive_main',
|
|
19
|
+
width: 'matchParent',
|
|
20
|
+
childViews: ->(grid) do
|
|
21
|
+
grid.label text: 'Label inside responsive'
|
|
22
|
+
end
|
|
23
|
+
)
|
|
24
|
+
res.spacer height: 12
|
|
25
|
+
res.hr width: 'matchParent'
|
|
26
|
+
res.h2 text: 'Variants and Props'
|
|
27
|
+
res.spacer height: 8
|
|
28
|
+
res.panels_flow(
|
|
29
|
+
innerPadding: { bottom: 0 },
|
|
30
|
+
childViews: ->(flow) do
|
|
31
|
+
flow.button(
|
|
32
|
+
text: 'Align left',
|
|
33
|
+
onClick: ->(action) do
|
|
34
|
+
action.components_set targetId: 'responsive_main', data: { align: 'left' }
|
|
35
|
+
end
|
|
36
|
+
)
|
|
37
|
+
flow.spacer width: 4
|
|
38
|
+
flow.button(
|
|
39
|
+
text: 'Align center',
|
|
40
|
+
onClick: ->(action) do
|
|
41
|
+
action.components_set targetId: 'responsive_main', data: { align: 'center' }
|
|
42
|
+
end
|
|
43
|
+
)
|
|
44
|
+
flow.spacer width: 4
|
|
45
|
+
flow.button(
|
|
46
|
+
text: 'Align right',
|
|
47
|
+
onClick: ->(action) do
|
|
48
|
+
action.components_set targetId: 'responsive_main', data: { align: 'right' }
|
|
49
|
+
end
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
)
|
|
53
|
+
res.spacer height: 12
|
|
54
|
+
res.hr width: 'matchParent'
|
|
55
|
+
res.h2 text: 'Actions and Events'
|
|
56
|
+
res.spacer height: 8
|
|
57
|
+
res.label id: 'responsive_action_status', text: 'Click status: idle'
|
|
58
|
+
res.spacer height: 6
|
|
59
|
+
res.panels_responsive(
|
|
60
|
+
onClick: ->(action) do
|
|
61
|
+
action.components_set targetId: 'responsive_action_status', data: { text: 'Click status: clicked' }
|
|
62
|
+
end,
|
|
63
|
+
styleClasses: ['card'],
|
|
64
|
+
padding: { all: 12 },
|
|
65
|
+
childViews: ->(grid) do
|
|
66
|
+
grid.panels_column(
|
|
67
|
+
xs: { cols: 12 },
|
|
68
|
+
childViews: ->(col) do
|
|
69
|
+
col.label text: 'Click this panel'
|
|
70
|
+
end
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
)
|
|
74
|
+
res.spacer height: 12
|
|
75
|
+
res.hr width: 'matchParent'
|
|
76
|
+
res.h2 text: 'Edge and Advanced'
|
|
77
|
+
res.spacer height: 8
|
|
78
|
+
res.label text: 'Column hidden on medium screens and below'
|
|
79
|
+
res.panels_responsive(
|
|
80
|
+
width: 'matchParent',
|
|
81
|
+
childViews: ->(grid) do
|
|
82
|
+
grid.panels_column(
|
|
83
|
+
mdAndDown: { hide: true },
|
|
84
|
+
lg: { cols: 6 },
|
|
85
|
+
childViews: ->(col) do
|
|
86
|
+
col.label text: 'Visible on large screens only'
|
|
87
|
+
end
|
|
88
|
+
)
|
|
89
|
+
grid.panels_column(
|
|
90
|
+
lg: { cols: 6 },
|
|
91
|
+
childViews: ->(col) do
|
|
92
|
+
col.label text: 'Always visible'
|
|
93
|
+
end
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
json.title 'Test Page (Scroll)'
|
|
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: 'Scroll panels provide a container with overflow handling for long content.'
|
|
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_scroll id: 'scroll_main', height: 160, width: 'matchParent', childViews: ->(scroll) do
|
|
18
|
+
(1..12).each do |index|
|
|
19
|
+
scroll.label text: "Scrollable item #{index}"
|
|
20
|
+
end
|
|
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: 'Short', onClick: ->(action) do
|
|
30
|
+
action.components_set targetId: 'scroll_main', data: { height: 120 }
|
|
31
|
+
end
|
|
32
|
+
flow.spacer width: 4
|
|
33
|
+
flow.button text: 'Tall', onClick: ->(action) do
|
|
34
|
+
action.components_set targetId: 'scroll_main', data: { height: 240 }
|
|
35
|
+
end
|
|
36
|
+
flow.spacer width: 4
|
|
37
|
+
flow.button text: 'Add padding', onClick: ->(action) do
|
|
38
|
+
action.components_set targetId: 'scroll_main', data: { padding: { all: 12 } }
|
|
39
|
+
end
|
|
40
|
+
flow.spacer width: 4
|
|
41
|
+
flow.button text: 'Clear padding', onClick: ->(action) do
|
|
42
|
+
action.components_set targetId: 'scroll_main', data: { padding: nil }
|
|
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: 'scroll_status', text: 'Scroll status: idle'
|
|
52
|
+
res.spacer height: 6
|
|
53
|
+
res.panels_scroll height: 120, onLoad: ->(action) do
|
|
54
|
+
action.components_set targetId: 'scroll_status', data: { text: 'Scroll status: loaded' }
|
|
55
|
+
end, childViews: ->(scroll) do
|
|
56
|
+
(1..8).each do |index|
|
|
57
|
+
scroll.label text: "Load item #{index}"
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
res.spacer height: 12
|
|
62
|
+
res.hr width: 'matchParent'
|
|
63
|
+
|
|
64
|
+
res.h2 text: 'Edge and Advanced'
|
|
65
|
+
res.spacer height: 8
|
|
66
|
+
res.label text: 'Nested scroll'
|
|
67
|
+
res.panels_scroll height: 140, childViews: ->(outer) do
|
|
68
|
+
outer.label text: 'Outer start'
|
|
69
|
+
outer.panels_scroll height: 80, childViews: ->(inner) do
|
|
70
|
+
(1..6).each do |index|
|
|
71
|
+
inner.label text: "Inner item #{index}"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
outer.label text: 'Outer end'
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
json.title 'Test Page (Split)'
|
|
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: 'Split panels provide left, center, and right sub-panels for multi-column layouts.'
|
|
13
|
+
res.spacer height: 12
|
|
14
|
+
res.hr width: 'matchParent'
|
|
15
|
+
res.h2 text: 'Basic'
|
|
16
|
+
res.spacer height: 8
|
|
17
|
+
res.panels_split(
|
|
18
|
+
id: 'split_main',
|
|
19
|
+
width: 'matchParent',
|
|
20
|
+
content: ->(content) do
|
|
21
|
+
content.left(
|
|
22
|
+
childViews: ->(left) do
|
|
23
|
+
left.label text: 'Left'
|
|
24
|
+
end
|
|
25
|
+
)
|
|
26
|
+
content.center(
|
|
27
|
+
childViews: ->(center) do
|
|
28
|
+
center.label text: 'Center content'
|
|
29
|
+
end
|
|
30
|
+
)
|
|
31
|
+
content.right(
|
|
32
|
+
childViews: ->(right) do
|
|
33
|
+
right.label text: 'Right'
|
|
34
|
+
end
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
)
|
|
38
|
+
res.spacer height: 12
|
|
39
|
+
res.hr width: 'matchParent'
|
|
40
|
+
res.h2 text: 'Actions and Events'
|
|
41
|
+
res.spacer height: 8
|
|
42
|
+
res.label id: 'split_action_status', text: 'Action status: idle'
|
|
43
|
+
res.spacer height: 6
|
|
44
|
+
res.panels_split(
|
|
45
|
+
width: 'matchParent',
|
|
46
|
+
content: ->(content) do
|
|
47
|
+
content.left(
|
|
48
|
+
childViews: ->(left) do
|
|
49
|
+
left.button(
|
|
50
|
+
text: 'Update status',
|
|
51
|
+
onClick: ->(action) do
|
|
52
|
+
action.components_set targetId: 'split_action_status', data: { text: 'Action status: clicked' }
|
|
53
|
+
end
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
)
|
|
57
|
+
content.center(
|
|
58
|
+
childViews: ->(center) do
|
|
59
|
+
center.label text: 'Center'
|
|
60
|
+
end
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
)
|
|
64
|
+
res.spacer height: 12
|
|
65
|
+
res.hr width: 'matchParent'
|
|
66
|
+
res.h2 text: 'Edge and Advanced'
|
|
67
|
+
res.spacer height: 8
|
|
68
|
+
res.label text: 'Split with only center content'
|
|
69
|
+
res.panels_split(
|
|
70
|
+
width: 'matchParent',
|
|
71
|
+
content: ->(content) do
|
|
72
|
+
content.center(
|
|
73
|
+
childViews: ->(center) do
|
|
74
|
+
center.label text: 'Only center is defined'
|
|
75
|
+
end
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
)
|