glib-web 4.21.0 → 4.22.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: d78202b475738a29ed66ed9ab23374b4ccebdbd9d58554e60273d41fa99acf8a
4
- data.tar.gz: b51e17878e5274b4955a2784a8c28f1fd739668ecea83a216b73380f4aa75d48
3
+ metadata.gz: 973660b5005d3ea4990845eeb17cbb853bc2e9545aef54659654e0c4955776a3
4
+ data.tar.gz: 8b5f8c01195733b5eadca70ff45b1b5d992ed2f6bf2c8f87818ac34a51e760bb
5
5
  SHA512:
6
- metadata.gz: a70cb51681f41ee739ff26fc4551b85ed5a7518267d9c911fcc0c5822261a7b0daa51bf25eab87868fba4206567355448cea1bf241bca10a903b3f6b2d603259
7
- data.tar.gz: dfa00b2574d73744bf31643d1e71db360772c79eebae88e2e1bc6ce9c6fae18a999f0caee5756dba83b5081f698a52753693a5300e6ca9d0e80709281be795fe
6
+ metadata.gz: 7980032e83ea3569932729997e50f57be9d4e6204590f81455f7d774911aafa68ce6302a91caa7913671b55d7645492aab7e4b58e278ec9bc10f39430359bff7
7
+ data.tar.gz: 8487bce20e4614df9099e751a210431340eb62cbea2b71a5bdd6c226b459a30172a20f46f0e645ee08225cb9b3cd6b5c1c33438b84b3f8a5c41a85b251585444
@@ -9,12 +9,13 @@ class Glib::JsonUi::ActionBuilder
9
9
  action :onBlur
10
10
  end
11
11
 
12
+ # deprecated, change to Clear at next major version release
12
13
  class Reset < Action
13
14
  string :targetId
14
15
  action :onReset
15
16
  end
16
17
 
17
- # deprecated
18
+ # deprecated, delete at next major version release
18
19
  class GetDynamicGroupEntryValues < Action
19
20
  array :names
20
21
  action :onGet
@@ -47,16 +47,16 @@ page.scroll childViews: ->(scroll) do
47
47
  form.spacer height: 20
48
48
  form.h2 text: 'Checkboxes with none_of_above'
49
49
  form.fields_checkGroup \
50
- valueForDisableAll: 'none_of_above',
51
- name: 'user[favorite_fruits][]',
52
- value: 'grape',
53
- uncheckValue: 1,
54
- childViews: ->(group) do
55
- group.fields_check label: 'Grape', checkValue: 'grape'
56
- group.fields_check label: 'Banana', checkValue: 'banana'
57
- group.fields_check label: 'Durian', checkValue: 'durian'
58
- group.fields_check label: 'I dont like fruits', checkValue: 'none_of_above'
59
- end
50
+ valueForDisableAll: 'none_of_above',
51
+ name: 'user[favorite_fruits][]',
52
+ value: 'grape',
53
+ uncheckValue: 1,
54
+ childViews: ->(group) do
55
+ group.fields_check label: 'Grape', checkValue: 'grape'
56
+ group.fields_check label: 'Banana', checkValue: 'banana'
57
+ group.fields_check label: 'Durian', checkValue: 'durian'
58
+ group.fields_check label: 'I dont like fruits', checkValue: 'none_of_above'
59
+ end
60
60
 
61
61
  form.spacer height: 20
62
62
  form.h2 text: 'Check all with checkGroup'
@@ -100,6 +100,26 @@ page.scroll childViews: ->(scroll) do
100
100
  form.fields_check id: 'check2', name: 'user[foo][]', label: 'Option 2', checkValue: true
101
101
  form.fields_check id: 'check3', name: 'user[foo][]', label: 'Option 3', checkValue: true
102
102
 
103
+ form.spacer height: 20
104
+ form.h2 text: 'Custom panels checkgroup'
105
+ form.fields_checkGroup \
106
+ width: 'matchParent',
107
+ name: 'user[custom_panels][]',
108
+ uncheckValue: 'unchecked',
109
+ childViews: ->(group) do
110
+ group.panels_flow id: 'flow', xs: { gap: { all: 8 } }, backgroundColor: 'grey', width: 'matchParent', childViews: ->(flow) do
111
+ flow.fields_check checkValue: '1', label: 'Choice 1', onChange: ->(action) do
112
+ action.components_set targetId: 'flow', data: { backgroundColor: '#ff0000' }
113
+ end
114
+ flow.fields_check checkValue: '2', label: 'Choice 2', onChange: ->(action) do
115
+ action.components_set targetId: 'flow', data: { backgroundColor: '#00ff00' }
116
+ end
117
+ flow.fields_check checkValue: '3', label: 'Choice 3', onChange: ->(action) do
118
+ action.components_set targetId: 'flow', data: { backgroundColor: '#0000ff' }
119
+ end
120
+ end
121
+ end
122
+
103
123
  form.spacer height: 20
104
124
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
105
125
  end
@@ -30,7 +30,7 @@ page.form \
30
30
  form.h2 text: 'Button Date'
31
31
  form.label text: 'Plus 30 days'
32
32
  form.spacer height: 6
33
- form.fields_date width: 150, name: 'user[date_start1]', label: 'Add start date', value: '2024-12-12', template: { type: 'text' }, onChange: ->(action) do
33
+ form.fields_date name: 'user[date_start1]', label: 'Add start date', value: '2024-12-12', min: '2024-11-1', max: '2024-12-31', template: { type: 'text' }, onChange: ->(action) do
34
34
  action.logics_set targetId: 'date3', conditionalData: { value: { "sum_date": [{ "var": 'user[date_start1]' }, { value: 86400 * 30, format: 'date' }] } }
35
35
  end
36
36
  form.spacer height: 6
@@ -130,25 +130,19 @@ page.form \
130
130
  column.fields_radio\
131
131
  width: 'matchParent',
132
132
  height: 'matchParent',
133
- value: 'yes', label: 'Yes', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' },
134
- onClick: ->(action) do
135
- action.windows_openWeb url: 'http://www.google.com'
136
- end
133
+ value: 'yes', label: 'Yes', icon: { template: 'featured', name: 'edit', size: 40, color: '#d1d1d1' }
137
134
  end
138
135
  res.panels_column width: 'matchParent', lg: { cols: 4, padding: { x: 10 } }, childViews: ->(column) do
139
136
  column.fields_radio\
140
137
  width: 'matchParent',
141
138
  value: 'no', label: 'No (very very very very very very very very very very very long description)',
142
- image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 },
143
- onClick: ->(action) do
144
- action.windows_openWeb url: 'http://www.google.com'
145
- end
139
+ image: { template: 'featured', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 80, height: 80 }
146
140
  end
147
141
  res.panels_column width: 'matchParent', lg: { cols: 4 }, childViews: ->(column) do
148
142
  column.fields_radio\
149
143
  value: 'idk', label: 'Not Sure',
150
144
  image: { template: 'thumbnail', url: 'https://cdn.pixabay.com/photo/2020/08/05/13/12/eco-5465432_1280.png', width: 24, height: 24 }
151
- column.fields_radio value: '', label: 'Empty'
145
+ column.fields_radio value: 'empty', label: 'Empty'
152
146
  end
153
147
 
154
148
  end
@@ -1,4 +1,4 @@
1
- navs = ['form', 'dialog', 'form_dynamic', 'auto_validate', 'multiupload', 'dirty_state', 'window']
1
+ navs = ['form', 'dialog', 'form_dynamic', 'auto_validate', 'multiupload', 'dirty_state', 'window', 'selectable']
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|
@@ -37,7 +37,7 @@ page.body childViews: ->(body) do
37
37
  template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question', styleClass: 'question'
38
38
 
39
39
  form.panels_responsive id: 'responsive_{{entryIndex}}', childViews: ->(column) do
40
- options = [:rating, :yes_no, :choices]
40
+ options = [:rating, :yes_no, :choices, :unspecified]
41
41
  template.fields_select \
42
42
  width: 'matchParent',
43
43
  name: 'type',
@@ -51,6 +51,11 @@ page.body childViews: ->(body) do
51
51
  multiple.fields_getValues fieldNames: { '{{entryPrefix}}[type]' => nil, '{{entryPrefix}}[question]' => nil }, onGet: ->(get) do
52
52
  get.snackbars_alert paramName: 'message', fieldName: 'entry-{{entryIndex}}'
53
53
  end
54
+ multiple.logics_run \
55
+ condition: { "==": [{ "var": '{{entryPrefix}}[type]' }, 'unspecified'] },
56
+ onTrue: ->(subaction) do
57
+ subaction.dialogs_alert message: 'Please select a valid type'
58
+ end
54
59
  multiple.logics_set \
55
60
  targetId: 'responsive_{{entryIndex}}', dataBuilder: ->(set) do
56
61
  set.panels_responsive width: 'matchParent', accessory: ->(accessory) do
