@t007/dialog 0.0.25 → 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.css +0 -1
- package/dist/index.global.js +6 -6
- package/package.json +5 -2
package/dist/index.css
CHANGED
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 = () => {
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
if (!config.enabled || existing) return existing ? existing : void 0;
|
|
250
250
|
const { enabled: isEnabled, selector, focusOnHover, loop, virtual, typeahead, resetMs, activeClass, inputSelector, defaultTabbableIndex, baseTabIndex, grid, rtl: isRtl, focusOptions, scrollIntoView, onSelect, onFocusOut, rovingTab } = { ...DEFAULT_CONFIG, ...config };
|
|
251
251
|
let gridX = grid.x || 1, gridY = grid.y || 1, vGridY = grid.vY || 1, activeIndex = -1, buffer = "", timeout = null, items = [];
|
|
252
|
-
const enabled = isEnabled ?? virtual, roving = rovingTab ?? !virtual, rtl = isRtl ?? getComputedStyle(container).direction === "rtl", shouldSnub = () => !enabled || !container, isItemDisabled = (el) => !el || el.hasAttribute("disabled") || el.hasAttribute("aria-disabled"), getItems = () => items = Array.from(container.querySelectorAll(selector));
|
|
252
|
+
const enabled = isEnabled ?? virtual, roving = rovingTab ?? !virtual, rtl = isRtl ?? ("undefined" === typeof document ? false : getComputedStyle(container).direction === "rtl"), shouldSnub = () => !enabled || !container, isItemDisabled = (el) => !el || el.hasAttribute("disabled") || el.hasAttribute("aria-disabled"), getItems = () => items = Array.from(container.querySelectorAll(selector));
|
|
253
253
|
const getAbleIndex = (targetIndex, e = { key: "ArrowRight", ctrlKey: false }) => {
|
|
254
254
|
if (shouldSnub() || !items.length) return null;
|
|
255
255
|
let index = targetIndex;
|
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
|
}
|