ui_bibz 3.0.0.alpha5 → 3.0.0.alpha11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -9
  3. data/README.md +4 -0
  4. data/lib/ui_bibz/concerns/models/searchable.rb +1 -1
  5. data/lib/ui_bibz/infos.rb +4 -4
  6. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb +1 -1
  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 +3 -3
  9. data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +5 -1
  10. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +3 -12
  11. data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +1 -2
  12. data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -1
  13. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +7 -1
  14. data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +7 -1
  15. data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +4 -0
  16. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +6 -6
  17. data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +1 -1
  18. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +2 -0
  19. data/lib/ui_bibz/ui/core/forms/numbers/range_field.rb +19 -1
  20. data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +13 -1
  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 +29 -5
  23. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -9
  24. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -9
  25. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +5 -4
  26. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +3 -8
  27. data/lib/ui_bibz/ui/core/icons/glyph.rb +9 -1
  28. data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
  29. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
  30. data/lib/ui_bibz/ui/core/navigations/nav.rb +3 -3
  31. data/lib/ui_bibz/ui/core/navigations/navbar.rb +6 -4
  32. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +5 -1
  33. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +15 -1
  34. data/lib/ui_bibz/ui/core/windows/modal.rb +6 -2
  35. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +11 -24
  36. data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +1 -1
  37. data/lib/ui_bibz/ui/extensions/core/forms/surround_extension.rb +1 -1
  38. data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +3 -2
  39. data/lib/ui_bibz/ui/ux/containers/components/panel_header_title.rb +47 -0
  40. data/lib/ui_bibz/ui/ux/tables/table_pagination_per_page.rb +3 -3
  41. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +4 -4
  42. data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +14 -6
  43. data/lib/ui_bibz/utils/internationalization.rb +1 -1
  44. data/test/simple_form_test.rb +4 -4
  45. data/test/ui/core/boxes/card_test.rb +2 -2
  46. data/test/ui/core/component_test.rb +2 -2
  47. data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
  48. data/test/ui/core/forms/buttons/button_link_test.rb +1 -8
  49. data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
  50. data/test/ui/core/forms/buttons/button_test.rb +2 -9
  51. data/test/ui/core/forms/choices/checkbox_field_test.rb +2 -2
  52. data/test/ui/core/forms/choices/choice_group_test.rb +3 -3
  53. data/test/ui/core/forms/choices/radio_field_test.rb +1 -1
  54. data/test/ui/core/forms/dropdowns/dropdown_test.rb +2 -2
  55. data/test/ui/core/forms/numbers/range_field_test.rb +14 -0
  56. data/test/ui/core/forms/numbers/slider_field_test.rb +2 -2
  57. data/test/ui/core/forms/selects/multi_select_field_test.rb +3 -3
  58. data/test/ui/core/forms/selects/select_field_test.rb +1 -1
  59. data/test/ui/core/forms/surrounds/surround_field_test.rb +27 -3
  60. data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
  61. data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
  62. data/test/ui/core/navigations/link_test.rb +1 -1
  63. data/test/ui/core/navigations/nav_test.rb +2 -2
  64. data/test/ui/core/navigations/navbar_test.rb +2 -4
  65. data/test/ui/core/navigations/tab_group_test.rb +5 -5
  66. data/test/ui/core/notifications/alert_test.rb +1 -1
  67. data/test/ui/core/notifications/badge_test.rb +2 -2
  68. data/test/ui/utils/breakdown_class_name_generator_test.rb +14 -0
  69. data/test/ui/ux/containers/panel_test.rb +1 -1
  70. data/test/ui/ux/tables/table_test.rb +2 -2
  71. data/ui_bibz.gemspec +1 -1
  72. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: daf6fae8ebb33a996aababffe959f600d9cce3c84554a9574d54f8623bc12d8e
4
- data.tar.gz: 5f3aa30344b85d267698918a1dc63bbbc8a220fef61395e5f9ca141666175c82
3
+ metadata.gz: 14f3630b3e813fbac60b0a3e5a7651a09a507dd3dee4a0e252288a7baa3728e2
4
+ data.tar.gz: b9baafb65a65cc12b9e1d57c4fec819f01a6b36cd1e6865c9d26a4a8a5fac155
5
5
  SHA512:
