effective_bootstrap 0.9.20 → 0.9.21

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: fc9ac29fcd023cd275a7a7297fa003465ae57dd4083bc918726ddd320a64aba7
4
- data.tar.gz: cdc85057126193e16d6ffe680d2176f4338fa18eb2e8ffbd9988ea80f3c7ec84
3
+ metadata.gz: d047c5108e24b36af0b9269cea370b61afaae229174b8b3febf59c95fdca14f7
4
+ data.tar.gz: 75f25ac6d8dc18e6f4b4462a6eb16b237c4aa6898d19c2686348241b8337da0d
5
5
  SHA512:
6
- metadata.gz: 43b8330b6295ba275311ea1dc07fa4eb96d33e740f24c35f48c793f4c2941e0e26ddd0b6940ef7d4046cd5e336d765fc47bd62357ce67124bed143d12a81625b
7
- data.tar.gz: cfcf9995db34b32add68cb9a3e7bc79c441d20758ee12846c177ac37985f0538495ea032b0bc34738cdd0d710cef499af164f2ca9f41fbf01076417044e5bf24
6
+ metadata.gz: '09531a9a125e7d7aebec11aa7fe41ef563ccc5f1777dc04cb02603ec8edb0d3384ba86d5f3c79aefe5d64b45a72dd4ded0c098fe6593c4347f080c8faaca237f'
7
+ data.tar.gz: 349e700ff1f0324dd51f81ecb134774720f0de7197d0c1da4684388a67314828c4a211e903a26b279e8adb25b451629632123ac12204a51380738c7f0dac7a67
@@ -411,7 +411,9 @@ module EffectiveBootstrapHelper
411
411
 
412
412
  @_tab_active = nil if @_tab_active == :first
413
413
 
414
- if @_tab_mode == :tablist # Inserting the label into the tablist top
414
+ if @_tab_mode == :tablist_vertical
415
+ content_tag(:a, label, id: ('tab-' + controls), class: ['nav-link', ('active' if active)].compact.join(' '), href: '#' + controls, 'aria-controls': controls, 'aria-selected': active.to_s, 'data-toggle': 'tab', role: 'tab')
416
+ elsif @_tab_mode == :tablist # Inserting the label into the tablist top
415
417
  content_tag(:li, class: 'nav-item') do
416
418
  content_tag(:a, label, id: ('tab-' + controls), class: ['nav-link', ('active' if active)].compact.join(' '), href: '#' + controls, 'aria-controls': controls, 'aria-selected': active.to_s, 'data-toggle': 'tab', role: 'tab')
417
419
  end
@@ -423,6 +425,29 @@ module EffectiveBootstrapHelper
423
425
  end
424
426
  end
425
427
 
428
+ def vertical_tabs(active: nil, unique: false, list: {}, content: {}, &block)
429
+ raise 'expected a block' unless block_given?
430
+
431
+ @_tab_mode = :tablist_vertical
432
+ @_tab_active = (active || :first)
433
+ @_tab_unique = ''.object_id if unique
434
+
435
+ content_tag(:div, class: 'row border') do
436
+ content_tag(:div, class: 'col-3 border-right') do
437
+ content_tag(:div, {class: 'nav flex-column nav-pills my-2', role: 'tablist', 'aria-orientation': :vertical}.merge(list)) do
438
+ yield # Yield to tab the first time
439
+ end
440
+ end +
441
+ content_tag(:div, class: 'col-9') do
442
+ content_tag(:div, {class: 'tab-content my-2'}.merge(content)) do
443
+ @_tab_mode = :content
444
+ @_tab_active = (active || :first)
445
+ yield # Yield to tab the second time
446
+ end
447
+ end
448
+ end
449
+ end
450
+
426
451
  def merge_class_key(hash, value)
427
452
  return { :class => value } unless hash.kind_of?(Hash)
428
453
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.20'.freeze
2
+ VERSION = '0.9.21'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.20
4
+ version: 0.9.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails