glib-web 0.5.4 → 0.5.11
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/ui.rb +7 -0
- data/app/helpers/glib/app_feature_support_helper.rb +16 -0
- data/app/helpers/glib/json_ui/abstract_builder.rb +9 -3
- data/app/helpers/glib/json_ui/action_builder.rb +36 -6
- data/app/helpers/glib/json_ui/action_builder/windows.rb +1 -0
- data/app/helpers/glib/json_ui/page_helper.rb +13 -5
- data/app/helpers/glib/json_ui/response_helper.rb +1 -1
- data/app/helpers/glib/json_ui/styling_helper.rb +22 -0
- data/app/helpers/glib/json_ui/view_builder.rb +16 -16
- data/app/helpers/glib/json_ui/view_builder/fields.rb +9 -1
- data/app/helpers/glib/json_ui/view_builder/panels.rb +2 -0
- data/app/helpers/glib/urls_helper.rb +7 -0
- data/app/policies/glib/application_policy.rb +27 -30
- data/app/views/json_ui/garage/actions/index.json.jbuilder +2 -2
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +9 -18
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +6 -3
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +20 -3
- data/app/views/json_ui/garage/forms/styled_boxes.json.jbuilder +4 -1
- data/app/views/json_ui/garage/forms/text_validation.json.jbuilder +1 -1
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +19 -21
- data/app/views/json_ui/garage/pages/index.json.jbuilder +11 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +12 -13
- data/app/views/json_ui/garage/pages/nav_buttons.json.jbuilder +28 -16
- data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +40 -0
- data/app/views/json_ui/garage/panels/carousel.json.jbuilder +24 -3
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +37 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +3 -0
- data/app/views/json_ui/garage/views/icons.json.jbuilder +22 -0
- data/app/views/json_ui/garage/views/images.json.jbuilder +4 -4
- data/app/views/json_ui/garage/views/index.json.jbuilder +3 -3
- data/lib/glib/json_crawler.rb +2 -0
- data/lib/glib/json_crawler/action_crawler.rb +4 -1
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +2 -5
- data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +2 -2
- data/lib/glib/json_crawler/action_crawlers/menu.rb +12 -0
- data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +3 -1
- data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +13 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +3 -0
- data/lib/glib/json_crawler/http.rb +3 -2
- data/lib/glib/json_crawler/router.rb +35 -28
- data/lib/glib/test_helpers.rb +4 -4
- metadata +8 -2
- data/app/views/json_ui/garage/views/carousels.json.jbuilder +0 -37
@@ -10,7 +10,8 @@ json_ui_page json do |page|
|
|
10
10
|
value = [
|
11
11
|
{
|
12
12
|
'question': 'Punctuality',
|
13
|
-
'type': 'rating'
|
13
|
+
'type': 'rating',
|
14
|
+
'enabled': '1'
|
14
15
|
},
|
15
16
|
{
|
16
17
|
'question': 'Quality of work',
|
@@ -21,30 +22,20 @@ json_ui_page json do |page|
|
|
21
22
|
'type': 'yes_no'
|
22
23
|
}
|
23
24
|
]
|
24
|
-
# form.fields_dynamicGroup width: 'matchParent', name: 'user[evaluation]', value: value, groupTitlePrefix: 'Entry', groupTemplateViews: ->(group) do
|
25
|
-
# group.spacer height: 10
|
26
|
-
# group.fields_text width: 'matchParent', name: 'question', label: 'Question'
|
27
|
-
# group.fields_text width: 'matchParent', name: 'type', label: 'Answer type'
|
28
|
-
# end
|
29
|
-
|
30
|
-
# form.fields_dynamicGroup width: 'matchParent', name: 'user[evaluation]', value: value, group: ->(group) do
|
31
|
-
# group.titlePrefix 'Entry'
|
32
|
-
# group.template childViews: ->(template) do
|
33
|
-
# template.spacer height: 10
|
34
|
-
# template.fields_text width: 'matchParent', name: 'question', label: 'Question'
|
35
|
-
# template.fields_text width: 'matchParent', name: 'type', label: 'Answer type'
|
36
|
-
# end
|
37
|
-
# end
|
38
25
|
|
39
26
|
form.fields_dynamicGroup width: 'matchParent', name: 'user[evaluation]', value: value, titlePrefix: 'Entry', content: ->(group) do
|
40
27
|
group.template padding: { left: 32 }, childViews: ->(template) do
|
41
28
|
template.spacer height: 10
|
42
|
-
template.fields_text width: 'matchParent', name: 'question', label: 'Question'
|
43
|
-
|
29
|
+
template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
|
30
|
+
options = [ :rating, :yes_no ]
|
31
|
+
template.fields_select width: 'matchParent', name: 'type', label: 'Answer Type', placeholder: 'Answer Type', options: options.map { |o| { text: o.to_s.humanize, value: o } }
|
32
|
+
template.fields_check width: 'matchParent', name: 'enabled', label: 'Enable', checkValue: '1'
|
33
|
+
|
34
|
+
template.spacer height: 14
|
44
35
|
end
|
45
36
|
end
|
46
37
|
|
47
38
|
form.spacer height: 20
|
48
|
-
form.
|
39
|
+
form.fields_submit text: 'Submit'
|
49
40
|
end
|
50
41
|
end
|
@@ -8,14 +8,16 @@ json_ui_page json do |page|
|
|
8
8
|
form.spacer height: 6
|
9
9
|
form.h4 text: 'Gender'
|
10
10
|
form.fields_radioGroup name: 'user[gender]', value: 'F', childViews: ->(group) do
|
11
|
+
group.fields_radio value: '', label: 'Unknown'
|
11
12
|
group.fields_radio value: 'M', label: 'Male'
|
12
13
|
group.fields_radio value: 'F', label: 'Female'
|
13
14
|
end
|
14
15
|
|
15
16
|
form.spacer height: 20
|
16
17
|
form.h2 text: 'Single Checkbox'
|
17
|
-
form.fields_check name: 'user[age_range]', value: '16+', uncheckValue: '0-16', label: 'I am over 16 (has default value)'
|
18
|
-
form.fields_check name: 'user[employer]',
|
18
|
+
form.fields_check name: 'user[age_range]', value: '16+', checkValue: '16+', uncheckValue: '0-16', label: 'I am over 16 (has default value)'
|
19
|
+
form.fields_check name: 'user[employer]', checkValue: 1, label: 'I am an employer (no default value)'
|
20
|
+
form.fields_check name: 'user[enabled]', checkValue: true, label: 'Enable', styleClass: 'switch', value: 'true'
|
19
21
|
|
20
22
|
form.spacer height: 20
|
21
23
|
form.h2 text: 'Date/Time'
|
@@ -36,7 +38,8 @@ json_ui_page json do |page|
|
|
36
38
|
latitudeField: { name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
|
37
39
|
longitudeField: { name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true }
|
38
40
|
|
39
|
-
form.
|
41
|
+
form.spacer height: 20
|
42
|
+
form.fields_submit text: 'Submit'
|
40
43
|
|
41
44
|
end
|
42
45
|
|
@@ -3,7 +3,7 @@ json.title 'Forms'
|
|
3
3
|
page = json_ui_page json
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
5
|
|
6
|
-
page.form url: json_ui_garage_url(path: 'forms/
|
6
|
+
page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
7
7
|
form.h1 text: 'Text'
|
8
8
|
form.fields_password name: 'user[text1]', width: 'matchParent', label: 'Type "show"'
|
9
9
|
form.label text: 'Typed', showIf: {
|
@@ -29,7 +29,7 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
29
29
|
|
30
30
|
form.spacer height: 20
|
31
31
|
form.h1 text: 'Check'
|
32
|
-
form.fields_check name: 'user[check1]',
|
32
|
+
form.fields_check name: 'user[check1]', checkValue: 'on', label: 'Show text'
|
33
33
|
form.spacer height: 10
|
34
34
|
form.label text: 'Checked', showIf: {
|
35
35
|
"==": [
|
@@ -70,7 +70,7 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
70
70
|
}
|
71
71
|
|
72
72
|
form.spacer height: 20
|
73
|
-
form.h1 text: '
|
73
|
+
form.h1 text: 'Combined conditions'
|
74
74
|
form.label text: 'Select the same option on both the radio and select fields above'
|
75
75
|
form.spacer height: 10
|
76
76
|
form.h3 text: 'Same!', showIf: {
|
@@ -84,5 +84,22 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
84
84
|
]
|
85
85
|
}
|
86
86
|
|
87
|
+
form.spacer height: 20
|
88
|
+
form.h1 text: 'Show/hide another field'
|
89
|
+
form.label text: ''
|
90
|
+
form.spacer height: 10
|
91
|
+
form.fields_check name: 'user[check2]', checkValue: 'on', label: 'Show field'
|
92
|
+
form.spacer height: 10
|
93
|
+
form.fields_text width: 'matchParent', label: 'Comment (optional)', name: 'user[comment]', value: 'This field can be submitted when it is hidden, but it is not necessary (i.e. up to the app)', showIf: {
|
94
|
+
"==": [
|
95
|
+
{
|
96
|
+
"var": 'user[check2]'
|
97
|
+
},
|
98
|
+
'on'
|
99
|
+
]
|
100
|
+
}
|
101
|
+
|
102
|
+
form.spacer height: 20
|
103
|
+
form.fields_submit text: 'Submit'
|
87
104
|
form.spacer height: 40
|
88
105
|
end
|
@@ -4,11 +4,14 @@ json_ui_page json do |page|
|
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
5
|
|
6
6
|
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
7
|
-
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Search', styleClasses: ['outlined', 'rounded']
|
7
|
+
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Search', placeholder: 'Enter a keyword', styleClasses: ['outlined', 'rounded']
|
8
8
|
|
9
9
|
form.spacer height: 14
|
10
10
|
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password', placeholder: 'Type your password', styleClass: 'outlined'
|
11
11
|
|
12
|
+
form.spacer height: 14
|
13
|
+
form.fields_textarea name: 'user[bio]', width: 'matchParent', label: 'Bio', placeholder: 'Enter your bio', styleClasses: ['outlined']
|
14
|
+
|
12
15
|
form.spacer height: 14
|
13
16
|
form.fields_stripeToken name: 'user[stripe_token_outlined]', width: 'matchParent', publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx', styleClass: 'outlined'
|
14
17
|
|
@@ -7,7 +7,7 @@ json_ui_page json do |page|
|
|
7
7
|
form.fields_email name: 'user[email]', width: 'matchParent', label: 'Email'
|
8
8
|
form.fields_url name: 'user[url]', width: 'matchParent', label: 'URL'
|
9
9
|
form.fields_number name: 'user[number]', width: 'matchParent', label: 'Number', validation: { required: { message: 'Required' } }
|
10
|
-
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
|
10
|
+
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password', hint: 'Should contain at least 6 characters'
|
11
11
|
form.fields_textarea name: 'user[textarea]', width: 'matchParent', label: 'Textarea with maxLength', maxLength: 50, validation: { required: { message: 'Required' } }
|
12
12
|
|
13
13
|
options = ['male', 'female'].map { |i| { text: i.humanize, value: i } }
|
@@ -14,7 +14,7 @@ json.ws({
|
|
14
14
|
# "topic" => "room:30",
|
15
15
|
# "event" => "comments_updated",
|
16
16
|
"topic" => "links",
|
17
|
-
"
|
17
|
+
"events" => ["new_link_added"],
|
18
18
|
"header" => {
|
19
19
|
"user_id" => 2,
|
20
20
|
"prev_item_id" => nil,
|
@@ -23,31 +23,29 @@ json.ws({
|
|
23
23
|
})
|
24
24
|
|
25
25
|
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, paramNameForFormData: 'formData', onSubmit: ->(action) do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
# url: "URL"
|
37
|
-
})
|
38
|
-
|
39
|
-
# "topic": "room:30",
|
40
|
-
# "event": "create_comment",
|
41
|
-
# "payload": {
|
42
|
-
# "club_id": "2",
|
43
|
-
# "room_id": "30",
|
44
|
-
# "user_id": "2"
|
45
|
-
# }
|
26
|
+
json.action "ws/push"
|
27
|
+
json.topic "links"
|
28
|
+
json.event "new_link"
|
29
|
+
json.payload({
|
30
|
+
"club_id": "2",
|
31
|
+
"room_id": "30",
|
32
|
+
"user_id": "2"
|
33
|
+
# title: "TITLE",
|
34
|
+
# url: "URL"
|
35
|
+
})
|
46
36
|
|
47
37
|
end, childViews: ->(form) do
|
38
|
+
form.spacer height: 14
|
39
|
+
form.label text: "Message: #{params[:message]}"
|
40
|
+
form.spacer height: 14
|
41
|
+
|
48
42
|
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
43
|
+
|
44
|
+
# TODO: Change this to radio for selecting alert vs reload response
|
49
45
|
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
|
50
46
|
|
47
|
+
form.fields_hidden name: 'baseUrl', width: 'matchParent', value: json_ui_garage_url(path: 'notifications/web_socket')
|
48
|
+
|
51
49
|
form.panels_split width: 'matchParent', content: ->(split) do
|
52
50
|
# split.left childViews: ->(left) do
|
53
51
|
# if params[:mode] == 'dialog'
|
@@ -41,6 +41,17 @@ json_ui_page json do |page|
|
|
41
41
|
action.windows_open url: json_ui_garage_url(path: 'pages/full_width')
|
42
42
|
end
|
43
43
|
end
|
44
|
+
end,
|
45
|
+
->(section) do
|
46
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
47
|
+
header.h2 text: 'Misc (Web Only)'
|
48
|
+
end
|
49
|
+
|
50
|
+
section.rows builder: ->(template) do
|
51
|
+
template.thumbnail title: 'Nested Scroll', onClick: ->(action) do
|
52
|
+
action.windows_open url: json_ui_garage_url(path: 'pages/nested_scroll')
|
53
|
+
end
|
54
|
+
end
|
44
55
|
end
|
45
56
|
]
|
46
57
|
|
@@ -1,19 +1,18 @@
|
|
1
1
|
json.title 'Pages'
|
2
2
|
|
3
|
-
json_ui_page json
|
4
|
-
|
5
|
-
|
6
|
-
page.header padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(header) do
|
7
|
-
header.h1 text: 'Header'
|
8
|
-
end
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
9
5
|
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
page.header padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(header) do
|
7
|
+
header.h1 text: 'Header'
|
8
|
+
end
|
9
|
+
|
10
|
+
page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
|
11
|
+
footer.h1 text: 'Footer'
|
12
|
+
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
14
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
15
|
+
(1..100).each do |index|
|
16
|
+
scroll.label text: 'Content'
|
18
17
|
end
|
19
18
|
end
|
@@ -1,21 +1,33 @@
|
|
1
1
|
json.title 'Pages'
|
2
2
|
|
3
|
-
json_ui_page json
|
4
|
-
|
5
|
-
|
6
|
-
page.rightNavButtons do |menu|
|
7
|
-
menu.button icon: 'search', onClick: ->(action) do
|
8
|
-
action.dialogs_alert message: 'Perform some action'
|
9
|
-
end
|
10
|
-
menu.button icon: { name: 'star', badge: { text: '1', backgroundColor: '#ff0000' } }, onClick: ->(action) do
|
11
|
-
action.dialogs_alert message: 'Perform some action'
|
12
|
-
end
|
13
|
-
menu.button icon: { name: 'map', badge: '2' }, onClick: ->(action) do
|
14
|
-
action.dialogs_alert message: 'Perform some action'
|
15
|
-
end
|
16
|
-
end
|
3
|
+
page = json_ui_page json
|
4
|
+
|
5
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
17
6
|
|
18
|
-
|
19
|
-
|
7
|
+
page.navBar backgroundColor: '#a8c4e3', rightButtons: ->(menu) do
|
8
|
+
menu.button icon: 'search', onClick: ->(action) do
|
9
|
+
action.dialogs_alert message: 'Perform some action'
|
10
|
+
end
|
11
|
+
menu.button icon: { name: 'star', badge: { text: '1', backgroundColor: '#ff0000' } }, onClick: ->(action) do
|
12
|
+
action.dialogs_alert message: 'Perform some action'
|
13
|
+
end
|
14
|
+
menu.button icon: { name: 'map', badge: '2' }, onClick: ->(action) do
|
15
|
+
action.dialogs_alert message: 'Perform some action'
|
20
16
|
end
|
21
17
|
end
|
18
|
+
|
19
|
+
# page.rightNavButtons do |menu|
|
20
|
+
# menu.button icon: 'search', onClick: ->(action) do
|
21
|
+
# action.dialogs_alert message: 'Perform some action'
|
22
|
+
# end
|
23
|
+
# menu.button icon: { name: 'star', badge: { text: '1', backgroundColor: '#ff0000' } }, onClick: ->(action) do
|
24
|
+
# action.dialogs_alert message: 'Perform some action'
|
25
|
+
# end
|
26
|
+
# menu.button icon: { name: 'map', badge: '2' }, onClick: ->(action) do
|
27
|
+
# action.dialogs_alert message: 'Perform some action'
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
|
31
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
32
|
+
scroll.label text: 'See the right menu buttons on the nav bar'
|
33
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
json.title 'Pages'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
# page.template 'fullWidth'
|
7
|
+
|
8
|
+
page.header childViews: ->(header) do
|
9
|
+
header.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
10
|
+
vertical.h1 text: 'Header'
|
11
|
+
end
|
12
|
+
header.spacer height: 10
|
13
|
+
end
|
14
|
+
|
15
|
+
page.footer childViews: ->(footer) do
|
16
|
+
footer.spacer height: 10
|
17
|
+
footer.panels_vertical width: 'matchParent', styleClass: 'card', padding: glib_json_padding_body, childViews: ->(vertical) do
|
18
|
+
vertical.h1 text: 'Footer'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
23
|
+
scroll.label text: 'Inner Header'
|
24
|
+
scroll.label text: 'Inner Header'
|
25
|
+
scroll.label text: 'Inner Header'
|
26
|
+
scroll.spacer height: 20
|
27
|
+
|
28
|
+
scroll.panels_vertical width: 'matchParent', styleClass: 'card', backgroundColor: glib_color_panel_background, padding: glib_json_padding_body.merge(right: nil), childViews: ->(padder) do
|
29
|
+
padder.panels_scroll width: 'matchParent', height: 300, childViews: ->(inner_scroll) do
|
30
|
+
(1..100).each do |index|
|
31
|
+
inner_scroll.label text: 'Content'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
scroll.spacer height: 20
|
37
|
+
scroll.label text: 'Inner Footer'
|
38
|
+
scroll.label text: 'Inner Footer'
|
39
|
+
scroll.label text: 'Inner Footer'
|
40
|
+
end
|
@@ -1,16 +1,37 @@
|
|
1
1
|
json.title 'Panels'
|
2
2
|
|
3
|
-
image_url1 = '
|
3
|
+
image_url1 = 'https://ichef.bbci.co.uk/news/976/cpsprodpb/18106/production/_97266589_gettyimages-474547165.jpg'
|
4
4
|
image_url2 = 'https://s.abcnews.com/images/International/Guam03-gty-jrl-170809_16x9_992.jpg'
|
5
5
|
|
6
6
|
json_ui_page json do |page|
|
7
7
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
8
|
-
|
8
|
+
|
9
9
|
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
10
|
-
scroll.
|
10
|
+
scroll.label text: "\n"
|
11
|
+
scroll.h1 text: 'Carousel with labels'
|
12
|
+
scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
|
13
|
+
carousel.label text: 'Item 1'
|
14
|
+
carousel.label text: 'Item 2'
|
15
|
+
end
|
16
|
+
|
17
|
+
scroll.label text: "\n"
|
18
|
+
scroll.h1 text: 'Carousel with images'
|
11
19
|
scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
|
12
20
|
carousel.image url: image_url1, width: 'matchParent'
|
13
21
|
carousel.image url: image_url2, width: 'matchParent'
|
14
22
|
end
|
23
|
+
|
24
|
+
scroll.label text: "\n"
|
25
|
+
scroll.h1 text: 'Carousel with complex layout'
|
26
|
+
scroll.panels_carousel width: 'matchParent', childViews: ->(carousel) do
|
27
|
+
carousel.panels_vertical childViews: ->(panel) do
|
28
|
+
panel.h3 text: 'Item 1'
|
29
|
+
panel.image url: image_url1, width: 'matchParent'
|
30
|
+
end
|
31
|
+
carousel.panels_vertical childViews: ->(panel) do
|
32
|
+
panel.h3 text: 'Item 2'
|
33
|
+
panel.image url: image_url2, width: 'matchParent'
|
34
|
+
end
|
35
|
+
end
|
15
36
|
end
|
16
37
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
page_index = params[:page].to_i
|
3
|
+
next_page = {
|
4
|
+
url: json_ui_garage_url(path: 'tables/autoload_all', page: page_index + 1, section_only: 'v1'),
|
5
|
+
autoload: 'asNeeded'
|
6
|
+
}
|
7
|
+
|
8
|
+
page = json_ui_page json
|
9
|
+
column_indexes = (1..3)
|
10
|
+
|
11
|
+
if params[:section_only].present?
|
12
|
+
json.nextPage next_page if page_index < 3
|
13
|
+
json.sections do
|
14
|
+
json.child! do
|
15
|
+
render 'json_ui/garage/tables/autoload_section', page: page, page_index: page_index, column_indexes: column_indexes
|
16
|
+
end
|
17
|
+
end
|
18
|
+
else
|
19
|
+
json.title 'Tables'
|
20
|
+
|
21
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
22
|
+
|
23
|
+
page.table nextPage: next_page, firstSection: ->(section) do
|
24
|
+
section.header cellViews: ->(header) do
|
25
|
+
column_indexes.each do |i|
|
26
|
+
header.label text: "Heading#{i}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
render "#{@path_prefix}/tables/autoload_section", page: page, page_index: page_index, column_indexes: column_indexes
|
31
|
+
end, onScrollToBottom: ->(action) do
|
32
|
+
action.snackbars_alert message: 'Scrolled to Bottom'
|
33
|
+
end, onScrollToTop: ->(action) do
|
34
|
+
action.snackbars_alert message: 'Scrolled to Top'
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -17,6 +17,9 @@ json_ui_page json do |page|
|
|
17
17
|
template.thumbnail title: 'Autoload All', onClick: ->(action) do
|
18
18
|
action.windows_open url: json_ui_garage_url(path: 'tables/autoload_all')
|
19
19
|
end
|
20
|
+
template.thumbnail title: 'Autoload as Needed', onClick: ->(action) do
|
21
|
+
action.windows_open url: json_ui_garage_url(path: 'tables/autoload_as_needed')
|
22
|
+
end
|
20
23
|
end
|
21
24
|
|
22
25
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
json.title 'Views'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
7
|
+
# TODO: Scrape all names from https://material.io/resources/icons
|
8
|
+
icon_names = [
|
9
|
+
'info', 'info', 'info', 'info', 'info', 'info', 'info', 'info',
|
10
|
+
'info', 'info', 'info', 'info', 'info', 'info', 'info', 'info',
|
11
|
+
'info', 'info', 'info', 'info', 'info', 'info', 'info', 'info',
|
12
|
+
]
|
13
|
+
icon_names.each do |icon_name|
|
14
|
+
scroll.panels_column lg: { cols: 2 }, childViews: ->(column) do
|
15
|
+
column.panels_horizontal align: 'middle', childViews: ->(horizontal) do
|
16
|
+
horizontal.icon spec: icon_name
|
17
|
+
horizontal.spacer width: 6
|
18
|
+
horizontal.label text: icon_name
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|