6
- metadata.gz: b9fecae8a62e153525d66d32626d01be6cb28ae0fb777ccc99ff14fabcbf3cb802c84c6095acef8da1232b2d02508e7199d28102b12dae75f09a7d7acd1e5482
7
- data.tar.gz: 4c20b4a4117f93a2539a6121b6b86471585c10eac3df4aeaf51c0521224a1ffa70de65447559413b5ab2503f3cab07027a497ddf7f253d2c90012d43362a24ba
6
+ metadata.gz: 890d5d75f44d9e31753f5928ffac99386adbf43ed95ad0cc452edf6b492aa3e6cc5de07186c62923ac091de30b759c191872b62d76eebffbf50c5630f7317297
7
+ data.tar.gz: 41bf57292c76239790786809649dd5d8bb83220b20789976b1af1c4d5332f210335448de36dce170d3610c86c93529af3816c352b57ba9f9ec73d7de95afa561
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ui_bibz (3.0.0.alpha5)
4
+ ui_bibz (3.0.0.alpha11)
5
5
  rails (~> 6.0.3, >= 6.0.3.2)
6
6
  will-paginate-i18n
7
7
  will_paginate (~> 3.1.0)
@@ -75,7 +75,7 @@ GEM
75
75
  concurrent-ruby (1.1.7)
76
76
  crass (1.0.6)
77
77
  docile (1.3.2)
78
- erubi (1.9.0)
78
+ erubi (1.10.0)
79
79
  erubis (2.7.0)
80
80
  factory_bot (4.11.1)
81
81
  activesupport (>= 3.0.0)
@@ -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.19.2)
126
+ parallel (1.20.1)
127
127
  parser (2.7.2.0)
128
128
  ast (~> 2.4.1)
129
129
  rack (2.2.3)
@@ -159,21 +159,21 @@ GEM
159
159
  rake (13.0.1)
160
160
  regexp_parser (1.8.2)
161
161
  rexml (3.2.4)
162
- rubocop (1.0.0)
162
+ rubocop (1.4.2)
163
163
  parallel (~> 1.10)
164
164
  parser (>= 2.7.1.5)
165
165
  rainbow (>= 2.2.2, < 4.0)
166
166
  regexp_parser (>= 1.8)
167
167
  rexml
168
- rubocop-ast (>= 0.6.0)
168
+ rubocop-ast (>= 1.1.1)
169
169
  ruby-progressbar (~> 1.7)
170
170
  unicode-display_width (>= 1.4.0, < 2.0)
171
- rubocop-ast (1.1.0)
171
+ rubocop-ast (1.2.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.0)
176
+ rubocop (>= 0.90.0, < 2.0)
177
177
  rubocop-ast (>= 0.4.0)
178
178
  rubocop-rails (2.8.1)
179
179
  activesupport (>= 4.2.0)
@@ -202,7 +202,7 @@ GEM
202
202
  thor (1.0.1)
203
203
  thread_safe (0.3.6)
204
204
  tilt (2.0.10)
205
- tzinfo (1.2.7)
205
+ tzinfo (1.2.8)
206
206
  thread_safe (~> 0.1)
207
207
  unicode-display_width (1.7.0)
208
208
  websocket-driver (0.7.3)
data/README.md CHANGED
@@ -23,3 +23,7 @@ Full documentation is here with bootstrap 5:
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.alpha2'
6
+ BOOTSTRAP_VERSION = '5.0.0.alpha3'
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.alpha5'
14
+ AUTHOR = 'Thooams [Thomas HUMMEL]'
15
+ VERSION = '3.0.0.alpha11'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -4,7 +4,7 @@ module UiBibzInputs
4
4
  class UiCheckboxFieldInput < BaseInput
5
5
  include UiBibz::Ui::Core::Forms::Choices
6
6
 
7
- def label
7
+ def label(_wrapper_options)
8
8
  false
9
9
  end
10
10
 
@@ -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)
@@ -5,11 +5,11 @@ module UiBibz::Ui::Concerns::HtmlConcern #:nodoc:
5
5
 
6
6
  included do
7
7
  def html(content = nil, &block)
8
- if !block.nil?
8
+ if block.nil?
9
+ @items << content
10
+ else
9
11
  context = eval('self', block.binding) # rubocop:disable Style/EvalWithLocation
10
12
  @items << context.capture(&block)
11
- else
12
- @items << content
13
13
  end
14
14
  end
15
15
  end
@@ -38,7 +38,11 @@ module UiBibz::Ui::Core::Boxes::Components
38
38
  # Render html tag
39
39
  def pre_render
40
40
  # image_tag content, html_options
41
- image_tag content, html_options
41
+ if options[:pack]
42
+ image_pack_tag content, html_options
43
+ else
44
+ image_tag content, html_options
45
+ end
42
46
  end
