glib-web 4.35.2 → 4.35.4

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: f641f7071417ce8d17c9485a2a1484faf3896768668d2e8213fe1683a1aa90fb
4
- data.tar.gz: e55f947ea933f5b318411fb0d22e349799f26fac9b5945689aa965151994df03
3
+ metadata.gz: f43a25bddae602f3006f9f75962217e4fc736dfdf0a5fc6c5bb8f7662fcff5d0
4
+ data.tar.gz: d927ddec574668cb4410835c1ad04052076ab8d18b1172d69881c906bc0bcce2
5
5
  SHA512:
6
- metadata.gz: 0d5edeb473e656e26a481849654819dec6c0050ad8bc362a2d18567b8cb6ecf455ca8c7db4ca63a8f42f3be3ec982f2ec78c2f4c10cf786a38978bca2752b819
7
- data.tar.gz: a33efa4e3074fa2c56cc259ce5ab1255772138d9535d39b1abdbfc092a1121fbc29b2c6463729a0d8015119a3a952d53f33f4392ddacfc1c934b2f5c05b036fc
6
+ metadata.gz: c9d47057c841b84141c4b6b89fd1100ea23f161c8ee6b24428e94c5bf5438a6c76541e5b1fddc3f25e5763da547653dea76c0b26091cbe471f8e736bc8be8daf
7
+ data.tar.gz: 261879367984016d4ed1f140209ab079d5bb31c85721ec56654f4c100d3d8e890327ba8752eb6b55b04ca492e65b8d0142f856107ff573825bffe8a81251d215
@@ -261,7 +261,7 @@ module Glib::Json::Libs
261
261
  if glib_json_dialog_mode?
262
262
  # Only do this in dialog mode because this seems to add to the rendering time
263
263
  # (i.e. longer flicker time), presumably due to the use of things like `nextTick()`.
264
- on_response = { action: 'dialogs/close', onClose: on_load }
264
+ on_response = { action: 'dialogs/close', onClose: on_response }
265
265
  end
266
266
 
267
267
  # Use onResponse because it is harder to guarantee that `onLoad` executes in Vuejs because it relies
@@ -14,7 +14,7 @@ module Glib::Json::Ui
14
14
  end
15
15
 
16
16
  # Override
17
- def form_authenticity_token(*args)
17
+ def form_authenticity_token(**args)
18
18
  Rails.env.test? ? 'test_token' : super
19
19
  end
20
20
 
@@ -7,7 +7,7 @@ module Glib
7
7
  button: I18n.t('glib.accepts.max_file_size_error.button', default: nil) || 'Dismiss'
8
8
  }
9
9
  default_max_length_error = {
10
- body: I18n.t('glib.accepts.max_file_length_error.body', default: nil) || 'Files exceed the maximum limit per upload',
10
+ body: I18n.t('glib.accepts.max_file_length_error.body', default: nil) || 'Files exceed the maximum limit',
11
11
  button: I18n.t('glib.accepts.max_file_length_error.button', default: nil) || 'Dismiss'
12
12
  }
13
13
 
@@ -46,7 +46,15 @@ page.form options.merge(childViews: ->(form) do
46
46
  name: 'user[multi][]',
47
47
  id: 'upload_1',
48
48
  width: 360,
49
- accepts: { fileType: 'image', maxFileSize: 10 },
49
+ accepts: {
50
+ fileType: 'image',
51
+ maxFileSize: 10,
52
+ maxFileLength: 2,
53
+ maxFileLengthErrorText: {
54
+ body: 'try with a smaller number of files',
55
+ button: 'OK'
56
+ }
57
+ },
50
58
  directUploadUrl: glib_direct_uploads_url,
51
59
  uploadTitle: 'Files uploaded:',
52
60
  storagePrefix: 'glib',
@@ -70,7 +78,10 @@ page.form options.merge(childViews: ->(form) do
70
78
  name: 'user[multi2][]',
71
79
  id: 'upload_2',
72
80
  width: 360,
73
- accepts: { fileType: 'image', maxFileSize: 5000 },
81
+ accepts: {
82
+ fileType: 'image',
83
+ maxFileSize: 5000
84
+ },
74
85
  directUploadUrl: glib_direct_uploads_url,
75
86
  uploadTitle: 'Files uploaded:',
76
87
  onFinishUpload: ->(action) { action.forms_submit }
@@ -89,7 +100,7 @@ page.form options.merge(childViews: ->(form) do
89
100
  form.fields_multiUpload \
90
101
  name: 'user[multi3][]',
91
102
  width: 360,
92
- accepts: { fileType: 'image', maxFileSize: 100 },
103
+ accepts: { fileType: 'image', maxFileSize: 100, maxFileLength: 2 },
93
104
  uploadTitle: 'Files uploaded:',
94
105
  onFinishUpload: ->(action) { action.forms_submit }
95
106
 
@@ -73,17 +73,27 @@ page.body childViews: ->(body) do
73
73
 
74
74
  validation = { required: { message: 'Required' } }
75
75
  options = ['option1', 'option2', 'option3', 'option4'].map { |option| { 'text'=> option.humanize, 'value' => option } }
76
+ options_with_icon = options.map.with_index do |option, index|
77
+ obj = option.dup
78
+ obj['icon'] = { name: "filter_#{index + 1}" }
79
+ obj
80
+ end
81
+ options_with_image = options.map.with_index do |option, index|
82
+ obj = option.dup
83
+ obj['imageUrl'] = 'https://flagsapi.com/ID/flat/24.png'
84
+ obj
85
+ end
76
86
 
77
87
  form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
78
88
  form.hr width: 'matchParent'
79
89
  form.fields_select clearable: true, multiple: true, width: 'matchParent', name: 'user[select][]', id: 'select', options: options, value: ['option1', 'option2'], validation: validation
80
90
  form.hr width: 'matchParent'
81
91
  form.panels_flow innerPadding: { bottom: 0 }, width: 'matchParent', id: 'select1', childViews: ->(flow) do
82
- form.fields_select clearable: true, width: 'matchParent', name: 'user[select1]', options: options, value: 'option1'
92
+ form.fields_select clearable: true, width: 'matchParent', name: 'user[select1]', options: options_with_icon, value: 'option1'
83
93
  form.hr width: 'matchParent'
84
94
  end
85
95
  form.panels_horizontal id: 'select2', width: 'matchParent', childViews: ->(hori) do
86
- form.fields_select clearable: true, width: 'matchParent', name: 'user[select2]', options: options, value: 'option2'
96
+ form.fields_select clearable: true, width: 'matchParent', name: 'user[select2]', options: options_with_image, value: 'option2'
87
97
  form.hr width: 'matchParent'
88
98
  end
89
99
  form.panels_split id: 'select3', width: 'matchParent', content: ->(split) do
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.35.2
4
+ version: 4.35.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''