ui_bibz 3.0.0.beta14 → 3.0.0.beta19

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.rubocop.yml +0 -1
  4. data/.ruby-version +1 -1
  5. data/Gemfile.lock +101 -97
  6. data/lib/ui_bibz.rb +2 -0
  7. data/lib/ui_bibz/concerns/models/searchable.rb +9 -7
  8. data/lib/ui_bibz/infos.rb +3 -3
  9. data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +10 -13
  10. data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +6 -8
  11. data/lib/ui_bibz/ui/concerns/navigation_concern.rb +12 -0
  12. data/lib/ui_bibz/ui/concerns/notification_concern.rb +13 -0
  13. data/lib/ui_bibz/ui/core/boxes/card.rb +1 -1
  14. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +1 -1
  15. data/lib/ui_bibz/ui/core/component.rb +5 -1
  16. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +4 -4
  17. data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +3 -3
  18. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +1 -1
  19. data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +8 -4
  20. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +2 -2
  21. data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +2 -2
  22. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +11 -0
  23. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +1 -1
  24. data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +1 -1
  25. data/lib/ui_bibz/ui/core/navigations/components/breadcrumb_link.rb +1 -1
  26. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
  27. data/lib/ui_bibz/ui/core/navigations/link.rb +1 -1
  28. data/lib/ui_bibz/ui/core/navigations/nav.rb +1 -5
  29. data/lib/ui_bibz/ui/core/navigations/navbar.rb +2 -6
  30. data/lib/ui_bibz/ui/core/notifications/components/bar.rb +1 -1
  31. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -1
  32. data/lib/ui_bibz/ui/core/notifications/popover.rb +2 -6
  33. data/lib/ui_bibz/ui/core/notifications/toast.rb +33 -3
  34. data/lib/ui_bibz/ui/core/notifications/tooltip.rb +2 -6
  35. data/lib/ui_bibz/ui/ux/tables/components/actions.rb +1 -1
  36. data/lib/ui_bibz/ui/ux/tables/components/store.rb +3 -0
  37. data/lib/ui_bibz/ui/ux/tables/extensions/paginable.rb +0 -3
  38. data/lib/ui_bibz/ui/ux/tables/table.rb +6 -2
  39. data/lib/ui_bibz/ui/ux/tables/table_pagination.rb +0 -3
  40. data/lib/ui_bibz/ui/ux/tables/table_pagination_per_page.rb +0 -3
  41. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -0
  42. data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +2 -2
  43. data/lib/ui_bibz/utils/screwdriver.rb +1 -1
  44. data/test/simple_form_test.rb +36 -27
  45. data/test/ui/core/forms/choices/checkbox_field_test.rb +7 -0
  46. data/test/ui/core/forms/selects/{multi_select_field_test.rb → dropdown_select_field_test.rb} +5 -5
  47. data/test/ui/core/notifications/toast_test.rb +2 -2
  48. data/ui_bibz.gemspec +3 -2
  49. metadata +28 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c7d0fa9075ddd53e329885fd916d87ddd4c0a83f704323122c45c8e2d35cd48
4
- data.tar.gz: 791f22fc1fa9a1d41f1fcb91eefc181c93ca3827a295acec4a6814f532735528
3
+ metadata.gz: f0011ba3d278a12f3d16b0e37c39e4f04c7ea6130b794ade6747c7b52c9ea9e3
4
+ data.tar.gz: 175d9532394f41bf208d8f664c8cb58ddc8db53758823b997a4fde94d138a262
5
5
  SHA512:
6
- metadata.gz: 8f13b92c62b6dad28625dfad5ccaee634f85a8dcc62979bf208e50e182ee86cfcf9a1a669290f950354795003b0cefe6323ee6623f66471ded08bf8aaf19b28c
7
- data.tar.gz: 226d1646f90d50e034b43753a3cb79b944b4f9b617d3d126fe582c384d6e4af063d9baf5bb9dbf7f2836d5bec2d39e82fb0dadee505916a487d9899d05fe26b3
6
+ metadata.gz: f40ded34bd486a366dd1722f8349e32955c02898dd560158eb522eb05ab177eea0fad23ac203620fd1b0b9b45ce08523a90b381f7840e6a81ba655e682cec06c
7
+ data.tar.gz: 8cd7cd92a76547d63e8189bbcb086c986efa410984bb5613f1a53e8687711f0050c88c98588164efb07baf6bf1fc32a7e3ad96bc4734a81e61071e3ae4d7a23b
@@ -23,6 +23,6 @@ jobs:
23
23
  - name: Test with Rake
24
24
  uses: paambaati/codeclimate-action@v2.7.5
25
25
  env:
26
- CC_TEST_REPORTER_ID: 7e50558afc7a861280e3194a765a159e9ea5bdd22d2ebe6c13e5e23fe914c66b
26
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
27
27
  with:
28
28
  coverageCommand: bundle exec rake
data/.rubocop.yml CHANGED
@@ -8,7 +8,6 @@ Layout/LineLength:
8
8
  Enabled: false
9
9
 
10
10
  AllCops:
11
- TargetRubyVersion: 2.7
12
11
  NewCops: enable
13
12
 
14
13
  Lint/UselessAssignment:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.1
1
+ ruby-3.0.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.beta14)
4
+ ui_bibz (3.0.0.beta19)
5
5
  will-paginate-i18n
6
6
  will_paginate (~> 3.3.0)
7
7
  will_paginate-bootstrap4
@@ -9,69 +9,73 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (6.0.3.5)
13
- actionpack (= 6.0.3.5)
12
+ actioncable (6.1.3.2)
13
+ actionpack (= 6.1.3.2)
14
+ activesupport (= 6.1.3.2)
14
15
  nio4r (~> 2.0)
15
16
  websocket-driver (>= 0.6.1)
16
- actionmailbox (6.0.3.5)
17
- actionpack (= 6.0.3.5)
18
- activejob (= 6.0.3.5)
19
- activerecord (= 6.0.3.5)
20
- activestorage (= 6.0.3.5)
21
- activesupport (= 6.0.3.5)
17
+ actionmailbox (6.1.3.2)
18
+ actionpack (= 6.1.3.2)
19
+ activejob (= 6.1.3.2)
20
+ activerecord (= 6.1.3.2)
21
+ activestorage (= 6.1.3.2)
22
+ activesupport (= 6.1.3.2)
22
23
  mail (>= 2.7.1)
23
- actionmailer (6.0.3.5)
24
- actionpack (= 6.0.3.5)
25
- actionview (= 6.0.3.5)
26
- activejob (= 6.0.3.5)
24
+ actionmailer (6.1.3.2)
25
+ actionpack (= 6.1.3.2)
26
+ actionview (= 6.1.3.2)
27
+ activejob (= 6.1.3.2)
28
+ activesupport (= 6.1.3.2)
27
29
  mail (~> 2.5, >= 2.5.4)
28
30
  rails-dom-testing (~> 2.0)
29
- actionpack (6.0.3.5)
30
- actionview (= 6.0.3.5)
31
- activesupport (= 6.0.3.5)
32
- rack (~> 2.0, >= 2.0.8)
31
+ actionpack (6.1.3.2)
32
+ actionview (= 6.1.3.2)
33
+ activesupport (= 6.1.3.2)
34
+ rack (~> 2.0, >= 2.0.9)
33
35
  rack-test (>= 0.6.3)
34
36
  rails-dom-testing (~> 2.0)
35
37
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.0.3.5)
37
- actionpack (= 6.0.3.5)
38
- activerecord (= 6.0.3.5)
39
- activestorage (= 6.0.3.5)
40
- activesupport (= 6.0.3.5)
38
+ actiontext (6.1.3.2)
39
+ actionpack (= 6.1.3.2)
40
+ activerecord (= 6.1.3.2)
41
+ activestorage (= 6.1.3.2)
42
+ activesupport (= 6.1.3.2)
41
43
  nokogiri (>= 1.8.5)
42
- actionview (6.0.3.5)
43
- activesupport (= 6.0.3.5)
44
+ actionview (6.1.3.2)
45
+ activesupport (= 6.1.3.2)
44
46
  builder (~> 3.1)
45
47
  erubi (~> 1.4)
46
48
  rails-dom-testing (~> 2.0)
47
49
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.0.3.5)
49
- activesupport (= 6.0.3.5)
50
+ activejob (6.1.3.2)
51
+ activesupport (= 6.1.3.2)
50
52
  globalid (>= 0.3.6)
51
- activemodel (6.0.3.5)
52
- activesupport (= 6.0.3.5)
53
- activerecord (6.0.3.5)
54
- activemodel (= 6.0.3.5)
55
- activesupport (= 6.0.3.5)
56
- activestorage (6.0.3.5)
57
- actionpack (= 6.0.3.5)
58
- activejob (= 6.0.3.5)
59
- activerecord (= 6.0.3.5)
60
- marcel (~> 0.3.1)
61
- activesupport (6.0.3.5)
53
+ activemodel (6.1.3.2)
54
+ activesupport (= 6.1.3.2)
55
+ activerecord (6.1.3.2)
56
+ activemodel (= 6.1.3.2)
57
+ activesupport (= 6.1.3.2)
58
+ activestorage (6.1.3.2)
59
+ actionpack (= 6.1.3.2)
60
+ activejob (= 6.1.3.2)
61
+ activerecord (= 6.1.3.2)
62
+ activesupport (= 6.1.3.2)
63
+ marcel (~> 1.0.0)
64
+ mini_mime (~> 1.0.2)
65
+ activesupport (6.1.3.2)
62
66
  concurrent-ruby (~> 1.0, >= 1.0.2)
63
- i18n (>= 0.7, < 2)
64
- minitest (~> 5.1)
65
- tzinfo (~> 1.1)
66
- zeitwerk (~> 2.2, >= 2.2.2)
67
+ i18n (>= 1.6, < 2)
68
+ minitest (>= 5.1)
69
+ tzinfo (~> 2.0)
70
+ zeitwerk (~> 2.3)
67
71
  ast (2.4.2)
68
- awesome_print (1.8.0)
72
+ awesome_print (1.9.2)
69
73
  builder (3.2.4)
70
74
  byebug (11.1.3)
71
- childprocess (4.0.0)
72
- concurrent-ruby (1.1.8)
75
+ childprocess (4.1.0)
76
+ concurrent-ruby (1.1.9)
73
77
  crass (1.0.6)
74
- docile (1.3.5)
78
+ docile (1.4.0)
75
79
  erubi (1.10.0)
76
80
  erubis (2.7.0)
77
81
  factory_bot (4.11.1)
@@ -95,93 +99,92 @@ GEM
95
99
  haml (>= 4.0, < 6)
96
100
  nokogiri (>= 1.6.0)
97
101
  ruby_parser (~> 3.5)
98
- i18n (1.8.8)
102
+ i18n (1.8.10)
99
103
  concurrent-ruby (~> 1.0)
100
104
  iniparse (1.5.0)
101
105
  jquery-rails (4.4.0)
102
106
  rails-dom-testing (>= 1, < 3)
103
107
  railties (>= 4.2.0)
104
108
  thor (>= 0.14, < 2.0)
105
- loofah (2.9.0)
109
+ loofah (2.10.0)
106
110
  crass (~> 1.0.2)
107
111
  nokogiri (>= 1.5.9)
108
112
  mail (2.7.1)
109
113
  mini_mime (>= 0.1.1)
110
- marcel (0.3.3)
111
- mimemagic (~> 0.3.2)
114
+ marcel (1.0.1)
112
115
  method_source (1.0.0)
113
- mimemagic (0.3.5)
114
- mini_mime (1.0.2)
115
- mini_portile2 (2.5.0)
116
- minitest (5.14.3)
117
- nio4r (2.5.5)
118
- nokogiri (1.11.1)
116
+ mini_mime (1.0.3)
117
+ mini_portile2 (2.5.3)
118
+ minitest (5.14.4)
119
+ nio4r (2.5.7)
120
+ nokogiri (1.11.7)
119
121
  mini_portile2 (~> 2.5.0)
120
122
  racc (~> 1.4)
121
- overcommit (0.57.0)
123
+ overcommit (0.58.0)
122
124
  childprocess (>= 0.6.3, < 5)
123
125
  iniparse (~> 1.4)
126
+ rexml (~> 3.2)
124
127
  parallel (1.20.1)
125
- parser (3.0.0.0)
128
+ parser (3.0.1.1)
126
129
  ast (~> 2.4.1)
127
130
  racc (1.5.2)
128
131
  rack (2.2.3)
129
132
  rack-test (1.1.0)
130
133
  rack (>= 1.0, < 3)
131
- rails (6.0.3.5)
132
- actioncable (= 6.0.3.5)
133
- actionmailbox (= 6.0.3.5)
134
- actionmailer (= 6.0.3.5)
135
- actionpack (= 6.0.3.5)
136
- actiontext (= 6.0.3.5)
137
- actionview (= 6.0.3.5)
138
- activejob (= 6.0.3.5)
139
- activemodel (= 6.0.3.5)
140
- activerecord (= 6.0.3.5)
141
- activestorage (= 6.0.3.5)
142
- activesupport (= 6.0.3.5)
143
- bundler (>= 1.3.0)
144
- railties (= 6.0.3.5)
134
+ rails (6.1.3.2)
135
+ actioncable (= 6.1.3.2)
136
+ actionmailbox (= 6.1.3.2)
137
+ actionmailer (= 6.1.3.2)
138
+ actionpack (= 6.1.3.2)
139
+ actiontext (= 6.1.3.2)
140
+ actionview (= 6.1.3.2)
141
+ activejob (= 6.1.3.2)
142
+ activemodel (= 6.1.3.2)
143
+ activerecord (= 6.1.3.2)
144
+ activestorage (= 6.1.3.2)
145
+ activesupport (= 6.1.3.2)
146
+ bundler (>= 1.15.0)
147
+ railties (= 6.1.3.2)
145
148
  sprockets-rails (>= 2.0.0)
146
149
  rails-dom-testing (2.0.3)
147
150
  activesupport (>= 4.2.0)
148
151
  nokogiri (>= 1.6)
149
152
  rails-html-sanitizer (1.3.0)
150
153
  loofah (~> 2.3)
151
- railties (6.0.3.5)
152
- actionpack (= 6.0.3.5)
153
- activesupport (= 6.0.3.5)
154
+ railties (6.1.3.2)
155
+ actionpack (= 6.1.3.2)
156
+ activesupport (= 6.1.3.2)
154
157
  method_source
155
158
  rake (>= 0.8.7)
156
- thor (>= 0.20.3, < 2.0)
159
+ thor (~> 1.0)
157
160
  rainbow (3.0.0)
158
161
  rake (13.0.3)
159
- regexp_parser (2.0.3)
160
- rexml (3.2.4)
161
- rubocop (1.9.1)
162
+ regexp_parser (2.1.1)
163
+ rexml (3.2.5)
164
+ rubocop (1.17.0)
162
165
  parallel (~> 1.10)
163
166
  parser (>= 3.0.0.0)
164
167
  rainbow (>= 2.2.2, < 4.0)
165
168
  regexp_parser (>= 1.8, < 3.0)
