glib-web 0.5.52 → 0.5.57

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: c17691f0a87e24994e6b3a1af23a55350ef9be02683c475f61333d0d15e7b30f
4
- data.tar.gz: 923a13b5d4978f0b22e5e158f7f8199c529838530551d15ffce83ff4336ecb17
3
+ metadata.gz: 8c052aa46d123f84220a32c4a8d1b64cc9a4484a6d8cc6f78eb7ac32e0b1389b
4
+ data.tar.gz: '096f1169b89c4d184c69932b2c0570f0b126154a27fa70d57f55e80731a58ddf'
5
5
  SHA512:
6
- metadata.gz: f27c4bc9283b72361186a13241a416d3250f635258fefe800ea58de6fd38efd42fd21e274dce8cf5d416fad6c0800b80b414183a6a691e93bacef0254569b0ee
7
- data.tar.gz: 0b75d7c3eaba5c71caedece99f2f70b8d12de0a1f1a2b16a834f4ae86a3bdc9bb5c475e8c928be260c2998a5484fac821c55d256287bb5c4dfb391a28334f3f1
6
+ metadata.gz: f8f1cc55527fec48236f33f45baf0bef64552effc6661332703b1abf846b457503f35e05e4439244976de9f7f530efafce4eab55c886e2a0204d85c0905babba
7
+ data.tar.gz: b34dc89c7ad1653beda8a2a7dd1e26b66cc39092bb1ac4ce0c2d957cc6c69822792c3b18f1f7f1ce020f3c6965ac171f326f917aae660379525c630294c7775f
@@ -69,6 +69,11 @@ module Glib::Json::Libs
69
69
  end
70
70
  end
71
71
 
72
+ def glib_json_redirect_to(url)
73
+ render json: {
74
+ onResponse: { action: 'dialogs/close', onClose: { action: 'windows/open', url: url } }
75
+ }
76
+ end
72
77
 
73
78
  module ClassMethods
74
79
 
@@ -0,0 +1,8 @@
1
+ class Glib::JsonUi::ActionBuilder
2
+ module Lists
3
+ class ScrollToBottom < Action
4
+ action :onScroll
5
+ bool :animate
6
+ end
7
+ end
8
+ end
@@ -22,5 +22,10 @@ class Glib::JsonUi::ActionBuilder
22
22
  string :url, cache: true
23
23
  action :onReload
24
24
  end
25
+
26
+ class CloseWithReload < Action
27
+ string :fallbackUrl
28
+ action :onReload
29
+ end
25
30
  end
26
31
  end
@@ -12,6 +12,7 @@ module Glib
12
12
  menu :editButtons
13
13
  menu :chips
14
14
  singleton_array :styleClass, :styleClasses
15
+ color :backgroundColor
15
16
 
16
17
  # def editButtons(block)
17
18
  # json.editButtons do
@@ -233,8 +233,22 @@ class Glib::JsonUi::ViewBuilder
233
233
  string :publicKey
234
234
  end
235
235
 
236
+ class StripeExternalAccount < AbstractField
237
+ string :publicKey
238
+ string :accountHolderName
239
+ string :accountHolderType
240
+ string :country
241
+ string :currency
242
+ end
243
+
236
244
  class CreditCard < AbstractField
237
245
  string :publicKey
238
246
  end
247
+
248
+ class Rating < AbstractField
249
+ bool :halfIncrements
250
+ string :color
251
+ int :size
252
+ end
239
253
  end
240
254
  end
@@ -202,6 +202,7 @@ class Glib::JsonUi::ViewBuilder
202
202
  views :childViews
203
203
  string :distribution
204
204
  string :align
205
+ action :onClick
205
206
  end
206
207
 
207
208
  class Horizontal < View
@@ -3,5 +3,10 @@ module Glib
3
3
  def glib_url_current(new_params)
4
4
  url_for(params.to_unsafe_h.merge(new_params.merge(only_path: false)))
5
5
  end
6
+
7
+ def glib_url_equals_current?(url)
8
+ route = Rails.application.routes.recognize_path(url)
9
+ route[:controller] == controller_name && route[:action] == action_name
10
+ end
6
11
  end
7
12
  end
