ui_bibz 3.0.0.alpha10 → 3.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +8 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.github/workflows/ci.yml +28 -0
  5. data/Gemfile.lock +35 -30
  6. data/README.md +3 -4
  7. data/lib/ui_bibz/concerns/models/searchable.rb +1 -1
  8. data/lib/ui_bibz/infos.rb +3 -3
  9. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_text_field_input.rb +1 -1
  10. data/lib/ui_bibz/ui/concerns/html_concern.rb +8 -2
  11. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +1 -1
  12. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +4 -4
  13. data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +1 -1
  14. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +26 -6
  15. data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +1 -1
  16. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +1 -1
  17. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +35 -5
  18. data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
  19. data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
  20. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
  21. data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -1
  22. data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +1 -1
  23. data/lib/ui_bibz/ui/core/navigations/link.rb +1 -1
  24. data/lib/ui_bibz/ui/core/navigations/nav.rb +1 -1
  25. data/lib/ui_bibz/ui/core/navigations/navbar.rb +2 -2
  26. data/lib/ui_bibz/ui/core/navigations/toolbar.rb +1 -1
  27. data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +1 -1
  28. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +5 -5
  29. data/lib/ui_bibz/ui/core/notifications/toast.rb +1 -1
  30. data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -1
  31. data/lib/ui_bibz/ui/core/windows/modal.rb +2 -2
  32. data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +6 -6
  33. data/test/simple_form_test.rb +4 -4
  34. data/test/ui/core/boxes/card_test.rb +1 -1
  35. data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
  36. data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
  37. data/test/ui/core/forms/buttons/button_test.rb +6 -6
  38. data/test/ui/core/forms/dropdowns/dropdown_test.rb +5 -5
  39. data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
  40. data/test/ui/core/forms/selects/multi_select_field_test.rb +3 -3
  41. data/test/ui/core/forms/surrounds/surround_field_test.rb +2 -2
  42. data/test/ui/core/lists/list_group_test.rb +1 -1
  43. data/test/ui/core/navigations/link_test.rb +1 -1
  44. data/test/ui/core/navigations/nav_test.rb +2 -2
  45. data/test/ui/core/navigations/navbar_test.rb +4 -4
  46. data/test/ui/core/navigations/tab_group_test.rb +5 -5
  47. data/test/ui/core/navigations/toolbar_test.rb +1 -1
  48. data/test/ui/core/notifications/alert_test.rb +1 -1
  49. data/test/ui/core/notifications/spinner_test.rb +1 -1
  50. data/test/ui/core/notifications/toast_test.rb +1 -1
  51. data/test/ui/core/windows/modal_test.rb +2 -2
  52. data/test/ui/ux/containers/panel_test.rb +4 -4
  53. data/ui_bibz.gemspec +2 -1
  54. metadata +21 -6
  55. data/.github/workflows/ruby.yml +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63c95abb3d6e510f893aaa054080dc4e4b3012fd0a071cd0828a8d2333a0d20d
4
- data.tar.gz: 5c13dccaeea9254bd66d0c0a778b3ee18764973438a0668b74f9a56b9b093f10
3
+ metadata.gz: efe8b08b80f4ee4b0ab28e1956134dea1530d71ff1bfe0d6d1b6e3800d839bce
4
+ data.tar.gz: 7970efb91f6a676dc012753c8cc79e39ae4514db97818ac1394f55b37e729a99
5
5
  SHA512:
6
- metadata.gz: a138d91759572dec4f047dd5fb7dacd4ea517fffefaca70e73c92aba4fc96a1e799c4e11c8c4ad9420f19e6d9ca0d32a714a9d4ced4ddacac0e8c3368ccafe8c
7
- data.tar.gz: 380361211a36fbf4cccfff82512233dcd05e84f20949bdf28e5808a53ea16626a1fafd5e8c020d8130307e3ecc3937e0c1e375ac5d91d58acf07cb0d66baaf4b
6
+ metadata.gz: a24bc17b0a2afcfbec5a89a058920e411aaa8c7e014b9f3604880a659f813ced5431e96a975da9d32d43500508e18b19531aaf1caccefea0ecade3fa24df0e94
7
+ data.tar.gz: 512a44e10d6944881806b3ccf697715f0c9fabf240338813ccea5a54b4a9299a52304cc097e6c90658644a28e7355e3449e775b54d95ffc343e3b3eb55395ac4
@@ -0,0 +1,8 @@
1
+ version: "2"
2
+ plugins:
3
+ brakeman:
4
+ enabled: true
5
+ bundler-audit:
6
+ enabled: true
7
+ rubocop:
8
+ enabled: true
@@ -2,3 +2,4 @@
2
2
 
3
3
  github: thooams
4
4
  patreon: user?u=8672183