166
169
  rexml
167
- rubocop-ast (>= 1.2.0, < 2.0)
170
+ rubocop-ast (>= 1.7.0, < 2.0)
168
171
  ruby-progressbar (~> 1.7)
169
172
  unicode-display_width (>= 1.4.0, < 3.0)
170
- rubocop-ast (1.4.1)
171
- parser (>= 2.7.1.5)
172
- rubocop-minitest (0.10.3)
173
- rubocop (>= 0.87, < 2.0)
174
- rubocop-performance (1.9.2)
175
- rubocop (>= 0.90.0, < 2.0)
173
+ rubocop-ast (1.7.0)
174
+ parser (>= 3.0.1.1)
175
+ rubocop-minitest (0.13.0)
176
+ rubocop (>= 0.90, < 2.0)
177
+ rubocop-performance (1.11.3)
178
+ rubocop (>= 1.7.0, < 2.0)
176
179
  rubocop-ast (>= 0.4.0)
177
- rubocop-rails (2.9.1)
180
+ rubocop-rails (2.11.0)
178
181
  activesupport (>= 4.2.0)
179
182
  rack (>= 1.1)
180
- rubocop (>= 0.90.0, < 2.0)
183
+ rubocop (>= 1.7.0, < 2.0)
181
184
  ruby-progressbar (1.11.0)
182
- ruby_parser (3.15.1)
183
- sexp_processor (~> 4.9)
184
- sexp_processor (4.15.2)
185
+ ruby_parser (3.16.0)
186
+ sexp_processor (~> 4.15, >= 4.15.1)
187
+ sexp_processor (4.15.3)
185
188
  simple_form (5.1.0)
186
189
  actionpack (>= 5.2)
187
190
  activemodel (>= 5.2)
@@ -190,7 +193,7 @@ GEM
190
193
  simplecov-html (~> 0.11)
191
194
  simplecov_json_formatter (~> 0.1)
192
195
  simplecov-html (0.12.3)
193
- simplecov_json_formatter (0.1.2)
196
+ simplecov_json_formatter (0.1.3)
194
197
  sprockets (4.0.2)
195
198
  concurrent-ruby (~> 1.0)
196
199
  rack (> 1, < 3)
@@ -201,18 +204,18 @@ GEM
201
204
  sqlite3 (1.4.2)
202
205
  temple (0.8.2)
203
206
  thor (1.1.0)
204
- thread_safe (0.3.6)
205
207
  tilt (2.0.10)
206
- tzinfo (1.2.9)
207
- thread_safe (~> 0.1)
208
+ tzinfo (2.0.4)
209
+ concurrent-ruby (~> 1.0)
208
210
  unicode-display_width (2.0.0)
209
- websocket-driver (0.7.3)
211
+ websocket-driver (0.7.5)
210
212
  websocket-extensions (>= 0.1.0)
211
213
  websocket-extensions (0.1.5)
212
214
  will-paginate-i18n (0.1.15)
213
215
  will_paginate (3.3.0)
214
216
  will_paginate-bootstrap4 (0.2.2)
215
217
  will_paginate (~> 3.0, >= 3.0.0)
218
+ yard (0.9.26)
216
219
  zeitwerk (2.4.2)
217
220
 
218
221
  PLATFORMS
@@ -226,7 +229,7 @@ DEPENDENCIES
226
229
  jquery-rails (>= 3.1.0)
227
230
  minitest
228
231
  overcommit
229
- rails (~> 6.0.3, >= 6.0.3.2)
232
+ rails (~> 6.1.3, >= 6.1.3.2)
230
233
  rubocop
231
234
  rubocop-ast
232
235
  rubocop-minitest
@@ -236,6 +239,7 @@ DEPENDENCIES
236
239
  simplecov
237
240
  sqlite3
238
241
  ui_bibz!
242
+ yard
239
243
 
