css-zero 0.0.85 → 0.0.86
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 +4 -4
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/resources.yml +1 -0
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/prose.css +1 -1
- data/lib/generators/css_zero/add/templates/app/assets/stylesheets/zcombobox.css +0 -5
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js +11 -0
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/menu_controller.js +23 -8
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/popover_controller.js +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9db39d993375c71281634dcc6d4cf952d063cc91fa06a5dac1d570ed73970b4c
|
4
|
+
data.tar.gz: b317d56e8be1be45f5eb781c8db8a776acd43f8cf6c49058758bc65ed5573fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80cd9c9f10bd5dc571ebb119606cfc3c2555243157a85d1175054f3ebbed55524f5ee22d9a84e54de02eccc7d6e1855a6cf77e481f2f7ebd228259180b02b3a9
|
7
|
+
data.tar.gz: 97792e3a516b4eab80d530fa5f01e4f7e429c4f5201b61636ca85b4033bd6946f4109a79620620723a6760dd01d0666da44ba4fd2eee65a480dcfe3ec34ebee6
|
data/lib/css_zero/version.rb
CHANGED
@@ -52,6 +52,7 @@ dropdown:
|
|
52
52
|
- app/javascript/controllers/popover_controller.js
|
53
53
|
- app/assets/stylesheets/menu.css
|
54
54
|
- app/javascript/controllers/menu_controller.js
|
55
|
+
- app/javascript/controllers/context_menu_controller.js
|
55
56
|
flash:
|
56
57
|
- app/assets/stylesheets/flash.css
|
57
58
|
- app/javascript/controllers/element_removal_controller.js
|
data/lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [ "menu" ]
|
5
|
+
|
6
|
+
show(event) {
|
7
|
+
this.menuTarget.style.insetInlineStart = `${event.clientX - 5}px`
|
8
|
+
this.menuTarget.style.insetBlockStart = `${event.clientY - 5}px`
|
9
|
+
setTimeout(() => this.menuTarget.showPopover(), 150)
|
10
|
+
}
|
11
|
+
}
|
@@ -4,31 +4,46 @@ export default class extends Controller {
|
|
4
4
|
static targets = [ "item" ]
|
5
5
|
static values = { index: Number }
|
6
6
|
|
7
|
+
#observer
|
8
|
+
|
9
|
+
initialize() {
|
10
|
+
this.#observer = new IntersectionObserver(this.#reset.bind(this))
|
11
|
+
}
|
12
|
+
|
7
13
|
connect() {
|
8
|
-
this.#
|
14
|
+
this.#observer.observe(this.element)
|
9
15
|
}
|
10
16
|
|
11
|
-
|
12
|
-
this.
|
13
|
-
this.#updateTabstops()
|
17
|
+
disconnect() {
|
18
|
+
this.#observer.disconnect()
|
14
19
|
}
|
15
20
|
|
16
21
|
prev() {
|
17
22
|
if (this.indexValue > 0) {
|
18
23
|
this.indexValue--
|
19
|
-
this.#
|
20
|
-
this.#focusCurrentItem()
|
24
|
+
this.#update()
|
21
25
|
}
|
22
26
|
}
|
23
27
|
|
24
28
|
next() {
|
25
29
|
if (this.indexValue < this.#lastIndex) {
|
26
30
|
this.indexValue++
|
27
|
-
this.#
|
28
|
-
this.#focusCurrentItem()
|
31
|
+
this.#update()
|
29
32
|
}
|
30
33
|
}
|
31
34
|
|
35
|
+
#reset([ entry ]) {
|
36
|
+
if (entry.isIntersecting) {
|
37
|
+
this.indexValue = 0
|
38
|
+
this.#update()
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
#update() {
|
43
|
+
this.#updateTabstops()
|
44
|
+
this.#focusCurrentItem()
|
45
|
+
}
|
46
|
+
|
32
47
|
#updateTabstops() {
|
33
48
|
this.itemTargets.forEach((element, index) => {
|
34
49
|
element.tabIndex = index === this.indexValue ? 0 : -1
|
@@ -31,7 +31,8 @@ export default class extends Controller {
|
|
31
31
|
|
32
32
|
orient() {
|
33
33
|
computePosition(this.buttonTarget, this.menuTarget, this.#options).then(({x, y}) => {
|
34
|
-
|
34
|
+
this.menuTarget.style.insetInlineStart = `${x}px`
|
35
|
+
this.menuTarget.style.insetBlockStart = `${y}px`
|
35
36
|
})
|
36
37
|
}
|
37
38
|
|
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.86
|
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-
|
11
|
+
date: 2025-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
|
97
97
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/combobox_controller.js
|
98
98
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/command_controller.js
|
99
|
+
- lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
|
99
100
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/copyable_input_controller.js
|
100
101
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/datepicker_controller.js
|
101
102
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
|