glib-web 0.11.8 → 0.11.9
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/dynamic_images_helper.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/dialogs.rb +11 -5
- data/app/helpers/glib/json_ui/view_builder/fields.rb +4 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +10 -0
- data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +12 -2
- data/app/views/json_ui/garage/forms/basic.json.jbuilder +4 -2
- data/app/views/json_ui/garage/forms/get_request.json.jbuilder +0 -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
- data/app/views/json_ui/garage/panels/vertical.json.jbuilder +0 -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: 9b101f8560396e7f8f7eb2bed21767dabca54753d886f4ddeb285e5d5c5a2650
|
4
|
+
data.tar.gz: eb691036c279090986d67035e7e71e49b014d7ec8042acfe8e3816cb0011736c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3a007875e8305e326bd288c3883c26c64930084684b8020218893640abb3094bbcc4d0a5e85e471d607f63a81810bb0eeff45e69163c3e047bec5f3afc6918c
|
7
|
+
data.tar.gz: a987e2bb2b60798edd4c1485f290a29552457fb6f81f2e9175c739c5fe0fb0364251ff27093c811368d99f969984b6d93de3d30317d7a0596d9b1c9ef68d7f90
|
File without changes
|
@@ -6,11 +6,11 @@ class Glib::JsonUi::ActionBuilder
|
|
6
6
|
action :onClose
|
7
7
|
end
|
8
8
|
|
9
|
-
class Show < Action
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
9
|
+
# class Show < Action
|
10
|
+
# string :body
|
11
|
+
# action :onLoad
|
12
|
+
# action :onClose
|
13
|
+
# end
|
14
14
|
|
15
15
|
# Deprecated in favour of `sheets/select`
|
16
16
|
class Options < Action
|
@@ -25,6 +25,7 @@ class Glib::JsonUi::ActionBuilder
|
|
25
25
|
|
26
26
|
class Show < Action
|
27
27
|
panels_builder :content, :body
|
28
|
+
bool :showClose
|
28
29
|
|
29
30
|
# Future plan
|
30
31
|
# panels_builder :content, :body, :footer
|
@@ -35,6 +36,11 @@ class Glib::JsonUi::ActionBuilder
|
|
35
36
|
bool :showClose
|
36
37
|
end
|
37
38
|
|
39
|
+
class Reload < Action
|
40
|
+
string :url, cache: true
|
41
|
+
bool :showClose
|
42
|
+
end
|
43
|
+
|
38
44
|
class Close < Action
|
39
45
|
action :onClose
|
40
46
|
end
|
@@ -200,6 +200,7 @@ class Glib::JsonUi::ViewBuilder
|
|
200
200
|
# string :name
|
201
201
|
# string :value
|
202
202
|
views :childViews
|
203
|
+
bool :row
|
203
204
|
|
204
205
|
# Override
|
205
206
|
def value(value)
|
@@ -215,6 +216,9 @@ class Glib::JsonUi::ViewBuilder
|
|
215
216
|
class Radio < View
|
216
217
|
string :label
|
217
218
|
string :value
|
219
|
+
action :onClick
|
220
|
+
string :offIcon
|
221
|
+
string :onIcon
|
218
222
|
end
|
219
223
|
|
220
224
|
class File < Text
|
@@ -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
|
@@ -61,13 +61,23 @@ section.rows builder: ->(template) do
|
|
61
61
|
"\n" +
|
62
62
|
'~~Strikethrough~~' + "\n"
|
63
63
|
template.thumbnail title: 'dialogs/show', onClick: ->(action) do
|
64
|
-
action.dialogs_show content: ->(dialog) do
|
64
|
+
action.dialogs_show showClose: true, content: ->(dialog) do
|
65
65
|
dialog.body padding: glib_json_padding_body, childViews: ->(body) do
|
66
66
|
body.markdown text: markdown
|
67
67
|
|
68
68
|
body.panels_split width: 'matchParent', content: ->(split) do
|
69
|
+
split.left childViews: ->(left) do
|
70
|
+
left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
|
71
|
+
horizontal.label text: 'Open current', onClick: ->(subaction) do
|
72
|
+
subaction.dialogs_reload url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
69
77
|
split.right childViews: ->(right) do
|
70
|
-
right.button text: '
|
78
|
+
right.button text: 'Open New', onClick: ->(subaction) do
|
79
|
+
subaction.dialogs_open url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
|
80
|
+
end
|
71
81
|
end
|
72
82
|
end
|
73
83
|
end
|
@@ -9,8 +9,10 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
9
9
|
|
10
10
|
form.panels_split width: 'matchParent', content: ->(split) do
|
11
11
|
split.left childViews: ->(left) do
|
12
|
-
|
13
|
-
|
12
|
+
left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
|
13
|
+
if params[:mode] == 'dialog'
|
14
|
+
horizontal.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
split.right childViews: ->(right) do
|
File without changes
|
@@ -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
|
File without changes
|
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.11.
|
4
|
+
version: 0.11.9
|
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
|