ui_bibz 3.0.0.alpha6 → 3.0.0.alpha12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/Gemfile.lock +17 -14
- data/README.md +5 -1
- data/lib/ui_bibz/concerns/models/searchable.rb +1 -1
- data/lib/ui_bibz/infos.rb +4 -4
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_text_field_input.rb +1 -1
- data/lib/ui_bibz/ui/concerns/html_concern.rb +10 -4
- data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +5 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +2 -11
- data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +1 -2
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +3 -1
- data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +2 -0
- data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +35 -5
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -9
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -9
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +5 -4
- data/lib/ui_bibz/ui/core/icons/glyph.rb +9 -1
- data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/nav.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +6 -4
- data/lib/ui_bibz/ui/core/navigations/tab_group.rb +5 -1
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +15 -1
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +9 -24
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +1 -1
- data/lib/ui_bibz/ui/extensions/core/forms/surround_extension.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table_pagination_per_page.rb +3 -3
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +4 -4
- data/test/simple_form_test.rb +4 -4
- data/test/ui/core/boxes/card_test.rb +2 -2
- data/test/ui/core/component_test.rb +2 -2
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -8
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -9
- data/test/ui/core/forms/choices/choice_group_test.rb +3 -3
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
- data/test/ui/core/forms/selects/multi_select_field_test.rb +3 -3
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +4 -4
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/lists/list_group_test.rb +1 -1
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +1 -1
- data/test/ui/core/navigations/nav_test.rb +2 -2
- data/test/ui/core/navigations/tab_group_test.rb +5 -5
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +2 -2
- data/test/ui/ux/containers/panel_test.rb +1 -1
- data/test/ui/ux/tables/table_test.rb +2 -2
- data/ui_bibz.gemspec +2 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d07d4573a050023aaaff846d4650f8b802c00782cc7fe30ed14107198933ab11
|
4
|
+
data.tar.gz: 546e986d41e72153d86002461adbaa26d6646db7952964fc51cbd699ae9443d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be6d842f92e1393f0672190054d7f1a7181ce040921d1bc0e7b861ddc40db059a9d1b1edb2d9599630511c3c35894f9d7d0adb159e74ee9b24faf87c3f5d61c2
|
7
|
+
data.tar.gz: cea2368f567e2442f90588fd959a10db60acf2461e795d2b40d807706b7b400648b82c2630243ef642bd8f695c85da29812c70a3c1252ad1a06e11754c1abbf4
|
data/.github/FUNDING.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ui_bibz (3.0.0.
|
4
|
+
ui_bibz (3.0.0.alpha12)
|
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.
|
78
|
+
erubi (1.10.0)
|
79
79
|
erubis (2.7.0)
|
80
80
|
factory_bot (4.11.1)
|
81
81
|
activesupport (>= 3.0.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.
|
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.
|
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.
|
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,23 +157,23 @@ GEM
|
|
157
157
|
thor (>= 0.20.3, < 2.0)
|
158
158
|
rainbow (3.0.0)
|
159
159
|
rake (13.0.1)
|
160
|
-
regexp_parser (
|
160
|
+
regexp_parser (2.0.0)
|
161
161
|
rexml (3.2.4)
|
162
|
-
rubocop (1.
|
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 (>= 1.
|
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.
|
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.
|
176
|
-
rubocop (>= 0.
|
175
|
+
rubocop-performance (1.9.1)
|
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)
|
@@ -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.
|
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)
|
@@ -202,7 +204,7 @@ GEM
|
|
202
204
|
thor (1.0.1)
|
203
205
|
thread_safe (0.3.6)
|
204
206
|
tilt (2.0.10)
|
205
|
-
tzinfo (1.2.
|
207
|
+
tzinfo (1.2.8)
|
206
208
|
thread_safe (~> 0.1)
|
207
209
|
unicode-display_width (1.7.0)
|
208
210
|
websocket-driver (0.7.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.
|
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/
|
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|
|
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.
|
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 = '
|
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.
|
14
|
+
AUTHOR = 'Thooams [Thomas HUMMEL]'
|
15
|
+
VERSION = '3.0.0.alpha12'
|
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)
|
@@ -5,12 +5,18 @@ module UiBibz::Ui::Concerns::HtmlConcern #:nodoc:
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
def html(content = nil, &block)
|
8
|
-
if
|
9
|
-
|
10
|
-
@items << context.capture(&block)
|
8
|
+
if block.nil?
|
9
|
+
@items << RenderString.new(content)
|
11
10
|
else
|
12
|
-
|
11
|
+
context = eval('self', block.binding) # rubocop:disable Style/EvalWithLocation
|
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
|
@@ -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
|
-
|
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
|
@@ -21,7 +21,6 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
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(
|
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
|
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(
|
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
|
@@ -21,12 +21,14 @@ 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
34
|
# * +alignment+ - Symbol
|
@@ -111,7 +113,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
111
113
|
end
|
112
114
|
|
113
115
|
def button_content
|
114
|
-
glyph_and_content_html(
|
116
|
+
glyph_and_content_html(@content)
|
115
117
|
end
|
116
118
|
|
117
119
|
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
|
|
@@ -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,13 +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
|
-
content_tag :div, class: 'input-group-btn' do
|
9
|
-
button_html_tag
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
4
|
+
class SurroundButton < UiBibz::Ui::Core::Forms::Buttons::Button; end
|
13
5
|
end
|
@@ -1,13 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module UiBibz::Ui::Core::Forms::Surrounds
|
4
|
-
class SurroundButtonLink < UiBibz::Ui::Core::Forms::Buttons::ButtonLink
|
5
|
-
# See UiBibz::Ui::Core::Dropdown.initialize
|
6
|
-
|
7
|
-
def pre_render
|
8
|
-
content_tag :div, class: 'input-group-btn' do
|
9
|
-
button_link_html_tag
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
4
|
+
class SurroundButtonLink < UiBibz::Ui::Core::Forms::Buttons::ButtonLink; end
|
13
5
|
end
|
@@ -4,10 +4,11 @@ module UiBibz::Ui::Core::Forms::Surrounds
|
|
4
4
|
class SurroundDropdown < UiBibz::Ui::Core::Forms::Dropdowns::Dropdown
|
5
5
|
# See UiBibz::Ui::Core::Dropdown.initialize
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def pre_render
|
8
|
+
capture do
|
9
|
+
concat button_html
|
10
|
+
concat ul_html
|
11
|
+
end
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|