ui_bibz 3.0.0.alpha9 → 3.0.0.beta2

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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/Gemfile.lock +18 -15
  4. data/README.md +5 -1
  5. data/lib/ui_bibz/concerns/models/searchable.rb +1 -1
  6. data/lib/ui_bibz/infos.rb +4 -4
  7. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_text_field_input.rb +1 -1
  8. data/lib/ui_bibz/ui/concerns/html_concern.rb +8 -2
  9. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +1 -1
  10. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +4 -4
  11. data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +2 -2
  12. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +27 -7
  13. data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +1 -1
  14. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +1 -1
  15. data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +2 -2
  16. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +35 -5
  17. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -7
  18. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -7
  19. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +5 -4
  20. data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
  21. data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
  22. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
  23. data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -1
  24. data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +1 -1
  25. data/lib/ui_bibz/ui/core/navigations/link.rb +1 -1
  26. data/lib/ui_bibz/ui/core/navigations/nav.rb +3 -3
  27. data/lib/ui_bibz/ui/core/navigations/navbar.rb +2 -2
  28. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +1 -1
  29. data/lib/ui_bibz/ui/core/navigations/toolbar.rb +1 -1
  30. data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +1 -1
  31. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +18 -4
  32. data/lib/ui_bibz/ui/core/notifications/toast.rb +1 -1
  33. data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -1
  34. data/lib/ui_bibz/ui/core/windows/modal.rb +2 -2
  35. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +0 -1
  36. data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +7 -7
  37. data/test/simple_form_test.rb +4 -4
  38. data/test/ui/core/boxes/card_test.rb +1 -1
  39. data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
  40. data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
  41. data/test/ui/core/forms/buttons/button_test.rb +6 -6
  42. data/test/ui/core/forms/dropdowns/dropdown_test.rb +5 -5
  43. data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
  44. data/test/ui/core/forms/selects/multi_select_field_test.rb +3 -3
  45. data/test/ui/core/forms/surrounds/surround_field_test.rb +2 -2
  46. data/test/ui/core/lists/list_group_test.rb +1 -1
  47. data/test/ui/core/navigations/link_test.rb +1 -1
  48. data/test/ui/core/navigations/nav_test.rb +2 -2
  49. data/test/ui/core/navigations/navbar_test.rb +4 -4
  50. data/test/ui/core/navigations/tab_group_test.rb +5 -5
  51. data/test/ui/core/navigations/toolbar_test.rb +1 -1
  52. data/test/ui/core/notifications/alert_test.rb +1 -1
  53. data/test/ui/core/notifications/spinner_test.rb +1 -1
  54. data/test/ui/core/notifications/toast_test.rb +1 -1
  55. data/test/ui/core/windows/modal_test.rb +2 -2
  56. data/test/ui/ux/containers/panel_test.rb +4 -4
  57. data/ui_bibz.gemspec +2 -1
  58. metadata +20 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e609add47b874d22474ad98a691fb0511ac6b1704309355079a369ae7141a2ac
4
- data.tar.gz: c202dad217807b43e0857d17de0fe98d6df0ee9e26b20d74c9d33244fae1ab01
3
+ metadata.gz: 9e265efc2e27c62c3bdefd67242d59b0bad016d3fab791b74880b1a9030092ce
4
+ data.tar.gz: 324e8e048bc431bf9426f7bb54572e95035e7079e1c87304349963592c1d13fe
5
5
  SHA512:
6
- metadata.gz: c57825fadad8a281d4891732ee10a91fc2d7eef81ca51060c9cecba484658b7132cebf1969b796e1ce49698bd50039c037f78782741fe8226083799a908c1720
7
- data.tar.gz: d2ff37b288db8a88b8797f22af6f87b43c2f76fe2bcfe0c39bc14d01e582b7a9aacd908a32bf98cd8ee35e6e5df13c32689d1ecd2b669949c6f66338ea3dc5c8
6
+ metadata.gz: ff64e1386ea6c156c0e82ad35950c50e7e603a154fbbc7104de530efbe6e15b3b2f5b9955899ecee33e7dce5883e0b15144fbc04d4e82f007d326bc017cc76d8
7
+ data.tar.gz: daf77edc8f5dbdeffa62a3822a232d80c39a2bc7f3cf5e6b8fdb1d06b261bd4c14b84de1f2a2422fa1bbc1535fa6a5e115bcd965b4fb269e4279e2c39055d590
@@ -2,3 +2,4 @@
2
2
 
