bootstrap5_helper 1.0.0
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +506 -0
- data/Rakefile +3 -0
- data/lib/bootstrap5_helper/accordion/item.rb +107 -0
- data/lib/bootstrap5_helper/accordion.rb +46 -0
- data/lib/bootstrap5_helper/alert.rb +69 -0
- data/lib/bootstrap5_helper/badge.rb +53 -0
- data/lib/bootstrap5_helper/callout.rb +58 -0
- data/lib/bootstrap5_helper/card.rb +204 -0
- data/lib/bootstrap5_helper/component.rb +156 -0
- data/lib/bootstrap5_helper/configuration.rb +65 -0
- data/lib/bootstrap5_helper/constants.rb +28 -0
- data/lib/bootstrap5_helper/dropdown/menu.rb +157 -0
- data/lib/bootstrap5_helper/dropdown.rb +121 -0
- data/lib/bootstrap5_helper/initialize.rb +19 -0
- data/lib/bootstrap5_helper/input_group.rb +70 -0
- data/lib/bootstrap5_helper/modal.rb +224 -0
- data/lib/bootstrap5_helper/nav.rb +145 -0
- data/lib/bootstrap5_helper/offcanvas/content.rb +127 -0
- data/lib/bootstrap5_helper/offcanvas.rb +169 -0
- data/lib/bootstrap5_helper/page_header.rb +42 -0
- data/lib/bootstrap5_helper/railtie.rb +12 -0
- data/lib/bootstrap5_helper/spinner.rb +44 -0
- data/lib/bootstrap5_helper/tab/content.rb +58 -0
- data/lib/bootstrap5_helper/tab.rb +72 -0
- data/lib/bootstrap5_helper/toast.rb +7 -0
- data/lib/bootstrap5_helper/version.rb +3 -0
- data/lib/bootstrap5_helper.rb +547 -0
- data/lib/tasks/bootstrap5_helper_tasks.rake +4 -0
- metadata +152 -0
@@ -0,0 +1,547 @@
|
|
1
|
+
require 'bootstrap5_helper/version'
|
2
|
+
require 'bootstrap5_helper/railtie'
|
3
|
+
require 'bootstrap5_helper/constants'
|
4
|
+
|
5
|
+
Bootstrap5Helper::Constants::COMPONENTS.each do |component|
|
6
|
+
require "bootstrap5_helper/#{component}"
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'bootstrap5_helper/initialize'
|
10
|
+
|
11
|
+
# This is the module that will get included in your partials.
|
12
|
+
#
|
13
|
+
#
|
14
|
+
module Bootstrap5Helper
|
15
|
+
# Creates a single Accordion element.
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# ```erb
|
19
|
+
# <%= accordion_helper do |a| %>
|
20
|
+
# <%= a.item do |item| %>
|
21
|
+
# <%= item.header do %>
|
22
|
+
# // Some HTML or Ruby
|
23
|
+
# <% end %>
|
24
|
+
# <%= item.body %>
|
25
|
+
# // Some HTML or Ruby
|
26
|
+
# <% end %>
|
27
|
+
# <% end %>
|
28
|
+
# <% end %>
|
29
|
+
# ```
|
30
|
+
#
|
31
|
+
# @param [Hash] opts
|
32
|
+
# @option opts [String] :id
|
33
|
+
# @option opts [String] :class
|
34
|
+
# @option opts [Hash] :data
|
35
|
+
# @option opts [Boolean] :always_open
|
36
|
+
# @option opts [Boolean] :flush
|
37
|
+
# @return [Accordion]
|
38
|
+
#
|
39
|
+
def accordion_helper(opts = {}, &block)
|
40
|
+
Accordion.new(self, opts, &block)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Creates an Alert component.
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
# ```erb
|
47
|
+
# <%= alert_helper :danger, dismissble: true do %>
|
48
|
+
# Something went wrong with your model data...
|
49
|
+
# <% end %>
|
50
|
+
# ```
|
51
|
+
#
|
52
|
+
# @overload alert_helper(context, opts)
|
53
|
+
# @param [Symbol|String] context - :primary, :danger etc
|
54
|
+
# @param [Hash] opts
|
55
|
+
# @option opts [String] :id
|
56
|
+
# @option opts [String] :class
|
57
|
+
# @option opts [Boolean] :dismissible
|
58
|
+
#
|
59
|
+
# @overload alert_helper(opts)
|
60
|
+
# @param [Hash] opts
|
61
|
+
# @option opts [String] :id
|
62
|
+
# @option opts [String] :class
|
63
|
+
# @option opts [Boolean] :dismissible
|
64
|
+
#
|
65
|
+
# @return [String]
|
66
|
+
#
|
67
|
+
def alert_helper(*args, &block)
|
68
|
+
Alert.new(self, *args, &block)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Creates a badge component. Badges have a context variable. Providing nothing
|
72
|
+
# will give you the `secondary` context.
|
73
|
+
#
|
74
|
+
# @example
|
75
|
+
# ```erb
|
76
|
+
# <li>
|
77
|
+
# Messages: <%= badge_helper(:primary) { @messages.count } %>
|
78
|
+
# </li>
|
79
|
+
# <li>
|
80
|
+
# Notifications: <%= badge_healper { @notifications.count } %>
|
81
|
+
# </li>
|
82
|
+
# ```
|
83
|
+
#
|
84
|
+
# @overload badge_helper(context, opts)
|
85
|
+
# @param [Symbol|String] context - :primary, :danger etc
|
86
|
+
# @param [Hash] opts
|
87
|
+
# @option opts [String] :id
|
88
|
+
# @option opts [String] :class
|
89
|
+
# @option opts [Hash] : :data
|
90
|
+
#
|
91
|
+
# @overload badge_helper(opts)
|
92
|
+
# @param [Hash] opts
|
93
|
+
# @option opts [String] :id
|
94
|
+
# @option opts [String] :class
|
95
|
+
# @option opts [Hash] : :data
|
96
|
+
#
|
97
|
+
# @return [String]
|
98
|
+
#
|
99
|
+
def badge_helper(*args, &block)
|
100
|
+
Badge.new(self, *args, &block)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Internal helper, used with personal Bootstrap modifications.
|
104
|
+
#
|
105
|
+
#
|
106
|
+
def callout_helper(*args, &block)
|
107
|
+
Callout.new(self, *args, &block)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Creates a Card component.
|
111
|
+
#
|
112
|
+
# @example Regular Card
|
113
|
+
# ```erb
|
114
|
+
# <%= card_helper do |c| %>
|
115
|
+
# <%= c.header class: 'text-white bg-primary' do %>
|
116
|
+
# <h4>This is the header...</h4>
|
117
|
+
# <% end %>
|
118
|
+
# <%= c.body do %>
|
119
|
+
# <%= c.title { 'This is the title' } %>
|
120
|
+
# <%= c.text { 'This card body' } %>
|
121
|
+
# <ul>
|
122
|
+
# <% [1, 2, 3].each do |x| %>
|
123
|
+
# <li>Item: <%= x %></li>
|
124
|
+
# <% end %>
|
125
|
+
# </ul>
|
126
|
+
# <% end %>
|
127
|
+
# <%= c.footer do %>
|
128
|
+
# This is the footer...
|
129
|
+
# <% end %>
|
130
|
+
# <% end %>
|
131
|
+
# ```
|
132
|
+
#
|
133
|
+
# @example Horizontal Card
|
134
|
+
# ```erb
|
135
|
+
# <%= card_helper do |c| %>
|
136
|
+
# <div class="row no-gutters">
|
137
|
+
# <div class="col-md-4">
|
138
|
+
# <%= image_tag 'placeholder.svg', class: 'card-img' %>
|
139
|
+
# </div>
|
140
|
+
# <div class="col-md-8">
|
141
|
+
# <%= c.body do %>
|
142
|
+
# <%= c.title { "Card title" } %>
|
143
|
+
# <%= c.text do
|
144
|
+
# This is a wider card with supporting text below as a natural
|
145
|
+
# lead-in to additional content.
|
146
|
+
# <% end %>
|
147
|
+
# <%= c.text do %>
|
148
|
+
# <small class="text-muted">Last updated 3 mins ago</small>
|
149
|
+
# <% end %>
|
150
|
+
# <% end %>
|
151
|
+
# </div>
|
152
|
+
# </div>
|
153
|
+
# <% end %>
|
154
|
+
# ```
|
155
|
+
#
|
156
|
+
# @param [Hash] opts
|
157
|
+
# @option opts [String] :id
|
158
|
+
# @option opts [String] :class
|
159
|
+
# @option opts [Hash] :data
|
160
|
+
# @return [String]
|
161
|
+
#
|
162
|
+
def card_helper(opts = {}, &block)
|
163
|
+
Card.new(self, opts, &block)
|
164
|
+
end
|
165
|
+
|
166
|
+
# Generates a Dropdown component. Default type `:dropdown`.
|
167
|
+
#
|
168
|
+
# @example Dropdown
|
169
|
+
# ```erb
|
170
|
+
# <%= dropdown_helper do |dropdown| %>
|
171
|
+
# <%= dropdown.button(:primary) { "Action" } %>
|
172
|
+
# <%= dropdown.menu do |menu| %>
|
173
|
+
# <%= menu.link 'Edit', '#' %>
|
174
|
+
# <%= menu.link 'Delete', '#' %>
|
175
|
+
# <%= menu.text 'Static text' %>
|
176
|
+
# <% end %>
|
177
|
+
# <% end %>
|
178
|
+
# ```
|
179
|
+
#
|
180
|
+
# @example Dropup
|
181
|
+
# ```erb
|
182
|
+
# <%= dropdown_helper :dropup do |dropdown| %>
|
183
|
+
# <%= dropdown.button(:primary) { "Action" } %>
|
184
|
+
# <%= dropdown.menu do |menu| %>
|
185
|
+
# <%= menu.link 'Edit', '#' %>
|
186
|
+
# <%= menu.link 'Delete', '#' %>
|
187
|
+
# <%= menu.text 'Static text' %>
|
188
|
+
# <% end %>
|
189
|
+
# <% end %>
|
190
|
+
# ```
|
191
|
+
#
|
192
|
+
# @example Dropdown w/ menu
|
193
|
+
# ```erb
|
194
|
+
# <%= dropdown_helper do |dropdown| %>
|
195
|
+
# <%= dropdown.button :primary do %>
|
196
|
+
# Login
|
197
|
+
# <% end %>
|
198
|
+
# <%= dropdown.menu do |menu| %>
|
199
|
+
# <form class="px-4 py-3">
|
200
|
+
# <div class="form-group">
|
201
|
+
# <label for="exampleDropdownFormEmail1">Email address</label>
|
202
|
+
# <input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com">
|
203
|
+
# </div>
|
204
|
+
# <div class="form-group">
|
205
|
+
# <label for="exampleDropdownFormPassword1">Password</label>
|
206
|
+
# <input type="password" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password">
|
207
|
+
# </div>
|
208
|
+
# <div class="form-group">
|
209
|
+
# <div class="form-check">
|
210
|
+
# <input type="checkbox" class="form-check-input" id="dropdownCheck">
|
211
|
+
# <label class="form-check-label" for="dropdownCheck">
|
212
|
+
# Remember me
|
213
|
+
# </label>
|
214
|
+
# </div>
|
215
|
+
# </div>
|
216
|
+
# <button type="submit" class="btn btn-primary">Sign in</button>
|
217
|
+
# </form>
|
218
|
+
# <%= menu.divider %>
|
219
|
+
# <%= menu.link "New around here? Sign up", "#" %>
|
220
|
+
# <%= menu.link "Forgot password", "#" %>
|
221
|
+
# <% end %>
|
222
|
+
# <% end %>
|
223
|
+
# ```
|
224
|
+
#
|
225
|
+
# @example Dropdown::Menu in a Nav menu
|
226
|
+
# ```erb
|
227
|
+
# <%= nav.dropdown 'More' do |dropdown| %>
|
228
|
+
# <%= dropdown.item :item5 %>
|
229
|
+
# <%= dropdown.item(:item6) { 'Item 6' } %>
|
230
|
+
# <% end %>
|
231
|
+
# ```
|
232
|
+
#
|
233
|
+
# @overload dropdown_helper(type, opts)
|
234
|
+
# @param [Symbol|String] type - :dropdown, :dropup, :dropstart, :dropend
|
235
|
+
# @param [Hash] opts
|
236
|
+
# @option opts [String] :id
|
237
|
+
# @option opts [String] :class
|
238
|
+
# @option opts [Hash] :data
|
239
|
+
# @option opts [Boolean] :split
|
240
|
+
#
|
241
|
+
# @overload dropdown(opts)
|
242
|
+
# @param [Hash] opts
|
243
|
+
# @option opts [String] :id
|
244
|
+
# @option opts [String] :class
|
245
|
+
# @option opts [Hash] :data
|
246
|
+
# @option opts [Boolean] :split
|
247
|
+
#
|
248
|
+
# @return [String]
|
249
|
+
#
|
250
|
+
def dropdown_helper(*args, &block)
|
251
|
+
Dropdown.new(self, *args, &block)
|
252
|
+
end
|
253
|
+
|
254
|
+
# Generates Modal windows.
|
255
|
+
#
|
256
|
+
# @example
|
257
|
+
# ```erb
|
258
|
+
# <%= modal_helper id: 'exampleModal' do |m| %>
|
259
|
+
# <%= m.header do %>
|
260
|
+
# <%= m.title { 'Example Modal' } %>
|
261
|
+
# <%= m.close_button %>
|
262
|
+
# <% end %>
|
263
|
+
# <%= m.body do %>
|
264
|
+
# Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel nisi tempora, eius iste sit nobis
|
265
|
+
# earum in harum optio dolore explicabo. Eveniet reprehenderit harum itaque ad fuga beatae, quasi
|
266
|
+
# sequi! Laborum ea porro nihil ipsam repudiandae vel harum voluptates minima corrupti unde quas,
|
267
|
+
# dolore possimus doloribus voluptatem sint fuga dolores odio dignissimos at molestias earum.
|
268
|
+
# <% end %>
|
269
|
+
# <%= m.footer do %>
|
270
|
+
# <%= m.close_button class: 'btn btn-secondary' do %>
|
271
|
+
# Close
|
272
|
+
# <% end %>
|
273
|
+
# <% end %>
|
274
|
+
# <% end %>
|
275
|
+
# ```
|
276
|
+
#
|
277
|
+
# @param [Hash] opts
|
278
|
+
# @option opts [String] :id
|
279
|
+
# @option opts [String] :class
|
280
|
+
# @option opts [Hash] :data
|
281
|
+
# @option opts [Boolean] :scrollable
|
282
|
+
# @option opts [Boolean] :vcentered
|
283
|
+
# @option opts [Boolean] :static
|
284
|
+
# @option opts [Boolean|Symbol] :fullscreen - true, :sm, :lg, :xl etc
|
285
|
+
# @option opts [Symbol] :size - :sm, :md, :lg etc
|
286
|
+
# @return [String]
|
287
|
+
#
|
288
|
+
def modal_helper(opts = {}, &block)
|
289
|
+
Modal.new(self, opts, &block)
|
290
|
+
end
|
291
|
+
|
292
|
+
# Generates Nav components.
|
293
|
+
#
|
294
|
+
# @example
|
295
|
+
# ```erb
|
296
|
+
# <%= nav_helper do |nav| %>
|
297
|
+
# <%= nav.link "Item 1", "https://www.google.com" %>
|
298
|
+
# <%= nav.link "Item 2", "#" %>
|
299
|
+
# <%= nav.link "Item 3", "#" %>
|
300
|
+
# <%= nav.dropdown :more do |menu| %>
|
301
|
+
# <%= menu.link 'People', '#' %>
|
302
|
+
# <%= menu.link 'Records', '#' %>
|
303
|
+
# <% end %>
|
304
|
+
#
|
305
|
+
# <%= nav.dropdown "More 2" do |menu| %>
|
306
|
+
# <%= menu.link 'People', '#' %>
|
307
|
+
# <%= menu.link 'Records', '#' %>
|
308
|
+
# <% end %>
|
309
|
+
# <% end %>
|
310
|
+
# ```
|
311
|
+
#
|
312
|
+
# @overload nav_helper(tag, opts)
|
313
|
+
# @param [Symbol|String] tag - :nav, :ul
|
314
|
+
# @param [Hash] opts
|
315
|
+
# @option opts [String] :id
|
316
|
+
# @option opts [String] :class
|
317
|
+
# @option opts [Hash] :data
|
318
|
+
# @option opts [Hash] :child - data attributes for child, NOT wrapper
|
319
|
+
#
|
320
|
+
# @overload nav_helper(opts)
|
321
|
+
# @param [Hash] opts
|
322
|
+
# @option opts [String] :id
|
323
|
+
# @option opts [String] :class
|
324
|
+
# @option opts [Hash] :data
|
325
|
+
# @option opts [Hash] :child - data attributes for child, NOT wrapper
|
326
|
+
#
|
327
|
+
# @return [String]
|
328
|
+
#
|
329
|
+
def nav_helper(*args, &block)
|
330
|
+
Nav.new(self, *args, &block)
|
331
|
+
end
|
332
|
+
|
333
|
+
# Generates a Offcanvas component.
|
334
|
+
#
|
335
|
+
# @example:
|
336
|
+
# ```erb
|
337
|
+
# <%= offcanvas_helper :top, id: 'off_canvas_example1' do |off| %>
|
338
|
+
# <%= off.button 'Open sidebar', class: 'btn btn-primary' %>
|
339
|
+
# <%= off.content do |c| %>
|
340
|
+
# <%= c.header do %>
|
341
|
+
# <%= c.title { 'Sidebar content' } %>
|
342
|
+
# <%= c.close_button %>
|
343
|
+
# <% end %>
|
344
|
+
# <%= c.body do %>
|
345
|
+
# <p>Some content in the sidebar!</p>
|
346
|
+
# <% end %>
|
347
|
+
# <% end %>
|
348
|
+
# <% end %>
|
349
|
+
# ```
|
350
|
+
#
|
351
|
+
# @example:
|
352
|
+
# ```erb
|
353
|
+
# <%= offcanvas_helper scrollable: true, id: 'off_canvas_example2' do |off| %>
|
354
|
+
# <%= off.link class: 'btn btn-danger' do %>
|
355
|
+
# <strong>*</strong> Open sidebar 2
|
356
|
+
# <% end %>
|
357
|
+
#
|
358
|
+
# <%= off.content do |c| %>
|
359
|
+
# <%= c.header do %>
|
360
|
+
# <%= c.title { 'Sidebar content 2' } %>
|
361
|
+
# <%= c.close_button class: 'btn btn-info' do %>
|
362
|
+
# Close
|
363
|
+
# <% end %>
|
364
|
+
# <% end %>
|
365
|
+
# <%= c.body do %>
|
366
|
+
# <p>Some content in the sidebar 2!</p>
|
367
|
+
# <% end %>
|
368
|
+
# <% end %>
|
369
|
+
# <% end %>
|
370
|
+
# ```
|
371
|
+
#
|
372
|
+
# @overload offcanvas_helper(position, options)
|
373
|
+
# @param [Symbol] position - :start, :end, :top, :bottom
|
374
|
+
# @param [Hash] opts
|
375
|
+
# @option opts [String] :id
|
376
|
+
# @option opts [String] :class
|
377
|
+
# @option opts [Hash] :data
|
378
|
+
# @option opts [Hash] :aria
|
379
|
+
# @option opts [Boolean] :scrollable
|
380
|
+
# @option opts [Boolean|String] :backdrop - true, false, 'static'
|
381
|
+
#
|
382
|
+
# @overload offcanvas_helper(options)
|
383
|
+
# @param [Hash] opts
|
384
|
+
# @option opts [String] :id
|
385
|
+
# @option opts [String] :class
|
386
|
+
# @option opts [Hash] :data
|
387
|
+
# @option opts [Hash] :aria
|
388
|
+
# @option opts [Boolean] :scrollable
|
389
|
+
# @option opts [Boolean|String] :backdrop - true, false, 'static'
|
390
|
+
#
|
391
|
+
# @return [String]
|
392
|
+
#
|
393
|
+
def offcanvas_helper(*args, &block)
|
394
|
+
Offcanvas.new(self, *args, &block)
|
395
|
+
end
|
396
|
+
|
397
|
+
# Generates a page header, similiar to bootstrap 3
|
398
|
+
#
|
399
|
+
# @example
|
400
|
+
# ```erb
|
401
|
+
# <%= page_header_helper class: 'mt-5' do %>
|
402
|
+
# Test Application
|
403
|
+
# <% end %>
|
404
|
+
# ```
|
405
|
+
#
|
406
|
+
# @overload page_header_helper(tag, opts)
|
407
|
+
# @param [Symbol|String] tag
|
408
|
+
# @param [Hash] opts
|
409
|
+
# @option opts [String] :id
|
410
|
+
# @option opts [String] :class
|
411
|
+
# @option opts [Hash] :data
|
412
|
+
#
|
413
|
+
# @overload page_header_helper(opts)
|
414
|
+
# @param [Hash] opts
|
415
|
+
# @option opts [String] :id
|
416
|
+
# @option opts [String] :class
|
417
|
+
# @option opts [Hash] :data
|
418
|
+
#
|
419
|
+
# @return [String]
|
420
|
+
#
|
421
|
+
def page_header_helper(*args, &block)
|
422
|
+
PageHeader.new(self, *args, &block)
|
423
|
+
end
|
424
|
+
|
425
|
+
# Generates a input group component.
|
426
|
+
#
|
427
|
+
# @example
|
428
|
+
# ```erb
|
429
|
+
# <%= input_group_helper do |ig| %>
|
430
|
+
# <%= ig.text do %>
|
431
|
+
# <i class="fas fa-at"></i>
|
432
|
+
# <% end %>
|
433
|
+
# <input type="text" value="" name="email" placeholder="Email" class="form-control" />
|
434
|
+
# <% end %>
|
435
|
+
# ```
|
436
|
+
#
|
437
|
+
# @example Large input group
|
438
|
+
# ```erb
|
439
|
+
# <%= input_group_helper :lg do |ig| %>
|
440
|
+
# <input type="text" value="" name="email" placeholder="Email" class="form-control" />
|
441
|
+
# <%= ig.text { "@" } %>
|
442
|
+
# <% end %>
|
443
|
+
# ```
|
444
|
+
#
|
445
|
+
# @overload input_group_helper(context, options)
|
446
|
+
# @param [Symbol|String] context - :sm, :lg
|
447
|
+
# @param [Hash] opts
|
448
|
+
# @option opts [String] :id
|
449
|
+
# @option opts [String] :class
|
450
|
+
# @option opts [Hash] :data
|
451
|
+
#
|
452
|
+
# @overload input_group_helper(opts)
|
453
|
+
# @param [Hash] opts
|
454
|
+
# @option opts [String] :id
|
455
|
+
# @option opts [String] :class
|
456
|
+
# @option opts [Hash] :data
|
457
|
+
#
|
458
|
+
# @return [String]
|
459
|
+
#
|
460
|
+
def input_group_helper(*args, &block)
|
461
|
+
InputGroup.new(self, *args, &block)
|
462
|
+
end
|
463
|
+
|
464
|
+
# Generates a Tab component.
|
465
|
+
#
|
466
|
+
# @example
|
467
|
+
# ```erb
|
468
|
+
# <%= tab_helper do |tab| %>
|
469
|
+
# <%= tab.nav do |nav| %>
|
470
|
+
# <%= nav.item :item1 do %>
|
471
|
+
# Item 1
|
472
|
+
# <% end %>
|
473
|
+
# <%= nav.item(:item2, class: 'active') { "Item 2" } %>
|
474
|
+
# <%= nav.item(:item3) { "Item 3" } %>
|
475
|
+
# <%= nav.item :item4 %>
|
476
|
+
# <%= nav.dropdown 'More' do |dropdown| %>
|
477
|
+
# <%= dropdown.item :item5 %>
|
478
|
+
# <%= dropdown.item(:item6) { 'Item 6' } %>
|
479
|
+
# <% end %>
|
480
|
+
# <% end %>
|
481
|
+
#
|
482
|
+
# <%= tab.content do |content| %>
|
483
|
+
# <%= content.pane :item1, class: 'mt-3' do %>
|
484
|
+
# Content 1
|
485
|
+
# <% end %>
|
486
|
+
#
|
487
|
+
# <%= content.pane :item2, class: 'active mt-3' do %>
|
488
|
+
# Content 2
|
489
|
+
# <% end %>
|
490
|
+
#
|
491
|
+
# <%= content.pane :item3, class: 'mt-3' do %>
|
492
|
+
# Content 3
|
493
|
+
# <% end %>
|
494
|
+
#
|
495
|
+
# <%= content.pane :item4, class: 'mt-3' do %>
|
496
|
+
# Content 4
|
497
|
+
# <% end %>
|
498
|
+
#
|
499
|
+
# <%= content.pane :item5, class: 'mt-3' do %>
|
500
|
+
# Content 5
|
501
|
+
# <% end %>
|
502
|
+
#
|
503
|
+
# <%= content.pane :item6, class: 'mt-3' do %>
|
504
|
+
# Content 6
|
505
|
+
# <% end %>
|
506
|
+
# <% end %>
|
507
|
+
# <% end %>
|
508
|
+
# ```
|
509
|
+
#
|
510
|
+
# @overload tab_helper(type, opts)
|
511
|
+
# @param [Symbol|String] type - :tabs, :pills
|
512
|
+
# @param [Hash] opts
|
513
|
+
# @option opts [String] :id
|
514
|
+
# @option opts [String] :class
|
515
|
+
# @option opts [Hash] :data
|
516
|
+
#
|
517
|
+
# @overload tab_helper(opts)
|
518
|
+
# @param [Hash] opts
|
519
|
+
# @option opts [String] :id
|
520
|
+
# @option opts [String] :class
|
521
|
+
# @option opts [Hash] :data
|
522
|
+
#
|
523
|
+
# @return [String]
|
524
|
+
#
|
525
|
+
def tab_helper(*args, &block)
|
526
|
+
Tab.new(self, *args, &block)
|
527
|
+
end
|
528
|
+
|
529
|
+
# Generates spinner annimations.
|
530
|
+
#
|
531
|
+
# @example
|
532
|
+
# ```erb
|
533
|
+
# <%= spinner_helper class: 'text-warning' %>
|
534
|
+
# <%= spinner_helper type: :grow, class: 'text-danger', id: 'loadingRecords' %>
|
535
|
+
# ```
|
536
|
+
#
|
537
|
+
# @param [Hash] args
|
538
|
+
# @option opts [Symbol] :type - :border, :grow
|
539
|
+
# @option opts [String] :id
|
540
|
+
# @option opts [String] :class
|
541
|
+
# @option opts [Hash] :data
|
542
|
+
# @return [String]
|
543
|
+
#
|
544
|
+
def spinner_helper(opts = {}, &block)
|
545
|
+
Spinner.new(self, opts, &block)
|
546
|
+
end
|
547
|
+
end
|
metadata
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootstrap5_helper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Robert David
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-07-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bootstrap
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.1.3
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.1.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jquery-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: redcarpet
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: solargraph
|
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'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.2'
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 8.0.0
|
79
|
+
type: :runtime
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '4.2'
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 8.0.0
|
89
|
+
description: Rails helpers for generating Bootstrap 5 components.
|
90
|
+
email:
|
91
|
+
- robert.david@state.mn.us
|
92
|
+
executables: []
|
93
|
+
extensions: []
|
94
|
+
extra_rdoc_files: []
|
95
|
+
files:
|
96
|
+
- MIT-LICENSE
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- lib/bootstrap5_helper.rb
|
100
|
+
- lib/bootstrap5_helper/accordion.rb
|
101
|
+
- lib/bootstrap5_helper/accordion/item.rb
|
102
|
+
- lib/bootstrap5_helper/alert.rb
|
103
|
+
- lib/bootstrap5_helper/badge.rb
|
104
|
+
- lib/bootstrap5_helper/callout.rb
|
105
|
+
- lib/bootstrap5_helper/card.rb
|
106
|
+
- lib/bootstrap5_helper/component.rb
|
107
|
+
- lib/bootstrap5_helper/configuration.rb
|
108
|
+
- lib/bootstrap5_helper/constants.rb
|
109
|
+
- lib/bootstrap5_helper/dropdown.rb
|
110
|
+
- lib/bootstrap5_helper/dropdown/menu.rb
|
111
|
+
- lib/bootstrap5_helper/initialize.rb
|
112
|
+
- lib/bootstrap5_helper/input_group.rb
|
113
|
+
- lib/bootstrap5_helper/modal.rb
|
114
|
+
- lib/bootstrap5_helper/nav.rb
|
115
|
+
- lib/bootstrap5_helper/offcanvas.rb
|
116
|
+
- lib/bootstrap5_helper/offcanvas/content.rb
|
117
|
+
- lib/bootstrap5_helper/page_header.rb
|
118
|
+
- lib/bootstrap5_helper/railtie.rb
|
119
|
+
- lib/bootstrap5_helper/spinner.rb
|
120
|
+
- lib/bootstrap5_helper/tab.rb
|
121
|
+
- lib/bootstrap5_helper/tab/content.rb
|
122
|
+
- lib/bootstrap5_helper/toast.rb
|
123
|
+
- lib/bootstrap5_helper/version.rb
|
124
|
+
- lib/tasks/bootstrap5_helper_tasks.rake
|
125
|
+
homepage: https://github.com/rdavid369/bootstrap5-helper
|
126
|
+
licenses:
|
127
|
+
- MIT
|
128
|
+
metadata:
|
129
|
+
allowed_push_host: https://rubygems.org
|
130
|
+
homepage_uri: https://github.com/rdavid369/bootstrap5-helper
|
131
|
+
source_code_uri: https://github.com/rdavid369/bootstrap5-helper/blob/main/CHANGELOG.md
|
132
|
+
changelog_uri: https://github.com/rdavid369/bootstrap5-helper
|
133
|
+
post_install_message:
|
134
|
+
rdoc_options: []
|
135
|
+
require_paths:
|
136
|
+
- lib
|
137
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
requirements: []
|
148
|
+
rubygems_version: 3.1.6
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: Rails helpers for generating Bootstrap 5 components.
|
152
|
+
test_files: []
|