@t007/dialog 0.0.26 → 0.0.27
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/dist/index.global.js +5 -5
- package/package.json +5 -2
package/dist/index.global.js
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
var NOOP = () => {
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
// ../utils/dist/chunk-
|
|
62
|
+
// ../utils/dist/chunk-Y5YJMRXD.js
|
|
63
63
|
var INTERACTIVE_SELECTOR = ":is(button,[href],input:not([type='hidden']),select,textarea,details>summary,[contenteditable='true'],iframe,audio[controls],video[controls],[tabindex]):not([disabled],[tabindex='-1'],[data-focus-guard],[inert],[inert] *)";
|
|
64
64
|
var isInteractive = (target) => target instanceof HTMLElement && target.matches(INTERACTIVE_SELECTOR);
|
|
65
65
|
var VIRTUAL_RESOURCE = /* @__PURE__ */ Symbol.for("T007_VIRTUAL_RESOURCE");
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
window.T007_DIALOG_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest/dist/index.min.css`;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
// ../utils/dist/chunk-
|
|
127
|
+
// ../utils/dist/chunk-YDARUYLO.js
|
|
128
128
|
function initOutsideClick(el, { enabled = false, onOutsideClick = NOOP, outOnClick = true, outOnEscape = true, outOnFocusOut = false, allowInputs = false, root = window, scoped = true, capture = true } = NIL) {
|
|
129
129
|
const stacks = t007._outsiders_stacks ??= /* @__PURE__ */ new WeakMap(), existing = (t007._outsiders ??= /* @__PURE__ */ new WeakMap()).get(el);
|
|
130
130
|
if (!enabled || existing) return existing ? existing : void 0;
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
if (rt.hasAttribute("tabindex")) return rt.focus();
|
|
155
155
|
const items = getFocusable();
|
|
156
156
|
if (!items.length) return resetFocus(0, null);
|
|
157
|
-
const
|
|
158
|
-
let p = rt.parentElement ||
|
|
159
|
-
while (p !==
|
|
157
|
+
const ceil = document.fullscreenElement || document.querySelector("dialog:modal") || document.body;
|
|
158
|
+
let p = rt.parentElement || ceil, all = getFocusable(p);
|
|
159
|
+
while (p !== ceil && (!all.length || (pre ? rt.contains(all[0]) : rt.contains(all.at(-1))))) all = getFocusable(p = p.parentElement || ceil);
|
|
160
160
|
for (let target, len = all.length, i = all.indexOf(items[pre ? 0 : items.length - 1]) + (pre ? -1 : 1); pre ? i >= 0 : i < len; pre ? i-- : i++) if (!rt.contains(target = all[i])) return target.focus();
|
|
161
161
|
(pre ? first : last).blur();
|
|
162
162
|
}, handleFocusIn = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t007/dialog",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "A lightweight, pure JS dialog system.",
|
|
5
5
|
"author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
"accessible"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@t007/utils": "^0.0.
|
|
59
|
+
"@t007/utils": "^0.0.30"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"esbuild-sass-plugin": "^3.7.0"
|
|
60
63
|
}
|
|
61
64
|
}
|