240
244
  BUNDLED WITH
241
- 2.1.4
245
+ 2.2.15
data/lib/ui_bibz.rb CHANGED
@@ -78,6 +78,8 @@ module UiBibz
78
78
  module Concerns
79
79
  autoload :HtmlConcern, 'ui_bibz/ui/concerns/html_concern'
80
80
  autoload :CardItemableConcern, 'ui_bibz/ui/concerns/card_itemable_concern'
81
+ autoload :NavigationConcern, 'ui_bibz/ui/concerns/navigation_concern'
82
+ autoload :NotificationConcern, 'ui_bibz/ui/concerns/notification_concern'
81
83
  end
82
84
 
83
85
  # Core
@@ -37,11 +37,13 @@ module UiBibz::Concerns::Models::Searchable
37
37
 
38
38
  # If there is more one table in html page
39
39
  def self.initialize_params
40
+ @tmp_params = { per_page: @arguments[:per_page] }
41
+
40
42
  return unless good_store_id?
41
43
 
42
44
  @tmp_params = {
43
45
  search: @params[:search],
44
- per_page: @params[:per_page],
46
+ per_page: @params[:per_page] || @arguments[:per_page],
45
47
  page: new_search? ? nil : @params[:page],
46
48
  sort: @params[:sort],
47
49
  direction: @params[:direction]
@@ -119,19 +121,19 @@ module UiBibz::Concerns::Models::Searchable
119
121
  if attribute.is_a?(Hash)
120
122
  if attribute == :as
121
123
  attribute.each_value do |value|
122
- sql_subquery << "lower(#{value}) LIKE :#{value}_#{i}"
123
- sql_attributes = sql_attributes.merge(Hash["#{value}_#{i}".to_sym, "%#{pattern}%"])
124
+ sql_subquery << "lower(CAST(#{value} AS TEXT)) LIKE :#{value}_#{i}"
125
+ sql_attributes = sql_attributes.merge({ "#{value}_#{i}".to_sym => "%#{pattern}%" })
124
126
  end
125
127
  else
126
128
  key_name = attribute.keys.first.to_s.pluralize
127
129
  attribute.each_value do |value|
128
- sql_subquery << "lower(#{key_name}.#{value}) LIKE :#{key_name}_#{value}_#{i}"
129
- sql_attributes = sql_attributes.merge(Hash["#{key_name}_#{value}_#{i}".to_sym, "%#{pattern}%"])
130
+ sql_subquery << "lower(CAST(#{key_name}.#{value} AS TEXT)) LIKE :#{key_name}_#{value}_#{i}"
131
+ sql_attributes = sql_attributes.merge({ "#{key_name}_#{value}_#{i}".to_sym => "%#{pattern}%" })
130
132
  end
131
133
  end
132
134
  else
133
- sql_subquery << "lower(#{to_s.underscore.pluralize.split('/').last}.#{attribute}) LIKE :#{attribute}_#{i}"
134
- sql_attributes = sql_attributes.merge(Hash["#{attribute}_#{i}".to_sym, "%#{pattern}%"])
135
+ sql_subquery << "lower(CAST(#{to_s.underscore.pluralize.split('/').last}.#{attribute} AS TEXT)) LIKE :#{attribute}_#{i}"
136
+ sql_attributes = sql_attributes.merge({ "#{attribute}_#{i}".to_sym => "%#{pattern}%" })
135
137
  end
136
138
  end
137
139
  sql_query << "(#{sql_subquery.join(' OR ')})"
data/lib/ui_bibz/infos.rb CHANGED
@@ -3,15 +3,15 @@
3
3
  module UiBibz
4
4
  NAME = 'Ui Bibz'
5
5
  SLUG = 'ui_bibz'
6
- BOOTSTRAP_VERSION = '5.0.0.beta1'
6
+ BOOTSTRAP_VERSION = '5.0.0.beta3'
7
7
  DESCRIPTION = "A Rails Interface Framework using Bootstrap #{BOOTSTRAP_VERSION}."
8
8
  SUMMARY = "Ui Bibz is an Ui Framework that allows you to build an interface very quickly and simply using Bootstrap #{BOOTSTRAP_VERSION}."
9
9
  LICENSE = 'MIT'
10
- FONTAWESOME_VERSION = '5.15.2'
10
+ FONTAWESOME_VERSION = '5.15.3'
11
11
  HOMEPAGE = 'https://hummel.link/ui-bibz/'
12
12
  REPO = 'git+https://github.com/thooams/ui_bibz.git'
13
13
  EMAIL = 'thomas@hummel.link'
14
14
  AUTHOR = 'Thooams [Thomas HUMMEL]'
15
- VERSION = '3.0.0.beta14'
15
+ VERSION = '3.0.0.beta19'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -17,10 +17,10 @@ module UiBibzForm
17
17
  wrapper_html = (options[:input_html] || {}).merge({ class: input_classes })
18
18
  surround_field = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new(content, opts, html_options).tap(&block)
19
19
  errors_text = surround_field.errors.flatten.to_sentence
20
- required = surround_field.required_fields.any? { |u| u == true }
20
+ required = surround_field.required_fields.any?(true)
21
21
  wrapper_classes = UiBibz::Utils::Screwdriver.join_classes(('has-error' if errors_text.present?), wrapper_html.try(:[], :class))
22
22
  label_classes = UiBibz::Utils::Screwdriver.join_classes(('required' if required), 'control-label')
23
- abbr_html = content_tag('abbr', I18n.t(:"simple_form.required.mark", default: '*'), title: I18n.t(:"simple_form.required.text", default: 'required')) if required
23
+ abbr_html = content_tag('abbr', I18n.t(:'simple_form.required.mark', default: '*'), title: I18n.t(:'simple_form.required.text', default: 'required')) if required
24
24
 
25
25
  wrapper_html[:class] = wrapper_classes
26
26
 
@@ -32,19 +32,16 @@ module UiBibzForm
32
32
  end
33
33
 
34
34
  def ui_button_group(content = nil, opts = nil, html_options = nil, &block)
35
- content = (options || {}).merge(content || {})
36
- content = content.merge(template: @template, form: self)
37
-
38
- input_classes = UiBibz::Utils::Screwdriver.join_classes('button_group', options[:input_html].try(:[], :class))
39
- wrapper_html = (options[:input_html] || {}).merge({ class: input_classes })
40
-
41
- content_tag :div, wrapper_html do
42
- concat content_tag(:label, content[:label]) unless content[:label].nil?
43
- concat UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(content, opts, html_options).tap(&block).render
44
- end
35
+ ui_component_group_by(UiBibz::Ui::Core::Forms::Buttons::ButtonGroup, content, opts, html_options, &block)
45
36
  end
46
37
 
47
38
  def ui_choice_group(content = nil, opts = nil, html_options = nil, &block)
39
+ ui_component_group_by(UiBibz::Ui::Core::Forms::Choices::ChoiceGroup, content, opts, html_options, &block)
40
+ end
41
+
42
+ private
43
+
44
+ def ui_component_group_by(component_class, content = nil, opts = nil, html_options = nil, &block)
48
45
  content = (options || {}).merge(content || {})
49
46
  content = content.merge(template: @template, form: self)
50
47
 
@@ -53,7 +50,7 @@ module UiBibzForm
53
50
 
54
51
  content_tag :div, wrapper_html do
55
52
  concat content_tag(:label, content[:label]) unless content[:label].nil?
56
- concat UiBibz::Ui::Core::Forms::Choices::ChoiceGroup.new(content, opts, html_options).tap(&block).render
53
+ concat component_class.new(content, opts, html_options).tap(&block).render
57
54
  end
58
55
  end
59
56
  end