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: d230136d48595c4f4300a001323a7d19ea58863dcca0486cfbfdaa9c1cb4e787
4
- data.tar.gz: 82720943d66e77dffd6a566ca8992abc02e743c2ca1eb7a8595fa75b2747049a
3
+ metadata.gz: 381fe687b6f870e28180cb109cba31516bda4bffd2337434e51d6f41f42e849c
4
+ data.tar.gz: 237ae1863d6fb0c7f8bbc04b76a332f8a6f35886e4956c4606b78da39bfbacc0
5
5
  SHA512:
6
- metadata.gz: 0b2b7c559fcbe30355f716c6140fccdabbe0afbaa883753c257602de2d148ea2cf680da2566150d7a4bbc4438a6dc7f491cfc36cdc0b19b6fef8220f0a44976f
7
- data.tar.gz: ecc26cc0be6fcf85b77a92fa35ed65888f17fcb73061d4655dabcca4ea26123828b0730ebdef3f3487e471210653f2d6d8bc17b275bc2f4f65b58592c8ed7937
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.2)
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.3.0)
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.0)
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)
@@ -33,7 +33,7 @@ module UiBibz::Concerns::Models::Searchable
33
33
  end
34
34
 
35
35
  def self.store_id
36
- @arguments[:store_id] || @arguments[:controller] || @params[:controller]
36
+ @arguments[:store_id] || @params[:controller]
37
37
  end
38
38
 
39
39
  def self.create_model
data/lib/ui_bibz/infos.rb CHANGED
@@ -12,6 +12,6 @@ module UiBibz
12
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.2'
15
+ VERSION = '3.0.3'
16
16
  AUTHORS = ['Thooams'].freeze
17
17
  end
@@ -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 header tab group' do
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.2
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-18 00:00:00.000000000 Z
11
+ date: 2021-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails