@y14e/portal 1.2.10 → 1.2.12
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 +3 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ npm i @y14e/portal
|
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
// npm
|
|
13
|
-
import { createPortal } from '@y14e/portal@1.2.
|
|
13
|
+
import { createPortal } from '@y14e/portal@1.2.12';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { createPortal } from 'https://esm.sh/@y14e/portal@1.2.
|
|
16
|
+
import { createPortal } from 'https://esm.sh/@y14e/portal@1.2.12';
|
|
17
17
|
// or
|
|
18
|
-
import { createPortal } from 'https://cdn.jsdelivr.net/npm/@y14e/portal@1.2.
|
|
18
|
+
import { createPortal } from 'https://cdn.jsdelivr.net/npm/@y14e/portal@1.2.12/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import { createPortal } from 'https://esm.unpkg.com/@y14e/portal@1.2.
|
|
20
|
+
import { createPortal } from 'https://esm.unpkg.com/@y14e/portal@1.2.12';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
package/dist/index.cjs
CHANGED
|
@@ -463,6 +463,7 @@ var Portal = class {
|
|
|
463
463
|
this.#update();
|
|
464
464
|
const last = [...this.#focusables].at(-1);
|
|
465
465
|
last && focusElement(last);
|
|
466
|
+
return;
|
|
466
467
|
}
|
|
467
468
|
};
|
|
468
469
|
#onKeyDown = (event) => {
|
|
@@ -481,7 +482,7 @@ var Portal = class {
|
|
|
481
482
|
const focusables = this.#getFocusables();
|
|
482
483
|
if (!focusables.length) {
|
|
483
484
|
event.preventDefault();
|
|
484
|
-
this.#
|
|
485
|
+
this.#moveFocus(shiftKey ? "previous" : "next");
|
|
485
486
|
return;
|
|
486
487
|
}
|
|
487
488
|
const index = focusables.indexOf(active);
|
|
@@ -566,7 +567,7 @@ function getActiveElement2() {
|
|
|
566
567
|
* Lightweight DOM portal (teleport) utility with fully focus management.
|
|
567
568
|
* Designed for accessible dialogs, menus, overlays, popovers.
|
|
568
569
|
*
|
|
569
|
-
* @version 1.2.
|
|
570
|
+
* @version 1.2.12
|
|
570
571
|
* @author Yusuke Kamiyamane
|
|
571
572
|
* @license MIT
|
|
572
573
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Lightweight DOM portal (teleport) utility with fully focus management.
|
|
4
4
|
* Designed for accessible dialogs, menus, overlays, popovers.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.2.
|
|
6
|
+
* @version 1.2.12
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Lightweight DOM portal (teleport) utility with fully focus management.
|
|
4
4
|
* Designed for accessible dialogs, menus, overlays, popovers.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.2.
|
|
6
|
+
* @version 1.2.12
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -461,6 +461,7 @@ var Portal = class {
|
|
|
461
461
|
this.#update();
|
|
462
462
|
const last = [...this.#focusables].at(-1);
|
|
463
463
|
last && focusElement(last);
|
|
464
|
+
return;
|
|
464
465
|
}
|
|
465
466
|
};
|
|
466
467
|
#onKeyDown = (event) => {
|
|
@@ -479,7 +480,7 @@ var Portal = class {
|
|
|
479
480
|
const focusables = this.#getFocusables();
|
|
480
481
|
if (!focusables.length) {
|
|
481
482
|
event.preventDefault();
|
|
482
|
-
this.#
|
|
483
|
+
this.#moveFocus(shiftKey ? "previous" : "next");
|
|
483
484
|
return;
|
|
484
485
|
}
|
|
485
486
|
const index = focusables.indexOf(active);
|
|
@@ -564,7 +565,7 @@ function getActiveElement2() {
|
|
|
564
565
|
* Lightweight DOM portal (teleport) utility with fully focus management.
|
|
565
566
|
* Designed for accessible dialogs, menus, overlays, popovers.
|
|
566
567
|
*
|
|
567
|
-
* @version 1.2.
|
|
568
|
+
* @version 1.2.12
|
|
568
569
|
* @author Yusuke Kamiyamane
|
|
569
570
|
* @license MIT
|
|
570
571
|
* @copyright Copyright (c) Yusuke Kamiyamane
|