@y14e/menu 1.4.1 → 1.4.2
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.
- package/README.md +4 -4
- package/dist/index.cjs +2 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ npm i @y14e/menu
|
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
// npm
|
|
13
|
-
import Menu from '@y14e/menu@1.4.
|
|
13
|
+
import Menu from '@y14e/menu@1.4.2';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import Menu from 'https://esm.sh/@y14e/menu@1.4.
|
|
16
|
+
import Menu from 'https://esm.sh/@y14e/menu@1.4.2';
|
|
17
17
|
// or
|
|
18
|
-
import Menu from 'https://cdn.jsdelivr.net/npm/@y14e/menu@1.4.
|
|
18
|
+
import Menu from 'https://cdn.jsdelivr.net/npm/@y14e/menu@1.4.2/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import Menu from 'https://esm.unpkg.com/@y14e/menu@1.4.
|
|
20
|
+
import Menu from 'https://esm.unpkg.com/@y14e/menu@1.4.2';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.cjs
CHANGED
|
@@ -2745,12 +2745,9 @@ var Menu = class _Menu {
|
|
|
2745
2745
|
this.#triggerElement.setAttribute("aria-expanded", "false");
|
|
2746
2746
|
this.#triggerElement.setAttribute("aria-haspopup", "true");
|
|
2747
2747
|
this.#triggerElement.id ||= `menu-trigger-${id}`;
|
|
2748
|
-
this.#triggerElement.setAttribute(
|
|
2749
|
-
"tabindex",
|
|
2750
|
-
isFocusable3(this.#triggerElement) && !this.#isSubmenu ? "0" : "-1"
|
|
2751
|
-
);
|
|
2752
2748
|
if (!isFocusable3(this.#triggerElement)) {
|
|
2753
2749
|
this.#triggerElement.setAttribute("aria-disabled", "true");
|
|
2750
|
+
this.#triggerElement.setAttribute("tabindex", "-1");
|
|
2754
2751
|
this.#triggerElement.style.setProperty("pointer-events", "none");
|
|
2755
2752
|
}
|
|
2756
2753
|
this.#triggerElement.addEventListener("click", this.#onTriggerClick, {
|
|
@@ -3200,7 +3197,7 @@ function isFocusable3(element) {
|
|
|
3200
3197
|
* WAI-ARIA compliant menu (menu button) pattern implementation in TypeScript.
|
|
3201
3198
|
* Supports checkbox item, radio item, and infinitely nested menus.
|
|
3202
3199
|
*
|
|
3203
|
-
* @version 1.4.
|
|
3200
|
+
* @version 1.4.2
|
|
3204
3201
|
* @author Yusuke Kamiyamane
|
|
3205
3202
|
* @license MIT
|
|
3206
3203
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { Middleware, Placement } from '@floating-ui/dom';
|
|
|
5
5
|
* WAI-ARIA compliant menu (menu button) pattern implementation in TypeScript.
|
|
6
6
|
* Supports checkbox item, radio item, and infinitely nested menus.
|
|
7
7
|
*
|
|
8
|
-
* @version 1.4.
|
|
8
|
+
* @version 1.4.2
|
|
9
9
|
* @author Yusuke Kamiyamane
|
|
10
10
|
* @license MIT
|
|
11
11
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Middleware, Placement } from '@floating-ui/dom';
|
|
|
5
5
|
* WAI-ARIA compliant menu (menu button) pattern implementation in TypeScript.
|
|
6
6
|
* Supports checkbox item, radio item, and infinitely nested menus.
|
|
7
7
|
*
|
|
8
|
-
* @version 1.4.
|
|
8
|
+
* @version 1.4.2
|
|
9
9
|
* @author Yusuke Kamiyamane
|
|
10
10
|
* @license MIT
|
|
11
11
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -2743,12 +2743,9 @@ var Menu = class _Menu {
|
|
|
2743
2743
|
this.#triggerElement.setAttribute("aria-expanded", "false");
|
|
2744
2744
|
this.#triggerElement.setAttribute("aria-haspopup", "true");
|
|
2745
2745
|
this.#triggerElement.id ||= `menu-trigger-${id}`;
|
|
2746
|
-
this.#triggerElement.setAttribute(
|
|
2747
|
-
"tabindex",
|
|
2748
|
-
isFocusable3(this.#triggerElement) && !this.#isSubmenu ? "0" : "-1"
|
|
2749
|
-
);
|
|
2750
2746
|
if (!isFocusable3(this.#triggerElement)) {
|
|
2751
2747
|
this.#triggerElement.setAttribute("aria-disabled", "true");
|
|
2748
|
+
this.#triggerElement.setAttribute("tabindex", "-1");
|
|
2752
2749
|
this.#triggerElement.style.setProperty("pointer-events", "none");
|
|
2753
2750
|
}
|
|
2754
2751
|
this.#triggerElement.addEventListener("click", this.#onTriggerClick, {
|
|
@@ -3198,7 +3195,7 @@ function isFocusable3(element) {
|
|
|
3198
3195
|
* WAI-ARIA compliant menu (menu button) pattern implementation in TypeScript.
|
|
3199
3196
|
* Supports checkbox item, radio item, and infinitely nested menus.
|
|
3200
3197
|
*
|
|
3201
|
-
* @version 1.4.
|
|
3198
|
+
* @version 1.4.2
|
|
3202
3199
|
* @author Yusuke Kamiyamane
|
|
3203
3200
|
* @license MIT
|
|
3204
3201
|
* @copyright Copyright (c) Yusuke Kamiyamane
|