css-zero 0.0.82 → 0.0.83

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: e8ec29ec17afa74563dcc2fa5bd24685b96132de62a6aa0cb14785463925dcf2
4
- data.tar.gz: 183f5f659feb95a2d82467e8c4739acd0ba2cdb9f49b143cadcc4e4d5688aa59
3
+ metadata.gz: 71c3c38650e2b111579da72c2349589c5ae2bd114223701b7dd6dc2459136b35
4
+ data.tar.gz: 19401b13fa751a752893c70e9d9b84d641984a510fd66e246e188054360edbb1
5
5
  SHA512:
6
- metadata.gz: d68e553275f7974dbb96e912119d23c70e2362eb63ec111485d601ac15f07f17d36c172001eb63e958b4f2c29bf21d34f8bab6954355645574784e10730ccf1a
7
- data.tar.gz: 799ae1844ba99b374498076523c3050473eaf40dccfaa0b05f1e680293ca679c7e96a8fe005909985d3f8cf2de12a30e8f9c6186425c599e43020dab837cf076
6
+ metadata.gz: d67f8fb7778c60e40e7bfcedd7524b6296091777561e48c60c267d1c4bef5969f124c8b80ccd37a1f28f2da8d7e9988e8d9d3b90fbc67e9d4e70c904aabf4c51
7
+ data.tar.gz: 52d1ebd7224d43b4a4d67cd9b473fbbd60f849cfe02f56b8abecd3cdb8c02f460d6f8795411a7a22fd08234e0f0958e8de7bd263ca5059bb09809d9c623bf877
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.82"
2
+ VERSION = "0.0.83"
3
3
  end
@@ -36,7 +36,7 @@ combobox:
36
36
  command:
37
37
  - app/assets/stylesheets/command.css
38
38
  - app/javascript/controllers/filter_controller.js
39
- - app/javascript/controllers/list_controller.js
39
+ - app/javascript/controllers/listbox_controller.js
40
40
  - app/assets/images/search.svg
41
41
  collapsible:
42
42
  - app/javascript/controllers/collapsible_controller.js
@@ -0,0 +1,22 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import Listbox from "https://cdn.skypack.dev/@github/combobox-nav@3.0.1?min"
3
+
4
+ export default class extends Controller {
5
+ static targets = [ "input", "list" ]
6
+
7
+ connect() {
8
+ this.listbox = new Listbox(this.inputTarget, this.listTarget)
9
+ }
10
+
11
+ disconnect() {
12
+ this.listbox.destroy()
13
+ }
14
+
15
+ start() {
16
+ this.listbox.start()
17
+ }
18
+
19
+ stop() {
20
+ this.listbox.stop()
21
+ }
22
+ }
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.82
4
+ version: 0.0.83
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: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: lazaronixon@hotmail.com
@@ -105,7 +105,7 @@ files:
105
105
  - lib/generators/css_zero/add/templates/app/javascript/controllers/hotkey_controller.js
106
106
  - lib/generators/css_zero/add/templates/app/javascript/controllers/inputmask_controller.js
107
107
  - lib/generators/css_zero/add/templates/app/javascript/controllers/lightbox_controller.js
108
- - lib/generators/css_zero/add/templates/app/javascript/controllers/list_controller.js
108
+ - lib/generators/css_zero/add/templates/app/javascript/controllers/listbox_controller.js
109
109
  - lib/generators/css_zero/add/templates/app/javascript/controllers/local_time_controller.js
110
110
  - lib/generators/css_zero/add/templates/app/javascript/controllers/menu_controller.js
111
111
  - lib/generators/css_zero/add/templates/app/javascript/controllers/navigation_controller.js
@@ -1,79 +0,0 @@
1
- import { Controller } from "@hotwired/stimulus"
2
-
3
- export default class extends Controller {
4
- static targets = [ "option" ]
5
- static values = { index: Number }
6
-
7
- connect() {
8
- this.#removeTabstops()
9
- this.#selectFirstOption()
10
- }
11
-
12
- reset() {
13
- this.indexValue = 0
14
- this.#selectCurrentOption()
15
- }
16
-
17
- navigate(event) {
18
- switch (event.key) {
19
- case "ArrowUp":
20
- event.preventDefault()
21
- this.#prev()
22
- break
23
- case "ArrowDown":
24
- event.preventDefault()
25
- this.#next()
26
- break
27
- case "Enter":
28
- event.preventDefault()
29
- this.#clickSelected()
30
- break
31
- }
32
- }
33
-
34
- #prev() {
35
- if (this.indexValue > 0) {
36
- this.indexValue--
37
- this.#selectCurrentOption()
38
- }
39
- }
40
-
41
- #next() {
42
- if (this.indexValue < this.#lastIndex) {
43
- this.indexValue++
44
- this.#selectCurrentOption()
45
- }
46
- }
47
-
48
- #clickSelected() {
49
- this.#visibleOptions[this.indexValue]?.click()
50
- }
51
-
52
- #removeTabstops() {
53
- this.optionTargets.forEach(e => e.tabIndex = -1)
54
- }
55
-
56
- #selectFirstOption() {
57
- this.optionTargets.forEach((element, index) => {
58
- element.ariaSelected = index === 0
59
- })
60
- }
61
-
62
- #selectCurrentOption() {
63
- this.optionTargets.forEach((element, index) => {
64
- element.ariaSelected = false
65
- })
66
-
67
- this.#visibleOptions.forEach((element, index) => {
68
- element.ariaSelected = index === this.indexValue
69
- })
70
- }
71
-
72
- get #visibleOptions() {
73
- return this.optionTargets.filter(e => e.offsetParent != null)
74
- }
75
-
76
- get #lastIndex() {
77
- return this.#visibleOptions.length -1
78
- }
79
- }