five-two-nw-olivander 0.2.0.48 → 0.2.0.49
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d230d3b035fa0ef2848260e9a18935d703332e40ae67e1f3ac82720859ed681
|
4
|
+
data.tar.gz: 25d75dde2112dee7691f9e01f02da3383b7f86fb1a5bebf21516fffbef504443
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64885a09cd9644a5eb035605186ec6ccfd711906772a81ff62b3ecf8523c78cf7ed2fd6a6eeb4e349e19779591f09b7f02516dd6ab06f8a4a0520aca8af0a212
|
7
|
+
data.tar.gz: 95a26ab22fb487d7fae8646898457fc77fbd77d02dd0a5fa8439931a892b1da3e05c80ac23307c9d2db6a0f3561f0c727abcf4975f93315679b913761b201a89
|
@@ -0,0 +1,33 @@
|
|
1
|
+
- content_for tab_strip_id do
|
2
|
+
%ul.nav.nav-tabs{id: id, role: "tablist"}
|
3
|
+
- tabs.each_with_index do |tab, index|
|
4
|
+
%li.nav-item
|
5
|
+
%a.nav-link{
|
6
|
+
id: "#{tab.id}-tab",
|
7
|
+
href: "##{tab.id}",
|
8
|
+
"data-toggle": "tab",
|
9
|
+
role: "tab",
|
10
|
+
"aria-controls": tab.id,
|
11
|
+
"aria-selected": tab.active,
|
12
|
+
class: ("nav-link active" if tab.active)
|
13
|
+
}
|
14
|
+
= tab.title
|
15
|
+
- content_for tab_content_id do
|
16
|
+
.tab-content.mt-2{id: "#{id}-content"}
|
17
|
+
- tabs.each do |tab|
|
18
|
+
.tab-pane.fade{
|
19
|
+
id: tab.id,
|
20
|
+
role: "tabpanel",
|
21
|
+
"aria-labelledby": "#{tab.id}-tab",
|
22
|
+
class: ("tab-pane fade show active" if tab.active)
|
23
|
+
}
|
24
|
+
= tab
|
25
|
+
- if card
|
26
|
+
.card.card-tabs{ class: card_class }
|
27
|
+
.card-header.p-0.pt-1
|
28
|
+
= content_for tab_strip_id
|
29
|
+
.card-body
|
30
|
+
= content_for tab_content_id
|
31
|
+
- else
|
32
|
+
= content_for tab_strip_id
|
33
|
+
= content_for tab_content_id
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# app/components/tab_component.rb
|
4
|
+
module Olivander
|
5
|
+
module Components
|
6
|
+
# component to render tabs
|
7
|
+
class TabsComponent < ViewComponent::Base
|
8
|
+
renders_many :tabs, '::Olivander::Components::TabsComponent::Tab'
|
9
|
+
|
10
|
+
attr_reader :id, :card, :card_class, :tab_strip_id, :tab_content_id
|
11
|
+
|
12
|
+
def initialize(*args)
|
13
|
+
super
|
14
|
+
options = args.extract_options!
|
15
|
+
@id = options[:id] || "tabs-#{SecureRandom.hex(4)}"
|
16
|
+
@card = options.key?(:card) ? !!options[:card] : true
|
17
|
+
@card_class = options.key?(:card_class) ? !!options[:card_class] : 'card-primary'
|
18
|
+
@tab_strip_id = "tab-strip-#{SecureRandom.hex(4)}"
|
19
|
+
@tab_content_id = "tab-strip-#{SecureRandom.hex(4)}"
|
20
|
+
end
|
21
|
+
|
22
|
+
class Tab < ViewComponent::Base
|
23
|
+
attr_reader :title, :id, :active
|
24
|
+
|
25
|
+
def initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false)
|
26
|
+
super
|
27
|
+
@title = title
|
28
|
+
@id = id
|
29
|
+
@active = active
|
30
|
+
end
|
31
|
+
|
32
|
+
def call
|
33
|
+
content
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -41,6 +41,8 @@ module Olivander
|
|
41
41
|
dc = collection.nil? ? klazz.all : collection
|
42
42
|
|
43
43
|
attributes.each do |att|
|
44
|
+
next if att[0].to_s == 'deleted_at' && klazz.respond_to?(:paranoid?) && klazz.paranoid?
|
45
|
+
|
44
46
|
dc = dc.where("#{att[0]} = ?", att[1]) if klazz_attributes.include?(att[0].to_s)
|
45
47
|
end
|
46
48
|
|
data/lib/olivander/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five-two-nw-olivander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -268,6 +268,8 @@ files:
|
|
268
268
|
- app/components/olivander/components/table_portlet_component.html.haml
|
269
269
|
- app/components/olivander/components/table_portlet_component.rb
|
270
270
|
- app/components/olivander/components/table_portlet_component/table_component.html.haml
|
271
|
+
- app/components/olivander/components/tabs_component.html.haml
|
272
|
+
- app/components/olivander/components/tabs_component.rb
|
271
273
|
- app/controllers/concerns/olivander/resources/application_record.rb
|
272
274
|
- app/controllers/concerns/olivander/resources/auto_form_attributes.rb
|
273
275
|
- app/controllers/concerns/olivander/resources/crud_controller.rb
|