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,143 @@
|
|
|
1
|
+
json.title 'Test Page (Components)'
|
|
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: 'Components'
|
|
12
|
+
res.label text: 'Update or replace views at runtime.'
|
|
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 components/set to mutate an existing view or components/replace to swap it entirely.'
|
|
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: 'components_basic', text: 'Label text: default'
|
|
26
|
+
res.spacer height: 8
|
|
27
|
+
res.button(
|
|
28
|
+
text: 'components/set text',
|
|
29
|
+
onClick: ->(action) do
|
|
30
|
+
action.components_set targetId: 'components_basic', data: { text: 'Label text: updated' }
|
|
31
|
+
end
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
res.spacer height: 16
|
|
35
|
+
res.hr width: 'matchParent'
|
|
36
|
+
res.spacer height: 16
|
|
37
|
+
|
|
38
|
+
res.h2 text: 'Variants/props'
|
|
39
|
+
res.spacer height: 8
|
|
40
|
+
res.panels_flow(
|
|
41
|
+
innerPadding: { bottom: 0 },
|
|
42
|
+
width: 'matchParent',
|
|
43
|
+
childViews: ->(flow) do
|
|
44
|
+
flow.button(
|
|
45
|
+
text: 'Hide',
|
|
46
|
+
onClick: ->(action) do
|
|
47
|
+
action.components_set targetId: 'components_basic', data: { displayed: false }
|
|
48
|
+
end
|
|
49
|
+
)
|
|
50
|
+
flow.spacer width: 8
|
|
51
|
+
flow.button(
|
|
52
|
+
text: 'Show',
|
|
53
|
+
onClick: ->(action) do
|
|
54
|
+
action.components_set targetId: 'components_basic', data: { displayed: true }
|
|
55
|
+
end
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
res.spacer height: 16
|
|
61
|
+
res.hr width: 'matchParent'
|
|
62
|
+
res.spacer height: 16
|
|
63
|
+
|
|
64
|
+
res.h2 text: 'Actions/events'
|
|
65
|
+
res.spacer height: 8
|
|
66
|
+
res.label id: 'components_status', text: 'Status: idle'
|
|
67
|
+
res.spacer height: 8
|
|
68
|
+
res.button(
|
|
69
|
+
text: 'components/set (with onSet)',
|
|
70
|
+
onClick: ->(action) do
|
|
71
|
+
action.components_set(
|
|
72
|
+
targetId: 'components_basic',
|
|
73
|
+
data: { text: 'Label text: updated again' },
|
|
74
|
+
onSet: ->(subaction) do
|
|
75
|
+
subaction.runMultiple(
|
|
76
|
+
childActions: ->(multi) do
|
|
77
|
+
multi.logics_set targetId: 'components_status', data: { text: 'Status: set callback fired' }
|
|
78
|
+
multi.snackbars_alert message: 'Updated', styleClass: 'success'
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
res.spacer height: 16
|
|
87
|
+
res.hr width: 'matchParent'
|
|
88
|
+
res.spacer height: 16
|
|
89
|
+
|
|
90
|
+
res.h2 text: 'Edge/advanced'
|
|
91
|
+
res.spacer height: 8
|
|
92
|
+
res.label id: 'components_replace_target', text: 'Replace me'
|
|
93
|
+
res.spacer height: 8
|
|
94
|
+
res.panels_flow(
|
|
95
|
+
innerPadding: { bottom: 0 },
|
|
96
|
+
width: 'matchParent',
|
|
97
|
+
childViews: ->(flow) do
|
|
98
|
+
flow.button(
|
|
99
|
+
text: 'Replace with icon',
|
|
100
|
+
onClick: ->(action) do
|
|
101
|
+
action.components_replace(
|
|
102
|
+
targetId: 'components_replace_target',
|
|
103
|
+
newView: ->(view) do
|
|
104
|
+
view.icon name: 'verified', size: 24, styleClasses: ['success']
|
|
105
|
+
end
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
)
|
|
109
|
+
flow.spacer width: 8
|
|
110
|
+
flow.button(
|
|
111
|
+
text: 'Replace with button',
|
|
112
|
+
onClick: ->(action) do
|
|
113
|
+
action.components_replace(
|
|
114
|
+
targetId: 'components_replace_target',
|
|
115
|
+
newView: ->(view) do
|
|
116
|
+
view.button(
|
|
117
|
+
text: 'New button',
|
|
118
|
+
onClick: ->(subaction) do
|
|
119
|
+
subaction.snackbars_alert message: 'Button clicked'
|
|
120
|
+
end
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
)
|
|
124
|
+
end
|
|
125
|
+
)
|
|
126
|
+
flow.spacer width: 8
|
|
127
|
+
flow.button(
|
|
128
|
+
text: 'Restore label',
|
|
129
|
+
onClick: ->(action) do
|
|
130
|
+
action.components_replace(
|
|
131
|
+
targetId: 'components_replace_target',
|
|
132
|
+
newView: ->(view) do
|
|
133
|
+
view.label text: 'Replace me'
|
|
134
|
+
end
|
|
135
|
+
)
|
|
136
|
+
end
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
json.title 'Test Page (Cookies)'
|
|
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: 'Cookies'
|
|
12
|
+
res.label text: 'Save, remove, and clear browser cookies.'
|
|
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 cookie actions to persist lightweight browser state and clean it up when needed.'
|
|
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: 'cookies/save',
|
|
27
|
+
onClick: ->(action) do
|
|
28
|
+
action.cookies_save key: 'glib_cookie', value: "test_cookie_#{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: 'cookies/remove',
|
|
44
|
+
onClick: ->(action) do
|
|
45
|
+
action.cookies_remove key: 'glib_cookie'
|
|
46
|
+
end
|
|
47
|
+
)
|
|
48
|
+
flow.spacer width: 8
|
|
49
|
+
flow.button(
|
|
50
|
+
text: 'cookies/clear',
|
|
51
|
+
onClick: ->(action) do
|
|
52
|
+
action.cookies_clear key: 'glib_cookie'
|
|
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: 'cookies_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: 'cookies/save (onSave)',
|
|
72
|
+
onClick: ->(action) do
|
|
73
|
+
action.cookies_save key: 'glib_cookie', value: "event_cookie_#{DateTime.current.to_i}", onSave: ->(subaction) do
|
|
74
|
+
subaction.logics_set targetId: 'cookies_status', data: { text: 'Status: saved (callback)' }
|
|
75
|
+
subaction.snackbars_alert message: 'Saved'
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
)
|
|
79
|
+
flow.spacer width: 8
|
|
80
|
+
flow.button(
|
|
81
|
+
text: 'cookies/remove (onRemove)',
|
|
82
|
+
onClick: ->(action) do
|
|
83
|
+
action.cookies_remove key: 'glib_cookie', onRemove: ->(subaction) do
|
|
84
|
+
subaction.logics_set targetId: 'cookies_status', data: { text: 'Status: removed (callback)' }
|
|
85
|
+
subaction.snackbars_alert message: 'Removed'
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
res.spacer height: 16
|
|
93
|
+
res.hr width: 'matchParent'
|
|
94
|
+
res.spacer height: 16
|
|
95
|
+
|
|
96
|
+
res.h2 text: 'Edge/advanced'
|
|
97
|
+
res.spacer height: 8
|
|
98
|
+
res.button(
|
|
99
|
+
text: 'cookies/remove missing key',
|
|
100
|
+
onClick: ->(action) do
|
|
101
|
+
action.cookies_remove key: 'glib_missing_cookie', onRemove: ->(subaction) do
|
|
102
|
+
subaction.snackbars_alert message: 'Remove attempted'
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
json.title 'Test Page (Custom)'
|
|
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: 'Custom panels render a predefined template with custom data payloads.'
|
|
11
|
+
|
|
12
|
+
data_primary = { imageUrl: glib_json_image_standard_url, title: 'Primary', subtitle: 'Thumbnail template' }
|
|
13
|
+
data_alt = { imageUrl: glib_json_image_standard_url, title: 'Alternate', subtitle: 'Alternate data payload' }
|
|
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_custom id: 'custom_main', template: 'thumbnail', width: 'matchParent', backgroundColor: '#fafafa', data: data_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: 'Primary data', onClick: ->(action) do
|
|
29
|
+
action.components_set targetId: 'custom_main', data: { data: data_primary }
|
|
30
|
+
end
|
|
31
|
+
flow.spacer width: 4
|
|
32
|
+
flow.button text: 'Alternate data', onClick: ->(action) do
|
|
33
|
+
action.components_set targetId: 'custom_main', data: { data: data_alt }
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
res.spacer height: 12
|
|
38
|
+
res.hr width: 'matchParent'
|
|
39
|
+
|
|
40
|
+
res.h2 text: 'Actions and Events'
|
|
41
|
+
res.spacer height: 8
|
|
42
|
+
res.label id: 'custom_action_status', text: 'Action status: idle'
|
|
43
|
+
res.spacer height: 6
|
|
44
|
+
res.panels_custom template: 'thumbnail', data: data_primary, onClick: ->(action) do
|
|
45
|
+
action.components_set targetId: 'custom_action_status', data: { text: 'Action status: clicked' }
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
res.spacer height: 12
|
|
49
|
+
res.hr width: 'matchParent'
|
|
50
|
+
|
|
51
|
+
res.h2 text: 'Edge and Advanced'
|
|
52
|
+
res.spacer height: 8
|
|
53
|
+
res.label text: 'Non-existent template'
|
|
54
|
+
res.panels_custom template: 'nonExistentTemplate'
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
json.title 'Test Page (Flow)'
|
|
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: 'Flow panels wrap children across rows like text flow with configurable gaps.'
|
|
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_flow id: 'flow_main', width: 240, innerPadding: { x: 6, y: 6 }, backgroundColor: '#e6e6e6', childViews: ->(flow) do
|
|
18
|
+
(1..8).each do |index|
|
|
19
|
+
flow.button text: "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: 'Tight gap', onClick: ->(action) do
|
|
30
|
+
action.components_set targetId: 'flow_main', data: { innerPadding: { x: 2, y: 2 } }
|
|
31
|
+
end
|
|
32
|
+
flow.spacer width: 4
|
|
33
|
+
flow.button text: 'Loose gap', onClick: ->(action) do
|
|
34
|
+
action.components_set targetId: 'flow_main', data: { innerPadding: { x: 12, y: 12 } }
|
|
35
|
+
end
|
|
36
|
+
flow.spacer width: 4
|
|
37
|
+
flow.button text: 'Align middle', onClick: ->(action) do
|
|
38
|
+
action.components_set targetId: 'flow_main', data: { align: 'middle' }
|
|
39
|
+
end
|
|
40
|
+
flow.spacer width: 4
|
|
41
|
+
flow.button text: 'Align bottom', onClick: ->(action) do
|
|
42
|
+
action.components_set targetId: 'flow_main', data: { align: 'bottom' }
|
|
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: 'flow_action_status', text: 'Hover status: idle'
|
|
52
|
+
res.spacer height: 6
|
|
53
|
+
res.panels_flow width: 200, innerPadding: { x: 6, y: 6 }, backgroundColor: '#e6e6e6', onMouseEnter: ->(action) do
|
|
54
|
+
action.components_set targetId: 'flow_action_status', data: { text: 'Hover status: entered' }
|
|
55
|
+
end, onMouseLeave: ->(action) do
|
|
56
|
+
action.components_set targetId: 'flow_action_status', data: { text: 'Hover status: left' }
|
|
57
|
+
end, childViews: ->(flow) do
|
|
58
|
+
flow.label text: 'Hover this panel'
|
|
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: 'Empty flow panel'
|
|
67
|
+
res.panels_flow width: 200, height: 40, backgroundColor: '#f2f2f2', childViews: ->(_flow) do
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
json.title 'Test Page (Forms)'
|
|
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: 'Forms'
|
|
12
|
+
res.label text: 'Programmatically submit forms or override destinations.'
|
|
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 forms/submit to post form data from buttons, dialogs, or custom flows.'
|
|
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_form(
|
|
26
|
+
id: 'forms_basic',
|
|
27
|
+
url: json_ui_garage_url(path: 'forms/generic_post'),
|
|
28
|
+
method: 'post',
|
|
29
|
+
childViews: ->(form) do
|
|
30
|
+
form.fields_text name: 'user[name]', label: 'Name', width: 300, placeholder: 'Full name'
|
|
31
|
+
form.spacer height: 6
|
|
32
|
+
form.fields_textarea name: 'user[notes]', label: 'Notes', width: 'matchParent'
|
|
33
|
+
form.spacer height: 6
|
|
34
|
+
form.fields_submit text: 'Submit (native)'
|
|
35
|
+
end
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
res.spacer height: 16
|
|
39
|
+
res.hr width: 'matchParent'
|
|
40
|
+
res.spacer height: 16
|
|
41
|
+
|
|
42
|
+
res.h2 text: 'Variants/props'
|
|
43
|
+
res.spacer height: 8
|
|
44
|
+
res.panels_flow(
|
|
45
|
+
innerPadding: { bottom: 0 },
|
|
46
|
+
width: 'matchParent',
|
|
47
|
+
childViews: ->(flow) do
|
|
48
|
+
flow.button(
|
|
49
|
+
text: 'forms/submit targetId',
|
|
50
|
+
onClick: ->(action) do
|
|
51
|
+
action.forms_submit targetId: 'forms_basic'
|
|
52
|
+
end
|
|
53
|
+
)
|
|
54
|
+
flow.spacer width: 8
|
|
55
|
+
flow.button(
|
|
56
|
+
text: 'forms/submit overrideUrl',
|
|
57
|
+
onClick: ->(action) do
|
|
58
|
+
action.forms_submit targetId: 'forms_basic', overrideUrl: json_ui_garage_url(path: 'forms/generic_post_all')
|
|
59
|
+
end
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
res.spacer height: 16
|
|
65
|
+
res.hr width: 'matchParent'
|
|
66
|
+
res.spacer height: 16
|
|
67
|
+
|
|
68
|
+
res.h2 text: 'Actions/events'
|
|
69
|
+
res.spacer height: 8
|
|
70
|
+
res.label id: 'forms_status', text: 'Status: idle'
|
|
71
|
+
res.spacer height: 8
|
|
72
|
+
res.button(
|
|
73
|
+
text: 'forms/submit with status update',
|
|
74
|
+
onClick: ->(action) do
|
|
75
|
+
action.logics_set targetId: 'forms_status', data: { text: 'Status: submitting' }
|
|
76
|
+
action.forms_submit targetId: 'forms_basic'
|
|
77
|
+
end
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
res.spacer height: 16
|
|
81
|
+
res.hr width: 'matchParent'
|
|
82
|
+
res.spacer height: 16
|
|
83
|
+
|
|
84
|
+
res.h2 text: 'Edge/advanced'
|
|
85
|
+
res.spacer height: 8
|
|
86
|
+
res.panels_form(
|
|
87
|
+
id: 'forms_secondary',
|
|
88
|
+
url: json_ui_garage_url(path: 'forms/generic_post_all'),
|
|
89
|
+
method: 'post',
|
|
90
|
+
childViews: ->(form) do
|
|
91
|
+
form.fields_text name: 'user[email]', label: 'Email', width: 300, placeholder: 'name@example.com'
|
|
92
|
+
form.fields_hidden name: 'user[source]', value: 'edge_case'
|
|
93
|
+
end
|
|
94
|
+
)
|
|
95
|
+
res.spacer height: 8
|
|
96
|
+
res.button(
|
|
97
|
+
text: 'forms/submit secondary form',
|
|
98
|
+
onClick: ->(action) do
|
|
99
|
+
action.forms_submit targetId: 'forms_secondary'
|
|
100
|
+
end
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
json.title 'Test Page (Grid)'
|
|
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: 'Grid panels arrange child views in a responsive grid with min/max box sizing.'
|
|
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_grid id: 'grid_main', width: 'matchParent', boxMinWidth: 140, columnGap: 12, rowGap: 12, childViews: ->(box) do
|
|
18
|
+
(1..6).each do |index|
|
|
19
|
+
box.panels_vertical height: 70, backgroundColor: '#e6e6e6', align: 'center', childViews: ->(panel) do
|
|
20
|
+
panel.label text: "Box #{index}"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
res.spacer height: 12
|
|
26
|
+
res.hr width: 'matchParent'
|
|
27
|
+
|
|
28
|
+
res.h2 text: 'Variants and Props'
|
|
29
|
+
res.spacer height: 8
|
|
30
|
+
res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
|
|
31
|
+
flow.button text: 'Small boxes', onClick: ->(action) do
|
|
32
|
+
action.components_set targetId: 'grid_main', data: { boxMinWidth: 100, columnGap: 8, rowGap: 8 }
|
|
33
|
+
end
|
|
34
|
+
flow.spacer width: 4
|
|
35
|
+
flow.button text: 'Large boxes', onClick: ->(action) do
|
|
36
|
+
action.components_set targetId: 'grid_main', data: { boxMinWidth: 180, columnGap: 16, rowGap: 16 }
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
res.spacer height: 12
|
|
41
|
+
res.hr width: 'matchParent'
|
|
42
|
+
|
|
43
|
+
res.h2 text: 'Actions and Events'
|
|
44
|
+
res.spacer height: 8
|
|
45
|
+
res.label id: 'grid_action_status', text: 'Hover status: idle'
|
|
46
|
+
res.spacer height: 6
|
|
47
|
+
res.panels_grid width: 'matchParent', boxMinWidth: 120, columnGap: 8, rowGap: 8, onMouseEnter: ->(action) do
|
|
48
|
+
action.components_set targetId: 'grid_action_status', data: { text: 'Hover status: entered' }
|
|
49
|
+
end, onMouseLeave: ->(action) do
|
|
50
|
+
action.components_set targetId: 'grid_action_status', data: { text: 'Hover status: left' }
|
|
51
|
+
end, childViews: ->(box) do
|
|
52
|
+
(1..4).each do |index|
|
|
53
|
+
box.panels_vertical height: 50, backgroundColor: '#e6e6e6', align: 'center', childViews: ->(panel) do
|
|
54
|
+
panel.label text: "Tile #{index}"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
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 grid'
|
|
65
|
+
res.panels_grid width: 'matchParent', boxMinWidth: 120, columnGap: 8, rowGap: 8, childViews: ->(_box) do
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
json.title 'Test Page (Horizontal)'
|
|
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: 'Horizontal panels lay out children left to right with spacing and alignment controls.'
|
|
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_horizontal id: 'horizontal_main', width: 240, 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: 'horizontal_main', data: { width: 300, distribution: 'fillEqually' }
|
|
31
|
+
end
|
|
32
|
+
flow.spacer width: 4
|
|
33
|
+
flow.button text: 'Space equally', onClick: ->(action) do
|
|
34
|
+
action.components_set targetId: 'horizontal_main', data: { width: 300, distribution: 'spaceEqually' }
|
|
35
|
+
end
|
|
36
|
+
flow.spacer width: 4
|
|
37
|
+
flow.button text: 'Overlap 3', onClick: ->(action) do
|
|
38
|
+
action.components_set targetId: 'horizontal_main', data: { distribution: 'overlap-3' }
|
|
39
|
+
end
|
|
40
|
+
flow.spacer width: 4
|
|
41
|
+
flow.button text: 'Align middle', onClick: ->(action) do
|
|
42
|
+
action.components_set targetId: 'horizontal_main', data: { align: 'middle' }
|
|
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: 'horizontal_action_status', text: 'Click status: idle'
|
|
52
|
+
res.spacer height: 6
|
|
53
|
+
res.panels_horizontal width: 180, height: 60, align: 'middle', backgroundColor: '#e6e6e6', onClick: ->(action) do
|
|
54
|
+
action.components_set targetId: 'horizontal_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: 'Horizontal with no children'
|
|
65
|
+
res.panels_horizontal width: 200, height: 40, backgroundColor: '#f2f2f2', childViews: ->(_panel) do
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|