glib-web 0.4.63 → 0.4.64
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/helpers/glib/json_ui/view_builder/charts.rb +15 -1
- data/app/helpers/glib/json_ui/view_builder/fields.rb +4 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +78 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +3 -90
- data/app/views/json_ui/garage/panels/index.json.jbuilder +6 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +4 -0
- data/app/views/json_ui/garage/views/charts.json.jbuilder +62 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 858f6fed00fa49aec1cf76be385cca527a974886
|
4
|
+
data.tar.gz: 68dede69174f1fd1f1e446163b29381fae940e31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17af41de6d205e5d29e6f8c824d0528537f23bc50a4620eab2f0230133a1abeacfca4a7fcc7a62cc701dae2fabce43fb96d818482e59283bf1c382e1e19b641f
|
7
|
+
data.tar.gz: 7a403d20f8dd93dcca61ecfbbf148882c1d6030f30bcb65f2e1442c522c8e190e29b6054841b1c1c7b90b4db8c4b3220b63d3e207021df900f6d755ac695d32f
|
@@ -2,7 +2,7 @@ class Glib::JsonUi::ViewBuilder
|
|
2
2
|
module Charts
|
3
3
|
class Line < View
|
4
4
|
hash :nextPage
|
5
|
-
|
5
|
+
|
6
6
|
def dataSeries(blocks)
|
7
7
|
json.dataSeries do
|
8
8
|
blocks.each do |block|
|
@@ -15,5 +15,19 @@ class Glib::JsonUi::ViewBuilder
|
|
15
15
|
|
16
16
|
end
|
17
17
|
|
18
|
+
class Column < View
|
19
|
+
bool :stacked
|
20
|
+
|
21
|
+
def dataGroups(blocks)
|
22
|
+
json.dataGroups do
|
23
|
+
blocks.each do |block|
|
24
|
+
json.child! do
|
25
|
+
block.call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
18
32
|
end
|
19
33
|
end
|
@@ -170,7 +170,11 @@ class Glib::JsonUi::ViewBuilder
|
|
170
170
|
end
|
171
171
|
|
172
172
|
class File < Text
|
173
|
+
# file_rules = { fileType: 'image/*', maxFileSize: 5000 }
|
174
|
+
# file_rules = { fileType: 'video/*', maxFileSize: 50000 }
|
175
|
+
# file_rules = { fileType: 'application/pdf', maxFileSize: 5000 }
|
173
176
|
hash :accepts
|
177
|
+
|
174
178
|
string :directUploadUrl
|
175
179
|
string :fileUrl
|
176
180
|
string :fileTitle
|
@@ -0,0 +1,78 @@
|
|
1
|
+
json.title 'Panels'
|
2
|
+
|
3
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
4
|
+
|
5
|
+
page.scroll backgroundColor: '#fafafa', padding: { top: 10, right: 10, bottom: 10, left: 10 }, childViews: ->(scroll) do
|
6
|
+
scroll.h2 text: 'Vertical panel'
|
7
|
+
scroll.spacer height: 6
|
8
|
+
scroll.panels_vertical styleClasses: styleClasses, padding: glib_json_padding_body, width: 'matchParent', childViews: ->(panel) do
|
9
|
+
panel.button text: 'Button1'
|
10
|
+
panel.button text: 'Button2'
|
11
|
+
panel.button text: 'Button3'
|
12
|
+
end
|
13
|
+
|
14
|
+
scroll.spacer height: 20
|
15
|
+
scroll.h2 text: 'Horizontal panel'
|
16
|
+
scroll.spacer height: 6
|
17
|
+
scroll.panels_horizontal styleClasses: styleClasses, padding: glib_json_padding_body, width: 'matchParent', childViews: ->(panel) do
|
18
|
+
panel.button text: 'Button1'
|
19
|
+
panel.button text: 'Button2'
|
20
|
+
panel.button text: 'Button3'
|
21
|
+
end
|
22
|
+
|
23
|
+
scroll.spacer height: 20
|
24
|
+
scroll.h2 text: 'Split panel'
|
25
|
+
scroll.spacer height: 6
|
26
|
+
scroll.panels_split styleClasses: styleClasses, padding: glib_json_padding_body, width: 'matchParent', content: ->(split) do
|
27
|
+
split.left childViews: ->(left) do
|
28
|
+
left.button text: '1'
|
29
|
+
end
|
30
|
+
split.center childViews: ->(center) do
|
31
|
+
center.button width: 'matchParent', text: '2'
|
32
|
+
end
|
33
|
+
split.right childViews: ->(right) do
|
34
|
+
right.button text: '3'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
scroll.spacer height: 20
|
40
|
+
scroll.h2 text: 'Responsive panel'
|
41
|
+
scroll.spacer height: 6
|
42
|
+
scroll.panels_responsive styleClasses: styleClasses, padding: glib_json_padding_body, width: 'matchParent', childViews: ->(horizontal) do
|
43
|
+
horizontal.panels_column lg: { cols: 8 }, backgroundColor: '#c3cad2', childViews: ->(column) do
|
44
|
+
column.button text: '1'
|
45
|
+
end
|
46
|
+
horizontal.panels_column lg: { cols: 4 }, backgroundColor: '#b3bac2', childViews: ->(column) do
|
47
|
+
column.button text: '2'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
scroll.spacer height: 20
|
52
|
+
scroll.h2 text: 'Grid-like layout'
|
53
|
+
scroll.spacer height: 6
|
54
|
+
scroll.panels_responsive width: 'matchParent', childViews: ->(horizontal) do
|
55
|
+
gap = { top: 12, left: 10, right: 10, bottom: 12 }
|
56
|
+
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
57
|
+
column.panels_vertical styleClasses: styleClasses, width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
58
|
+
column.button text: '1'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
62
|
+
column.panels_vertical styleClasses: styleClasses, width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
63
|
+
column.button text: '2'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
67
|
+
column.panels_vertical styleClasses: styleClasses, width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
68
|
+
column.button text: '3'
|
69
|
+
end
|
70
|
+
end
|
71
|
+
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
72
|
+
column.panels_vertical styleClasses: styleClasses, width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
73
|
+
column.button text: '4'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -1,91 +1,4 @@
|
|
1
|
-
json.title 'Panels'
|
1
|
+
json.title 'Card Panels'
|
2
2
|
|
3
|
-
json_ui_page json
|
4
|
-
|
5
|
-
|
6
|
-
page.scroll backgroundColor: '#fafafa', padding: { top: 10, right: 10, bottom: 10, left: 10 }, childViews: ->(scroll) do
|
7
|
-
scroll.h2 text: 'Vertical panel'
|
8
|
-
scroll.spacer height: 6
|
9
|
-
scroll.panels_vertical styleClass: 'card', padding: glib_json_padding_body, width: 'matchParent', childViews: ->(panel) do
|
10
|
-
panel.button text: 'Button1'
|
11
|
-
panel.button text: 'Button2'
|
12
|
-
panel.button text: 'Button3'
|
13
|
-
end
|
14
|
-
|
15
|
-
scroll.spacer height: 20
|
16
|
-
scroll.h2 text: 'Horizontal panel'
|
17
|
-
scroll.spacer height: 6
|
18
|
-
scroll.panels_horizontal styleClass: 'card', padding: glib_json_padding_body, width: 'matchParent', childViews: ->(panel) do
|
19
|
-
panel.button text: 'Button1'
|
20
|
-
panel.button text: 'Button2'
|
21
|
-
panel.button text: 'Button3'
|
22
|
-
end
|
23
|
-
|
24
|
-
# scroll.spacer height: 20
|
25
|
-
# scroll.h2 text: 'Split panel'
|
26
|
-
# scroll.spacer height: 6
|
27
|
-
# scroll.panels_split styleClass: 'card', padding: glib_json_padding_body, width: 'matchParent', leftViews: ->(panel) do
|
28
|
-
# panel.button text: '1'
|
29
|
-
# end, centerViews: ->(panel) do
|
30
|
-
# panel.button width: 'matchParent', text: '2'
|
31
|
-
# end, rightViews: ->(panel) do
|
32
|
-
# panel.button text: '3'
|
33
|
-
# end
|
34
|
-
|
35
|
-
scroll.spacer height: 20
|
36
|
-
scroll.h2 text: 'Split panel'
|
37
|
-
scroll.spacer height: 6
|
38
|
-
scroll.panels_split styleClass: 'card', padding: glib_json_padding_body, width: 'matchParent', content: ->(split) do
|
39
|
-
split.left childViews: ->(left) do
|
40
|
-
left.button text: '1'
|
41
|
-
end
|
42
|
-
split.center childViews: ->(center) do
|
43
|
-
center.button width: 'matchParent', text: '2'
|
44
|
-
end
|
45
|
-
split.right childViews: ->(right) do
|
46
|
-
right.button text: '3'
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
scroll.spacer height: 20
|
52
|
-
scroll.h2 text: 'Responsive panel'
|
53
|
-
scroll.spacer height: 6
|
54
|
-
scroll.panels_responsive styleClass: 'card', padding: glib_json_padding_body, width: 'matchParent', childViews: ->(horizontal) do
|
55
|
-
horizontal.panels_column lg: { cols: 8 }, backgroundColor: '#c3cad2', childViews: ->(column) do
|
56
|
-
column.button text: '1'
|
57
|
-
end
|
58
|
-
horizontal.panels_column lg: { cols: 4 }, backgroundColor: '#b3bac2', childViews: ->(column) do
|
59
|
-
column.button text: '2'
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
scroll.spacer height: 20
|
64
|
-
scroll.h2 text: 'Grid-like layout'
|
65
|
-
scroll.spacer height: 6
|
66
|
-
scroll.panels_responsive width: 'matchParent', childViews: ->(horizontal) do
|
67
|
-
gap = { top: 12, left: 10, right: 10, bottom: 12 }
|
68
|
-
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
69
|
-
column.panels_vertical styleClass: 'card', width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
70
|
-
column.button text: '1'
|
71
|
-
end
|
72
|
-
end
|
73
|
-
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
74
|
-
column.panels_vertical styleClass: 'card', width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
75
|
-
column.button text: '2'
|
76
|
-
end
|
77
|
-
end
|
78
|
-
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
79
|
-
column.panels_vertical styleClass: 'card', width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
80
|
-
column.button text: '3'
|
81
|
-
end
|
82
|
-
end
|
83
|
-
horizontal.panels_column lg: { cols: 4 }, padding: gap, childViews: ->(column) do
|
84
|
-
column.panels_vertical styleClass: 'card', width: 'matchParent', padding: glib_json_padding_body, childViews: ->(column) do
|
85
|
-
column.button text: '4'
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
end
|
3
|
+
page = json_ui_page json
|
4
|
+
render "#{@path_prefix}/panels/styled", json: json, page: page, styleClasses: ['card']
|
@@ -104,6 +104,12 @@ json_ui_page json do |page|
|
|
104
104
|
template.thumbnail title: 'Card', onClick: ->(action) do
|
105
105
|
action.windows_open url: json_ui_garage_url(path: 'panels/card')
|
106
106
|
end
|
107
|
+
end
|
108
|
+
|
109
|
+
section.rows builder: ->(template) do
|
110
|
+
template.thumbnail title: 'Outlined', onClick: ->(action) do
|
111
|
+
action.windows_open url: json_ui_garage_url(path: 'panels/outlined')
|
112
|
+
end
|
107
113
|
|
108
114
|
end
|
109
115
|
end, ->(section) do
|
@@ -10,7 +10,7 @@ else
|
|
10
10
|
|
11
11
|
json_ui_page json do |page|
|
12
12
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
13
|
-
|
13
|
+
|
14
14
|
page.scroll padding: {top: 20, left: 20, right: 20, bottom: 20}, childViews: ->(scroll) do
|
15
15
|
scroll.h1 text: 'Line chart'
|
16
16
|
scroll.charts_line dataSeries: [
|
@@ -48,6 +48,67 @@ else
|
|
48
48
|
scroll.h1 text: 'Line chart using remote data'
|
49
49
|
render "#{@path_prefix}/views/chart_data", json: json, builder: scroll
|
50
50
|
|
51
|
+
scroll.h2 text: 'Column chart (Clustered)'
|
52
|
+
scroll.charts_column dataGroups: [
|
53
|
+
-> do
|
54
|
+
json.title 'Column 1'
|
55
|
+
|
56
|
+
points = {
|
57
|
+
'2010' => 10,
|
58
|
+
'2020' => 16,
|
59
|
+
}
|
60
|
+
json.points points
|
61
|
+
end,
|
62
|
+
-> do
|
63
|
+
json.title 'Column 2'
|
64
|
+
|
65
|
+
points = {
|
66
|
+
'2010' => 24,
|
67
|
+
'2020' => 22,
|
68
|
+
}
|
69
|
+
json.points points
|
70
|
+
end,
|
71
|
+
-> do
|
72
|
+
json.title 'Column 3'
|
73
|
+
|
74
|
+
points = {
|
75
|
+
'2010' => 20,
|
76
|
+
'2020' => 23,
|
77
|
+
}
|
78
|
+
json.points points
|
79
|
+
end
|
80
|
+
]
|
81
|
+
|
82
|
+
scroll.h2 text: 'Column chart (Stacked)'
|
83
|
+
scroll.charts_column stacked: true, dataGroups: [
|
84
|
+
-> do
|
85
|
+
json.title 'Column 1'
|
86
|
+
|
87
|
+
points = {
|
88
|
+
'2010' => 10,
|
89
|
+
'2020' => 16,
|
90
|
+
}
|
91
|
+
json.points points
|
92
|
+
end,
|
93
|
+
-> do
|
94
|
+
json.title 'Column 2'
|
95
|
+
|
96
|
+
points = {
|
97
|
+
'2010' => 24,
|
98
|
+
'2020' => 22,
|
99
|
+
}
|
100
|
+
json.points points
|
101
|
+
end,
|
102
|
+
-> do
|
103
|
+
json.title 'Column 3'
|
104
|
+
|
105
|
+
points = {
|
106
|
+
'2010' => 20,
|
107
|
+
'2020' => 23,
|
108
|
+
}
|
109
|
+
json.points points
|
110
|
+
end
|
111
|
+
]
|
51
112
|
end
|
52
113
|
end
|
53
114
|
|
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.
|
4
|
+
version: 0.4.64
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -148,12 +148,14 @@ files:
|
|
148
148
|
- app/views/json_ui/garage/pages/layout.json.jbuilder
|
149
149
|
- app/views/json_ui/garage/pages/nav_buttons.json.jbuilder
|
150
150
|
- app/views/json_ui/garage/pages/tab_bar.json.jbuilder
|
151
|
+
- app/views/json_ui/garage/panels/_styled.json.jbuilder
|
151
152
|
- app/views/json_ui/garage/panels/card.json.jbuilder
|
152
153
|
- app/views/json_ui/garage/panels/carousel.json.jbuilder
|
153
154
|
- app/views/json_ui/garage/panels/custom.json.jbuilder
|
154
155
|
- app/views/json_ui/garage/panels/flow.json.jbuilder
|
155
156
|
- app/views/json_ui/garage/panels/horizontal.json.jbuilder
|
156
157
|
- app/views/json_ui/garage/panels/index.json.jbuilder
|
158
|
+
- app/views/json_ui/garage/panels/outlined.json.jbuilder
|
157
159
|
- app/views/json_ui/garage/panels/responsive.json.jbuilder
|
158
160
|
- app/views/json_ui/garage/panels/split.json.jbuilder
|
159
161
|
- app/views/json_ui/garage/panels/vertical.json.jbuilder
|