3
3
  github: thooams
4
4
  patreon: user?u=8672183
5
+ liberapay: thooams
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.alpha9)
4
+ ui_bibz (3.0.0.beta2)
5
5
  rails (~> 6.0.3, >= 6.0.3.2)
6
6
  will-paginate-i18n
7
7
  will_paginate (~> 3.1.0)
@@ -84,7 +84,7 @@ GEM
84
84
  railties (>= 3.0.0)
85
85
  globalid (0.4.2)
86
86
  activesupport (>= 4.2.0)
87
- haml (5.2.0)
87
+ haml (5.2.1)
88
88
  temple (>= 0.8.0)
89
89
  tilt
90
90
  haml-rails (2.0.1)
@@ -105,7 +105,7 @@ GEM
105
105
  rails-dom-testing (>= 1, < 3)
106
106
  railties (>= 4.2.0)
107
107
  thor (>= 0.14, < 2.0)
108
- loofah (2.7.0)
108
+ loofah (2.8.0)
109
109
  crass (~> 1.0.2)
110
110
  nokogiri (>= 1.5.9)
111
111
  mail (2.7.1)
@@ -123,7 +123,7 @@ GEM
123
123
  overcommit (0.57.0)
124
124
  childprocess (>= 0.6.3, < 5)
125
125
  iniparse (~> 1.4)
126
- parallel (1.20.0)
126
+ parallel (1.20.1)
127
127
  parser (2.7.2.0)
128
128
  ast (~> 2.4.1)
129
129
  rack (2.2.3)
@@ -157,28 +157,28 @@ GEM
157
157
  thor (>= 0.20.3, < 2.0)
158
158
  rainbow (3.0.0)
159
159
  rake (13.0.1)
160
- regexp_parser (1.8.2)
160
+ regexp_parser (2.0.0)
161
161
  rexml (3.2.4)
162
- rubocop (1.3.1)
162
+ rubocop (1.6.1)
163
163
  parallel (~> 1.10)
164
164
  parser (>= 2.7.1.5)
165
165
  rainbow (>= 2.2.2, < 4.0)
166
- regexp_parser (>= 1.8)
166
+ regexp_parser (>= 1.8, < 3.0)
167
167
  rexml
168
- rubocop-ast (>= 1.1.1)
168
+ rubocop-ast (>= 1.2.0, < 2.0)
169
169
  ruby-progressbar (~> 1.7)
170
170
  unicode-display_width (>= 1.4.0, < 2.0)
171
- rubocop-ast (1.1.1)
171
+ rubocop-ast (1.3.0)
172
172
  parser (>= 2.7.1.5)
173
173
  rubocop-minitest (0.10.1)
174
174
  rubocop (>= 0.87)
175
- rubocop-performance (1.8.1)
176
- rubocop (>= 0.87.0)
175
+ rubocop-performance (1.9.1)
176
+ rubocop (>= 0.90.0, < 2.0)
177
177
  rubocop-ast (>= 0.4.0)
178
- rubocop-rails (2.8.1)
178
+ rubocop-rails (2.9.0)
179
179
  activesupport (>= 4.2.0)
180
180
  rack (>= 1.1)
181
- rubocop (>= 0.87.0)
181
+ rubocop (>= 0.90.0, < 2.0)
182
182
  ruby-progressbar (1.10.1)
183
183
  ruby_parser (3.15.0)
184
184
  sexp_processor (~> 4.9)
@@ -186,10 +186,12 @@ GEM
186
186
  simple_form (5.0.3)
187
187
  actionpack (>= 5.0)
188
188
  activemodel (>= 5.0)
189
- simplecov (0.19.1)
189
+ simplecov (0.20.0)
190
190
  docile (~> 1.1)
191
191
  simplecov-html (~> 0.11)
192
+ simplecov_json_formatter (~> 0.1)
192
193
  simplecov-html (0.12.3)
194
+ simplecov_json_formatter (0.1.2)
193
195
  sprockets (4.0.2)
194
196
  concurrent-ruby (~> 1.0)
195
197
  rack (> 1, < 3)
@@ -212,7 +214,7 @@ GEM
212
214
  will_paginate (3.1.8)
213
215
  will_paginate-bootstrap4 (0.2.2)
214
216
  will_paginate (~> 3.0, >= 3.0.0)
215
- zeitwerk (2.4.1)
217
+ zeitwerk (2.4.2)
216
218
 
217
219
  PLATFORMS
218
220
  ruby
@@ -227,6 +229,7 @@ DEPENDENCIES
227
229
  minitest
228
230
  overcommit
229
231
  rubocop
232
+ rubocop-ast
230
233
  rubocop-minitest
231
234
  rubocop-performance
232
235
  rubocop-rails
data/README.md CHANGED
@@ -19,7 +19,11 @@ Ui Bibz load [Bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fon
19
19
 
20
20
  ## Documentation
21
21
  Full documentation is here with bootstrap 5:
22
- [Ui Bibz v3](http://hummel.link/Ui-Bibz/)
22
+ [Ui Bibz v3](http://hummel.link/ui-bibz/)
23
23
 
24
24
  Older documentation is here with bootstrap 4:
25
25
  [Ui Bibz v2.5](http://hummel.link/Ui-Bibz/docs/v2.5/)
26
+
27
+
28
+ ## Donate
29
+ ![Liberapay](https://img.shields.io/liberapay/patrons/Thomas.svg?logo=liberapay)
@@ -110,7 +110,7 @@ module UiBibz::Concerns::Models::Searchable
110
110
  search_patterns = @tmp_params[:search].strip.gsub(/(?<=[\\s])\\s*|^\\s+|\\s+$/, '').downcase
111
111
 
112
112
  search_patterns_tmp = search_patterns.scan(/"(.*?)"/).flatten
113
- search_patterns = search_patterns.gsub(/"(.*?)"/, '').split(' ')
113
+ search_patterns = search_patterns.gsub(/"(.*?)"/, '').split
114
114
  search_patterns << search_patterns_tmp
115
115
 
116
116
  search_patterns.flatten.each_with_index do |pattern, i|
@@ -3,15 +3,15 @@
3
3
  module UiBibz
4
4
  NAME = 'Ui Bibz'
5
5
  SLUG = 'ui_bibz'
6
- BOOTSTRAP_VERSION = '5.0.0.alpha3'
6
+ BOOTSTRAP_VERSION = '5.0.0.beta1'
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
10
  FONTAWESOME_VERSION = '5.15.1'
11
- HOMEPAGE = 'http://thooams.github.io/Ui-Bibz/'
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
- AUTHOR = 'Thooams'
15
- VERSION = '3.0.0.alpha9'
14
+ AUTHOR = 'Thooams [Thomas HUMMEL]'
15
+ VERSION = '3.0.0.beta2'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -7,7 +7,7 @@ module UiBibzInputs
7
7
  def input(wrapper_options)
8
8
  unless string?
9
9
  input_html_classes.unshift('string')
10
- input_html_options[:type] ||= input_type if html5?
10
+ # input_html_options[:type] ||= input_type if html5?
11
11
  end
12
12
 
13
13
  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
@@ -6,11 +6,17 @@ module UiBibz::Ui::Concerns::HtmlConcern #:nodoc:
6
6
  included do
7
7
  def html(content = nil, &block)
8
8
  if block.nil?
9
- @items << content
9
+ @items << RenderString.new(content)
10
10
  else
11
11
  context = eval('self', block.binding) # rubocop:disable Style/EvalWithLocation
12
- @items << context.capture(&block)
12
+ @items << RenderString.new(context.capture(&block))
13
13
  end
14
14
  end
15
15
  end
16
16
  end
17
+
18
+ class RenderString < SimpleDelegator
19
+ def render
20
+ self
21
+ end
22
+ end
@@ -46,7 +46,7 @@ module UiBibz::Ui::Core::Boxes::Components
46
46
  # Render html tag
47
47
  def pre_render
48
48
  if options[:collapse]
49
- content_tag :div, class: join_classes('collapse', show), id: options[:collapse], "data-parent": "##{options[:parent_collapse]}" do
49
+ content_tag :div, class: join_classes('collapse', show), id: options[:collapse], "data-bs-parent": "##{options[:parent_collapse]}" do
50
50
  content_tag :div, @items.join.html_safe, html_options
51
51
  end
52
52
  else
@@ -83,8 +83,8 @@ module UiBibz::Ui::Core::Forms::Buttons
83
83
  def collapse
84
84
  # Must be flat hash not deep hash
85
85
  {
86
- "data-toggle": :collapse,
87
- "data-target": "##{options[:collapse]}",
86
+ "data-bs-toggle": :collapse,
87
+ "data-bs-target": "##{options[:collapse]}",
88
88
  "aria-controls": options[:collapse],
89
89
  "aria-expanded": options[:expand_collapse].nil? ? false : options[:expand_collapse]
90
90
  }
@@ -99,7 +99,7 @@ module UiBibz::Ui::Core::Forms::Buttons
99
99
  end
100
100
 
101
101
  def toggle
102
- { 'data-toggle' => 'button', 'aria-pressed' => false, 'autocomplete' => 'off' }
102
+ { 'data-bs-toggle' => 'button', 'aria-pressed' => false, 'autocomplete' => 'off' }
103
103
  end
104
104
 
105
105
  def active_html_options
@@ -121,7 +121,7 @@ module UiBibz::Ui::Core::Forms::Buttons
121
121
  end
122
122
 
123
123
  def spinner_html
124
- opts = { size: :sm, tag: :span, class: options[:text] == false ? nil : 'mr-2' }
124
+ opts = { size: :sm, tag: :span, class: options[:text] == false ? nil : 'me-2' }
125
125
  opts = opts.merge(options[:spinner]) if options[:spinner].is_a? Hash
126
126
 
127
127
  UiBibz::Ui::Core::Notifications::Spinner.new(nil, opts).render
@@ -62,7 +62,7 @@ module UiBibz::Ui::Core::Forms::Buttons
62
62
  def button_link_html_tag
63
63
  link_to link_url, html_options do
64
64
  concat spinner_html unless options[:spinner].nil?
65
- concat glyph_and_content_html(options[:text].nil? ? @content : '')
65
+ concat glyph_and_content_html(@content)
66
66
  concat badge_html unless options[:badge].nil?
67
67
  end
68
68
  end
@@ -78,7 +78,7 @@ module UiBibz::Ui::Core::Forms::Buttons
78
78
  def collapse
79
79
  # Must be flat hash not deep hash
80
80
  {
81
- "data-toggle": :collapse,
81
+ "data-bs-toggle": :collapse,
82
82
  "aria-controls": options[:collapse],
83
83
  "aria-expanded": options[:expand_collaspe].nil? ? false : options[:expand_collaspe]
84
84
  }
@@ -21,16 +21,18 @@ module UiBibz::Ui::Core::Forms::Dropdowns
21
21
  # * +status+ - status of element with symbol value:
22
22
  # (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
23
23
  # * +size+
24
+ # * +open+ - Boolean
24
25
  # (+:xs+, +:sm+, +:lg+)
25
26
  # * +glyph+ - Add glyph with name or hash options
26
27
  # * +name+ - String
27
28
  # * +size+ - Integer
28
29
  # * +type+ - Symbol
29
30
  # * +html_button+ - Hash
31
+ # * +theme+ - Symbol, defaut: +:dark+
30
32
  # * +position+ - Symbol
31
33
  # (+:up+, +:right+, +:down+, +:left+)
32
- # * +alignment+ - Symbol
33
- # (+:right)
34
+ # * +alignment+ - Symbol/Hash - eq. { direction: :start, size: :lg }
35
+ # (+:left+, +:right+, +:start+, +:end+)
34
36
  #
35
37
  # ==== Signatures
36
38
  #
@@ -111,15 +113,15 @@ module UiBibz::Ui::Core::Forms::Dropdowns
111
113
  end
112
114
 
113
115
  def button_content
114
- glyph_and_content_html(options[:text].nil? ? @content : '').html_safe
116
+ glyph_and_content_html(@content)
115
117
  end
116
118
 
117
119
  def button_html
118
120
  html_button = options[:html_button] || {}
119
121
  if options[:tag] == :a
120
- content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), role: 'button', 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, 'id' => id }.merge(html_button)
122
+ content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), role: 'button', 'data-bs-toggle' => 'dropdown', 'aria-expanded' => false, 'id' => id }.merge(html_button)
121
123
  else
122
- content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), type: 'button', 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, 'id' => id }.merge(html_button)
124
+ content_tag dropdown_tag, button_content, { class: join_classes('btn', button_status, state, size, 'dropdown-toggle'), type: 'button', 'data-bs-toggle' => 'dropdown', 'aria-expanded' => false, 'id' => id }.merge(html_button)
123
125
  end
124
126
  end
125
127
 
@@ -132,11 +134,17 @@ module UiBibz::Ui::Core::Forms::Dropdowns
132
134
  end
133
135
 
134
136
  def alignment
135
- "dropdown-menu-#{@options[:alignment]}" unless @options[:alignment].nil?
137
+ return nil if @options[:alignment].nil?
138
+
139
+ if @options[:alignment].is_a? Hash
140
+ ['dropdown-menu', @options[:alignment][:size], match_direction[@options[:alignment][:direction]]].join('-')
141
+ else
142
+ "dropdown-menu-#{match_direction[@options[:alignment]]}"
143
+ end
136
144
  end
137
145
 
138
146
  def position
139
- "drop#{@options[:position] || 'down'}"
147
+ "drop#{match_direction[@options[:position] || :down]}"
140
148
  end
141
149
 
142
150
  def open
@@ -171,5 +179,17 @@ module UiBibz::Ui::Core::Forms::Dropdowns
171
179
  def theme
172
180
  'dropdown-menu-dark' if @options[:theme]
173
181
  end
182
+
183
+ # Match end and start directions
184
+ def match_direction
185
+ {
186
+ up: 'up',
187
+ right: 'end',
188
+ down: 'down',
189
+ left: 'start',
190
+ start: 'start',
191
+ end: 'end'
192
+ }.with_indifferent_access
193
+ end
174
194
  end
