bootstrap5_helper 1.1.2 → 1.1.3

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: 50b1e83426c0845570591efbaaf2c7071a528039ec8c5a051304784ab13e7f91
4
- data.tar.gz: 2a543eca14020820fa8fcbfdbe208a97b925a4ca5371483d98249914ee9a4c06
3
+ metadata.gz: 19522a2350e79f5f8dc104a998c2af7da568feb05de8747adc3b2a530eb86ccc
4
+ data.tar.gz: 15c5cd096185cff3d04305451d10551541eb6abdaaf2fe8886dc0828d212ae67
5
5
  SHA512:
6
- metadata.gz: fa6a248942c919c442e4602781401de5b383394733c4a89eeba5fc5cfe50f066a58711d7f70411a708f84570d0b3ef07cd1b6bfebaa2638d1cc48ee15d9483f4
7
- data.tar.gz: e2b0deb1b20740897688cb60d9a31c9e17477d57d93dbd0ddf19a586eb8b1cd967268c7db15ba3f5cd88dd07506cab8c58bad35696a2bd9ad0740e74cd18e024
6
+ metadata.gz: cbfadc39eb05885160db4b02a115f984c82d4a434568a777e891fe16ea2d484330a6713944c95a4736d347b1f3c9edb1734764289e404e364f1059f8bb57a1bd
7
+ data.tar.gz: 565e02e9240376cdbb95a5dfc43eaf034a1af210d041269085b99ddac8f3a87cd38d732e87b4d3f3739d96dde35507ec658d4c0abf8de72b6b96c0a71bc61f1a
@@ -19,6 +19,7 @@ module Bootstrap5Helper
19
19
 
20
20
  @id = args.fetch(:id, uuid)
21
21
  @class = args.fetch(:class, '')
22
+ @data = args.fetch(:data, {})
22
23
  @dismissible = args.fetch(:dismissible, false)
23
24
  @content = block || proc { '' }
24
25
  end
@@ -42,7 +43,7 @@ module Bootstrap5Helper
42
43
  # @return [String]
43
44
  #
44
45
  def to_s
45
- content_tag :div, id: @id, class: container_class do
46
+ content_tag(:div, id: @id, class: container_class, data: @data) do
46
47
  concat(@dismissible ? close_button : '')
47
48
  @content.call(self)
48
49
  end
@@ -195,7 +195,7 @@ module Bootstrap5Helper
195
195
  # @return [String]
196
196
  #
197
197
  def image(src, opts = {})
198
- (opts[:class] ||= '') << 'card-img'
198
+ (opts[:class] ||= '') << ' card-img'
199
199
  @template.image_tag(src, opts)
200
200
  end
201
201
 
@@ -207,7 +207,7 @@ module Bootstrap5Helper
207
207
  # @return [String]
208
208
  #
209
209
  def image_cap(src, type = :top, opts = {})
210
- (opts[:class] ||= '') << "card-img-#{type}"
210
+ (opts[:class] ||= '') << " card-img-#{type}"
211
211
  @template.image_tag(src, opts)
212
212
  end
213
213
 
@@ -48,7 +48,7 @@ module Bootstrap5Helper
48
48
  #
49
49
  def nav(*tag_or_options, &block)
50
50
  tag, args = parse_tag_or_options(*tag_or_options, {})
51
- args[:class] = (args[:class] || '') << 'nav-tabs card-header-tabs'
51
+ args[:class] = (args[:class] || '') << ' nav-tabs card-header-tabs'
52
52
  args[:data] = (args[:data] || {}).merge('bs-toggle' => 'tab')
53
53
  args[:child] = (args[:child] || {}).merge(
54
54
  data: {
@@ -80,7 +80,12 @@ module Bootstrap5Helper
80
80
  #
81
81
  #
82
82
  def to_s
83
- content_tag :div, class: "card with-nav-tabs-#{@context}" do
83
+ content_tag(
84
+ :div,
85
+ class: "card with-nav-tabs-#{@context} #{@class}",
86
+ id: @id,
87
+ data: @data
88
+ ) do
84
89
  @content.call(self)
85
90
  end
86
91
  end
@@ -197,7 +197,7 @@ module Bootstrap5Helper
197
197
  when TrueClass
198
198
  'modal-fullscreen'
199
199
  when String, Symbol
200
- "modal-fullscreen-#{@fullscreen}-down "
200
+ "modal-fullscreen-#{@fullscreen}-down "
201
201
  else
202
202
  ''
203
203
  end
@@ -117,7 +117,7 @@ module Bootstrap5Helper
117
117
  # @return [String]
118
118
  #
119
119
  def to_s
120
- content_tag(@tag, id: @id, class: "nav #{@class}") do
120
+ content_tag(@tag, id: @id, class: "nav #{@class}", data: @data) do
121
121
  @content.call(self)
122
122
  end
123
123
  end
@@ -32,8 +32,13 @@ module Bootstrap5Helper
32
32
  # @return [String]
33
33
  #
34
34
  def link(name = nil, options = nil, html_options = nil, &block)
35
- html_options ||= {}
36
- html_options[:class] = (html_options[:class] || '') << ' dropdown-item'
35
+ if block_given?
36
+ options ||= {}
37
+ options[:class] = (options[:class] || '') << ' dropdown-item'
38
+ else
39
+ html_options ||= {}
40
+ html_options[:class] = (html_options[:class] || '') << ' dropdown-item'
41
+ end
37
42
 
38
43
  nav_item_wrapper do
39
44
  @template.link_to(name, options, html_options, &block)
@@ -92,7 +92,7 @@ module Bootstrap5Helper
92
92
  end
93
93
  end
94
94
 
95
- # Used to create a new <tt>Dropdown::Menu</tt>
95
+ # Used to create a new <tt>Overlay::Menu</tt>
96
96
  #
97
97
  # @param [Hash] opts
98
98
  # @option opts [String] :id
@@ -1,3 +1,3 @@
1
1
  module Bootstrap5Helper
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
@@ -101,7 +101,7 @@ module Bootstrap5Helper
101
101
  Badge.new(self, *args, &block)
102
102
  end
103
103
 
104
- # Internal helper, used with personal Bootstrap modifications.
104
+ # @note Internal helper, used with personal Bootstrap modifications.
105
105
  #
106
106
  #
107
107
  def callout_helper(*args, &block)
@@ -165,6 +165,8 @@ module Bootstrap5Helper
165
165
  Card.new(self, opts, &block)
166
166
  end
167
167
 
168
+ # @note Internal helper, used with personal Bootstrap modifications.
169
+ #
168
170
  # @overload card_with_nav_tab_helper(context, opts)
169
171
  # @param [Symbol|String] context
170
172
  # @param [Hash] opts
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.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert David
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-01 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: solargraph
57
71
  requirement: !ruby/object:Gem::Requirement