43
47
 
44
48
  private
@@ -16,12 +16,11 @@ module UiBibz::Ui::Core::Forms::Buttons
16
16
  # You can add HTML attributes using the +html_options+.
17
17
  # You can pass arguments in options attribute:
18
18
  # * +status+ - status of element with symbol value:
19
- # (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+, +:link+)
19
+ # (+:primary+, +:secondary+, +:success+, :info+, +:warning+, +:danger+, +:light+, +:dark+)
20
20
  # * +size+
21
21
  # (+:xs+, +:sm+, +:lg+)
22
22
  # * +outline+ - Boolean
23
23
  # * +state+ - Symbol (+:active+, +:disabled)
24
- # * +type+ - Symbol (+:outline)
25
24
  # * +collapse+ - String
26
25
  # * +expand_collaspe+ - Boolean
27
26
  # * +glyph+ - Add glyph with name or hash options
@@ -63,13 +62,13 @@ module UiBibz::Ui::Core::Forms::Buttons
63
62
  def button_html_tag
64
63
  content_tag :button, html_options do
65
64
  concat spinner_html unless options[:spinner].nil?
66
- concat glyph_and_content_html(options[:text].nil? ? @content : '')
65
+ concat glyph_and_content_html(@content)
67
66
  concat badge_html unless options[:badge].nil?
68
67
  end
69
68
  end
70
69
 
71
70
  def component_html_classes
72
- super << ['btn', size, type, without_text]
71
+ super << ['btn', size]
73
72
  end
74
73
 
75
74
  def component_html_options
@@ -107,14 +106,6 @@ module UiBibz::Ui::Core::Forms::Buttons
107
106
  { 'aria-pressed' => true }
108
107
  end
109
108
 
110
- def type
111
- 'btn-block' if options[:type] == :block
112
- end
113
-
114
- def without_text
115
- 'without-text' unless options[:text].nil?
116
- end
117
-
118
109
  def action
119
110
  add_html_data('action', value: options[:action]) unless options[:action].nil?
120
111
  end
@@ -22,7 +22,6 @@ module UiBibz::Ui::Core::Forms::Buttons
22
22
  # * +url+ - String url
23
23
  # * +outline+ - Boolean
24
24
  # * +state+ - Symbol (+:active+, +:disabled)
25
- # * +type+ - Symbol (+:block)
26
25
  # * +glyph+ - Add glyph with name or hash options
27
26
  # * +name+ - String
28
27
  # * +size+ - Integer
@@ -63,7 +62,7 @@ module UiBibz::Ui::Core::Forms::Buttons
63
62
  def button_link_html_tag
64
63
  link_to link_url, html_options do
65
64
  concat spinner_html unless options[:spinner].nil?
66
- concat glyph_and_content_html(options[:text].nil? ? @content : '')
65
+ concat glyph_and_content_html(@content)
67
66
  concat badge_html unless options[:badge].nil?
68
67
  end
69
68
  end
@@ -20,7 +20,6 @@ module UiBibz::Ui::Core::Forms::Buttons
20
20
  # (+:xs+, +:sm+, +:lg+)
21
21
  # * +outline+ - Boolean
22
22
  # * +state+ - Symbol (+:active+, +:disabled)
23
- # * +type+ - Symbol (+:outline)
24
23
  # * +glyph+ - Add glyph with name or hash options
25
24
  # * +name+ - String
26
25
  # * +size+ - Integer
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core::Forms::Choices
70
70
  disabled: disabled?,
71
71
  indeterminate: options[:indeterminate],
72
72
  "data-action": options[:action],
73
- class: 'form-check-input'
73
+ class: UiBibz::Utils::Screwdriver.join_classes('form-check-input', input_status)
74
74
  }.tap do |html|
75
75
  html[:id] = html_options[:id] if html_options[:id]
76
76
  end
@@ -95,6 +95,12 @@ module UiBibz::Ui::Core::Forms::Choices
95
95
  super << component_wrapper_html_classes
96
96
  end
97
97
 
98
+ def input_status
99
+ "form-check-input-#{options[:status]}" if options[:status]
100
+ end
101
+
102
+ def status; end
103
+
98
104
  def inline
99
105
  'form-check-inline' if options[:inline]
100
106
  end
@@ -67,7 +67,7 @@ module UiBibz::Ui::Core::Forms::Choices
67
67
  {
68
68
  disabled: options[:state] == :disabled,
69
69
  "data-action": options[:action],
70
- class: 'form-check-input'
70
+ class: UiBibz::Utils::Screwdriver.join_classes('form-check-input', input_status)
71
71
  }