175
195
  end
@@ -78,7 +78,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
78
78
 
79
79
  def split_html
80
80
  content_tag :button, split_content, class: split_classes, type: 'button',
81
- 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false
81
+ 'data-bs-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false
82
82
  end
83
83
 
84
84
  def split_content
@@ -53,7 +53,7 @@ module UiBibz::Ui::Core::Forms::Numbers
53
53
  sf.text_field formula_field_name, nil, text_field_formula_html_options
54
54
  sf.addon '=', class: 'formula-field-sign'
55
55
  sf.text_field content, nil, text_field_input_html_options
56
- sf.addon formula_field_alert_glyph, { class: 'formula-field-alert' }, { data: { toggle: 'tooltip' } }
56
+ sf.addon formula_field_alert_glyph, { class: 'formula-field-alert' }, { data: { "bs-toggle": 'tooltip' } }
57
57
  sf.addon @options[:prepend] unless @options[:prepend].nil?
58
58
  end.render
59
59
  end
@@ -52,14 +52,14 @@ module UiBibz::Ui::Core::Forms::Numbers
52
52
 
53
53
  def header_min
54
54
  content_tag :div, class: 'slider-header-min' do
55
- concat content_tag :label, options[:label_min] || 'Min: '
55
+ concat content_tag :label, options[:label_min] || 'Min: ', for: options[:label_for_min]
56
56
  concat content_tag :span, options[:thumb_min], "data-unit": options[:unit] || options[:unit_min]
