@uva-glass/component-library 1.32.1 → 1.32.3
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/{MenuLink-CLEqkVVh.js → MenuLink-CIzBwlKY.js} +9 -15
- package/dist/{MenuLink-CLEqkVVh.js.map → MenuLink-CIzBwlKY.js.map} +1 -1
- package/dist/{MultiSelect-CFOkF66G.js → MultiSelect-Cb4-L7lm.js} +3 -3
- package/dist/{MultiSelect-CFOkF66G.js.map → MultiSelect-Cb4-L7lm.js.map} +1 -1
- package/dist/MultiSelectItem-CwKowz2B.js +24 -0
- package/dist/MultiSelectItem-CwKowz2B.js.map +1 -0
- package/dist/assets/InputField.css +1 -1
- package/dist/assets/MultiSelectItem.css +1 -1
- package/dist/clsx-OuTLNxxd.js +17 -0
- package/dist/{clsx-DB4S2d7J.js.map → clsx-OuTLNxxd.js.map} +1 -1
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.stories.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/Drawer/Drawer.stories.js +2 -2
- package/dist/components/FormField/FormField.js +1 -1
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InfoMessage/InfoMessage.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/InputField/InputField.js +19 -19
- package/dist/components/InputField/InputField.stories.js +2 -2
- package/dist/components/Label/Label.js +1 -1
- package/dist/components/MenuLink/MenuLink.js +2 -2
- package/dist/components/MenuLink/MenuLink.stories.js +1 -1
- package/dist/components/MenuLink/index.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.js +2 -2
- package/dist/components/ModalDialog/ModalDialog.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +2 -2
- package/dist/components/MultiSelect/MultiSelect.js +3 -3
- package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
- package/dist/components/MultiSelect/components/MultiSelectItem.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
- package/dist/components/RadioButton/RadioButton.js +1 -1
- package/dist/components/Repeater/Repeater.js +1 -1
- package/dist/components/SectionNotification/SectionNotification.js +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/SelectProvider.js +1 -2
- package/dist/components/SelectListbox/SelectProvider.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectContainer.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js +1 -1
- package/dist/components/StatusPill/StatusPill.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/hooks/useDebounce.js.map +1 -1
- package/dist/components/hooks/usePositionedFloaters.js +2 -4
- package/dist/components/hooks/usePositionedFloaters.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/storyComponents/Container/Container.js +1 -1
- package/dist/{index-BA9Z7itR.js → index-BNwc4sai.js} +1269 -1774
- package/dist/{index-BA9Z7itR.js.map → index-BNwc4sai.js.map} +1 -1
- package/dist/{index-DFUrxrKJ.js → index-CYUtHyCV.js} +1590 -2915
- package/dist/{index-DFUrxrKJ.js.map → index-CYUtHyCV.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{useDialog-DDVWB2iX.js → useDialog-D4QXqVAd.js} +56 -103
- package/dist/{useDialog-DDVWB2iX.js.map → useDialog-D4QXqVAd.js.map} +1 -1
- package/package.json +15 -15
- package/dist/MultiSelectItem-D5q99kfp.js +0 -24
- package/dist/MultiSelectItem-D5q99kfp.js.map +0 -1
- package/dist/clsx-DB4S2d7J.js +0 -23
package/dist/index.js
CHANGED
|
@@ -15,10 +15,10 @@ import { InfoMessage as P } from "./components/InfoMessage/InfoMessage.js";
|
|
|
15
15
|
import { Input as R } from "./components/Input/Input.js";
|
|
16
16
|
import { InputField as w } from "./components/InputField/InputField.js";
|
|
17
17
|
import { Label as G } from "./components/Label/Label.js";
|
|
18
|
-
import { M as N } from "./MenuLink-
|
|
18
|
+
import { M as N } from "./MenuLink-CIzBwlKY.js";
|
|
19
19
|
import { MetaDataList as T } from "./components/MetaDataList/MetaDataList.js";
|
|
20
20
|
import { ModalDialog as q } from "./components/ModalDialog/ModalDialog.js";
|
|
21
|
-
import { M as E } from "./MultiSelect-
|
|
21
|
+
import { M as E } from "./MultiSelect-Cb4-L7lm.js";
|
|
22
22
|
import { OverlayCloseButton as K } from "./components/OverlayCloseButton/OverlayCloseButton.js";
|
|
23
23
|
import { ProgrammeCard as U } from "./components/ProgrammeCard/ProgrammeCard.js";
|
|
24
24
|
import { RadioButton as W } from "./components/RadioButton/RadioButton.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import p, { useRef as g, useCallback as F, useState as Y, useContext as L, useEffect as P, useMemo as B } from "react";
|
|
2
|
-
import { $ as Ne } from "./index-
|
|
2
|
+
import { $ as Ne } from "./index-BNwc4sai.js";
|
|
3
3
|
const h = typeof document < "u" ? p.useLayoutEffect : () => {
|
|
4
4
|
};
|
|
5
5
|
function A(e) {
|
|
@@ -15,8 +15,7 @@ function A(e) {
|
|
|
15
15
|
}
|
|
16
16
|
function Me(e) {
|
|
17
17
|
let [t, n] = Y(e), r = g(null), o = A(() => {
|
|
18
|
-
if (!r.current)
|
|
19
|
-
return;
|
|
18
|
+
if (!r.current) return;
|
|
20
19
|
let i = r.current.next();
|
|
21
20
|
if (i.done) {
|
|
22
21
|
r.current = null;
|
|
@@ -114,8 +113,7 @@ function Re(e = []) {
|
|
|
114
113
|
}
|
|
115
114
|
function ee(...e) {
|
|
116
115
|
return (...t) => {
|
|
117
|
-
for (let n of e)
|
|
118
|
-
typeof n == "function" && n(...t);
|
|
116
|
+
for (let n of e) typeof n == "function" && n(...t);
|
|
119
117
|
};
|
|
120
118
|
}
|
|
121
119
|
const E = (e) => {
|
|
@@ -139,15 +137,13 @@ const E = (e) => {
|
|
|
139
137
|
]), ze = /^(data-.*)$/;
|
|
140
138
|
function qe(e, t = {}) {
|
|
141
139
|
let { labelable: n, isLink: r, propNames: o } = t, a = {};
|
|
142
|
-
for (const i in e)
|
|
143
|
-
Object.prototype.hasOwnProperty.call(e, i) && (Be.has(i) || n && Ve.has(i) || r && je.has(i) || o != null && o.has(i) || ze.test(i)) && (a[i] = e[i]);
|
|
140
|
+
for (const i in e) Object.prototype.hasOwnProperty.call(e, i) && (Be.has(i) || n && Ve.has(i) || r && je.has(i) || o != null && o.has(i) || ze.test(i)) && (a[i] = e[i]);
|
|
144
141
|
return a;
|
|
145
142
|
}
|
|
146
143
|
function de(e) {
|
|
147
|
-
if (Ge())
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
});
|
|
144
|
+
if (Ge()) e.focus({
|
|
145
|
+
preventScroll: !0
|
|
146
|
+
});
|
|
151
147
|
else {
|
|
152
148
|
let t = Ue(e);
|
|
153
149
|
e.focus(), Xe(t);
|
|
@@ -212,25 +208,21 @@ function _e() {
|
|
|
212
208
|
}
|
|
213
209
|
let C = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Set();
|
|
214
210
|
function se() {
|
|
215
|
-
if (typeof window > "u")
|
|
216
|
-
return;
|
|
211
|
+
if (typeof window > "u") return;
|
|
217
212
|
function e(r) {
|
|
218
213
|
return "propertyName" in r;
|
|
219
214
|
}
|
|
220
215
|
let t = (r) => {
|
|
221
|
-
if (!e(r) || !r.target)
|
|
222
|
-
return;
|
|
216
|
+
if (!e(r) || !r.target) return;
|
|
223
217
|
let o = C.get(r.target);
|
|
224
218
|
o || (o = /* @__PURE__ */ new Set(), C.set(r.target, o), r.target.addEventListener("transitioncancel", n, {
|
|
225
219
|
once: !0
|
|
226
220
|
})), o.add(r.propertyName);
|
|
227
221
|
}, n = (r) => {
|
|
228
|
-
if (!e(r) || !r.target)
|
|
229
|
-
return;
|
|
222
|
+
if (!e(r) || !r.target) return;
|
|
230
223
|
let o = C.get(r.target);
|
|
231
224
|
if (o && (o.delete(r.propertyName), o.size === 0 && (r.target.removeEventListener("transitioncancel", n), C.delete(r.target)), C.size === 0)) {
|
|
232
|
-
for (let a of te)
|
|
233
|
-
a();
|
|
225
|
+
for (let a of te) a();
|
|
234
226
|
te.clear();
|
|
235
227
|
}
|
|
236
228
|
};
|
|
@@ -248,8 +240,7 @@ function fe(e, t) {
|
|
|
248
240
|
}
|
|
249
241
|
function we(e, t) {
|
|
250
242
|
let n = e;
|
|
251
|
-
for (fe(n, t) && (n = n.parentElement); n && !fe(n, t); )
|
|
252
|
-
n = n.parentElement;
|
|
243
|
+
for (fe(n, t) && (n = n.parentElement); n && !fe(n, t); ) n = n.parentElement;
|
|
253
244
|
return n || document.scrollingElement || document.documentElement;
|
|
254
245
|
}
|
|
255
246
|
function tt(e) {
|
|
@@ -321,8 +312,7 @@ function rt(e) {
|
|
|
321
312
|
}
|
|
322
313
|
let I = null, ot = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), M = !1, ne = !1;
|
|
323
314
|
function ae(e, t) {
|
|
324
|
-
for (let n of ot)
|
|
325
|
-
n(e, t);
|
|
315
|
+
for (let n of ot) n(e, t);
|
|
326
316
|
}
|
|
327
317
|
function it(e) {
|
|
328
318
|
return !(e.metaKey || !Ee() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
@@ -343,8 +333,7 @@ function Te() {
|
|
|
343
333
|
M = !1, ne = !0;
|
|
344
334
|
}
|
|
345
335
|
function ve(e) {
|
|
346
|
-
if (typeof window > "u" || W.get(j(e)))
|
|
347
|
-
return;
|
|
336
|
+
if (typeof window > "u" || W.get(j(e))) return;
|
|
348
337
|
const t = j(e), n = E(e);
|
|
349
338
|
let r = t.HTMLElement.prototype.focus;
|
|
350
339
|
t.HTMLElement.prototype.focus = function() {
|
|
@@ -412,8 +401,7 @@ function ct(e) {
|
|
|
412
401
|
});
|
|
413
402
|
P(() => {
|
|
414
403
|
let d = a.current;
|
|
415
|
-
if (r)
|
|
416
|
-
return;
|
|
404
|
+
if (r) return;
|
|
417
405
|
const u = t.current, c = E(u);
|
|
418
406
|
if (typeof PointerEvent < "u") {
|
|
419
407
|
let s = ($) => {
|
|
@@ -440,12 +428,10 @@ function ct(e) {
|
|
|
440
428
|
]);
|
|
441
429
|
}
|
|
442
430
|
function K(e, t) {
|
|
443
|
-
if (e.button > 0)
|
|
444
|
-
return !1;
|
|
431
|
+
if (e.button > 0) return !1;
|
|
445
432
|
if (e.target) {
|
|
446
433
|
const n = e.target.ownerDocument;
|
|
447
|
-
if (!n || !n.documentElement.contains(e.target) || e.target.closest("[data-react-aria-top-layer]"))
|
|
448
|
-
return !1;
|
|
434
|
+
if (!n || !n.documentElement.contains(e.target) || e.target.closest("[data-react-aria-top-layer]")) return !1;
|
|
449
435
|
}
|
|
450
436
|
return t.current && !t.current.contains(e.target);
|
|
451
437
|
}
|
|
@@ -456,13 +442,11 @@ function re(e) {
|
|
|
456
442
|
et(() => {
|
|
457
443
|
t.activeElement === n && e.isConnected && de(e);
|
|
458
444
|
});
|
|
459
|
-
} else
|
|
460
|
-
de(e);
|
|
445
|
+
} else de(e);
|
|
461
446
|
}
|
|
462
447
|
function dt(e) {
|
|
463
448
|
const t = j(e);
|
|
464
|
-
if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement))
|
|
465
|
-
return !1;
|
|
449
|
+
if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement)) return !1;
|
|
466
450
|
let { display: n, visibility: r } = e.style, o = n !== "none" && r !== "hidden" && r !== "collapse";
|
|
467
451
|
if (o) {
|
|
468
452
|
const { getComputedStyle: a } = e.ownerDocument.defaultView;
|
|
@@ -513,8 +497,7 @@ function Ft(e) {
|
|
|
513
497
|
const $ = E(l.current ? l.current[0] : void 0).activeElement;
|
|
514
498
|
let v = null;
|
|
515
499
|
if (w($, l.current)) {
|
|
516
|
-
for (let f of m.traverse())
|
|
517
|
-
f.scopeRef && w($, f.scopeRef.current) && (v = f);
|
|
500
|
+
for (let f of m.traverse()) f.scopeRef && w($, f.scopeRef.current) && (v = f);
|
|
518
501
|
v === m.getTreeNode(l) && (b = v.scopeRef);
|
|
519
502
|
}
|
|
520
503
|
}, [
|
|
@@ -608,8 +591,7 @@ function N(e) {
|
|
|
608
591
|
function O(e) {
|
|
609
592
|
let t = m.getTreeNode(b);
|
|
610
593
|
for (; t && t.scopeRef !== e; ) {
|
|
611
|
-
if (t.contain)
|
|
612
|
-
return !1;
|
|
594
|
+
if (t.contain) return !1;
|
|
613
595
|
t = t.parent;
|
|
614
596
|
}
|
|
615
597
|
return !0;
|
|
@@ -624,16 +606,13 @@ function bt(e, t) {
|
|
|
624
606
|
}
|
|
625
607
|
const a = E(o ? o[0] : void 0);
|
|
626
608
|
let i = (u) => {
|
|
627
|
-
if (u.key !== "Tab" || u.altKey || u.ctrlKey || u.metaKey || !O(e) || u.isComposing)
|
|
628
|
-
return;
|
|
609
|
+
if (u.key !== "Tab" || u.altKey || u.ctrlKey || u.metaKey || !O(e) || u.isComposing) return;
|
|
629
610
|
let c = a.activeElement, s = e.current;
|
|
630
|
-
if (!s || !w(c, s))
|
|
631
|
-
return;
|
|
611
|
+
if (!s || !w(c, s)) return;
|
|
632
612
|
let $ = N(s), v = S($, {
|
|
633
613
|
tabbable: !0
|
|
634
614
|
}, s);
|
|
635
|
-
if (!c)
|
|
636
|
-
return;
|
|
615
|
+
if (!c) return;
|
|
637
616
|
v.currentNode = c;
|
|
638
617
|
let f = u.shiftKey ? v.previousNode() : v.nextNode();
|
|
639
618
|
f || (v.currentNode = u.shiftKey ? s[s.length - 1].nextElementSibling : s[0].previousElementSibling, f = u.shiftKey ? v.previousNode() : v.nextNode()), u.preventDefault(), f && x(f, !0);
|
|
@@ -645,8 +624,7 @@ function bt(e, t) {
|
|
|
645
624
|
if (b = e, a.body.contains(u.target)) {
|
|
646
625
|
var c;
|
|
647
626
|
n.current = u.target, (c = n.current) === null || c === void 0 || c.focus();
|
|
648
|
-
} else
|
|
649
|
-
b.current && U(b.current);
|
|
627
|
+
} else b.current && U(b.current);
|
|
650
628
|
});
|
|
651
629
|
};
|
|
652
630
|
return a.addEventListener("keydown", i, !1), a.addEventListener("focusin", l, !1), o == null || o.forEach((u) => u.addEventListener("focusin", l, !1)), o == null || o.forEach((u) => u.addEventListener("focusout", d, !1)), () => {
|
|
@@ -668,11 +646,9 @@ function w(e, t) {
|
|
|
668
646
|
return !e || !t ? !1 : t.some((n) => n.contains(e));
|
|
669
647
|
}
|
|
670
648
|
function q(e, t = null) {
|
|
671
|
-
if (e instanceof Element && e.closest("[data-react-aria-top-layer]"))
|
|
672
|
-
return !0;
|
|
649
|
+
if (e instanceof Element && e.closest("[data-react-aria-top-layer]")) return !0;
|
|
673
650
|
for (let { scopeRef: n } of m.traverse(m.getTreeNode(t)))
|
|
674
|
-
if (n && w(e, n.current))
|
|
675
|
-
return !0;
|
|
651
|
+
if (n && w(e, n.current)) return !0;
|
|
676
652
|
return !1;
|
|
677
653
|
}
|
|
678
654
|
function pt(e) {
|
|
@@ -682,23 +658,20 @@ function G(e, t) {
|
|
|
682
658
|
var n;
|
|
683
659
|
let r = (n = m.getTreeNode(t)) === null || n === void 0 ? void 0 : n.parent;
|
|
684
660
|
for (; r; ) {
|
|
685
|
-
if (r.scopeRef === e)
|
|
686
|
-
return !0;
|
|
661
|
+
if (r.scopeRef === e) return !0;
|
|
687
662
|
r = r.parent;
|
|
688
663
|
}
|
|
689
664
|
return !1;
|
|
690
665
|
}
|
|
691
666
|
function x(e, t = !1) {
|
|
692
|
-
if (e != null && !t)
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
} catch {
|
|
701
|
-
}
|
|
667
|
+
if (e != null && !t) try {
|
|
668
|
+
re(e);
|
|
669
|
+
} catch {
|
|
670
|
+
}
|
|
671
|
+
else if (e != null) try {
|
|
672
|
+
e.focus();
|
|
673
|
+
} catch {
|
|
674
|
+
}
|
|
702
675
|
}
|
|
703
676
|
function U(e, t = !0) {
|
|
704
677
|
let n = e[0].previousElementSibling, r = N(e), o = S(r, {
|
|
@@ -725,8 +698,7 @@ function mt(e, t) {
|
|
|
725
698
|
}
|
|
726
699
|
function ht(e, t, n) {
|
|
727
700
|
h(() => {
|
|
728
|
-
if (t || n)
|
|
729
|
-
return;
|
|
701
|
+
if (t || n) return;
|
|
730
702
|
let r = e.current;
|
|
731
703
|
const o = E(r ? r[0] : void 0);
|
|
732
704
|
let a = (i) => {
|
|
@@ -745,8 +717,7 @@ function ht(e, t, n) {
|
|
|
745
717
|
function Et(e) {
|
|
746
718
|
let t = m.getTreeNode(b);
|
|
747
719
|
for (; t && t.scopeRef !== e; ) {
|
|
748
|
-
if (t.nodeToRestore)
|
|
749
|
-
return !1;
|
|
720
|
+
if (t.nodeToRestore) return !1;
|
|
750
721
|
t = t.parent;
|
|
751
722
|
}
|
|
752
723
|
return (t == null ? void 0 : t.scopeRef) === e;
|
|
@@ -756,8 +727,7 @@ function wt(e, t, n) {
|
|
|
756
727
|
h(() => {
|
|
757
728
|
let o = e.current;
|
|
758
729
|
const a = E(o ? o[0] : void 0);
|
|
759
|
-
if (!t || n)
|
|
760
|
-
return;
|
|
730
|
+
if (!t || n) return;
|
|
761
731
|
let i = () => {
|
|
762
732
|
(!b || G(b, e)) && w(a.activeElement, e.current) && (b = e);
|
|
763
733
|
};
|
|
@@ -769,17 +739,13 @@ function wt(e, t, n) {
|
|
|
769
739
|
n
|
|
770
740
|
]), h(() => {
|
|
771
741
|
const o = E(e.current ? e.current[0] : void 0);
|
|
772
|
-
if (!t)
|
|
773
|
-
return;
|
|
742
|
+
if (!t) return;
|
|
774
743
|
let a = (i) => {
|
|
775
|
-
if (i.key !== "Tab" || i.altKey || i.ctrlKey || i.metaKey || !O(e) || i.isComposing)
|
|
776
|
-
return;
|
|
744
|
+
if (i.key !== "Tab" || i.altKey || i.ctrlKey || i.metaKey || !O(e) || i.isComposing) return;
|
|
777
745
|
let l = o.activeElement;
|
|
778
|
-
if (!w(l, e.current))
|
|
779
|
-
return;
|
|
746
|
+
if (!w(l, e.current)) return;
|
|
780
747
|
let d = m.getTreeNode(e);
|
|
781
|
-
if (!d)
|
|
782
|
-
return;
|
|
748
|
+
if (!d) return;
|
|
783
749
|
let u = d.nodeToRestore, c = S(o.body, {
|
|
784
750
|
tabbable: !0
|
|
785
751
|
});
|
|
@@ -802,15 +768,13 @@ function wt(e, t, n) {
|
|
|
802
768
|
n
|
|
803
769
|
]), h(() => {
|
|
804
770
|
const o = E(e.current ? e.current[0] : void 0);
|
|
805
|
-
if (!t)
|
|
806
|
-
return;
|
|
771
|
+
if (!t) return;
|
|
807
772
|
let a = m.getTreeNode(e);
|
|
808
773
|
if (a) {
|
|
809
774
|
var i;
|
|
810
775
|
return a.nodeToRestore = (i = r.current) !== null && i !== void 0 ? i : void 0, () => {
|
|
811
776
|
let l = m.getTreeNode(e);
|
|
812
|
-
if (!l)
|
|
813
|
-
return;
|
|
777
|
+
if (!l) return;
|
|
814
778
|
let d = l.nodeToRestore;
|
|
815
779
|
if (t && d && // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
816
780
|
(w(o.activeElement, e.current) || o.activeElement === o.body && Et(e))) {
|
|
@@ -860,8 +824,7 @@ class ue {
|
|
|
860
824
|
}
|
|
861
825
|
addTreeNode(t, n, r) {
|
|
862
826
|
let o = this.fastMap.get(n ?? null);
|
|
863
|
-
if (!o)
|
|
864
|
-
return;
|
|
827
|
+
if (!o) return;
|
|
865
828
|
let a = new oe({
|
|
866
829
|
scopeRef: t
|
|
867
830
|
});
|
|
@@ -871,29 +834,23 @@ class ue {
|
|
|
871
834
|
this.fastMap.set(t.scopeRef, t);
|
|
872
835
|
}
|
|
873
836
|
removeTreeNode(t) {
|
|
874
|
-
if (t === null)
|
|
875
|
-
return;
|
|
837
|
+
if (t === null) return;
|
|
876
838
|
let n = this.fastMap.get(t);
|
|
877
|
-
if (!n)
|
|
878
|
-
return;
|
|
839
|
+
if (!n) return;
|
|
879
840
|
let r = n.parent;
|
|
880
|
-
for (let a of this.traverse())
|
|
881
|
-
a !== n && n.nodeToRestore && a.nodeToRestore && n.scopeRef && n.scopeRef.current && w(a.nodeToRestore, n.scopeRef.current) && (a.nodeToRestore = n.nodeToRestore);
|
|
841
|
+
for (let a of this.traverse()) a !== n && n.nodeToRestore && a.nodeToRestore && n.scopeRef && n.scopeRef.current && w(a.nodeToRestore, n.scopeRef.current) && (a.nodeToRestore = n.nodeToRestore);
|
|
882
842
|
let o = n.children;
|
|
883
843
|
r && (r.removeChild(n), o.size > 0 && o.forEach((a) => r && r.addChild(a))), this.fastMap.delete(n.scopeRef);
|
|
884
844
|
}
|
|
885
845
|
// Pre Order Depth First
|
|
886
846
|
*traverse(t = this.root) {
|
|
887
|
-
if (t.scopeRef != null && (yield t), t.children.size > 0)
|
|
888
|
-
for (let n of t.children)
|
|
889
|
-
yield* this.traverse(n);
|
|
847
|
+
if (t.scopeRef != null && (yield t), t.children.size > 0) for (let n of t.children) yield* this.traverse(n);
|
|
890
848
|
}
|
|
891
849
|
clone() {
|
|
892
850
|
var t;
|
|
893
851
|
let n = new ue();
|
|
894
852
|
var r;
|
|
895
|
-
for (let o of this.traverse())
|
|
896
|
-
n.addTreeNode(o.scopeRef, (r = (t = o.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, o.nodeToRestore);
|
|
853
|
+
for (let o of this.traverse()) n.addTreeNode(o.scopeRef, (r = (t = o.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, o.nodeToRestore);
|
|
897
854
|
return n;
|
|
898
855
|
}
|
|
899
856
|
constructor() {
|
|
@@ -1006,8 +963,7 @@ function Tt() {
|
|
|
1006
963
|
}));
|
|
1007
964
|
}));
|
|
1008
965
|
}, i = null, l = () => {
|
|
1009
|
-
if (i)
|
|
1010
|
-
return;
|
|
966
|
+
if (i) return;
|
|
1011
967
|
let u = () => {
|
|
1012
968
|
window.scrollTo(0, 0);
|
|
1013
969
|
}, c = window.pageXOffset, s = window.pageYOffset;
|
|
@@ -1094,19 +1050,16 @@ function Nt(e) {
|
|
|
1094
1050
|
function Wt(e) {
|
|
1095
1051
|
let t = he(), { portalContainer: n = t ? null : document.body, ...r } = e;
|
|
1096
1052
|
if (p.useEffect(() => {
|
|
1097
|
-
if (n != null && n.closest("[data-overlay-container]"))
|
|
1098
|
-
throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
1053
|
+
if (n != null && n.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
1099
1054
|
}, [
|
|
1100
1055
|
n
|
|
1101
|
-
]), !n)
|
|
1102
|
-
return null;
|
|
1056
|
+
]), !n) return null;
|
|
1103
1057
|
let o = /* @__PURE__ */ p.createElement(Nt, r);
|
|
1104
1058
|
return /* @__PURE__ */ Ne.createPortal(o, n);
|
|
1105
1059
|
}
|
|
1106
1060
|
function At(e) {
|
|
1107
1061
|
let t = L(X);
|
|
1108
|
-
if (!t)
|
|
1109
|
-
throw new Error("Modal is not contained within a provider");
|
|
1062
|
+
if (!t) throw new Error("Modal is not contained within a provider");
|
|
1110
1063
|
return P(() => {
|
|
1111
1064
|
if (!(e != null && e.isDisabled || !t || !t.parent))
|
|
1112
1065
|
return t.parent.addModal(), () => {
|
|
@@ -1177,4 +1130,4 @@ export {
|
|
|
1177
1130
|
Wt as f,
|
|
1178
1131
|
Ft as g
|
|
1179
1132
|
};
|
|
1180
|
-
//# sourceMappingURL=useDialog-
|
|
1133
|
+
//# sourceMappingURL=useDialog-D4QXqVAd.js.map
|