glib-web 4.24.1 → 4.25.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e91ec21f3a9e674ffac98bfc5e368c2699d21b1f7be276653259128ce93cdb7
4
- data.tar.gz: bffb66483b1945abbd67ce0bbf9207842987da1dc468bcadf814950a8a8c7d93
3
+ metadata.gz: dc26ae3f37f2a84e0f13450313daebedb18b6d1d9107abdda47448e9a454780b
4
+ data.tar.gz: 8953e083db18c24190d3d93484ccd9e444d1cf8c9563743ed5afb691b9185fd2
5
5
  SHA512:
6
- metadata.gz: 937fca0435f86fcad0826de4572ebf3be09e7cc6019044fd04ae0cc1787a43e4a0c0a4b4bd02ded135f6c565e0c886b4f49feae514bb69f40bcd3e2715110d4f
7
- data.tar.gz: 6505324ba697e1382dd86b5c3e2998235e03437e07c39d58ed9fdaa1e18bc5131c63a5370e575651fdc56fc67cc7d5bee4b39b0ba54cab53c0ee24de7a8cdc9a
6
+ metadata.gz: df5c7b0f6c32a96fc1e2113b458a0c59a91232d430d0c918366d8f4ef0d507ec2d7805a84ece577c3108695726f8e912e7d1e61c05bd120b4626730f646001ba
7
+ data.tar.gz: ad0e4e8a6443c6b7427247db82ea176803fef26cbbf6c3281b3ec073144a5223564e49b7f1257acb2bd95f3f785b785d4f2b82245992ee6fb7d7fc50b81a922d
@@ -1,3 +1,4 @@
1
+ # deprecated
1
2
  class Glib::JsonUi::ActionBuilder
2
3
  module BottomBanners
3
4
  class Open < Action
@@ -23,5 +23,19 @@ class Glib::JsonUi::ActionBuilder
23
23
  end
24
24
  end
25
25
 
26
+ class Open < Action
27
+ string :url
28
+ string :placement # top, right, bottom, left
29
+ end
30
+
31
+ class Show < Action
32
+ panels_builder :content, :body
33
+ string :placement
34
+ end
35
+
36
+ class Close < Action
37
+ action :onClose
38
+ end
39
+
26
40
  end
27
41
  end
@@ -293,6 +293,12 @@ module Glib
293
293
  end
294
294
  end
295
295
 
296
+ if (on_rerender = options[:reRender])
297
+ json.onRerender do
298
+ on_rerender.call @action_builder
299
+ end
300
+ end
301
+
296
302
  if (on_unload = options[:unload])
297
303
  json.onUnload do
298
304
  on_unload.call @action_builder
@@ -70,6 +70,7 @@ module Glib
70
70
 
71
71
  hash :tooltip, required: [:text], optional: [:placement, :position]
72
72
  action :onLoad
73
+ action :onRerender
73
74
 
74
75
  def self.component_name
75
76
  @component_name ||= self.name.sub('Glib::JsonUi::ViewBuilder::', '')
@@ -66,8 +66,9 @@ if local_assigns[:top_nav] || json_ui_app_is_web?
66
66
  action.windows_open url: json_ui_garage_url
67
67
  end
68
68
 
69
- menu.button icon: 'refresh', text: 'Reload', badge: { text: '!' }, onClick: ->(action) do
70
- action.windows_reload
69
+ badgeText = params[:badgeText] || '!'
70
+ menu.button icon: 'refresh', text: 'Reload', badge: { text: badgeText }, onClick: ->(action) do
71
+ action.windows_reload url: json_ui_garage_current_url({ badgeText: params[:badgeText].to_i + 1 })
71
72
  end
72
73
 
73
74
  menu.button icon: { name: 'zoom_in', badge: { text: '?', backgroundColor: '#00ffff' } }, text: 'Diagnostics', onClick: ->(action) do
@@ -15,4 +15,66 @@ section.rows builder: ->(template) do
15
15
  end
16
16
  end
17
17
 