57
57
  end
58
58
  end
59
59
 
60
60
  def header_max
61
61
  content_tag :div, class: 'slider-header-max' do
62
- concat content_tag :label, options[:label_max] || 'Max: '
62
+ concat content_tag :label, options[:label_max] || 'Max: ', for: options[:label_for_max]
63
63
  concat content_tag :span, options[:thumb_max], "data-unit": options[:unit] || options[:unit_max]
64
64
  end
65
65
  end
@@ -25,7 +25,13 @@ module UiBibz::Ui::Core::Forms::Selects
25
25
  # * +searchable+ - Boolean
26
26
  # * +select_all_option+ - Boolean
27
27
  # * +append+ - String, Html
28
+ # * +open+ - Boolean
29
+ # * +theme+ - Symbol, defaut: +:dark+
28
30
  # * +prepend+ - String, Html
31
+ # * +position+ - Symbol
32
+ # (+:up+, +:right+, +:down+, +:left+)
33
+ # * +alignment+ - Symbol
34
+ # (+:right)
29
35
  # * +connect+ - Hash
30
36
  # * +event+ - String
31
37
  # * +mode+ - String
@@ -69,7 +75,7 @@ module UiBibz::Ui::Core::Forms::Selects
69
75
  end
70
76
 
71
77
  def component_html_classes
72
- [size, type, button_status, 'multi-select-field']
78
+ [open, size, type, button_status, 'multi-select-field']
73
79
  end
74
80
 
75
81
  def component_html_data
@@ -79,6 +85,8 @@ module UiBibz::Ui::Core::Forms::Selects
79
85
  searchable
80
86
  select_all_options
81
87
  number_displayed
88
+ dropdown_menu_classes
89
+ dropdown_classes
82
90
  end
83
91
 
84
92
  def clickable_opt_group
@@ -101,6 +109,32 @@ module UiBibz::Ui::Core::Forms::Selects
101
109
  add_html_data('include_select_all_option') if options[:select_all_options]
102
110
  end
103
111
 
112
+ def dropdown_menu_classes
113
+ classes = join_classes(theme, alignment, open)
114
+ add_html_data('dropdown_menu_classes', value: classes.nil? ? nil : classes.join(' '))
115
+ end
116
+
117
+ def dropdown_classes
118
+ classes = join_classes(position, open)
119
+ add_html_data('dropdown_classes', value: classes.nil? ? nil : classes.join(' '))
120
+ end
121
+
122
+ def position
123
+ "drop#{@options[:position] || 'down'}"
124
+ end
125
+
126
+ def theme
127
+ 'dropdown-menu-dark' if @options[:theme]
128
+ end
129
+
130
+ def open
131
+ 'show' if @options[:open]
132
+ end
133
+
134
+ def alignment
135
+ "dropdown-menu-#{@options[:alignment]}" unless @options[:alignment].nil?
136
+ end
137
+
104
138
  def type
105
139
  'btn-block' if options[:type] == :block
106
140
  end
@@ -117,9 +151,5 @@ module UiBibz::Ui::Core::Forms::Selects
117
151
  def outline
118
152
  'outline' if options[:outline]
119
153
  end
120
-
121
- def theme
122
- 'dropdown-menu-dark' if @options[:theme]
123
- end
124
154
  end
125
155
  end
@@ -1,11 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UiBibz::Ui::Core::Forms::Surrounds
4
- class SurroundButton < UiBibz::Ui::Core::Forms::Buttons::Button
5
- # See UiBibz::Ui::Core::Dropdown.initialize
6
-
7
- def pre_render
8
- button_html_tag
9
- end
10
- end
4
+ class SurroundButton < UiBibz::Ui::Core::Forms::Buttons::Button; end
11
5
  end