glib-web 3.17.1 → 3.17.2

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: 9c37ac1c9bd5d4d9565ab86f986291b9632078fbbff826f9fbe97af830bb751c
4
- data.tar.gz: 492bd2a9ba30eec6f10e305902840f767092689e27c49fbf270eb0bd5934dc53
3
+ metadata.gz: dd24effaae205cda3bbaa562759d4e10ad6ec1a746bab48e09bd58e122750904
4
+ data.tar.gz: 0017f7bddf14f314f6d1d653bf9e8696e87e55931472a487a33374b430a77c39
5
5
  SHA512:
6
- metadata.gz: c1825b0b69216a06f5cc44f1caec35d966712b6109fb6db4cd31e0b5ba12736b784c570eab3a02ed050364f61723b45466f2b650cd182665533e85633caa0456
7
- data.tar.gz: b74fd94c300707ecbe6a64225d0e20125903c9772939bfdcc2e1517b2729666d8e0564f30499c957a4d6c4608b8a270378cb87539a4fd8fc84b6d7c17afe1f05
6
+ metadata.gz: 785f4c5cc7a5f118b83a1f51913cb5ad7f612610046841124361c3e11f123fa35ab7115195900dc62a01967a8ad0beb009d7478427d50fe7b45ce781022fab9e
7
+ data.tar.gz: e627ad1cb3d030a0ed2ed3059735899331e5f0137ad12dad13fa9c55de6cf84c0925ca9d63f381ad1cdb73f798f46e27818bb22af37fa92331bfbd05eb3ae070
@@ -11,7 +11,7 @@ module Glib::Auth
11
11
  params[:_dialog].present? # E.g. _dialog=v1
12
12
  end
13
13
 
14
- def __glib_error_dialog(title, message)
14
+ def __glib_error_dialog(title, message, bottom_views = [])
15
15
  {
16
16
  action: 'dialogs/show',
17
17
  # Don't show another dialog, just use the current one since it's a new dialog anyway, which means
@@ -21,23 +21,39 @@ module Glib::Auth
21
21
  body: {
22
22
  childViews: [
23
23
  {
24
- "view": "label",
25
- "text": message
24
+ view: 'label',
25
+ text: message
26
26
  },
27
- ],
28
- "padding": {
29
- "x": 20,
30
- "y": 22,
27
+ ].concat(bottom_views),
28
+ padding: {
29
+ x: 20,
30
+ y: 22,
31
31
  },
32
32
  }
33
33
  }
34
34
  end
35
35
 
36
- def json_ui_401_response
36
+ def json_ui_401_response(sign_in_url)
37
37
  {
38
38
  # Handle dialogs_open and windows_open
39
39
  glib_json_dialog_mode? ? :onLoad : :onResponse => __glib_error_dialog(
40
- 'Your session has ended', 'Please refresh the page and re-login.')
40
+ 'Your session has ended', 'Please re-login.', [
41
+ {
42
+ view: 'spacer',
43
+ height: 20
44
+ },
45
+ {
46
+ view: 'button',
47
+ text: 'Re-login',
48
+ onClick: {
49
+ action: 'dialogs/close',
50
+ onClose: {
51
+ action: 'windows/open',
52
+ url: sign_in_url
53
+ }
54
+ }
55
+ },
56
+ ])
41
57
  }
42
58
  end
43
59
  end
@@ -101,7 +101,7 @@ module Glib::Json::Libs
101
101
  redirect_to sign_in_url
102
102
  end
103
103
  format.json do
104
- render json: json_ui_401_response, status: Rails.env.test? ? :unauthorized : :ok
104
+ render json: json_ui_401_response(sign_in_url), status: Rails.env.test? ? :unauthorized : :ok
105
105
  end
106
106
  end
107
107
  end
@@ -1,14 +1,36 @@
1
1
  class Glib::JsonUi::ActionBuilder
2
2
  module Components
3
-
4
3
  class Find < Action
5
4
  string :targetId
6
5
  action :onFind
7
6
  end
8
7
 
8
+ class FindClosest < Action
9
+ string :view
10
+ action :onFind
11
+ end
12
+
13
+ # Deprecated. Use components_replace instead
9
14
  class Update < Action
10
15
  string :targetId
11
16
  views :views
12
17
  end
18
+
19
+ class Replace < Action
20
+ string :targetId
21
+ action :onReplace
22
+
23
+ def newView(block)
24
+ json.newView do
25
+ block.call(page.sview_builder)
26
+ end
27
+ end
28
+ end
29
+
30
+ class Set < Action
31
+ string :targetId
32
+ hash :data
33
+ action :onSet
34
+ end
13
35
  end
14
36
  end
@@ -1,5 +1,10 @@
1
1
  class Glib::JsonUi::ActionBuilder
2
2
  module Fields
3
+ class Focus < Action
4
+ string :targetId
5
+ action :onFocus
6
+ end
7
+
3
8
  class Reset < Action
4
9
  string :targetId
5
10
  action :onReset
@@ -5,6 +5,7 @@ class Glib::JsonUi::ViewBuilder
5
5
  attr_accessor :current_dynamic_group
6
6
 
7
7
  action :onSubmit
8
+ action :onChange
8
9
  string :paramNameForFormData
9
10
  bool :local
10
11
 
@@ -40,9 +40,14 @@ module Glib
40
40
  color :backgroundColor
41
41
  hash :padding
42
42
  singleton_array :styleClass, :styleClasses
43
- hash :showIf
43
+
44
44
  hash :valueIf
45
+
46
+ hash :showIf
45
47
  hash :loadIf
48
+ action :onIfTrue
49
+ action :onIfFalse
50
+
46
51
  hash :analytics
47
52
  # hash :tooltip
48
53
  array :extensions
@@ -59,7 +59,7 @@ section.rows builder: ->(template) do
59
59
  end
60
60
 
61
61
  template.thumbnail title: 'dialogs/open', onClick: ->(action) do
62
- action.dialogs_open width: 950, url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
62
+ action.dialogs_open width: 950, url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog'), disableCloseButton: true
63
63
  end
64
64
 
65
65
  template.thumbnail title: 'dialogs/open (fullscreen on mobile)', onClick: ->(action) do
@@ -1,7 +1,8 @@
1
1
  data = params[:user] || {}
2
2
 
3
3
  json_ui_response_with_view json do |action|
4
- action.components_update targetId: 'preview', views: ->(update) do
4
+ # See if we can use components_set instead.
5
+ action.components_replace targetId: 'preview', newView: ->(update) do
5
6
  update.panels_vertical childViews: ->(vertical) do
6
7
  vertical.label text: "Hello #{data[:name]},"
7
8
  vertical.spacer height: 18
@@ -70,10 +70,9 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
70
70
  accessory.header padding: { x: 16, y: 10 }, childViews: ->(header) do
71
71
  header.label text: 'Header'
72
72
  end
73
- accessory.footer padding: { x: 16, y: 10 }, childViews: ->(header) do
74
- header.label text: 'Footer'
73
+ accessory.footer padding: { x: 16, y: 10 }, childViews: ->(footer) do
74
+ footer.label text: 'Footer'
75
75
  end
76
- # footer.label text: 'TEST123'
77
76
  end
78
77
 
79
78
  form.fields_select \
@@ -131,10 +131,6 @@ json_ui_page json do |page|
131
131
  action.windows_open url: json_ui_garage_url(path: 'panels/grid')
132
132
  end
133
133
 
134
- template.thumbnail title: 'Dynamic Group', onClick: ->(action) do
135
- # TODO
136
- end
137
-
138
134
  template.thumbnail title: 'List Template Accessory', onClick: ->(action) do
139
135
  # TODO
140
136
  end
@@ -20,6 +20,9 @@ page.list firstSection: ->(section) do
20
20
  template.thumbnail title: 'Autoload All', onClick: ->(action) do
21
21
  action.windows_open url: json_ui_garage_url(path: 'tables/autoload_all')
22
22
  end
23
+ template.thumbnail title: 'Panel Content', onClick: ->(action) do
24
+ action.windows_open url: json_ui_garage_url(path: 'tables/panel_content')
25
+ end
23
26
  end
24
27
 
25
28
  end
@@ -0,0 +1,36 @@
1
+ json.title 'Tables'
2
+
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ page.table styleClass: 'table--grid', sections: [
7
+ ->(section) do
8
+ section.header cellViews: ->(header) do
9
+ header.label text: 'Vertical'
10
+ header.label text: 'Horizontal'
11
+ header.label text: 'Unordered List'
12
+ end
13
+
14
+ items = [1, 2, 3]
15
+ section.rows objects: items, builder: ->(row, item, index) do
16
+ row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
17
+ cell.panels_vertical childViews: ->(vertical) do
18
+ vertical.h3 text: "Title #{item}"
19
+ vertical.spacer height: 4
20
+ vertical.label text: "Subtitle #{item}"
21
+ end
22
+
23
+ cell.panels_horizontal childViews: ->(vertical) do
24
+ vertical.label text: "Left #{item}"
25
+ vertical.spacer width: 10
26
+ vertical.label text: "Right #{item}"
27
+ end
28
+
29
+ cell.panels_ul childViews: ->(ul) do
30
+ ul.label text: "Item A#{item}"
31
+ ul.label text: "Item B#{item}"
32
+ end
33
+ end
34
+ end
35
+ end
36
+ ]
@@ -129,6 +129,7 @@ else
129
129
  plugins[:datalabels][:formatType] = 'label'
130
130
  scroll.h2 text: 'Pie chart'
131
131
  scroll.charts_pie \
132
+ legend: { display: false },
132
133
  colors: ['#fc5a8d', '#F5E216'],
133
134
  plugins: plugins,
134
135
  dataPoints: [{ title: 'Strawberry', value: 25 }, { title: 'Banana', value: 75 }], legend: { display: false }
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: 3.17.1
4
+ version: 3.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -254,6 +254,7 @@ files:
254
254
  - app/views/json_ui/garage/tables/horizontal_scroll.json.jbuilder
255
255
  - app/views/json_ui/garage/tables/index.json.jbuilder
256
256
  - app/views/json_ui/garage/tables/layout.json.jbuilder
257
+ - app/views/json_ui/garage/tables/panel_content.json.jbuilder
257
258
  - app/views/json_ui/garage/views/_chart_data.json.jbuilder
258
259
  - app/views/json_ui/garage/views/banners.json.jbuilder
259
260
  - app/views/json_ui/garage/views/calendar_data.json.jbuilder