@@ -0,0 +1,84 @@
1
+ page = json_ui_page json
2
+
3
+ languages = {
4
+ 'East Asia' => {
5
+ 'zh' => 'Chinese',
6
+ 'ja' => 'Japanese',
7
+ 'ko' => 'Korean',
8
+ },
9
+ 'Middle East' => {
10
+ 'ar' => 'Arabic',
11
+ 'hi' => 'Hindi',
12
+ },
13
+ 'Europe' => {
14
+ 'nl' => 'Dutch',
15
+ 'en' => 'English',
16
+ 'fr' => 'French',
17
+ 'de' => 'German',
18
+ 'it' => 'Italian',
19
+ 'pt' => 'Portuguese',
20
+ 'es' => 'Spanish',
21
+ },
22
+ 'Eastern Europe' => {
23
+ 'ru' => 'Russian',
24
+ }
25
+ }
26
+ options = []
27
+ languages.each do |group, sub|
28
+ options << { type: 'label', text: group }
29
+ options.concat(sub.map { |k, v| { value: k, text: v, subtitle: 'Country' } })
30
+ options << { type: 'divider' }
31
+ end
32
+ options << { text: 'None of above', value: 'none_of_above' }
33
+
34
+ page.body padding: glib_json_padding_body, childViews: ->(body) do
35
+ body.panels_form \
36
+ url: json_ui_garage_url(path: 'forms/generic_post'),
37
+ method: 'post',
38
+ onChange: ->(action) do
39
+ action.logics_set targetId: 'checker2', skipOnChange: true, conditionalData: {
40
+ value: { "==": [{ "countNonNull": [{ "var": 'user[foo][]' }] }, 3] },
41
+ indeterminate: { "<": [0, { "countNonNull": [{ "var": 'user[foo][]' }] }, 3] }
42
+ }
43
+ end,
44
+ width: 'matchParent',
45
+ childViews: ->(form) do
46
+ form.h2 text: 'Select prepend & none_of_above'
47
+
48
+ form.fields_select \
49
+ valueForDisableAll: 'none_of_above',
50
+ prependSelectAll: true,
51
+ name: 'user[cities2][]',
52
+ width: 'matchParent',
53
+ label: 'Cities',
54
+ options: options,
55
+ value: ['melbourne', 'sydney'],
56
+ multiple: true
57
+
58
+ form.spacer height: 8
59
+
60
+ form.h2 text: 'Checkboxes none_of_above'
61
+ form.fields_checkGroup \
62
+ valueForDisableAll: 'none_of_above',
63
+ name: 'user[favorite_fruits][]',
64
+ value: 'grape',
65
+ uncheckValue: 1,
66
+ childViews: ->(group) do
67
+ group.fields_check label: 'Grape', checkValue: 'grape'
68
+ group.fields_check label: 'Banana', checkValue: 'banana'
69
+ group.fields_check label: 'Durian', checkValue: 'durian'
70
+ group.fields_check label: 'I dont like fruits', checkValue: 'none_of_above'
71
+ end
72
+
73
+ form.h2 text: 'Check all'
74
+ form.fields_check name: 'check_all_1', id: 'checker2', label: 'check all', checkValue: true, onChange: ->(action) do
75
+ action.logics_set targetIds: ['check1', 'check2', 'check3'], conditionalData: { value: { "!!": [{ "var": 'check_all_1' }] } }
76
+ end
77
+ form.fields_check id: 'check1', name: 'user[foo][]', label: 'Option 1', checkValue: true
78
+ form.fields_check id: 'check2', name: 'user[foo][]', label: 'Option 2', checkValue: true
79
+ form.fields_check id: 'check3', name: 'user[foo][]', label: 'Option 3', checkValue: true
80
+
81
+ form.spacer height: 8
82
+ form.fields_submit text: 'Submit'
83
+ end
84
+ end
data/lib/tasks/db.rake CHANGED
@@ -79,6 +79,8 @@ namespace :db do
79
79
  attrs[key] = value.utc
80
80
  elsif value.is_a? ActiveSupport::HashWithIndifferentAccess
81
81
  attrs[key] = value.to_json
82
+ elsif value.is_a? BigDecimal
83
+ attrs[key] = value.to_f
82
84
  end
83
85
  end
84
86
 
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.21.0
4
+ version: 4.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -325,6 +325,7 @@ files:
325
325
  - app/views/json_ui/garage/test_page/form.json.jbuilder
326
326
  - app/views/json_ui/garage/test_page/form_dynamic.json.jbuilder
327
327
  - app/views/json_ui/garage/test_page/multiupload.json.jbuilder
328
+ - app/views/json_ui/garage/test_page/selectable.json.jbuilder
328
329
  - app/views/json_ui/garage/test_page/window.json.jbuilder
329
330
  - app/views/json_ui/garage/views/_chart_data.json.jbuilder
330
331
  - app/views/json_ui/garage/views/banners.json.jbuilder