glib-web 0.11.8 → 0.11.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cd15bf3fd097051be173b2902213156338df3950b115ff0aa99849d88359aa2
4
- data.tar.gz: 3a6cf180833d226aa5f06e0fb7fa7672b6b89b4d6baa2936a180a1f8b5d260af
3
+ metadata.gz: 85abe76e3d1977c064f2e86fdbb94762e1876847a81fca85846c7081f6ccb863
4
+ data.tar.gz: '0192085bf3a998491f3090afc395a953d31d4c66d8199e6754fd9f0e1c71c430'
5
5
  SHA512:
6
- metadata.gz: a04352865668b8bfa4a84365f553a8c4ecc19bfb148511072d2c3cb722c6db10eed605dcd0318c20e2a52bb1c180a5322c42a7ba97d4b069b4e2b2d8a1816ca8
7
- data.tar.gz: 100274a1840bd282bec052edc043d1b57c70237b0ebc16c1c4bbb74aef9b175cb1f87162e8cbe6b493eb275b71258af74a8ab2ff7320bac99110a255ef9bf189
6
+ metadata.gz: 030c770a4d216aa32c5ca2f01d662112de29646adbe92777bdf4eed1e3b027896c4bbf9fe201780190c9d964f1c0a500cb7f3aaded8d337565b7ad249dc96d00
7
+ data.tar.gz: 191d5d6e515722fdf0bb53f84c4c689dba91c5fb4112c850d9b6540ab5b3e376b8c7eda433a80e2b577efd74c838459cbe900cca27590557473b4a952942c09c
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
- string :body
11
- action :onLoad
12
- action :onClose
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,12 @@ class Glib::JsonUi::ActionBuilder
35
36
  bool :showClose
36
37
  end
37
38
 
39
+ class Reload < Action
40
+ panels_builder :content, :body
41
+ string :url, cache: true
42
+ bool :showClose
43
+ end
44
+
38
45
  class Close < Action
39
46
  action :onClose
40
47
  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
@@ -54,24 +54,8 @@ section.rows builder: ->(template) do
54
54
  end
55
55
  end
56
56
 
57
- markdown = '## Emphasis' + "\n" +
58
- '**This is bold text**' + "\n" +
59
- "\n" +
60
- '*This is italic text*' + "\n" +
61
- "\n" +
62
- '~~Strikethrough~~' + "\n"
63
57
  template.thumbnail title: 'dialogs/show', onClick: ->(action) do
64
- action.dialogs_show content: ->(dialog) do
65
- dialog.body padding: glib_json_padding_body, childViews: ->(body) do
66
- body.markdown text: markdown
67
-
68
- body.panels_split width: 'matchParent', content: ->(split) do
69
- split.right childViews: ->(right) do
70
- right.button text: 'OK', onClick: ->(subaction) { subaction.dialogs_close }
71
- end
72
- end
73
- end
74
- end
58
+ render 'json_ui/garage/actions/dialogs_show', json: json, action: action, dialog_mode: :show
75
59
  end
76
60
 
77
61
  template.thumbnail title: 'dialogs/open', onClick: ->(action) do
@@ -0,0 +1,28 @@
1
+ markdown = '## Emphasis' + "\n" +
2
+ '**This is bold text**' + "\n" +
3
+ "\n" +
4
+ '*This is italic text*' + "\n" +
5
+ "\n" +
6
+ '~~Strikethrough~~' + "\n"
7
+
8
+ action.send "dialogs_#{dialog_mode}", showClose: true, content: ->(dialog) do
9
+ dialog.body padding: glib_json_padding_body, childViews: ->(body) do
10
+ body.markdown text: markdown
11
+
12
+ body.panels_split width: 'matchParent', content: ->(split) do
13
+ split.left childViews: ->(left) do
14
+ left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
15
+ horizontal.label text: 'Open current', onClick: ->(subaction) do
16
+ subaction.dialogs_reload url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog_reload')
17
+ end
18
+ end
19
+ end
20
+
21
+ split.right childViews: ->(right) do
22
+ right.button text: 'Open New', onClick: ->(subaction) do
23
+ subaction.dialogs_open url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -9,8 +9,15 @@ 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
- if params[:mode] == 'dialog'
13
- left.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
12
+ left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
13
+ case params[:mode]
14
+ when 'dialog'
15
+ horizontal.button styleClass: 'link', text: 'cancel', onClick: ->(action) { action.dialogs_close }
16
+ when 'dialog_reload'
17
+ horizontal.button styleClass: 'link', text: 'back', onClick: ->(action) do
18
+ render 'json_ui/garage/actions/dialogs_show', json: json, action: action, dialog_mode: :reload
19
+ end
20
+ end
14
21
  end
15
22
  end
16
23
  split.right childViews: ->(right) do
@@ -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.11.8
4
+ version: 0.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -129,6 +129,7 @@ files:
129
129
  - app/views/json_ui/garage/_nav_menu.json.jbuilder
130
130
  - app/views/json_ui/garage/actions/_commands.json.jbuilder
131
131
  - app/views/json_ui/garage/actions/_dialogs.json.jbuilder
132
+ - app/views/json_ui/garage/actions/_dialogs_show.json.jbuilder
132
133
  - app/views/json_ui/garage/actions/_http.json.jbuilder
133
134
  - app/views/json_ui/garage/actions/_panels.json.jbuilder
134
135
  - app/views/json_ui/garage/actions/_reload.json.jbuilder
@@ -201,6 +202,7 @@ files:
201
202
  - app/views/json_ui/garage/pages/tab_bar.json.jbuilder
202
203
  - app/views/json_ui/garage/panels/_hover_views_content.json.jbuilder
203
204
  - app/views/json_ui/garage/panels/_styled.json.jbuilder
205
+ - app/views/json_ui/garage/panels/_timeline_content.json.jbuilder
204
206
  - app/views/json_ui/garage/panels/card.json.jbuilder
205
207
  - app/views/json_ui/garage/panels/carousel.json.jbuilder
206
208
  - app/views/json_ui/garage/panels/custom.json.jbuilder
@@ -212,6 +214,7 @@ files:
212
214
  - app/views/json_ui/garage/panels/outlined.json.jbuilder
213
215
  - app/views/json_ui/garage/panels/responsive.json.jbuilder
214
216
  - app/views/json_ui/garage/panels/split.json.jbuilder
217
+ - app/views/json_ui/garage/panels/timeline.json.jbuilder
215
218
  - app/views/json_ui/garage/panels/ul.json.jbuilder
216
219
  - app/views/json_ui/garage/panels/vertical.json.jbuilder
217
220
  - app/views/json_ui/garage/panels/web.json.jbuilder