5
+ liberapay: thooams
@@ -0,0 +1,28 @@
1
+ name: CI
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+
13
+ - name: Set up Ruby with .ruby-version file
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ bundler-cache: true
17
+
18
+ - name: Install gems
19
+ run: |
20
+ gem install bundler
21
+ bundle install --jobs 4 --retry 3
22
+
23
+ - name: Test with Rake
24
+ uses: paambaati/codeclimate-action@v2.7.5
25
+ env:
26
+ CC_TEST_REPORTER_ID: 95196f8dbe3406321c6e7b406585532102784f0a3d4141a25f53937eedb844b6
27
+ with:
28
+ coverageCommand: bundle exec rake
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.alpha10)
5
- rails (~> 6.0.3, >= 6.0.3.2)
4
+ ui_bibz (3.0.0.beta3)
6
5
  will-paginate-i18n
7
6
  will_paginate (~> 3.1.0)
8
7
  will_paginate-bootstrap4
@@ -74,7 +73,7 @@ GEM
74
73
  simplecov
75
74
  concurrent-ruby (1.1.7)
76
75
  crass (1.0.6)
77
- docile (1.3.2)
76
+ docile (1.3.4)
78
77
  erubi (1.10.0)
79
78
  erubis (2.7.0)
80
79
  factory_bot (4.11.1)
@@ -84,7 +83,7 @@ GEM
84
83
  railties (>= 3.0.0)
85
84
  globalid (0.4.2)
86
85
  activesupport (>= 4.2.0)
87
- haml (5.2.0)
86
+ haml (5.2.1)
88
87
  temple (>= 0.8.0)
89
88
  tilt
90
89
  haml-rails (2.0.1)
@@ -98,14 +97,14 @@ GEM
98
97
  haml (>= 4.0, < 6)
99
98
  nokogiri (>= 1.6.0)
100
99
  ruby_parser (~> 3.5)
101
- i18n (1.8.5)
100
+ i18n (1.8.7)
102
101
  concurrent-ruby (~> 1.0)
103
102
  iniparse (1.5.0)
104
103
  jquery-rails (4.4.0)
105
104
  rails-dom-testing (>= 1, < 3)
106
105
  railties (>= 4.2.0)
107
106
  thor (>= 0.14, < 2.0)
108
- loofah (2.7.0)
107
+ loofah (2.8.0)
109
108
  crass (~> 1.0.2)
110
109
  nokogiri (>= 1.5.9)
111
110
  mail (2.7.1)
@@ -115,17 +114,19 @@ GEM
115
114
  method_source (1.0.0)
116
115
  mimemagic (0.3.5)
117
116
  mini_mime (1.0.2)
118
- mini_portile2 (2.4.0)
119
- minitest (5.14.2)
117
+ mini_portile2 (2.5.0)
118
+ minitest (5.14.3)
120
119
  nio4r (2.5.4)
121
- nokogiri (1.10.10)
122
- mini_portile2 (~> 2.4.0)
120
+ nokogiri (1.11.1)
121
+ mini_portile2 (~> 2.5.0)
122
+ racc (~> 1.4)
123
123
  overcommit (0.57.0)
124
124
  childprocess (>= 0.6.3, < 5)
125
125
  iniparse (~> 1.4)
126
- parallel (1.20.0)
127
- parser (2.7.2.0)
126
+ parallel (1.20.1)
127
+ parser (3.0.0.0)
128
128
  ast (~> 2.4.1)
129
+ racc (1.5.2)
129
130
  rack (2.2.3)
130
131
  rack-test (1.1.0)
131
132
  rack (>= 1.0, < 3)
@@ -156,40 +157,42 @@ GEM
156
157
  rake (>= 0.8.7)
157
158
  thor (>= 0.20.3, < 2.0)
158
159
  rainbow (3.0.0)
159
- rake (13.0.1)
160
- regexp_parser (1.8.2)
160
+ rake (13.0.3)
161
+ regexp_parser (2.0.3)
161
162
  rexml (3.2.4)
162
- rubocop (1.3.1)
163
+ rubocop (1.8.0)
163
164
  parallel (~> 1.10)
164
- parser (>= 2.7.1.5)
165
+ parser (>= 3.0.0.0)
165
166
  rainbow (>= 2.2.2, < 4.0)
166
- regexp_parser (>= 1.8)
167
+ regexp_parser (>= 1.8, < 3.0)
167
168
  rexml
168
- rubocop-ast (>= 1.1.1)
169
+ rubocop-ast (>= 1.2.0, < 2.0)
169
170
  ruby-progressbar (~> 1.7)
170
- unicode-display_width (>= 1.4.0, < 2.0)
171
- rubocop-ast (1.1.1)
171
+ unicode-display_width (>= 1.4.0, < 3.0)
172
+ rubocop-ast (1.4.0)
172
173
  parser (>= 2.7.1.5)
173
- rubocop-minitest (0.10.1)
174
- rubocop (>= 0.87)
175
- rubocop-performance (1.9.0)
174
+ rubocop-minitest (0.10.2)
175
+ rubocop (>= 0.87, < 2.0)
176
+ rubocop-performance (1.9.2)
176
177
  rubocop (>= 0.90.0, < 2.0)
177
178
  rubocop-ast (>= 0.4.0)