72
72
  end
73
73
 
@@ -79,6 +79,12 @@ module UiBibz::Ui::Core::Forms::Choices
79
79
  super << component_wrapper_html_classes
80
80
  end
81
81
 
82
+ def status; end
83
+
84
+ def input_status
85
+ "form-check-input-#{options[:status]}" if options[:status]
86
+ end
87
+
82
88
  def inline
83
89
  'form-check-inline' if options[:inline]
84
90
  end
@@ -43,6 +43,10 @@ module UiBibz::Ui::Core::Forms::Choices
43
43
  class SwitchField < UiBibz::Ui::Core::Forms::Choices::CheckboxField
44
44
  private
45
45
 
46
+ def component_options
47
+ { boolean: true }
48
+ end
49
+
46
50
  def component_html_classes
47
51
  ['form-check', 'form-switch', inline]
48
52
  end
@@ -29,7 +29,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
29
29
  # * +html_button+ - Hash
30
30
  # * +position+ - Symbol
31
31
  # (+:up+, +:right+, +:down+, +:left+)
32
- # * +alignement+ - Symbol
32
+ # * +alignment+ - Symbol
33
33
  # (+:right)
34
34
  #
35
35
  # ==== Signatures
@@ -111,7 +111,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
111
111
  end
112
112
 
113
113
  def button_content
114
- glyph_and_content_html(options[:text].nil? ? @content : '').html_safe
114
+ glyph_and_content_html(@content)
115
115
  end
116
116
 
117
117
  def button_html
@@ -124,15 +124,15 @@ module UiBibz::Ui::Core::Forms::Dropdowns
124
124
  end
125
125
 
126
126
  def ul_html
127
- content_tag :div, @items.join.html_safe, class: join_classes('dropdown-menu', theme, alignement, open), 'arial-labelledby' => id
127
+ content_tag :div, @items.join.html_safe, class: join_classes('dropdown-menu', theme, alignment, open), 'arial-labelledby' => id
128
128
  end
129
129
 
130
130
  def dropdown_tag
131
131
  options[:tag] || :button
132
132
  end
133
133
 
134
- def alignement
135
- "dropdown-menu-#{@options[:alignement]}" unless @options[:alignement].nil?
134
+ def alignment
135
+ "dropdown-menu-#{@options[:alignment]}" unless @options[:alignment].nil?
136
136
  end
137
137
 
138
138
  def position
@@ -148,7 +148,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
148
148
  end
149
149
 
150
150
  def inline
151
- 'btn-group' if @options[:inline] || @options[:alignement]
151
+ 'btn-group' if @options[:inline] || @options[:alignment]
152
152
  end
153
153
 
154
154
  def without_caret
@@ -69,7 +69,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
69
69
  private
70
70
 
71
71
  def component_html_classes
72
- ['btn-group', position, alignement, open, inline, keep_open]
72
+ ['btn-group', position, alignment, open, inline, keep_open]
73
73
  end
74
74
 
75
75
  def button_html
@@ -49,10 +49,12 @@ module UiBibz::Ui::Core::Forms::Numbers
49
49
 
50
50
  def formula_field_html_tag
51
51
  UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new(class: join_classes('formula_field', state, size)).tap do |sf|
52
+ sf.addon @options[:append] unless @options[:append].nil?
52
53
  sf.text_field formula_field_name, nil, text_field_formula_html_options
53
54
  sf.addon '=', class: 'formula-field-sign'
54
55
  sf.text_field content, nil, text_field_input_html_options
55
56
  sf.addon formula_field_alert_glyph, { class: 'formula-field-alert' }, { data: { toggle: 'tooltip' } }
57
+ sf.addon @options[:prepend] unless @options[:prepend].nil?
56
58
  end.render
57
59
  end
58
60
 
@@ -20,6 +20,12 @@ module UiBibz::Ui::Core::Forms::Numbers
20
20
  # * +step+ - [Float, Integer]
21
21
  # * +in+ - Array
22
22
  # * +within+ - Array
23
+ # * +status+ - status of element with symbol value:
24
+ # (+:primary+, +:secondary+, +:success+, :info+, +:warning+, +:danger+, +:light+, +:dark+)
25
+ # * +thumb_status+ - status of the thumb:
26
+ # (+:primary+, +:secondary+, +:success+, :info+, +:warning+, +:danger+, +:light+, +:dark+)
27
+ # * +track_status+ - status of track:
28
+ # (+:primary+, +:secondary+, +:success+, :info+, +:warning+, +:danger+, +:light+, +:dark+)
23
29
  #
