glib-web 0.10.9 → 0.11.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/panels.rb +10 -0
- data/app/views/json_ui/garage/panels/_timeline_content.json.jbuilder +24 -0
- data/app/views/json_ui/garage/panels/index.json.jbuilder +3 -0
- data/app/views/json_ui/garage/panels/timeline.json.jbuilder +70 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b752fcae7cc608d5890e82e1d8684ef0c00bcb825d4048384c39a8436b1a0960
|
4
|
+
data.tar.gz: 27b120d2754f94a98733ade53e81208631fd30d0ee78c8122c295fe5fb171e55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d1970741807a9de81b871d4d88c3d7ffd20de6cf1a52f54e8e8d8c9de3fb121bf039c55b319218d08735b747f415bde933ec36fb9201f51d2bc6d075f5acec1
|
7
|
+
data.tar.gz: bf8e5cb1620b44914a692ea142733ce1eab9eab8207f1392e10ee37b9efe616cc88cef5b854a771c7654363ee94d88225a61602784ff4cde902756a1b24858e4
|
@@ -144,6 +144,16 @@ class Glib::JsonUi::ViewBuilder
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
147
|
+
class Timeline < View
|
148
|
+
color :completedColor
|
149
|
+
color :uncompletedColor
|
150
|
+
singleton_array :styleClass, :styleClasses
|
151
|
+
string :uncompletedIcon
|
152
|
+
string :completedIcon
|
153
|
+
array :items
|
154
|
+
views :childViews
|
155
|
+
end
|
156
|
+
|
147
157
|
class Table < View
|
148
158
|
hash :nextPage
|
149
159
|
hash :export
|
@@ -0,0 +1,24 @@
|
|
1
|
+
progress = params[:progress]&.to_i&.between?(0, 5) ? params[:progress].to_i : 0
|
2
|
+
|
3
|
+
tview.panels_responsive \
|
4
|
+
width: 400,
|
5
|
+
childViews: ->(res) do
|
6
|
+
res.panels_column sm: { cols: 11 }, childViews: ->(subcolumn) do
|
7
|
+
subcolumn.panels_column sm: { cols: 2, padding: { right: 10 } }, childViews: ->(inner_column) do
|
8
|
+
inner_column.spacer height: 10
|
9
|
+
inner_column.progressBar value: progress/5.to_f, height: 5, styleClass: 'no-text'
|
10
|
+
inner_column.spacer height: 10
|
11
|
+
end
|
12
|
+
subcolumn.panels_column sm: { cols: 9 }, childViews: ->(inner_column) do
|
13
|
+
inner_column.h4 \
|
14
|
+
text: "Progress #{progress}/5"
|
15
|
+
end
|
16
|
+
subcolumn.p text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
|
17
|
+
end
|
18
|
+
res.panels_column sm: { cols: 1 }, childViews: ->(subcolumn) do
|
19
|
+
subcolumn.icon name: 'add', size: 50
|
20
|
+
end
|
21
|
+
end, onClick: ->(action) do
|
22
|
+
action.windows_reload url: json_ui_garage_url(path: 'panels/timeline', progress: progress + 1)
|
23
|
+
end
|
24
|
+
tview.spacer height: 12
|
@@ -30,6 +30,9 @@ 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
|
+
template.thumbnail title: 'Timeline', subtitle: 'Timeline component with responsive panel as the childviews', onClick: ->(action) do
|
34
|
+
action.windows_open url: json_ui_garage_url(path: 'panels/timeline')
|
35
|
+
end
|
33
36
|
end
|
34
37
|
end, ->(section) do
|
35
38
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
@@ -0,0 +1,70 @@
|
|
1
|
+
json.title 'Timeline Panels'
|
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
|
+
scroll.h2 text: 'Basic timeline'
|
8
|
+
scroll.spacer height: 8
|
9
|
+
|
10
|
+
timeline_items = [
|
11
|
+
{ name: :submitted, label: 'Order submitted' },
|
12
|
+
{ name: :finding, label: 'Finding you a driver' },
|
13
|
+
{ name: :driver_assigned, label: 'Driver found, picking you up..' },
|
14
|
+
{ name: :otw, label: 'On the way' },
|
15
|
+
{ name: :arrived, label: 'Arrived' }
|
16
|
+
]
|
17
|
+
|
18
|
+
# Defining active or completed item
|
19
|
+
active_name = :driver_assigned
|
20
|
+
timeline_items.each_with_index do |h, i|
|
21
|
+
if h[:name] == active_name
|
22
|
+
h[:active] = true
|
23
|
+
break
|
24
|
+
else
|
25
|
+
h[:completed] = true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
scroll.panels_timeline items: timeline_items
|
30
|
+
scroll.spacer height: 32
|
31
|
+
|
32
|
+
custom_completed_item = {
|
33
|
+
name: :custom,
|
34
|
+
label: 'Completed item with a custom icon',
|
35
|
+
completed: true,
|
36
|
+
uncompletedIcon: 'place',
|
37
|
+
completedIcon: 'place'
|
38
|
+
}
|
39
|
+
custom_uncompleted_item = {
|
40
|
+
name: :custom,
|
41
|
+
label: 'Uncompleted item with a custom icon',
|
42
|
+
uncompletedIcon: 'flag',
|
43
|
+
completedIcon: 'flag'
|
44
|
+
}
|
45
|
+
scroll.h2 text: 'Timeline with outlined dots, custom icons and custom colors'
|
46
|
+
scroll.spacer height: 8
|
47
|
+
scroll.panels_timeline \
|
48
|
+
items: [custom_completed_item] + timeline_items + [custom_uncompleted_item],
|
49
|
+
completedColor: '#4BB543',
|
50
|
+
uncompletedColor: '#FFA500',
|
51
|
+
styleClasses: ['outlined'],
|
52
|
+
completedIcon: 'check',
|
53
|
+
uncompletedIcon: 'hourglass_empty'
|
54
|
+
scroll.spacer height: 32
|
55
|
+
|
56
|
+
scroll.h2 text: 'Timeline with childViews'
|
57
|
+
scroll.panels_timeline \
|
58
|
+
items: timeline_items,
|
59
|
+
childViews: ->(tview) do
|
60
|
+
tview.spacer height: 16
|
61
|
+
render 'json_ui/garage/panels/timeline_content', tview: tview
|
62
|
+
tview.spacer height: 16
|
63
|
+
|
64
|
+
tview.button text: 'Reset', onClick: ->(action) do
|
65
|
+
action.windows_reload url: json_ui_garage_url(path: 'panels/timeline')
|
66
|
+
end
|
67
|
+
tview.spacer height: 16
|
68
|
+
end
|
69
|
+
scroll.spacer height: 32
|
70
|
+
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.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- app/views/json_ui/garage/pages/tab_bar.json.jbuilder
|
202
202
|
- app/views/json_ui/garage/panels/_hover_views_content.json.jbuilder
|
203
203
|
- app/views/json_ui/garage/panels/_styled.json.jbuilder
|
204
|
+
- app/views/json_ui/garage/panels/_timeline_content.json.jbuilder
|
204
205
|
- app/views/json_ui/garage/panels/card.json.jbuilder
|
205
206
|
- app/views/json_ui/garage/panels/carousel.json.jbuilder
|
206
207
|
- app/views/json_ui/garage/panels/custom.json.jbuilder
|
@@ -212,6 +213,7 @@ files:
|
|
212
213
|
- app/views/json_ui/garage/panels/outlined.json.jbuilder
|
213
214
|
- app/views/json_ui/garage/panels/responsive.json.jbuilder
|
214
215
|
- app/views/json_ui/garage/panels/split.json.jbuilder
|
216
|
+
- app/views/json_ui/garage/panels/timeline.json.jbuilder
|
215
217
|
- app/views/json_ui/garage/panels/ul.json.jbuilder
|
216
218
|
- app/views/json_ui/garage/panels/vertical.json.jbuilder
|
217
219
|
- app/views/json_ui/garage/panels/web.json.jbuilder
|