css-zero 0.0.45 → 0.0.46
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7ffebd97b488ac4e393dc73e07f275f26eb725047c9eaa38ae5d8e4b2b1f269
|
4
|
+
data.tar.gz: dbf4888048ff67654e774494e939769966039ebbb9b3d81a1d528f1e9300c710
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdd78709eb65d56e40ba410ef5696658498cf0bd8038472b491c671bacf64d5566ad673b1489946b87f3aca0276f1dc2acfab6166db1227bb771f8d7cca3ed26
|
7
|
+
data.tar.gz: 28b8fafdafc09e8ec66815b0a1c5461bca0d5209d35528d3ede1b0fdfc7818c518a0a73928c6841da64d60711f9b42e8152380ebab5314eac5c98b50ab9edcc4
|
data/lib/css_zero/version.rb
CHANGED
@@ -2,11 +2,11 @@ import { Controller } from "@hotwired/stimulus"
|
|
2
2
|
|
3
3
|
export default class extends Controller {
|
4
4
|
static targets = [ "item" ]
|
5
|
-
static values = { index: Number }
|
5
|
+
static values = { index: { type: Number, default: -1 } }
|
6
6
|
|
7
|
-
indexValueChanged() {
|
7
|
+
indexValueChanged(index) {
|
8
8
|
this.#removeTabstops()
|
9
|
-
this.#focusCurrentItem()
|
9
|
+
this.#focusCurrentItem(index !== -1)
|
10
10
|
}
|
11
11
|
|
12
12
|
prev() {
|
@@ -18,16 +18,16 @@ export default class extends Controller {
|
|
18
18
|
}
|
19
19
|
|
20
20
|
reset() {
|
21
|
-
this.indexValue =
|
21
|
+
this.indexValue = -1
|
22
22
|
}
|
23
23
|
|
24
24
|
#removeTabstops() {
|
25
25
|
this.itemTargets.forEach(item => item.tabIndex = -1)
|
26
26
|
}
|
27
27
|
|
28
|
-
#focusCurrentItem() {
|
29
|
-
this.itemTargets[this.indexValue].tabIndex = 0
|
30
|
-
this.itemTargets[this.indexValue].focus()
|
28
|
+
#focusCurrentItem(shouldFocus) {
|
29
|
+
if (shouldFocus) this.itemTargets[this.indexValue].tabIndex = 0
|
30
|
+
if (shouldFocus) this.itemTargets[this.indexValue].focus()
|
31
31
|
}
|
32
32
|
|
33
33
|
get #lastIndex() {
|
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.46
|
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-10-
|
11
|
+
date: 2024-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|