ui_bibz 3.0.6 → 3.0.7
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09075fad5e0a57ae7e47b66cb1e9d84d9e208674216317117fc4cbd74002ec83'
|
4
|
+
data.tar.gz: 717b8ed5d3cfe6bdfa003d2db3e240427e2b96a494f8d422e085d0563e60d09c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756bb32c729a77d6de316ed2279745e0bc22e3c75e0f9f4e7c8c8d560d60f2c938fb445c84922c46536b3c4c49b151db1f45bb4155668f2418acdbc864f5c46f
|
7
|
+
data.tar.gz: d6e66096bb51fa27ae70f6f3c4a0715bff947df9c1fd9ef07c5f2193e1251a5d037467be677fabf4e1a6c2a1f9a7d5b8dceca8c974833627ecfae10e22745e8e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ui_bibz (3.0.
|
4
|
+
ui_bibz (3.0.7)
|
5
5
|
will-paginate-i18n
|
6
6
|
will_paginate (~> 3.3.0)
|
7
7
|
will_paginate-bootstrap4
|
@@ -113,7 +113,7 @@ GEM
|
|
113
113
|
mini_mime (>= 0.1.1)
|
114
114
|
marcel (1.0.2)
|
115
115
|
method_source (1.0.0)
|
116
|
-
mini_mime (1.1.
|
116
|
+
mini_mime (1.1.2)
|
117
117
|
mini_portile2 (2.6.1)
|
118
118
|
minitest (5.14.4)
|
119
119
|
nio4r (2.5.8)
|
@@ -172,12 +172,12 @@ GEM
|
|
172
172
|
unicode-display_width (>= 1.4.0, < 3.0)
|
173
173
|
rubocop-ast (1.12.0)
|
174
174
|
parser (>= 3.0.1.1)
|
175
|
-
rubocop-minitest (0.15.
|
175
|
+
rubocop-minitest (0.15.2)
|
176
176
|
rubocop (>= 0.90, < 2.0)
|
177
177
|
rubocop-performance (1.11.5)
|
178
178
|
rubocop (>= 1.7.0, < 2.0)
|
179
179
|
rubocop-ast (>= 0.4.0)
|
180
|
-
rubocop-rails (2.12.
|
180
|
+
rubocop-rails (2.12.4)
|
181
181
|
activesupport (>= 4.2.0)
|
182
182
|
rack (>= 1.1)
|
183
183
|
rubocop (>= 1.7.0, < 2.0)
|
data/lib/ui_bibz/infos.rb
CHANGED
@@ -73,7 +73,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def button_html
|
76
|
-
content_tag
|
76
|
+
content_tag dropdown_tag, button_content, dropdown_html_options
|
77
77
|
end
|
78
78
|
|
79
79
|
def split_html
|
@@ -86,11 +86,27 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def split_classes
|
89
|
-
join_classes('btn', button_status, size, 'dropdown-toggle', 'dropdown-toggle-split', options[:split_html].try(:[], :class))
|
89
|
+
join_classes('btn', button_status, size, state, 'dropdown-toggle', 'dropdown-toggle-split', options[:split_html].try(:[], :class))
|
90
90
|
end
|
91
91
|
|
92
92
|
def src_only
|
93
93
|
content_tag :span, 'Toggle Dropdown', class: 'sr-only'
|
94
94
|
end
|
95
|
+
|
96
|
+
def dropdown_html_options
|
97
|
+
opts = (options[:html_button] || {})
|
98
|
+
opts = opts.merge(href: options[:url]) if options[:tag] == :a
|
99
|
+
opts.merge(class: join_classes('btn', button_status, state, size, options[:html_button].try(:[], :class)))
|
100
|
+
end
|
101
|
+
|
102
|
+
def split_dropdown_html_option
|
103
|
+
(options[:html_split] || {}).merge({
|
104
|
+
class: split_classes,
|
105
|
+
type: 'button',
|
106
|
+
'data-bs-toggle' => 'dropdown',
|
107
|
+
'aria-haspopup' => true,
|
108
|
+
'aria-expanded' => false
|
109
|
+
})
|
110
|
+
end
|
95
111
|
end
|
96
112
|
end
|
@@ -43,13 +43,4 @@ class DropdownTest < ActionView::TestCase
|
|
43
43
|
|
44
44
|
assert_equal expected, actual.render
|
45
45
|
end
|
46
|
-
|
47
|
-
test 'Split Dropdown' do
|
48
|
-
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Split Dropdown').tap do |d|
|
49
|
-
d.link 'state'
|
50
|
-
end
|
51
|
-
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Split Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"
|
52
|
-
|
53
|
-
assert_equal expected, actual.render
|
54
|
-
end
|
55
46
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
class SplitDropdownTest < ActionView::TestCase
|
5
|
+
include UiBibz::Helpers::Ui::CoreHelper
|
6
|
+
|
7
|
+
test 'Split Dropdown' do
|
8
|
+
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Split Dropdown').tap do |d|
|
9
|
+
d.link 'state'
|
10
|
+
end
|
11
|
+
expected = "<div class=\"dropdown\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Split Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"
|
12
|
+
|
13
|
+
assert_equal expected, actual.render
|
14
|
+
end
|
15
|
+
|
16
|
+
test 'Split Dropdown with link' do
|
17
|
+
actual = UiBibz::Ui::Core::Forms::Dropdowns::Dropdown.new('Split Dropdown', tag: :a, url: "#test").tap do |d|
|
18
|
+
d.link 'state'
|
19
|
+
end
|
20
|
+
expected = "<div class=\"dropdown\"><a class=\"btn btn-secondary dropdown-toggle\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\">Split Dropdown</a><div class=\"dropdown-menu\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#\">state</a></div></div>"
|
21
|
+
|
22
|
+
assert_equal expected, actual.render
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ui_bibz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thooams [Thomas HUMMEL]
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -555,6 +555,7 @@ files:
|
|
555
555
|
- test/ui/core/forms/choices/radio_field_test.rb
|
556
556
|
- test/ui/core/forms/dates/date_picker_field_test.rb
|
557
557
|
- test/ui/core/forms/dropdowns/dropdown_test.rb
|
558
|
+
- test/ui/core/forms/dropdowns/split_dropdown_test.rb
|
558
559
|
- test/ui/core/forms/files/file_field_test.rb
|
559
560
|
- test/ui/core/forms/numbers/formula_field_test.rb
|
560
561
|
- test/ui/core/forms/numbers/number_field_test.rb
|
@@ -768,6 +769,7 @@ test_files:
|
|
768
769
|
- test/ui/core/forms/choices/radio_field_test.rb
|
769
770
|
- test/ui/core/forms/dates/date_picker_field_test.rb
|
770
771
|
- test/ui/core/forms/dropdowns/dropdown_test.rb
|
772
|
+
- test/ui/core/forms/dropdowns/split_dropdown_test.rb
|
771
773
|
- test/ui/core/forms/files/file_field_test.rb
|
772
774
|
- test/ui/core/forms/numbers/formula_field_test.rb
|
773
775
|
- test/ui/core/forms/numbers/number_field_test.rb
|