bootstrap5_helper 1.1.0 → 1.1.1
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 +4 -4
- data/lib/bootstrap5_helper/card_with_nav_tab.rb +16 -8
- data/lib/bootstrap5_helper/spinner.rb +16 -1
- data/lib/bootstrap5_helper/version.rb +1 -1
- data/lib/bootstrap5_helper.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69fbf952577b44a22763e9f054dc768bb4a1ad7d2f47ba094dda42612dc2f5b7
|
4
|
+
data.tar.gz: 2d656ebf99bc33d65e49c4ef2f661266958e31366fdfb7730dc9ed08cc782996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aab79e3287bea1f7cbb4d5ddd761840691d8cc319aa6eddfc89d5b87a5aedfe8ff8ce2ad271b75d6155a6e58586c305fb04db88bdfdaca240c9b3375663bca69
|
7
|
+
data.tar.gz: 992edacb8fd535b478cf3e4cfbf1191425d62ea9cf4b7093ce4a374fcb041feb294f96a21e252b2d14f9323b73cc863fe3869a542adad395917d1e3f87a76ac2
|
@@ -2,12 +2,20 @@ module Bootstrap5Helper
|
|
2
2
|
class CardWithNavTab < Component # :nodoc:
|
3
3
|
# Class constructor
|
4
4
|
#
|
5
|
-
# @
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# @overload initialize(template, context, opts)
|
6
|
+
# @param [ActionView] template
|
7
|
+
# @param [Symbol|String] context
|
8
|
+
# @param [Hash] opts
|
9
|
+
# @option opts [String] :id
|
10
|
+
# @option opts [String] :class
|
11
|
+
# @option opts [Hash] :data
|
12
|
+
#
|
13
|
+
# @overload initialize(template, opts)
|
14
|
+
# @param [ActionView] template
|
15
|
+
# @param [Hash] opts
|
16
|
+
# @option opts [String] :id
|
17
|
+
# @option opts [String] :class
|
18
|
+
# @option opts [Hash] :data
|
11
19
|
#
|
12
20
|
def initialize(template, *context_or_options, &block)
|
13
21
|
super(template)
|
@@ -42,12 +50,12 @@ module Bootstrap5Helper
|
|
42
50
|
tag, args = parse_tag_or_options(*tag_or_options, {})
|
43
51
|
args[:class] = (args[:class] || '') << 'nav-tabs card-header-tabs'
|
44
52
|
args[:data] = (args[:data] || {}).merge('bs-toggle' => 'tab')
|
45
|
-
args[:child] = {
|
53
|
+
args[:child] = (args[:child] || {}).merge(
|
46
54
|
data: {
|
47
55
|
'bs-toggle' => 'tab',
|
48
56
|
'bs-display' => 'static'
|
49
57
|
}
|
50
|
-
|
58
|
+
)
|
51
59
|
|
52
60
|
content_tag :div, class: 'card-header' do
|
53
61
|
Nav.new(@template, tag, args, &block).to_s
|
@@ -10,6 +10,7 @@ module Bootstrap5Helper
|
|
10
10
|
# @param [ActionView] template
|
11
11
|
# @param [Hash] opts
|
12
12
|
# @option opts [Symbol] :type
|
13
|
+
# @option opts [Symbol] :size
|
13
14
|
# @option opts [String] :id
|
14
15
|
# @option opts [String] :class
|
15
16
|
# @option opts [Hash] :data
|
@@ -18,6 +19,7 @@ module Bootstrap5Helper
|
|
18
19
|
super(template)
|
19
20
|
|
20
21
|
@type = opts.fetch(:type, :border)
|
22
|
+
@size = opts.fetch(:size, nil)
|
21
23
|
@id = opts.fetch(:id, uuid)
|
22
24
|
@class = opts.fetch(:class, '')
|
23
25
|
@data = opts.fetch(:data, {})
|
@@ -32,7 +34,7 @@ module Bootstrap5Helper
|
|
32
34
|
content_tag(
|
33
35
|
:span,
|
34
36
|
id: @id,
|
35
|
-
class:
|
37
|
+
class: component_classes,
|
36
38
|
role: 'status',
|
37
39
|
aria: { hidden: true },
|
38
40
|
data: @data
|
@@ -40,5 +42,18 @@ module Bootstrap5Helper
|
|
40
42
|
content_tag :span, 'Loading', class: 'visually-hidden'
|
41
43
|
end
|
42
44
|
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
# Cleaner way of getting the base component classes.
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
#
|
52
|
+
def component_classes
|
53
|
+
string = "spinner-#{@type} #{@class}"
|
54
|
+
string << " spinner-#{@type}-#{@size}" if @size.present?
|
55
|
+
|
56
|
+
string
|
57
|
+
end
|
43
58
|
end
|
44
59
|
end
|
data/lib/bootstrap5_helper.rb
CHANGED
@@ -165,15 +165,15 @@ module Bootstrap5Helper
|
|
165
165
|
Card.new(self, opts, &block)
|
166
166
|
end
|
167
167
|
|
168
|
-
# @overload card_with_nav_tab_helper(
|
169
|
-
# @param [Symbol|String]
|
170
|
-
# @param
|
168
|
+
# @overload card_with_nav_tab_helper(context, opts)
|
169
|
+
# @param [Symbol|String] context
|
170
|
+
# @param [Hash] opts
|
171
171
|
# @option opts [String] :id
|
172
172
|
# @option opts [String] :class
|
173
173
|
# @option opts [Hash] :data
|
174
174
|
#
|
175
175
|
# @overload card_with_nav_tab_helper(opts)
|
176
|
-
# @param
|
176
|
+
# @param [Hash] opts
|
177
177
|
# @option opts [String] :id
|
178
178
|
# @option opts [String] :class
|
179
179
|
# @option opts [Hash] :data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap5_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert David
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|