ui_bibz 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381fe687b6f870e28180cb109cba31516bda4bffd2337434e51d6f41f42e849c
|
4
|
+
data.tar.gz: 237ae1863d6fb0c7f8bbc04b76a332f8a6f35886e4956c4606b78da39bfbacc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b80564e26c0feb5283edded6dcbe44e762122270df77b2bc32e122c904ac5ae740ce456cadb03e0ae29987de28f886d381b921094fd8111a35f8993fe46a957b
|
7
|
+
data.tar.gz: ebe6b69f108fa97985127a144e3f8c53a9d610c05880e83c1bc81eb3784cb6fa2075c2d56afe21892602a1f164463f1b62762cc296e79309019feec056ad3041
|
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.3)
|
5
5
|
will-paginate-i18n
|
6
6
|
will_paginate (~> 3.3.0)
|
7
7
|
will_paginate-bootstrap4
|
@@ -149,7 +149,7 @@ GEM
|
|
149
149
|
rails-dom-testing (2.0.3)
|
150
150
|
activesupport (>= 4.2.0)
|
151
151
|
nokogiri (>= 1.6)
|
152
|
-
rails-html-sanitizer (1.
|
152
|
+
rails-html-sanitizer (1.4.1)
|
153
153
|
loofah (~> 2.3)
|
154
154
|
railties (6.1.4)
|
155
155
|
actionpack (= 6.1.4)
|
@@ -161,7 +161,7 @@ GEM
|
|
161
161
|
rake (13.0.6)
|
162
162
|
regexp_parser (2.1.1)
|
163
163
|
rexml (3.2.5)
|
164
|
-
rubocop (1.19.
|
164
|
+
rubocop (1.19.1)
|
165
165
|
parallel (~> 1.10)
|
166
166
|
parser (>= 3.0.0.0)
|
167
167
|
rainbow (>= 2.2.2, < 4.0)
|
data/lib/ui_bibz/infos.rb
CHANGED
@@ -26,6 +26,7 @@ module UiBibz::Ui::Core::Boxes
|
|
26
26
|
# * text - Hash (+:size+, +:position+)
|
27
27
|
# (+:left+, +:right+, +:center+)
|
28
28
|
# * block - Boolean
|
29
|
+
# * tabbed - Boolean to use tab card
|
29
30
|
# * type - Symbol
|
30
31
|
# (+:inverse+)
|
31
32
|
#
|
@@ -108,7 +109,7 @@ module UiBibz::Ui::Core::Boxes
|
|
108
109
|
end
|
109
110
|
|
110
111
|
def component_html_classes
|
111
|
-
['card', text, type, tab_pane, outline]
|
112
|
+
['card', text, type, tab_pane, outline, tabbed]
|
112
113
|
end
|
113
114
|
|
114
115
|
def status
|
@@ -135,6 +136,10 @@ module UiBibz::Ui::Core::Boxes
|
|
135
136
|
'tab-pane' if @options[:tab]
|
136
137
|
end
|
137
138
|
|
139
|
+
def tabbed
|
140
|
+
'tab-content' if @options[:tabbed]
|
141
|
+
end
|
142
|
+
|
138
143
|
def outline
|
139
144
|
'bg-transparent' if @options[:outline]
|
140
145
|
end
|
@@ -81,7 +81,11 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
81
81
|
private
|
82
82
|
|
83
83
|
def component_html_classes
|
84
|
-
['card-body', outline]
|
84
|
+
['card-body', outline, tab_pane]
|
85
|
+
end
|
86
|
+
|
87
|
+
def component_html_options
|
88
|
+
@options[:tab_pane].nil? ? {} : { id: @options[:tab_pane] }
|
85
89
|
end
|
86
90
|
|
87
91
|
def outline
|
@@ -91,5 +95,9 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
91
95
|
def show
|
92
96
|
'show' if @options[:show]
|
93
97
|
end
|
98
|
+
|
99
|
+
def tab_pane
|
100
|
+
'tab-pane' if options[:tab_pane]
|
101
|
+
end
|
94
102
|
end
|
95
103
|
end
|
@@ -136,16 +136,18 @@ class CardTest < ActionView::TestCase
|
|
136
136
|
assert_equal expected, actual
|
137
137
|
end
|
138
138
|
|
139
|
-
test 'card
|
140
|
-
actual = ui_card do |c|
|
139
|
+
test 'card tab' do
|
140
|
+
actual = ui_card tabbed: true do |c|
|
141
141
|
c.header do |h|
|
142
142
|
h.tab_group do |cg|
|
143
143
|
cg.tab 'link1', url: '#link1'
|
144
144
|
cg.tab 'link2', url: '#link2'
|
145
145
|
end
|
146
146
|
end
|
147
|
+
c.body tab_pan: "link1", state: :active
|
148
|
+
c.body tab_pan: "link2"
|
147
149
|
end
|
148
|
-
expected = "<div class=\"card\"><div class=\"card-header\"><ul class=\"nav nav-tabs card-header-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#link1\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">link1</a></li><li class=\"nav-item\"><a href=\"#link2\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">link2</a></li></ul></div></div>"
|
150
|
+
expected = "<div class=\"card tab-content\"><div class=\"card-header\"><ul class=\"nav nav-tabs card-header-tabs\" role=\"tablist\"><li class=\"nav-item\"><a href=\"#link1\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">link1</a></li><li class=\"nav-item\"><a href=\"#link2\" class=\"nav-link\" data-bs-toggle=\"tab\" role=\"tab\">link2</a></li></ul></div><div class=\"active card-body\"></div><div class=\"card-body\"></div></div>"
|
149
151
|
|
150
152
|
assert_equal expected, actual
|
151
153
|
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.3
|
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-08-
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|