178
- rubocop-rails (2.8.1)
179
+ rubocop-rails (2.9.1)
179
180
  activesupport (>= 4.2.0)
180
181
  rack (>= 1.1)
181
- rubocop (>= 0.87.0)
182
- ruby-progressbar (1.10.1)
182
+ rubocop (>= 0.90.0, < 2.0)
183
+ ruby-progressbar (1.11.0)
183
184
  ruby_parser (3.15.0)
184
185
  sexp_processor (~> 4.9)
185
186
  sexp_processor (4.15.1)
186
187
  simple_form (5.0.3)
187
188
  actionpack (>= 5.0)
188
189
  activemodel (>= 5.0)
189
- simplecov (0.19.1)
190
+ simplecov (0.21.1)
190
191
  docile (~> 1.1)
191
192
  simplecov-html (~> 0.11)
193
+ simplecov_json_formatter (~> 0.1)
192
194
  simplecov-html (0.12.3)
195
+ simplecov_json_formatter (0.1.2)
193
196
  sprockets (4.0.2)
194
197
  concurrent-ruby (~> 1.0)
195
198
  rack (> 1, < 3)
@@ -202,9 +205,9 @@ GEM
202
205
  thor (1.0.1)
203
206
  thread_safe (0.3.6)
204
207
  tilt (2.0.10)
205
- tzinfo (1.2.8)
208
+ tzinfo (1.2.9)
206
209
  thread_safe (~> 0.1)
207
- unicode-display_width (1.7.0)
210
+ unicode-display_width (2.0.0)
208
211
  websocket-driver (0.7.3)
209
212
  websocket-extensions (>= 0.1.0)
210
213
  websocket-extensions (0.1.5)
@@ -212,7 +215,7 @@ GEM
212
215
  will_paginate (3.1.8)
213
216
  will_paginate-bootstrap4 (0.2.2)
214
217
  will_paginate (~> 3.0, >= 3.0.0)
215
- zeitwerk (2.4.1)
218
+ zeitwerk (2.4.2)
216
219
 
217
220
  PLATFORMS
218
221
  ruby
@@ -226,7 +229,9 @@ DEPENDENCIES
226
229
  jquery-rails (>= 3.1.0)
227
230
  minitest
228
231
  overcommit
232
+ rails (~> 6.0.3, >= 6.0.3.2)
229
233
  rubocop
234
+ rubocop-ast
230
235
  rubocop-minitest
231
236
  rubocop-performance
232
237
  rubocop-rails
data/README.md CHANGED
@@ -1,12 +1,11 @@
1
1
  ![Ui Bibz logo](https://repository-images.githubusercontent.com/29547689/e29b2180-0d59-11eb-89f3-4541571d7c67)
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/ui_bibz.svg)](http://badge.fury.io/rb/ui_bibz)
4
- [![Build Status](https://travis-ci.org/thooams/Ui-Bibz.svg)](https://travis-ci.org/thooams/Ui-Bibz)
3
+ [![Gem Version](https://badge.fury.io/rb/ui_bibz.svg)](https://badge.fury.io/rb/ui_bibz)
5
4
  [![Code Climate](https://codeclimate.com/github/thooams/Ui-Bibz/badges/gpa.svg)](https://codeclimate.com/github/thooams/Ui-Bibz)
6
5
  [![Test Coverage](https://codeclimate.com/github/thooams/Ui-Bibz/badges/coverage.svg)](https://codeclimate.com/github/thooams/Ui-Bibz)
7
6
  [![Inline docs](http://inch-ci.org/github/thooams/Ui-Bibz.svg?branch=master)](http://inch-ci.org/github/thooams/Ui-Bibz)
8
7
  [![security](https://hakiri.io/github/thooams/Ui-Bibz/master.svg)](https://hakiri.io/github/thooams/Ui-Bibz/master)
9
- ![Ruby](https://github.com/thooams/Ui-Bibz/workflows/Ruby/badge.svg)
8
+ ![Ci](https://github.com/thooams/Ui-Bibz/workflows/CI/badge.svg)
10
9
 
11
10
  This project rocks and uses MIT-LICENSE.
12
11
 
@@ -19,7 +18,7 @@ Ui Bibz load [Bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fon
19
18
 
20
19
  ## Documentation
21
20
  Full documentation is here with bootstrap 5:
22
- [Ui Bibz v3](http://hummel.link/Ui-Bibz/)
21
+ [Ui Bibz v3](http://hummel.link/ui-bibz/)
23
22
 
24
23
  Older documentation is here with bootstrap 4:
25
24
  [Ui Bibz v2.5](http://hummel.link/Ui-Bibz/docs/v2.5/)
@@ -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
11
  HOMEPAGE = 'https://hummel.link/ui-bibz/'
12
- REPO = 'git+https://github.com/thooams/Ui-Bibz.git'
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.alpha10'
15
+ VERSION = '3.0.0.beta3'
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
@@ -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
  #
@@ -117,9 +119,9 @@ module UiBibz::Ui::Core::Forms::Dropdowns
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
@@ -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