18
+ template.thumbnail title: "sheets/open placement: 'top'", onClick: ->(action) do
19
+ action.sheets_open placement: 'top', url: json_ui_garage_url(path: 'actions/sheet_content')
20
+ end
21
+ template.thumbnail title: "sheets/open placement: 'right'", onClick: ->(action) do
22
+ action.sheets_open placement: 'right', url: json_ui_garage_url(path: 'actions/sheet_content')
23
+ end
24
+ template.thumbnail title: "sheets/open placement: 'bottom'", onClick: ->(action) do
25
+ action.sheets_open placement: 'bottom', url: json_ui_garage_url(path: 'actions/sheet_content')
26
+ end
27
+ template.thumbnail title: "sheets/open placement: 'left'", onClick: ->(action) do
28
+ action.sheets_open placement: 'left', url: json_ui_garage_url(path: 'actions/sheet_content')
29
+ end
30
+ template.thumbnail title: 'sheets/open wrong url', onClick: ->(action) do
31
+ action.sheets_open placement: 'left', url: json_ui_garage_url(path: 'wrongurl')
32
+ end
33
+ template.thumbnail title: 'sheets/show', onClick: ->(action) do
34
+ action.sheets_show placement: 'right', content: ->(sheet) do
35
+ sheet.body childViews: ->(sbody) do
36
+ sbody.panels_responsive width: 'matchParent', padding: { all: 16 }, childViews: ->(sres) do
37
+ sres.markdown text: %{
38
+ 1. First ordered list item
39
+ 2. Another item
40
+ ⋅⋅* Unordered sub-list.
41
+ 1. Actual numbers don't matter, just that it's a number
42
+ ⋅⋅1. Ordered sub-list
43
+ 4. And another item.
44
+
45
+ ⋅⋅⋅You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
46
+
47
+ ⋅⋅⋅To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅
48
+ ⋅⋅⋅Note that this line is separate, but within the same paragraph.⋅⋅
49
+ ⋅⋅⋅(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
50
+
51
+ * Unordered list can use asterisks
52
+ - Or minuses
53
+ + Or pluses
54
+
55
+ 1. Make my changes
56
+ 1. Fix bug
57
+ 2. Improve formatting
58
+ - Make the headings bigger
59
+ 2. Push my commits to GitHub
60
+ 3. Open a pull request
61
+ * Describe my changes
62
+ * Mention all the members of my team
63
+ * Ask for feedback
64
+
65
+ + Create a list by starting a line with `+`, `-`, or `*`
66
+ + Sub-lists are made by indenting 2 spaces:
67
+ - Marker character change forces new list start:
68
+ * Ac tristique libero volutpat at
69
+ + Facilisis in pretium nisl aliquet
70
+ - Nulla volutpat aliquam velit
71
+ + Very easy!
72
+ }
73
+ sres.spacer height: 8
74
+ sres.button text: 'close', onClick: ->(saction) { saction.sheets_close }
75
+ end
76
+ end
77
+ end
78
+ end
79
+
18
80
  end
@@ -0,0 +1,13 @@
1
+ page = json_ui_page json
2
+
3
+ page.body childViews: ->(body) do
4
+ body.panels_responsive padding: { all: 16 }, childViews: ->(res) do
5
+ res.p text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
6
+ res.spacer height: 8
7
+ res.button text: 'close', onClick: ->(action) do
8
+ action.sheets_close onClose: ->(saction) do
9
+ saction.snackbars_alert message: 'sheet closed'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,4 +1,4 @@
1
- navs = ['form', 'dialog', 'form_dynamic', 'auto_validate', 'multiupload', 'dirty_state', 'window', 'selectable']
1
+ navs = ['form', 'dialog', 'form_dynamic', 'auto_validate', 'multiupload', 'dirty_state', 'window', 'selectable', 'lifecycle']
2
2
 
3
3
  view.panels_flow innerPadding: { bottom: 0 }, styleClass: 'align-right', width: 'matchParent', childViews: ->(res) do
4
4
  navs.each_with_index do |nav, index|
@@ -0,0 +1,57 @@
1
+
2
+
3
+ json.title 'Test Page (Lifecycle hooks)'
4
+
5
+ page = json_ui_page json
6
+
7
+ page.on load: ->(action) do
8
+ action.snackbars_alert message: 'page.onLoad'
9
+ end,
10
+ reRender: ->(action) do
11
+ action.snackbars_alert message: 'page.onRerender'
12
+ end
13
+
14
+ page.body childViews: ->(body) do
15
+ render 'json_ui/garage/test_page/header', view: body
16
+
17
+ body.panels_responsive width: 'matchParent', childViews: ->(res) do
18
+ res.button \
19
+ id: 'button',
20
+ text: 'you should not see this',
21
+ onLoad: ->(action) do
22
+ action.components_set targetId: 'button', data: { text: 'onLoad' }
23
+ end,
24
+ onRerender: ->(action) do
25
+ action.components_set targetId: 'button', data: { text: 'onRerender' }
26
+ end
27
+ res.spacer height: 8
28
+ res.chip \
29
+ id: 'chip',
30
+ text: 'hover me',
31
+ tooltip: { text: 'you should not see this' },
32
+ onLoad: ->(action) do
33
+ action.components_set targetId: 'chip', data: { 'tooltip.text' => 'onLoad' }
34
+ end,
35
+ onRerender: ->(action) do
36
+ action.components_set targetId: 'chip', data: { 'tooltip.text' => 'onRerender' }
37
+ end
38
+ res.spacer height: 8
39
+ res.icon \
40
+ id: 'icon',
41
+ name: 'autorenew',
42
+ onLoad: ->(action) do
43
+ action.components_set targetId: 'icon', data: {
44
+ 'material.name' => 'home'
45
+ }
46
+ end,
47
+ onRerender: ->(action) do
48
+ action.components_set targetId: 'icon', data: {
49
+ 'material.name' => 'person'
50
+ }
51
+ end
52
+ res.spacer height: 8
53
+ res.label text: 'navigate to other page', onClick: ->(action) do
54
+ action.windows_open url: json_ui_garage_url(path: 'test_page/window')
55
+ end
56
+ end
57
+ end
@@ -32,6 +32,7 @@ end
32
32
  options << { text: 'None of above', value: 'none_of_above' }
33
33
 
34
34
  page.body padding: glib_json_padding_body, childViews: ->(body) do
35
+ render 'json_ui/garage/test_page/header', view: body
35
36
  body.panels_form \
36
37
  url: json_ui_garage_url(path: 'forms/generic_post'),
37
38
  method: 'post',
@@ -13,5 +13,8 @@ page.body childViews: ->(body) do
13
13
  res.button text: 'windows/open updateExisting: true', onClick: ->(action) do
14
14
  action.windows_open updateExisting: true, url: json_ui_garage_url(path: 'test_page/multiupload')
15
15
  end
16
+ res.button text: 'windows/close', onClick: ->(action) do
17
+ action.windows_close
18
+ end
16
19
  end
17
20
  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: 4.24.1
4
+ version: 4.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -138,7 +138,6 @@ files:
138
138
  - app/helpers/glib/json_ui/action_builder/logics.rb
139
139
  - app/helpers/glib/json_ui/action_builder/panels.rb
140
140
  - app/helpers/glib/json_ui/action_builder/popovers.rb
141
- - app/helpers/glib/json_ui/action_builder/right_banners.rb
142
141
  - app/helpers/glib/json_ui/action_builder/sheets.rb
143
142
  - app/helpers/glib/json_ui/action_builder/snackbars.rb
144
143
  - app/helpers/glib/json_ui/action_builder/storage_items.rb
@@ -196,6 +195,7 @@ files:
196
195
  - app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder
197
196
  - app/views/json_ui/garage/actions/index.json.jbuilder
198
197
  - app/views/json_ui/garage/actions/partial_update.json.jbuilder
198
+ - app/views/json_ui/garage/actions/sheet_content.json.jbuilder
199
199
  - app/views/json_ui/garage/empty.json.jbuilder
200
200
  - app/views/json_ui/garage/forms/_alert_post_all_data.json.jbuilder
201
201
  - app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder
@@ -325,6 +325,7 @@ files:
325
325
  - app/views/json_ui/garage/test_page/dirty_state.json.jbuilder
326
326
  - app/views/json_ui/garage/test_page/form.json.jbuilder
327
327
  - app/views/json_ui/garage/test_page/form_dynamic.json.jbuilder
328
+ - app/views/json_ui/garage/test_page/lifecycle.json.jbuilder
328
329
  - app/views/json_ui/garage/test_page/multiupload.json.jbuilder
329
330
  - app/views/json_ui/garage/test_page/selectable.json.jbuilder
330
331
  - app/views/json_ui/garage/test_page/window.json.jbuilder
@@ -1,10 +0,0 @@
1
- class Glib::JsonUi::ActionBuilder
2
- module RightBanners
3
- class Open < Action
4
- string :url
5
- end
6
-
7
- class Close < Action
8
- end
9
- end
10
- end