glib-web 0.8.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/glib/json_ui/view_builder/fields.rb +1 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +10 -0
- data/app/views/json_ui/garage/forms/disable_dirty_prompt.json.jbuilder +4 -2
- data/app/views/json_ui/garage/lists/_autoload_section.json.jbuilder +5 -1
- data/app/views/json_ui/garage/lists/autoload_as_needed_on_top_scroll.json.jbuilder +1 -1
- data/app/views/json_ui/garage/panels/grid.json.jbuilder +37 -0
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +12 -10
- data/app/views/json_ui/garage/panels/index.json.jbuilder +5 -3
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +22 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa095592b5c0a4c1b5cef5dd0c76095c3a6c2d4143d098ce7a35b32180a858aa
|
4
|
+
data.tar.gz: ee3327349607b707dd4d5ba9fb0037dce4daeea2e68a92e04c6683b9a550efa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c552ce93b0a47a4c7141425655fac46bdc1c699a00aca7b6bd917049dd0614dd276ae49eac1bc70d2760bbeb27473492a28029963c253787d6e0a71434ca0cb9
|
7
|
+
data.tar.gz: fb4df6d227777f82cdde5b6c2ae95e2a666c5e77b2e770c17a2310fb8cbea3049002da4ecb5fd073395618255a0dbcf46d09d195f9b504bfc25bcd7d91f41023
|
@@ -219,6 +219,7 @@ class Glib::JsonUi::ViewBuilder
|
|
219
219
|
views :childViews
|
220
220
|
string :distribution
|
221
221
|
string :align
|
222
|
+
action :onClick
|
222
223
|
end
|
223
224
|
|
224
225
|
class Flow < View
|
@@ -250,6 +251,15 @@ class Glib::JsonUi::ViewBuilder
|
|
250
251
|
end
|
251
252
|
end
|
252
253
|
|
254
|
+
class Grid < View
|
255
|
+
length :boxMinWidth
|
256
|
+
length :boxMaxWidth
|
257
|
+
length :columnGap
|
258
|
+
length :rowGap
|
259
|
+
|
260
|
+
views :childViews
|
261
|
+
end
|
262
|
+
|
253
263
|
class Web < View
|
254
264
|
string :url
|
255
265
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
json.title 'Forms'
|
2
|
-
json.disableDirtyPrompt true
|
2
|
+
# json.disableDirtyPrompt true
|
3
3
|
|
4
4
|
data = params[:user] || {}
|
5
5
|
|
@@ -17,7 +17,9 @@ page.form \
|
|
17
17
|
form.spacer height: 14
|
18
18
|
form.h3 text: "Hello #{ data[:name] }"
|
19
19
|
form.spacer height: 4
|
20
|
-
form.fields_text name: 'user[
|
20
|
+
form.fields_text name: 'user[dirty_check_enabled]', width: 'matchParent', label: 'Dirty check enabled'
|
21
|
+
form.spacer height: 14
|
22
|
+
form.fields_text name: 'user[dirty_check_disabled]', width: 'matchParent', label: 'Dirty check disabled', disableDirtyCheck: true
|
21
23
|
|
22
24
|
form.panels_split width: 'matchParent', content: ->(split) do
|
23
25
|
split.right childViews: ->(right) do
|
@@ -4,7 +4,11 @@ sleep 1
|
|
4
4
|
section = page.list_section_builder
|
5
5
|
section.rows builder: ->(row) do
|
6
6
|
batch_count = 30
|
7
|
-
batch_count
|
7
|
+
array = (0..(batch_count - 1)).to_a
|
8
|
+
if local_assigns[:reverse]
|
9
|
+
array = array.reverse
|
10
|
+
end
|
11
|
+
array.each do |i|
|
8
12
|
index = page_index * batch_count + i
|
9
13
|
if local_assigns[:reorder]
|
10
14
|
row.thumbnail title: "Item #{index}", onReorder: ->(action) do
|
@@ -29,7 +29,7 @@ else
|
|
29
29
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
30
30
|
|
31
31
|
page.list prevPage: next_page, firstSection: ->(section) do
|
32
|
-
render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index
|
32
|
+
render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index, reverse: true
|
33
33
|
end, onScrollToBottom: ->(action) do
|
34
34
|
action.snackbars_alert message: 'Scrolled to Bottom'
|
35
35
|
end, onScrollToTop: ->(action) do
|
@@ -0,0 +1,37 @@
|
|
1
|
+
json.title 'Panels'
|
2
|
+
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
small_image_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGQpSWjtELISLBlmugOZ6wzl1JamYXQvbFeYywpfg3E8b8DrO0Kg&s'
|
7
|
+
|
8
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
9
|
+
scroll.h2 text: 'Responsive grid box, try to resize browser width'
|
10
|
+
scroll.spacer height: 8
|
11
|
+
scroll.panels_grid width: 'matchParent', boxMinWidth: 200, columnGap: 20, rowGap: 10, childViews: ->(box) do
|
12
|
+
box.label text: 'Box', width: 'matchParent', backgroundColor: '#ddd'
|
13
|
+
box.label text: 'Box', width: 'matchParent', backgroundColor: '#ddd'
|
14
|
+
box.label text: 'Box', width: 'matchParent', backgroundColor: '#ddd'
|
15
|
+
box.label text: 'Box', width: 'matchParent', backgroundColor: '#ddd'
|
16
|
+
box.label text: 'Box', width: 'matchParent', backgroundColor: '#ddd'
|
17
|
+
end
|
18
|
+
|
19
|
+
scroll.spacer height: 16
|
20
|
+
scroll.h2 text: 'Responsive grid box with image'
|
21
|
+
scroll.spacer height: 8
|
22
|
+
scroll.panels_grid \
|
23
|
+
width: 'matchParent',
|
24
|
+
boxMinWidth: 300,
|
25
|
+
columnGap: 20,
|
26
|
+
rowGap: 10,
|
27
|
+
padding: { top: 0, right: 10, bottom: 0, left: 10 },
|
28
|
+
childViews: ->(box) do
|
29
|
+
box.image url: small_image_url
|
30
|
+
box.image url: small_image_url
|
31
|
+
box.image url: small_image_url
|
32
|
+
box.image url: small_image_url
|
33
|
+
box.image url: small_image_url
|
34
|
+
end
|
35
|
+
|
36
|
+
scroll.spacer height: 64
|
37
|
+
end
|
@@ -11,7 +11,7 @@ json_ui_page json do |page|
|
|
11
11
|
panel.button text: '3'
|
12
12
|
end
|
13
13
|
|
14
|
-
scroll.
|
14
|
+
scroll.spacer height: 20
|
15
15
|
scroll.h1 text: 'Equal filling'
|
16
16
|
scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'fillEqually', childViews: ->(panel) do
|
17
17
|
panel.button text: '1'
|
@@ -19,7 +19,7 @@ json_ui_page json do |page|
|
|
19
19
|
panel.button text: '3', height: 70
|
20
20
|
end
|
21
21
|
|
22
|
-
scroll.
|
22
|
+
scroll.spacer height: 20
|
23
23
|
scroll.h1 text: 'Equal spacing'
|
24
24
|
scroll.panels_horizontal backgroundColor: '#b3bac2', width: 300, distribution: 'spaceEqually', childViews: ->(panel) do
|
25
25
|
panel.button text: '1'
|
@@ -27,7 +27,7 @@ json_ui_page json do |page|
|
|
27
27
|
panel.button text: '3'
|
28
28
|
end
|
29
29
|
|
30
|
-
scroll.
|
30
|
+
scroll.spacer height: 20
|
31
31
|
scroll.h1 text: 'Overlaps (negative spacing)'
|
32
32
|
scroll.markdown text: 'Uses Material Design spacings: https://vuetifyjs.com/en/styles/spacing/#how-it-works'
|
33
33
|
scroll.panels_horizontal width: 'matchParent', distribution: 'overlap-1', childViews: ->(panel) do
|
@@ -56,7 +56,7 @@ json_ui_page json do |page|
|
|
56
56
|
panel.button text: '3'
|
57
57
|
end
|
58
58
|
|
59
|
-
scroll.
|
59
|
+
scroll.spacer height: 20
|
60
60
|
scroll.h1 text: 'Vertical panel combo'
|
61
61
|
scroll.panels_horizontal distribution: 'spaceEqually', childViews: ->(panel) do
|
62
62
|
panel.button text: '1'
|
@@ -67,7 +67,7 @@ json_ui_page json do |page|
|
|
67
67
|
panel.button text: '3'
|
68
68
|
end
|
69
69
|
|
70
|
-
scroll.
|
70
|
+
scroll.spacer height: 20
|
71
71
|
scroll.h1 text: 'Vertical panel combo (equal filling)'
|
72
72
|
scroll.panels_horizontal width: 'matchParent', distribution: 'fillEqually', childViews: ->(panel) do
|
73
73
|
panel.button text: '1'
|
@@ -78,7 +78,7 @@ json_ui_page json do |page|
|
|
78
78
|
panel.button text: '3'
|
79
79
|
end
|
80
80
|
|
81
|
-
scroll.
|
81
|
+
scroll.spacer height: 20
|
82
82
|
scroll.h1 text: 'Vertical panel combo (equal spacing)'
|
83
83
|
scroll.panels_horizontal width: 'matchParent', distribution: 'spaceEqually', childViews: ->(panel) do
|
84
84
|
panel.button text: '1'
|
@@ -89,7 +89,7 @@ json_ui_page json do |page|
|
|
89
89
|
panel.button text: '3'
|
90
90
|
end
|
91
91
|
|
92
|
-
scroll.
|
92
|
+
scroll.spacer height: 20
|
93
93
|
scroll.h1 text: 'Spacers'
|
94
94
|
scroll.panels_horizontal width: 'matchParent', childViews: ->(panel) do
|
95
95
|
panel.button text: '1'
|
@@ -99,7 +99,7 @@ json_ui_page json do |page|
|
|
99
99
|
panel.button text: '3'
|
100
100
|
end
|
101
101
|
|
102
|
-
scroll.
|
102
|
+
scroll.spacer height: 20
|
103
103
|
scroll.h1 text: 'Alignments'
|
104
104
|
scroll.panels_horizontal align: 'top', childViews: ->(panel) do
|
105
105
|
panel.button height: 50, text: 'Button'
|
@@ -117,12 +117,14 @@ json_ui_page json do |page|
|
|
117
117
|
panel.label text: 'bottom'
|
118
118
|
end
|
119
119
|
|
120
|
-
scroll.
|
121
|
-
scroll.h1 text: 'Label combo'
|
120
|
+
scroll.spacer height: 20
|
121
|
+
scroll.h1 text: 'Label combo (with onClick)'
|
122
122
|
scroll.panels_horizontal childViews: ->(panel) do
|
123
123
|
panel.label backgroundColor: '#b3bac2', text: 'Label 1'
|
124
124
|
panel.label text: 'Label 2'
|
125
125
|
panel.label backgroundColor: '#b3bac2', text: 'Label 3'
|
126
|
+
end, onClick: ->(action) do
|
127
|
+
action.windows_open url: json_ui_garage_url(path: 'home/blank')
|
126
128
|
end
|
127
129
|
|
128
130
|
scroll.label text: "\n"
|
@@ -30,8 +30,6 @@ json_ui_page json do |page|
|
|
30
30
|
template.thumbnail title: 'Unordered List', subtitle: 'Bullet points similar to HTML\'s <ul> tag', onClick: ->(action) do
|
31
31
|
action.windows_open url: json_ui_garage_url(path: 'panels/ul')
|
32
32
|
end
|
33
|
-
|
34
|
-
|
35
33
|
end
|
36
34
|
end, ->(section) do
|
37
35
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
@@ -120,10 +118,14 @@ json_ui_page json do |page|
|
|
120
118
|
end
|
121
119
|
end, ->(section) do
|
122
120
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
123
|
-
header.h2 text: '
|
121
|
+
header.h2 text: 'Experimental'
|
124
122
|
end
|
125
123
|
|
126
124
|
section.rows builder: ->(template) do
|
125
|
+
template.thumbnail title: 'Grid', subtitle: 'Arrage child component in grid like', onClick: ->(action) do
|
126
|
+
action.windows_open url: json_ui_garage_url(path: 'panels/grid')
|
127
|
+
end
|
128
|
+
|
127
129
|
template.thumbnail title: 'Dynamic Group', onClick: ->(action) do
|
128
130
|
# TODO
|
129
131
|
end
|
@@ -93,6 +93,28 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
93
93
|
action.windows_open url: json_ui_garage_url(path: 'home/blank')
|
94
94
|
end
|
95
95
|
|
96
|
+
scroll.spacer height: 16
|
97
|
+
scroll.h2 text: 'With grid-like functionality'
|
98
|
+
scroll.spacer height: 8
|
99
|
+
scroll.panels_responsive \
|
100
|
+
width: 'matchParent',
|
101
|
+
padding: { top: 0, right: 10, bottom: 0, left: 10 },
|
102
|
+
childViews: ->(responsive) do
|
103
|
+
small_image_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGQpSWjtELISLBlmugOZ6wzl1JamYXQvbFeYywpfg3E8b8DrO0Kg&s'
|
104
|
+
|
105
|
+
6.times do |_cell_index|
|
106
|
+
responsive.panels_column \
|
107
|
+
padding: { top: 5, right: 5, bottom: 5, left: 5 },
|
108
|
+
xl: { cols: 3 },
|
109
|
+
lg: { cols: 4 },
|
110
|
+
md: { cols: 6 },
|
111
|
+
backgroundColor: '#c3cad2',
|
112
|
+
childViews: ->(column) do
|
113
|
+
column.image width: 'matchParent', url: small_image_url
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
96
118
|
scroll.spacer height: 20
|
97
119
|
|
98
120
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- app/views/json_ui/garage/panels/carousel.json.jbuilder
|
205
205
|
- app/views/json_ui/garage/panels/custom.json.jbuilder
|
206
206
|
- app/views/json_ui/garage/panels/flow.json.jbuilder
|
207
|
+
- app/views/json_ui/garage/panels/grid.json.jbuilder
|
207
208
|
- app/views/json_ui/garage/panels/horizontal.json.jbuilder
|
208
209
|
- app/views/json_ui/garage/panels/index.json.jbuilder
|
209
210
|
- app/views/json_ui/garage/panels/outlined.json.jbuilder
|