@@ -0,0 +1,12 @@
1
+
2
+ section.header padding: glib_json_padding_list, childViews: ->(header) do
3
+ header.h3 text: 'Lists'
4
+ end
5
+
6
+ section.rows builder: ->(template) do
7
+ template.thumbnail title: 'lists/scrollToBottom', onClick: ->(action) do
8
+ action.lists_scrollToBottom animate: true, onScroll: ->(subaction) do
9
+ subaction.dialogs_alert message: 'Bottom reached'
10
+ end
11
+ end
12
+ end
@@ -6,6 +6,8 @@ render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
6
6
  page.list sections: [
7
7
  ->(section) do
8
8
  render "#{@path_prefix}/actions/reload", section: section
9
+ end, ->(section) do
10
+ render "#{@path_prefix}/actions/lists", section: section
9
11
  end, ->(section) do
10
12
  render "#{@path_prefix}/actions/dialogs", section: section
11
13
  end, ->(section) do
@@ -16,7 +16,7 @@ page.list sections: [
16
16
  template.thumbnail title: "Submission Flow (timestamp: #{DateTime.current.to_i})", onClick: ->(action) do
17
17
  action.windows_open url: json_ui_garage_url(path: 'forms/submission_flow')
18
18
  end
19
- template.thumbnail title: "Submission Indicator", onClick: ->(action) do
19
+ template.thumbnail title: 'Submission Indicator', onClick: ->(action) do
20
20
  action.windows_open url: json_ui_garage_url(path: 'forms/submission_indicator')
21
21
  end
22
22
  template.thumbnail title: 'GET Request', onClick: ->(action) do
@@ -59,7 +59,6 @@ page.list sections: [
59
59
  template.thumbnail title: 'Floating Submit', onClick: ->(action) do
60
60
  action.windows_open url: json_ui_garage_url(path: 'forms/floating_submit')
61
61
  end
62
-
63
62
  end
64
63
  end, ->(section) do
65
64
  section.header padding: glib_json_padding_list, childViews: ->(header) do
@@ -3,7 +3,12 @@ json.title 'Forms'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
6
+ page.form \
7
+ url: json_ui_garage_url(path: 'forms/generic_post'),
8
+ method: 'post',
9
+ padding: glib_json_padding_body,
10
+ childViews: ->(form) do
11
+
7
12
  form.h2 text: 'Radio Group'
8
13
  form.spacer height: 6
9
14
  form.h4 text: 'Gender'
@@ -15,15 +20,40 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
15
20
 
16
21
  form.spacer height: 20
17
22
  form.h2 text: 'Single Checkbox'
18
- form.fields_check name: 'user[age_range]', value: '16+', checkValue: '16+', uncheckValue: '0-16', label: 'I am over 16 (has default value)'
19
- form.fields_check name: 'user[employer]', checkValue: 1, label: 'I am an employer (no default value)'
20
- form.fields_check name: 'user[enabled]', checkValue: true, label: 'Enable', styleClass: 'switch', value: 'true'
23
+ form.fields_check \
24
+ name: 'user[age_range]',
25
+ value: '16+',
26
+ checkValue: '16+',
27
+ uncheckValue: '0-16',
28
+ label: 'I am over 16 (has default value)'
29
+ form.fields_check \
30
+ name: 'user[employer]',
31
+ checkValue: 1,
32
+ label: 'I am an employer (no default value)'
33
+ form.fields_check \
34
+ name: 'user[enabled]',
35
+ checkValue: true,
36
+ label: 'Enable',
37
+ styleClass: 'switch',
38
+ value: 'true'
21
39
 
22
40
  form.spacer height: 20
23
41
  form.h2 text: 'Date/Time'
24
42
  form.spacer height: 6
25
- form.fields_date name: 'user[date]', width: 'matchParent', label: 'Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
26
- form.fields_datetime name: 'user[date_time]', width: 'matchParent', label: 'Date Time', min: '2018-06-09T00:00', max: '2018-06-17T00:00', value: '2018-06-15T19:30'
43
+ form.fields_date \
44
+ name: 'user[date]',
45
+ width: 'matchParent',
46
+ label: 'Date',
47
+ min: '2010-01-01',
48
+ max: '2012-01-01',
49
+ value: '2010-02-01'
50
+ form.fields_datetime \
51
+ name: 'user[date_time]',
52
+ width: 'matchParent',
53
+ label: 'Date Time',
54
+ min: '2018-06-09T00:00',
55
+ max: '2018-06-17T00:00',
56
+ value: '2018-06-15T19:30'
27
57
 
28
58
  form.spacer height: 20
29
59
  form.h2 text: 'Country'
@@ -34,13 +64,39 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
34
64
  form.spacer height: 20
35
65
  form.h2 text: 'Map'
36
66
  form.spacer height: 6
37
- form.fields_location name: 'user[address]', width: 'matchParent', label: 'Type an address', value: 'Sydney Harbour Bridge',
67
+ form.fields_location \
68
+ name: 'user[address]',
69
+ width: 'matchParent',
70
+ label: 'Type an address',
71
+ value: 'Sydney Harbour Bridge',
38
72
  autocompleteOptions: { componentRestrictions: { country: 'au' }, types: ['(cities)'] },
39
73
  latitudeField: { view: 'fields/text', name: 'user[latitude]', label: 'Lat', value: -33.8523063, readOnly: true },
40
74
  longitudeField: { view: 'fields/text', name: 'user[longitude]', label: 'Long', value: 151.21078710000006, readOnly: true },
41
75
  zoomField: { view: 'fields/text', name: 'user[zoom]', label: 'Zoom' }
42
76
 
43
77
  form.spacer height: 20
44
- form.fields_submit text: 'Submit'
78
+ form.h2 text: 'Rating'
79
+ form.spacer height: 6
80
+ form.fields_rating \
81
+ name: 'user[rating_summary1]',
82
+ value: 1,
83
+ color: 'primary'
84
+ form.fields_rating \
85
+ name: 'user[rating_summary2]',
86
+ value: 1.5,
87
+ halfIncrements: true,
88
+ color: 'secondary'
89
+ form.fields_rating \
90
+ name: 'user[rating_summary3]',
91
+ value: 2,
92
+ color: 'ternary',
93
+ size: 35
94
+ form.fields_rating \
95
+ name: 'user[rating_summary4]',
96
+ value: 3,
97
+ readOnly: true,
98
+ size: 40
45
99
 
100
+ form.spacer height: 20
101
+ form.fields_submit text: 'Submit'
46
102
  end
@@ -2,15 +2,15 @@ json.title 'Forms'
2
2
 
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
-
5
+
6
6
  page.form url: json_ui_garage_url(path: 'forms/submission_flow_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
7
7
  form.fields_radioGroup name: 'user[flow]', childViews: ->(group) do
8
8
  group.h3 text: 'Flow'
9
9
  group.spacer height: 6
10
- group.fields_radio value: 'close_reload', label: 'close+reload - useful for form submission in mobile apps'
11
- group.fields_radio value: 'open', label: 'open - useful for form submission in web app'
12
- group.fields_radio value: 'close_alert', label: 'close+alert - useful for non-model form (e.g. contact us) in both mobile/web'
13
- group.fields_radio value: 'alert_close', label: 'alert+close - useful for non-model form (e.g. contact us) in both mobile/web'
10
+ group.fields_radio value: 'open', label: 'open - useful for form create'
11
+ group.fields_radio value: 'close_with_reload', label: 'closeWithReload - useful for form update'
12
+ group.fields_radio value: 'close_alert', label: 'close+alert - useful for non-model form (e.g. contact us)'
13
+ group.fields_radio value: 'alert_close', label: 'alert+close - useful for non-model form (e.g. contact us)'
14
14
  end
15
15
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
16
16
  end
@@ -5,10 +5,12 @@ json_ui_response json do |action|
5
5
  action.dialogs_alert message: 'Please enter all required information'
6
6
  else
7
7
  case flow
8
- when 'close_reload'
9
- action.windows_close onClose: ->(action) do
10
- action.windows_reload
11
- end
8
+ when 'close_with_reload'
9
+ # action.windows_close onClose: ->(action) do
10
+ # action.windows_reload
11
+ # end
12
+
13
+ action.windows_closeWithReload fallbackUrl: json_ui_garage_url(path: 'forms/index')
12
14
  when 'close_alert'
13
15
  action.windows_close onClose: ->(action) do
14
16
  action.dialogs_alert message: 'Thanks for the submission!'
@@ -54,6 +54,16 @@ page.form \
54
54
  width: 'matchParent',
55
55
  publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx'
56
56
 
57
+ form.spacer height: 20
58
+ form.fields_stripeExternalAccount \
59
+ name: 'user[stripe_external_account]',
60
+ width: 'matchParent',
61
+ publicKey: 'pk_test_TYooMQauvdEDq54NiTphI7jx',
62
+ accountHolderName: 'John Doe',
63
+ accountHolderType: 'individual',
64
+ country: 'AU',
65
+ currency: 'AUD'
66
+
57
67
  form.spacer height: 30
58
68
  form.fields_submit text: 'Submit'
59
69
  end
@@ -2,30 +2,34 @@ json.title 'Menu'
2
2
 
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
5
-
5
+
6
6
  page.list firstSection: ->(section) do
7
7
  section.rows builder: ->(template) do
8
- template.thumbnail title: 'Pages', onClick: ->(action) do
8
+ template.thumbnail title: 'Pages', onClick: ->(action) do
9
9
  action.windows_open url: json_ui_garage_url(path: 'pages/index')
10
10
  end
11
- template.thumbnail title: 'Lists', onClick: ->(action) do
11
+ template.thumbnail title: 'Panels', onClick: ->(action) do
12
+ action.windows_open url: json_ui_garage_url(path: 'panels/index')
13
+ end
14
+ template.thumbnail title: 'Lists', onClick: ->(action) do
12
15
  action.windows_open url: json_ui_garage_url(path: 'lists/index')
13
16
  end
14
- template.thumbnail title: 'Forms', onClick: ->(action) do
17
+ template.thumbnail title: 'Forms', onClick: ->(action) do
15
18
  action.windows_open url: json_ui_garage_url(path: 'forms/index')
16
19
  end
17
- template.thumbnail title: 'Panels', onClick: ->(action) do
18
- action.windows_open url: json_ui_garage_url(path: 'panels/index')
19
- end
20
- template.thumbnail title: 'Views', onClick: ->(action) do
20
+ template.thumbnail title: 'Views', onClick: ->(action) do
21
21
  action.windows_open url: json_ui_garage_url(path: 'views/index')
22
22
  end
23
- template.thumbnail title: 'Actions', onClick: ->(action) do
23
+ template.thumbnail title: 'Actions', onClick: ->(action) do
24
24
  action.windows_open url: json_ui_garage_url(path: 'actions/index')
25
25
  end
26
- template.thumbnail title: 'Tables (Web Only)', onClick: ->(action) do
26
+ template.thumbnail title: 'Tables (Web Only)', onClick: ->(action) do
27
27
  action.windows_open url: json_ui_garage_url(path: 'tables/index')
28
28
  end
29
+ # Disabled to prevent errors in crawler tests due to external dependencies
30
+ # template.thumbnail title: 'Services', onClick: ->(action) do
31
+ # action.windows_open url: json_ui_garage_url(path: 'services/index')
32
+ # end
29
33
  end
30
34
 
31
35
  end
@@ -43,7 +43,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
43
43
  scroll.panels_split width: 'matchParent', content: ->(content) do
44
44
  content.left childViews: ->(left) do
45
45
  left.fields_textarea \
46
- width: 'matchParent',
46
+ width: 440,
47
47
  label: "Messages from #{first_user.full_name}",
48
48
  onTypeStart: lambda { |action|
49
49
  action.cables_push \
@@ -69,7 +69,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
69
69
  end
70
70
  content.right childViews: ->(right) do
71
71
  right.fields_textarea \
72
- width: 'matchParent',
72
+ width: 440,
73
73
  label: "Messages from #{second_user.full_name}",
74
74
  onTypeStart: lambda { |action|
75
75
  action.cables_push \
@@ -46,5 +46,10 @@ json_ui_page json do |page|
46
46
  panel.button text: '3'
47
47
  end
48
48
 
49
+ scroll.label text: "\n"
50
+ scroll.h1 text: 'Click action'
51
+ scroll.panels_vertical width: 100, height: 100, backgroundColor: '#b3bac2', onClick: ->(action) do
52
+ action.dialogs_alert message: 'Perform action'
53
+ end
49
54
  end
50
55
  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.5.52
4
+ version: 0.5.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -59,9 +59,6 @@ dependencies:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 6.0.1
62
- - - "<"
63
- - !ruby/object:Gem::Version
64
- version: 6.1.0
65
62
  type: :runtime
66
63
  prerelease: false
67
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,9 +66,6 @@ dependencies:
69
66
  - - ">="
70
67
  - !ruby/object:Gem::Version
71
68
  version: 6.0.1
72
- - - "<"
73
- - !ruby/object:Gem::Version
74
- version: 6.1.0
75
69
  description:
76
70
  email: ''
77
71
  executables: []
@@ -98,6 +92,7 @@ files:
98
92
  - app/helpers/glib/json_ui/action_builder.rb
99
93
  - app/helpers/glib/json_ui/action_builder/dialogs.rb
100
94
  - app/helpers/glib/json_ui/action_builder/http.rb
95
+ - app/helpers/glib/json_ui/action_builder/lists.rb
101
96
  - app/helpers/glib/json_ui/action_builder/sheets.rb
102
97
  - app/helpers/glib/json_ui/action_builder/snackbars.rb
103
98
  - app/helpers/glib/json_ui/action_builder/windows.rb
@@ -129,6 +124,7 @@ files:
129
124
  - app/views/json_ui/garage/_nav_menu.json.jbuilder
130
125
  - app/views/json_ui/garage/actions/_dialogs.json.jbuilder
131
126
  - app/views/json_ui/garage/actions/_http.json.jbuilder
127
+ - app/views/json_ui/garage/actions/_lists.json.jbuilder
132
128
  - app/views/json_ui/garage/actions/_reload.json.jbuilder
133
129
  - app/views/json_ui/garage/actions/_sheets.json.jbuilder
134
130
  - app/views/json_ui/garage/actions/_snackbars.json.jbuilder