glib-web 4.35.1 → 4.35.3

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: cefea23c2039d47502f18d50116d608953d704316db5fd81150818d9a4d2fc04
4
- data.tar.gz: 0c224f7552b8d7ced23dd166eb184afa257d0f821f3b7a838f214e35681a0a99
3
+ metadata.gz: 139b8bb1e77c9778bb396d3ed8da72c74051d9cae9cacbae23dd713357ad9586
4
+ data.tar.gz: 200ab9fae64c136049b7eb288898216ede1c261dba047e1f386166daa0ab0309
5
5
  SHA512:
6
- metadata.gz: 4152bea87f6fd59ad0224ee40308c4366efbe62786572d2a4e439246c39de826217df01e2abd2a339b93d6370fb3d7e2694ada049ec965dfd6feaefefb2fd4e0
7
- data.tar.gz: 98d35bb888090b3b3dae94cfb8567f7c9ea565f2e4a3eb78246f21b55bcbd92ad55ede6bcf08150912ba2ea33d4407bd8a5ff27e78c6650c82958e090ae82bee
6
+ metadata.gz: a5761de4b8433b8aec45ac23f3890cc66f1052426d133e37e40d25e3bb10109ef6ac13ee607554b3db7d7b0695086f7823e86f7cb432ea377317b83d35d26375
7
+ data.tar.gz: d308d941d36c01460174449bc7375cbae1c767dd9797b56f4c008e86985605b890bb292c678d69a93e8a34e63e914921984d0fddde80d6eaa270cb6ae5275ae4
@@ -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
 
@@ -232,7 +232,9 @@ class Glib::JsonUi::ViewBuilder
232
232
  bool :clearable
233
233
  string :valueForDisableAll
234
234
  bool :prependSelectAll
235
- # bool :csvMode
235
+
236
+ # To override the default behaviour
237
+ bool :useChips
236
238
 
237
239
  def options(value)
238
240
  @_options = value
@@ -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.1
4
+ version: 4.35.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''