24
30
  # ==== Signatures
25
31
  #
@@ -75,7 +81,19 @@ module UiBibz::Ui::Core::Forms::Numbers
75
81
  end
76
82
 
77
83
  def component_html_classes
78
- 'form-range'
84
+ ['form-range', status, thumb_status, track_status]
85
+ end
86
+
87
+ def status
88
+ "form-range-#{options[:status]}" if options[:status]
89
+ end
90
+
91
+ def thumb_status
92
+ "form-range-thumb-#{options[:thumb_status]}" if options[:thumb_status]
93
+ end
94
+
95
+ def track_status
96
+ "form-range-track-#{options[:track_status]}" if options[:track_status]
79
97
  end
80
98
 
81
99
  def option_label(value)
@@ -20,6 +20,10 @@ module UiBibz::Ui::Core::Forms::Numbers
20
20
  # * +step+ - [Float, Integer]
21
21
  # * +in+ - Array
22
22
  # * +within+ - Array
23
+ # * +status+ - status of element with symbol value:
24
+ # (+:primary+, +:secondary+, +:success+, :info+, +:warning+, +:danger+, +:light+, +:dark+)
25
+ # * +track_status+ - status of track:
26
+ # (+:primary+, +:secondary+, +:success+, :info+, +:warning+, +:danger+, +:light+, +:dark+)
23
27
  #
24
28
  # ==== Signatures
25
29
  #
@@ -114,13 +118,21 @@ module UiBibz::Ui::Core::Forms::Numbers
114
118
  end
115
119
 
116
120
  def component_html_classes
117
- ['slider', ('disabled' if disabled)]
121
+ ['slider', status, track_status, ('disabled' if disabled)]
118
122
  end
119
123
 
120
124
  def disabled
121
125
  'disabled' if options[:state] == :disabled || html_options[:disabled]
122
126
  end
123
127
 
128
+ def status
129
+ "slider-#{options[:status]}" if options[:status]
130
+ end
131
+
132
+ def track_status
133
+ "slider-track-#{options[:track_status]}" if options[:track_status]
134
+ end
135
+
124
136
  def range_name(suffix)
125
137
  if content.end_with?(']')
126
138
  content.dup.insert(-2, suffix)
@@ -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
@@ -69,7 +69,7 @@ module UiBibz::Ui::Core::Forms::Selects
69
69
  end
70
70
 
71
71
  def component_html_classes
72
- [size, type, button_status, 'multi-select-field']
72
+ [open, size, type, button_status, 'multi-select-field']
73
73
  end
74
74
 
75
75
  def component_html_data
@@ -79,6 +79,8 @@ module UiBibz::Ui::Core::Forms::Selects
79
79
  searchable
80
80
  select_all_options
81
81
  number_displayed
82
+ dropdown_menu_classes
83
+ dropdown_classes
82
84
  end
83
85
 
84
86
  def clickable_opt_group
@@ -101,6 +103,32 @@ module UiBibz::Ui::Core::Forms::Selects
101
103
  add_html_data('include_select_all_option') if options[:select_all_options]
102
104
  end
103
105
 
106
+ def dropdown_menu_classes
107
+ classes = join_classes(theme, alignment, open)
108
+ add_html_data('dropdown_menu_classes', value: classes.nil? ? nil : classes.join(' '))
109
+ end
110
+
111
+ def dropdown_classes
112
+ classes = join_classes(position, open)
113
+ add_html_data('dropdown_classes', value: classes.nil? ? nil : classes.join(' '))
114
+ end
115
+
116
+ def position
117
+ "drop#{@options[:position] || 'down'}"
118
+ end
119
+
120
+ def theme
121
+ 'dropdown-menu-dark' if @options[:theme]
122
+ end
123
+
124
+ def open
125
+ 'show' if @options[:open]
126
+ end
127
+
128
+ def alignment
129
+ "dropdown-menu-#{@options[:alignment]}" unless @options[:alignment].nil?
130
+ end
131
+
104
132
  def type
105
133
  'btn-block' if options[:type] == :block
106
134
  end
@@ -117,9 +145,5 @@ module UiBibz::Ui::Core::Forms::Selects
117
145
  def outline
118
146
  'outline' if options[:outline]
119
147
  end
120
-
121
- def theme
122
- 'dropdown-menu-dark' if @options[:theme]
123
- end
124
148
  end
125
149
  end