css-zero 0.0.31 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/tabs_helper.rb +6 -2
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/sheet.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/tabs.css +1 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js +5 -5
- 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: b786d5d38b248a7289f4dcce1246ddcdffebc21deb4327dc8ac575c1466ba5b9
|
4
|
+
data.tar.gz: 4364538047fdcd11f323687ed346662b334651404bdabf2c125d822c3f96cc3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9efa1df9e4643f47ef0dd2cf9d334a02ddfcbfcf1979819acdada8068aefe81c22347180d392151b6d8699ca6022253763cb7438bba59c20fec123f5d7ff0d8
|
7
|
+
data.tar.gz: fd75ca1525671ceb6ffcb24c3fd4291e0f044366999c2958c3fb33c84973fff0ca32e35c509cfce4b7e5ead3218706787fc29763096a1b30ad8c438d281a76ed
|
data/app/helpers/tabs_helper.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
module TabsHelper
|
2
|
-
def tab_button(content = nil, value:, **, &)
|
3
|
-
tag.button(content, data: { tabs_target: "button", action: "tabs#select", value: }, **, &)
|
2
|
+
def tab_button(content = nil, id:, value:, **, &)
|
3
|
+
tag.button(content, id:, class: "btn", role: "tab", aria: { controls: value }, data: { tabs_target: "button", action: "tabs#select", value: }, **, &)
|
4
|
+
end
|
5
|
+
|
6
|
+
def tab_panel(id, labelled_by:, **, &)
|
7
|
+
tag.div(id:, role: "tabpanel", aria: { labelledby: labelled_by }, data: { tabs_target: "tab" }, **, &)
|
4
8
|
end
|
5
9
|
end
|
data/lib/css_zero/version.rb
CHANGED
@@ -2,24 +2,24 @@ import { Controller } from "@hotwired/stimulus"
|
|
2
2
|
|
3
3
|
export default class extends Controller {
|
4
4
|
static targets = [ "button", "tab" ]
|
5
|
-
static values
|
5
|
+
static values = { selected: String }
|
6
6
|
|
7
7
|
initialize() {
|
8
8
|
this.#showSelectedTab()
|
9
9
|
}
|
10
10
|
|
11
|
-
select(
|
12
|
-
this.selectedValue =
|
11
|
+
select({ target }) {
|
12
|
+
this.selectedValue = target.dataset.value
|
13
13
|
this.#showSelectedTab()
|
14
14
|
}
|
15
15
|
|
16
16
|
#showSelectedTab() {
|
17
17
|
this.buttonTargets.forEach(element => {
|
18
|
-
element.
|
18
|
+
element.ariaSelected = element.dataset.value === this.selectedValue
|
19
19
|
})
|
20
20
|
|
21
21
|
this.tabTargets.forEach(element => {
|
22
|
-
element.hidden = element.
|
22
|
+
element.hidden = element.id !== this.selectedValue
|
23
23
|
})
|
24
24
|
}
|
25
25
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lázaro Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|