glib-web 3.25.1 → 3.26.0

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: 838475dd1c241022699ae4cb206a3fac310be83932b8ec6d6094b61a9889d224
4
- data.tar.gz: f24efaef3bf63350fb001bd461e3f73c47c0110b2d2b10bc53ef97258eea774a
3
+ metadata.gz: a8ac2b87b2a72adbd5c302571faea43150d7058c0ff69a93c5a8f3331fc5ce44
4
+ data.tar.gz: cf37963271e6f7b2653a08b8433ede694de7e3c15c5ffcb8360d1809e7369fce
5
5
  SHA512:
6
- metadata.gz: 8eaa39d50da3e146150414e1491d73170a1d833037bc623b50d46d83dfc111a762b67e7dc47825b7c3a89d6332c52a0e67f63c5de9049f7164e77f881658c753
7
- data.tar.gz: '0940c9ba1f0beebf6088da4a42c1853defd8e67f8728c2ddf135e4c06168e39c0eec299f812e3e9601f1090aadf6b3295a6d265ca1309592325cc863dfa31440'
6
+ metadata.gz: de93f215305deef0bc19c5b199d5935c2fec9b37dfee551d4a957fa175587ff2ef1efc9cc0e3bfb705410c1efdc6e66156a6e4d10f06b8148028d40e470ff288
7
+ data.tar.gz: 17a11bab19832cad840d1a95f89adc8617819993c60d2dfd198fa779b06e36005e8ea9b677efa9b7d194384558640fa7539c15502cdf9937ecc8a5d24fd38556
@@ -31,6 +31,10 @@ module Glib
31
31
  .rounded-corner:hover:before {
32
32
  border-radius: 16px;
33
33
  }
34
+
35
+ .ma-2 {
36
+ margin: 8px;
37
+ }
34
38
  </style>
35
39
  eos
36
40
 
@@ -0,0 +1,14 @@
1
+ class Glib::JsonUi::ActionBuilder
2
+ module BottomBanners
3
+ class Open < Action
4
+ def newView(block)
5
+ json.newView do
6
+ block.call(page.sview_builder)
7
+ end
8
+ end
9
+ end
10
+
11
+ class Close < Action
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class Glib::JsonUi::ActionBuilder
2
+ module GlobalStates
3
+ # Experimental
4
+ class Watch < Action
5
+ string :state
6
+ action :onChange
7
+ end
8
+
9
+ class Set < Action
10
+ string :state
11
+ hash :data
12
+ end
13
+ end
14
+ end
@@ -106,6 +106,7 @@ module Glib
106
106
  json.directUploadUrl options[:directUploadUrl]
107
107
  json.url options[:url]
108
108
  json.inputName options[:inputName]
109
+ json.strategy options[:strategy]
109
110
  end
110
111
  end
111
112
 
@@ -50,17 +50,6 @@ module Glib
50
50
 
51
51
  ###
52
52
 
53
- ### Chart
54
-
55
- def glib_chart_tooltip_template(options)
56
- %{
57
- <div style="border: 1px solid gray; border-radius: 6px;">
58
- <div style="border-radius: 6px 6px 0 0; background-color: gray; padding: 4px; color: white;">#{options[:title]}</div>
59
- <div style="border-radius: 0 0 6px 6px; background-color: white; padding: 4px" color: black;>#{options[:content]}</div>
60
- </div>
61
- }
62
- end
63
-
64
53
  end
65
54
  end
66
55
  end
@@ -331,6 +331,8 @@ class Glib::JsonUi::ViewBuilder
331
331
  string :uploadTitle
332
332
  string :uploadFailedText # deprecated
333
333
  action :onFinishUpload
334
+ string :strategy # can be "delegate" or "dropUpload"
335
+ string :url # http post end point if you don't want to use onFinishUpload
334
336
 
335
337
  required :accepts, :directUploadUrl
336
338
 
@@ -329,10 +329,11 @@ module Glib
329
329
  string :inputName
330
330
  string :url
331
331
  string :directUploadUrl
332
- array :accepts
332
+ hash :accepts
333
333
  string :selected
334
334
  hash :items
335
335
  hash :dropData
336
+ string :strategy
336
337
  end
337
338
  end
338
339
  end
@@ -9,16 +9,16 @@ section.rows builder: ->(template) do
9
9
  subaction.dialogs_alert message: 'Previous window closed'
10
10
  end
11
11
  end
12
- end
13
12
 
14
- section.rows builder: ->(template) do
15
13
  template.thumbnail title: 'windows/open', onClick: ->(action) do
16
14
  action.windows_open url: json_ui_garage_url(path: 'home/blank')
17
15
  end
18
- end
19
16
 
20
- section.rows builder: ->(template) do
21
17
  template.thumbnail title: 'windows/openWeb', onClick: ->(action) do
22
18
  action.windows_openWeb url: 'http://www.google.com'
23
19
  end
20
+
21
+ template.thumbnail title: 'multistep form', onClick: ->(action) do
22
+ action.windows_open url: json_ui_garage_url(path: 'multistep_form/step1')
23
+ end
24
24
  end
@@ -0,0 +1,15 @@
1
+ json.title 'Multistep form'
2
+
3
+ page = json_ui_page json
4
+
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: false
6
+
7
+ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
8
+ scroll.p text: 'Go to next page without pushing state to history'
9
+ scroll.spacer height: 4
10
+ scroll.markdown text: '`action.windows_reload url: url`'
11
+ scroll.spacer height: 8
12
+ scroll.button text: 'Next', onClick: ->(action) do
13
+ action.windows_reload url: json_ui_garage_url(path: 'multistep_form/step2')
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ json.title 'Multistep form'
2
+
3
+ page = json_ui_page json
4
+
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: false
6
+
7
+ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
8
+ scroll.p text: 'Clicking browser back button will bring you to index page. Clicking button bellow will bring you to step 1'
9
+ scroll.spacer height: 8
10
+ scroll.button text: 'Back', onClick: ->(action) do
11
+ action.windows_reload url: json_ui_garage_url(path: 'multistep_form/step1')
12
+ end
13
+ end
@@ -75,15 +75,33 @@ else
75
75
  'Mar' => 70,
76
76
  'Apr' => 62,
77
77
  }
78
- prev = points['Jan']
79
78
 
79
+ prev = ''
80
+ json.points do
81
+ points.each do |k, v|
82
+ prev = points['Jan']
83
+ content = v >= prev ? "▲ #{v - prev}" : "▼ #{prev - v}"
84
+ json.child! do
85
+ json.x k
86
+ json.y v
87
+ json.tooltip do
88
+ json.childViews do
89
+ scroll.panels_responsive \
90
+ padding: { top: 8, right: 8, left: 8, bottom: 8 },
91
+ backgroundColor: '#EDE4E3',
92
+ styleClasses: ['rounded-corner'],
93
+ childViews: ->(sview) do
94
+ sview.label text: "Delta #{k}", color: '#6C6A61'
95
+ sview.spacer height: 4
96
+ sview.label text: content, color: '#6C6A61'
97
+ end
98
+ end
99
+ end
100
+ prev = k
101
+ end
102
+ end
103
+ end
80
104
 
81
- json.points points.map { |k, v|
82
- delta = prev - v
83
- tooltip = v < prev ? "<div>Delta</div><div>▼ #{delta}</div>" : "<div>Delta</div><div>▲ #{delta}</div>"
84
- prev = v
85
- { x: k, y: v, tooltip: glib_chart_tooltip_template(title: "Summary #{k}", content: tooltip) }
86
- }
87
105
  end
88
106
  ]
89
107
 
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.25.1
4
+ version: 3.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -95,10 +95,12 @@ files:
95
95
  - app/helpers/glib/forms_helper.rb
96
96
  - app/helpers/glib/json_ui/abstract_builder.rb
97
97
  - app/helpers/glib/json_ui/action_builder.rb
98
+ - app/helpers/glib/json_ui/action_builder/bottom_banners.rb
98
99
  - app/helpers/glib/json_ui/action_builder/commands.rb
99
100
  - app/helpers/glib/json_ui/action_builder/components.rb
100
101
  - app/helpers/glib/json_ui/action_builder/dialogs.rb
101
102
  - app/helpers/glib/json_ui/action_builder/fields.rb
103
+ - app/helpers/glib/json_ui/action_builder/global_states.rb
102
104
  - app/helpers/glib/json_ui/action_builder/http.rb
103
105
  - app/helpers/glib/json_ui/action_builder/iap.rb
104
106
  - app/helpers/glib/json_ui/action_builder/panels.rb
@@ -221,6 +223,8 @@ files:
221
223
  - app/views/json_ui/garage/lists/index.json.jbuilder
222
224
  - app/views/json_ui/garage/lists/reordering.json.jbuilder
223
225
  - app/views/json_ui/garage/lists/templating.json.jbuilder
226
+ - app/views/json_ui/garage/multistep_form/step1.json.jbuilder
227
+ - app/views/json_ui/garage/multistep_form/step2.json.jbuilder
224
228
  - app/views/json_ui/garage/notifications/action_cable.json.jbuilder
225
229
  - app/views/json_ui/garage/notifications/android_post.json.jbuilder
226
230
  - app/views/json_ui/garage/notifications/index.json.jbuilder