@okam/stack-ui 1.44.0 → 1.44.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/CHANGELOG.md +82 -4
- package/components/Popover/interface.d.ts +3 -3
- package/components/TagGroup/interface.d.ts +2 -2
- package/index.d.ts +2 -0
- package/index149.js +1 -1
- package/index149.mjs +4 -4
- package/index155.js +1 -1
- package/index155.mjs +4 -4
- package/index157.js +1 -1
- package/index157.mjs +4 -4
- package/index158.js +1 -1
- package/index158.mjs +2 -2
- package/index159.js +1 -1
- package/index159.mjs +1 -1
- package/index160.js +1 -1
- package/index160.mjs +1 -1
- package/index161.js +1 -2
- package/index161.mjs +39 -12
- package/index162.js +1 -1
- package/index162.mjs +12 -38
- package/index163.js +2 -1
- package/index163.mjs +26 -11
- package/index164.js +2 -1
- package/index164.mjs +38 -13
- package/index165.js +1 -1
- package/index165.mjs +21 -38
- package/index166.js +1 -2
- package/index166.mjs +44 -24
- package/index167.js +1 -1
- package/index167.mjs +25 -22
- package/index168.js +1 -1
- package/index168.mjs +40 -45
- package/index169.js +2 -1
- package/index169.mjs +57 -25
- package/index170.js +1 -1
- package/index170.mjs +39 -41
- package/index171.js +1 -2
- package/index171.mjs +30 -57
- package/index172.js +2 -1
- package/index172.mjs +8 -38
- package/index173.js +2 -1
- package/index173.mjs +9 -30
- package/index174.js +1 -2
- package/index174.mjs +32 -9
- package/index175.js +1 -2
- package/index175.mjs +14 -9
- package/index176.js +1 -1
- package/index176.mjs +16 -31
- package/index177.js +1 -1
- package/index177.mjs +11 -15
- package/index178.js +2 -1
- package/index178.mjs +47 -16
- package/index179.js +1 -2
- package/index179.mjs +36 -46
- package/index180.js +1 -1
- package/index180.mjs +31 -36
- package/index181.js +1 -1
- package/index181.mjs +20 -31
- package/index182.js +1 -1
- package/index182.mjs +32 -18
- package/index183.js +1 -1
- package/index183.mjs +14 -36
- package/index185.js +1 -1
- package/index185.mjs +3 -3
- package/index186.js +1 -1
- package/index186.mjs +23 -23
- package/index188.js +1 -1
- package/index188.mjs +5 -2025
- package/index189.js +2 -1
- package/index189.mjs +48 -58
- package/index190.js +1 -1
- package/index190.mjs +2010 -174
- package/index191.js +1 -1
- package/index191.mjs +59 -5
- package/index192.js +1 -2
- package/index192.mjs +186 -47
- package/index193.js +1 -1
- package/index193.mjs +203 -11
- package/index194.js +1 -1
- package/index194.mjs +51 -190
- package/index195.js +1 -1
- package/index195.mjs +130 -51
- package/index196.js +1 -1
- package/index196.mjs +111 -130
- package/index197.js +1 -1
- package/index197.mjs +205 -105
- package/index198.js +1 -1
- package/index198.mjs +169 -203
- package/index199.js +1 -1
- package/index199.mjs +61 -182
- package/index2.mjs +35 -35
- package/index200.js +1 -1
- package/index200.mjs +270 -60
- package/index201.js +1 -1
- package/index201.mjs +89 -270
- package/index202.js +1 -1
- package/index202.mjs +182 -92
- package/index203.js +1 -1
- package/index203.mjs +78 -182
- package/index204.js +1 -1
- package/index204.mjs +49 -75
- package/index205.js +1 -1
- package/index205.mjs +117 -49
- package/index206.js +1 -1
- package/index206.mjs +108 -118
- package/index207.js +1 -1
- package/index207.mjs +112 -106
- package/index208.js +1 -1
- package/index208.mjs +63 -113
- package/index209.js +1 -1
- package/index209.mjs +108 -70
- package/index210.js +1 -1
- package/index210.mjs +50 -108
- package/index211.js +1 -1
- package/index211.mjs +75 -34
- package/index212.js +1 -1
- package/index212.mjs +48 -71
- package/index213.js +1 -1
- package/index213.mjs +43 -57
- package/index214.js +1 -1
- package/index214.mjs +86 -43
- package/index215.js +5 -1
- package/index215.mjs +62 -81
- package/index216.js +1 -5
- package/index216.mjs +11 -80
- package/index217.js +1 -1
- package/index217.mjs +119 -125
- package/index218.js +1 -1
- package/index218.mjs +129 -185
- package/index219.js +1 -1
- package/index219.mjs +72 -121
- package/index220.js +1 -1
- package/index220.mjs +12 -132
- package/index221.js +1 -1
- package/index221.mjs +89 -69
- package/index222.js +1 -1
- package/index222.mjs +104 -12
- package/index223.js +1 -1
- package/index223.mjs +4 -95
- package/index224.js +1 -1
- package/index224.mjs +3 -106
- package/index225.js +1 -1
- package/index225.mjs +125 -4
- package/index226.js +1 -1
- package/index226.mjs +29 -3
- package/index227.js +1 -1
- package/index227.mjs +39 -113
- package/index228.js +1 -1
- package/index228.mjs +34 -19
- package/index229.js +1 -1
- package/index229.mjs +26 -40
- package/index230.js +1 -1
- package/index230.mjs +98 -29
- package/index231.js +1 -1
- package/index231.mjs +68 -28
- package/index232.js +1 -1
- package/index232.mjs +78 -90
- package/index233.js +1 -1
- package/index233.mjs +98 -78
- package/index234.js +1 -1
- package/index234.mjs +125 -96
- package/index235.js +1 -1
- package/index235.mjs +191 -98
- package/index236.js +1 -1
- package/index236.mjs +4 -126
- package/index237.js +1 -1
- package/index237.mjs +20 -67
- package/index238.js +1 -7
- package/index238.mjs +39 -431
- package/index239.js +1 -1
- package/index239.mjs +4 -57
- package/index240.js +1 -1
- package/index240.mjs +24 -3
- package/index241.js +1 -1
- package/index241.mjs +12 -25
- package/index242.js +1 -1
- package/index242.mjs +4 -47
- package/index243.js +1 -1
- package/index243.mjs +14 -5
- package/index244.js +1 -1
- package/index244.mjs +40 -22
- package/index245.js +1 -1
- package/index245.mjs +57 -11
- package/index246.js +1 -1
- package/index246.mjs +43 -4
- package/index247.js +1 -1
- package/index247.mjs +31 -13
- package/index248.js +1 -1
- package/index248.mjs +31 -42
- package/index249.js +1 -1
- package/index249.mjs +13 -57
- package/index250.js +1 -1
- package/index250.mjs +10 -43
- package/index251.js +1 -1
- package/index251.mjs +28 -31
- package/index252.js +1 -1
- package/index252.mjs +14 -30
- package/index253.js +1 -1
- package/index253.mjs +9 -14
- package/index254.js +1 -1
- package/index254.mjs +6 -10
- package/index255.js +1 -1
- package/index255.mjs +5 -29
- package/index256.js +1 -1
- package/index256.mjs +7 -15
- package/index257.js +1 -1
- package/index257.mjs +29 -9
- package/index258.js +1 -1
- package/index258.mjs +17 -6
- package/index259.js +1 -1
- package/index259.mjs +44 -5
- package/index260.js +1 -1
- package/index260.mjs +8 -7
- package/index261.js +1 -1
- package/index261.mjs +13 -26
- package/index262.js +1 -1
- package/index262.mjs +3 -18
- package/index263.js +1 -1
- package/index263.mjs +18 -43
- package/index264.js +1 -1
- package/index264.mjs +33 -7
- package/index265.js +1 -1
- package/index265.mjs +22 -16
- package/index266.js +1 -1
- package/index266.mjs +10 -3
- package/index267.js +1 -1
- package/index267.mjs +2 -18
- package/index268.js +1 -1
- package/index268.mjs +36 -34
- package/index269.js +1 -1
- package/index269.mjs +5 -22
- package/index270.js +1 -1
- package/index270.mjs +28 -53
- package/index271.js +1 -1
- package/index271.mjs +6 -27
- package/index272.js +1 -1
- package/index272.mjs +9 -144
- package/index273.js +1 -1
- package/index273.mjs +127 -207
- package/index274.js +1 -1
- package/index274.mjs +43 -22
- package/index275.js +1 -1
- package/index275.mjs +226 -44
- package/index276.js +1 -1
- package/index276.mjs +121 -42
- package/index277.js +1 -6
- package/index277.mjs +64 -105
- package/index278.js +7 -1
- package/index278.mjs +440 -72
- package/index279.js +1 -1
- package/index279.mjs +56 -72
- package/index28.js +1 -1
- package/index28.mjs +38 -94
- package/index280.js +1 -1
- package/index280.mjs +54 -7
- package/index281.js +1 -1
- package/index281.mjs +27 -11
- package/index282.js +1 -1
- package/index282.mjs +31 -9
- package/index283.js +1 -1
- package/index283.mjs +136 -125
- package/index284.js +1 -1
- package/index284.mjs +209 -39
- package/index285.js +1 -1
- package/index285.mjs +19 -228
- package/index286.js +1 -1
- package/index286.mjs +46 -28
- package/index287.js +1 -1
- package/index287.mjs +45 -8
- package/index288.js +6 -1
- package/index288.mjs +113 -3
- package/index289.js +1 -1
- package/index289.mjs +72 -37
- package/index29.js +1 -1
- package/index29.mjs +2 -2
- package/index290.js +1 -1
- package/index290.mjs +74 -5
- package/index291.js +1 -1
- package/index291.mjs +7 -29
- package/index292.js +1 -1
- package/index292.mjs +11 -6
- package/index30.js +1 -1
- package/index30.mjs +1 -1
- package/index329.js +1 -1
- package/index329.mjs +17 -59
- package/index33.js +1 -1
- package/index33.mjs +2 -2
- package/index330.js +1 -1
- package/index330.mjs +30 -7
- package/index331.js +1 -1
- package/index331.mjs +63 -27
- package/index332.js +1 -1
- package/index332.mjs +15 -87
- package/index333.js +1 -1
- package/index333.mjs +48 -7
- package/index334.js +1 -1
- package/index334.mjs +7 -26
- package/index335.js +1 -1
- package/index335.mjs +26 -32
- package/index336.js +1 -1
- package/index336.mjs +87 -6
- package/index337.js +1 -1
- package/index337.mjs +9 -6
- package/index338.js +1 -1
- package/index338.mjs +23 -48
- package/index339.js +1 -1
- package/index339.mjs +32 -28
- package/index34.js +1 -1
- package/index34.mjs +3 -3
- package/index340.js +1 -1
- package/index340.mjs +6 -15
- package/index341.js +1 -1
- package/index341.mjs +6 -21
- package/index342.js +1 -1
- package/index342.mjs +28 -28
- package/index345.js +1 -1
- package/index345.mjs +1 -1
- package/index35.js +1 -1
- package/index35.mjs +1 -1
- package/index36.js +1 -1
- package/index36.mjs +2 -2
- package/index38.js +1 -1
- package/index38.mjs +3 -3
- package/index39.js +1 -1
- package/index39.mjs +3 -3
- package/index40.js +1 -1
- package/index40.mjs +3 -3
- package/index42.js +1 -1
- package/index42.mjs +1 -1
- package/index44.js +1 -1
- package/index44.mjs +2 -2
- package/index45.js +1 -1
- package/index45.mjs +1 -1
- package/index48.js +1 -1
- package/index48.mjs +2 -2
- package/index52.js +1 -1
- package/index52.mjs +1 -1
- package/index54.js +1 -1
- package/index54.mjs +3 -3
- package/index56.js +1 -1
- package/index56.mjs +2 -2
- package/index57.js +1 -1
- package/index57.mjs +1 -1
- package/index59.js +1 -1
- package/index59.mjs +2 -2
- package/logger.d.ts +2 -2
- package/package.json +2 -2
package/index275.mjs
CHANGED
|
@@ -1,52 +1,234 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { getItemElement as B, useCollectionId as ue, isNonContiguousSelectionModifier as H } from "./index329.mjs";
|
|
2
|
+
import { useTypeSelect as fe } from "./index330.mjs";
|
|
3
|
+
import { getActiveElement as se } from "./index240.mjs";
|
|
4
|
+
import { mergeProps as q } from "./index158.mjs";
|
|
5
|
+
import { focusWithoutScrolling as G } from "./index244.mjs";
|
|
6
|
+
import { useRouter as ae } from "./index245.mjs";
|
|
7
|
+
import { useUpdateLayoutEffect as j } from "./index250.mjs";
|
|
8
|
+
import { useEvent as S } from "./index258.mjs";
|
|
9
|
+
import { scrollIntoView as de, scrollIntoViewport as J } from "./index259.mjs";
|
|
10
|
+
import { FOCUS_EVENT as ve, CLEAR_FOCUS_EVENT as pe } from "./index262.mjs";
|
|
11
|
+
import { isCtrlKeyPressed as F } from "./index263.mjs";
|
|
12
|
+
import { isTabbable as be } from "./index264.mjs";
|
|
13
|
+
import { moveVirtualFocus as me, dispatchVirtualFocus as ye, getFocusableTreeWalker as $e } from "@react-aria/focus";
|
|
14
|
+
import { flushSync as Ke } from "react-dom";
|
|
15
|
+
import { useRef as m, useEffect as C } from "react";
|
|
16
|
+
import { getInteractionModality as Q } from "./index331.mjs";
|
|
17
|
+
import { focusSafely as X } from "./index332.mjs";
|
|
18
|
+
import { useLocale as Fe } from "@react-aria/i18n";
|
|
19
|
+
function Ue(Y) {
|
|
20
|
+
let { selectionManager: e, keyboardDelegate: o, ref: i, autoFocus: w = !1, shouldFocusWrap: x = !1, disallowEmptySelection: Z = !1, disallowSelectAll: g = !1, escapeKeyBehavior: _ = "clearSelection", selectOnFocus: y = e.selectionBehavior === "replace", disallowTypeAhead: ee = !1, shouldUseVirtualFocus: b, allowsTabNavigation: le = !1, isVirtualized: N, scrollRef: s = i, linkBehavior: U = "action" } = Y, { direction: T } = Fe(), oe = ae(), te = (l) => {
|
|
21
|
+
var r;
|
|
22
|
+
if (l.altKey && l.key === "Tab" && l.preventDefault(), !(!((r = i.current) === null || r === void 0) && r.contains(l.target))) return;
|
|
23
|
+
const c = (t, v) => {
|
|
24
|
+
if (t != null) {
|
|
25
|
+
if (e.isLink(t) && U === "selection" && y && !H(l)) {
|
|
26
|
+
Ke(() => {
|
|
27
|
+
e.setFocusedKey(t, v);
|
|
28
|
+
});
|
|
29
|
+
let p = B(i, t), W = e.getItemProps(t);
|
|
30
|
+
p && oe.open(p, l, W.href, W.routerOptions);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (e.setFocusedKey(t, v), e.isLink(t) && U === "override") return;
|
|
34
|
+
l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : y && !H(l) && e.replaceSelection(t);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
switch (l.key) {
|
|
38
|
+
case "ArrowDown":
|
|
39
|
+
if (o.getKeyBelow) {
|
|
40
|
+
var n, f, u;
|
|
41
|
+
let t = e.focusedKey != null ? (n = o.getKeyBelow) === null || n === void 0 ? void 0 : n.call(o, e.focusedKey) : (f = o.getFirstKey) === null || f === void 0 ? void 0 : f.call(o);
|
|
42
|
+
t == null && x && (t = (u = o.getFirstKey) === null || u === void 0 ? void 0 : u.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case "ArrowUp":
|
|
46
|
+
if (o.getKeyAbove) {
|
|
47
|
+
var a, d, A;
|
|
48
|
+
let t = e.focusedKey != null ? (a = o.getKeyAbove) === null || a === void 0 ? void 0 : a.call(o, e.focusedKey) : (d = o.getLastKey) === null || d === void 0 ? void 0 : d.call(o);
|
|
49
|
+
t == null && x && (t = (A = o.getLastKey) === null || A === void 0 ? void 0 : A.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case "ArrowLeft":
|
|
53
|
+
if (o.getKeyLeftOf) {
|
|
54
|
+
var k, I, M;
|
|
55
|
+
let t = e.focusedKey != null ? (k = o.getKeyLeftOf) === null || k === void 0 ? void 0 : k.call(o, e.focusedKey) : null;
|
|
56
|
+
t == null && x && (t = T === "rtl" ? (I = o.getFirstKey) === null || I === void 0 ? void 0 : I.call(o, e.focusedKey) : (M = o.getLastKey) === null || M === void 0 ? void 0 : M.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, T === "rtl" ? "first" : "last"));
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
case "ArrowRight":
|
|
60
|
+
if (o.getKeyRightOf) {
|
|
61
|
+
var R, V, O;
|
|
62
|
+
let t = e.focusedKey != null ? (R = o.getKeyRightOf) === null || R === void 0 ? void 0 : R.call(o, e.focusedKey) : null;
|
|
63
|
+
t == null && x && (t = T === "rtl" ? (V = o.getLastKey) === null || V === void 0 ? void 0 : V.call(o, e.focusedKey) : (O = o.getFirstKey) === null || O === void 0 ? void 0 : O.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, T === "rtl" ? "last" : "first"));
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case "Home":
|
|
67
|
+
if (o.getFirstKey) {
|
|
68
|
+
if (e.focusedKey === null && l.shiftKey) return;
|
|
69
|
+
l.preventDefault();
|
|
70
|
+
let t = o.getFirstKey(e.focusedKey, F(l));
|
|
71
|
+
e.setFocusedKey(t), t != null && (F(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : y && e.replaceSelection(t));
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
case "End":
|
|
75
|
+
if (o.getLastKey) {
|
|
76
|
+
if (e.focusedKey === null && l.shiftKey) return;
|
|
77
|
+
l.preventDefault();
|
|
78
|
+
let t = o.getLastKey(e.focusedKey, F(l));
|
|
79
|
+
e.setFocusedKey(t), t != null && (F(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : y && e.replaceSelection(t));
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
case "PageDown":
|
|
83
|
+
if (o.getKeyPageBelow && e.focusedKey != null) {
|
|
84
|
+
let t = o.getKeyPageBelow(e.focusedKey);
|
|
85
|
+
t != null && (l.preventDefault(), c(t));
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
case "PageUp":
|
|
89
|
+
if (o.getKeyPageAbove && e.focusedKey != null) {
|
|
90
|
+
let t = o.getKeyPageAbove(e.focusedKey);
|
|
91
|
+
t != null && (l.preventDefault(), c(t));
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
case "a":
|
|
95
|
+
F(l) && e.selectionMode === "multiple" && g !== !0 && (l.preventDefault(), e.selectAll());
|
|
96
|
+
break;
|
|
97
|
+
case "Escape":
|
|
98
|
+
_ === "clearSelection" && !Z && e.selectedKeys.size !== 0 && (l.stopPropagation(), l.preventDefault(), e.clearSelection());
|
|
99
|
+
break;
|
|
100
|
+
case "Tab":
|
|
101
|
+
if (!le) {
|
|
102
|
+
if (l.shiftKey) i.current.focus();
|
|
103
|
+
else {
|
|
104
|
+
let t = $e(i.current, {
|
|
105
|
+
tabbable: !0
|
|
106
|
+
}), v, p;
|
|
107
|
+
do
|
|
108
|
+
p = t.lastChild(), p && (v = p);
|
|
109
|
+
while (p);
|
|
110
|
+
v && (!v.contains(document.activeElement) || document.activeElement && !be(document.activeElement)) && G(v);
|
|
111
|
+
}
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, E = m({
|
|
116
|
+
top: 0,
|
|
117
|
+
left: 0
|
|
118
|
+
});
|
|
119
|
+
S(s, "scroll", N ? void 0 : () => {
|
|
120
|
+
var l, r, c, n;
|
|
121
|
+
E.current = {
|
|
122
|
+
top: (c = (l = s.current) === null || l === void 0 ? void 0 : l.scrollTop) !== null && c !== void 0 ? c : 0,
|
|
123
|
+
left: (n = (r = s.current) === null || r === void 0 ? void 0 : r.scrollLeft) !== null && n !== void 0 ? n : 0
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
let re = (l) => {
|
|
127
|
+
if (e.isFocused) {
|
|
128
|
+
l.currentTarget.contains(l.target) || e.setFocused(!1);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (l.currentTarget.contains(l.target)) {
|
|
132
|
+
if (e.setFocused(!0), e.focusedKey == null) {
|
|
133
|
+
var r, c;
|
|
134
|
+
let u = (d) => {
|
|
135
|
+
d != null && (e.setFocusedKey(d), y && !e.isSelected(d) && e.replaceSelection(d));
|
|
136
|
+
}, a = l.relatedTarget;
|
|
137
|
+
var n, f;
|
|
138
|
+
a && l.currentTarget.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_FOLLOWING ? u((n = e.lastSelectedKey) !== null && n !== void 0 ? n : (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) : u((f = e.firstSelectedKey) !== null && f !== void 0 ? f : (c = o.getFirstKey) === null || c === void 0 ? void 0 : c.call(o));
|
|
139
|
+
} else !N && s.current && (s.current.scrollTop = E.current.top, s.current.scrollLeft = E.current.left);
|
|
140
|
+
if (e.focusedKey != null && s.current) {
|
|
141
|
+
let u = B(i, e.focusedKey);
|
|
142
|
+
u instanceof HTMLElement && (!u.contains(document.activeElement) && !b && G(u), Q() === "keyboard" && J(u, {
|
|
143
|
+
containingElement: i.current
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, ce = (l) => {
|
|
148
|
+
l.currentTarget.contains(l.relatedTarget) || e.setFocused(!1);
|
|
149
|
+
}, $ = m(!1);
|
|
150
|
+
S(i, ve, b ? (l) => {
|
|
151
|
+
let { detail: r } = l;
|
|
152
|
+
l.stopPropagation(), e.setFocused(!0), (r == null ? void 0 : r.focusStrategy) === "first" && ($.current = !0);
|
|
153
|
+
} : void 0), j(() => {
|
|
154
|
+
if ($.current) {
|
|
155
|
+
var l, r;
|
|
156
|
+
let c = (r = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && r !== void 0 ? r : null;
|
|
157
|
+
if (c == null) {
|
|
158
|
+
let n = se();
|
|
159
|
+
me(i.current), ye(n, null), e.collection.size > 0 && ($.current = !1);
|
|
160
|
+
} else
|
|
161
|
+
e.setFocusedKey(c), $.current = !1;
|
|
162
|
+
}
|
|
14
163
|
}, [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
164
|
+
e.collection
|
|
165
|
+
]), j(() => {
|
|
166
|
+
e.collection.size > 0 && ($.current = !1);
|
|
167
|
+
}, [
|
|
168
|
+
e.focusedKey
|
|
169
|
+
]), S(i, pe, b ? (l) => {
|
|
170
|
+
var r;
|
|
171
|
+
l.stopPropagation(), e.setFocused(!1), !((r = l.detail) === null || r === void 0) && r.clearFocusKey && e.setFocusedKey(null);
|
|
172
|
+
} : void 0);
|
|
173
|
+
const z = m(w), h = m(!1);
|
|
174
|
+
C(() => {
|
|
175
|
+
if (z.current) {
|
|
176
|
+
var l, r;
|
|
177
|
+
let f = null;
|
|
178
|
+
var c;
|
|
179
|
+
w === "first" && (f = (c = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && c !== void 0 ? c : null);
|
|
180
|
+
var n;
|
|
181
|
+
w === "last" && (f = (n = (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) !== null && n !== void 0 ? n : null);
|
|
182
|
+
let u = e.selectedKeys;
|
|
183
|
+
if (u.size) {
|
|
184
|
+
for (let a of u) if (e.canSelectItem(a)) {
|
|
185
|
+
f = a;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
e.setFocused(!0), e.setFocusedKey(f), f == null && !b && i.current && X(i.current), e.collection.size > 0 && (z.current = !1, h.current = !0);
|
|
190
|
+
}
|
|
31
191
|
});
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
192
|
+
let D = m(e.focusedKey), K = m(null);
|
|
193
|
+
C(() => {
|
|
194
|
+
if (e.isFocused && e.focusedKey != null && (e.focusedKey !== D.current || h.current) && s.current && i.current) {
|
|
195
|
+
let l = Q(), r = B(i, e.focusedKey);
|
|
196
|
+
if (!(r instanceof HTMLElement))
|
|
197
|
+
return;
|
|
198
|
+
(l === "keyboard" || h.current) && (K.current && cancelAnimationFrame(K.current), K.current = requestAnimationFrame(() => {
|
|
199
|
+
s.current && (de(s.current, r), l !== "virtual" && J(r, {
|
|
200
|
+
containingElement: i.current
|
|
201
|
+
}));
|
|
202
|
+
}));
|
|
36
203
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
204
|
+
!b && e.isFocused && e.focusedKey == null && D.current != null && i.current && X(i.current), D.current = e.focusedKey, h.current = !1;
|
|
205
|
+
}), C(() => () => {
|
|
206
|
+
K.current && cancelAnimationFrame(K.current);
|
|
207
|
+
}, []), S(i, "react-aria-focus-scope-restore", (l) => {
|
|
208
|
+
l.preventDefault(), e.setFocused(!0);
|
|
209
|
+
});
|
|
210
|
+
let P = {
|
|
211
|
+
onKeyDown: te,
|
|
212
|
+
onFocus: re,
|
|
213
|
+
onBlur: ce,
|
|
214
|
+
onMouseDown(l) {
|
|
215
|
+
s.current === l.target && l.preventDefault();
|
|
47
216
|
}
|
|
217
|
+
}, { typeSelectProps: ie } = fe({
|
|
218
|
+
keyboardDelegate: o,
|
|
219
|
+
selectionManager: e
|
|
220
|
+
});
|
|
221
|
+
ee || (P = q(ie, P));
|
|
222
|
+
let L;
|
|
223
|
+
b || (L = e.focusedKey == null ? 0 : -1);
|
|
224
|
+
let ne = ue(e.collection);
|
|
225
|
+
return {
|
|
226
|
+
collectionProps: q(P, {
|
|
227
|
+
tabIndex: L,
|
|
228
|
+
"data-collection": ne
|
|
229
|
+
})
|
|
48
230
|
};
|
|
49
231
|
}
|
|
50
232
|
export {
|
|
51
|
-
|
|
233
|
+
Ue as useSelectableCollection
|
|
52
234
|
};
|
package/index276.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),v={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},x={...v,customError:!0,valid:!1},c={isInvalid:!1,validationDetails:v,validationErrors:[]},h=n.createContext({}),I="__formValidationState"+Date.now();function R(e){if(e[I]){let{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:d,commitValidation:l}=e[I];return{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:d,commitValidation:l}}return w(e)}function w(e){let{isInvalid:a,validationState:t,name:i,value:d,builtinValidation:l,validate:s,validationBehavior:o="aria"}=e;t&&(a||(a=t==="invalid"));let V=a!==void 0?{isInvalid:a,validationErrors:[],validationDetails:x}:null,m=n.useMemo(()=>{if(!s||d==null)return null;let r=F(s,d);return T(r)},[s,d]);l!=null&&l.validationDetails.valid&&(l=void 0);let u=n.useContext(h),A=n.useMemo(()=>i?Array.isArray(i)?i.flatMap(r=>D(u[r])):D(u[i]):[],[u,i]),[C,L]=n.useState(u),[g,$]=n.useState(!1);u!==C&&(L(u),$(!1));let b=n.useMemo(()=>T(g?[]:A),[g,A]),M=n.useRef(c),[E,p]=n.useState(c),f=n.useRef(c),_=()=>{if(!O)return;S(!1);let r=m||l||M.current;y(r,f.current)||(f.current=r,p(r))},[O,S]=n.useState(!1);return n.useEffect(_),{realtimeValidation:V||b||m||l||c,displayValidation:o==="native"?V||b||E:V||b||m||l||E,updateValidation(r){o==="aria"&&!y(E,r)?p(r):M.current=r},resetValidation(){let r=c;y(r,f.current)||(f.current=r,p(r)),o==="native"&&S(!1),$(!0)},commitValidation(){o==="native"&&S(!0),$(!0)}}}function D(e){return e?Array.isArray(e)?e:[e]:[]}function F(e,a){if(typeof e=="function"){let t=e(a);if(t&&typeof t!="boolean")return D(t)}return[]}function T(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:x}:null}function y(e,a){return e===a?!0:!!e&&!!a&&e.isInvalid===a.isInvalid&&e.validationErrors.length===a.validationErrors.length&&e.validationErrors.every((t,i)=>t===a.validationErrors[i])&&Object.entries(e.validationDetails).every(([t,i])=>a.validationDetails[t]===i)}function U(...e){let a=new Set,t=!1,i={...v};for(let s of e){var d,l;for(let o of s.validationErrors)a.add(o);t||(t=s.isInvalid);for(let o in i)(d=i)[l=o]||(d[l]=s.validationDetails[o])}return i.valid=!t,{isInvalid:t,validationErrors:[...a],validationDetails:i}}exports.DEFAULT_VALIDATION_RESULT=c;exports.FormValidationContext=h;exports.VALID_VALIDITY_STATE=v;exports.mergeValidation=U;exports.privateValidationStateProp=I;exports.useFormValidationState=R;
|
package/index276.mjs
CHANGED
|
@@ -1,49 +1,128 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { useMemo as I, useContext as O, createContext as U, useState as f, useRef as T, useEffect as R } from "react";
|
|
2
|
+
const D = {
|
|
3
|
+
badInput: !1,
|
|
4
|
+
customError: !1,
|
|
5
|
+
patternMismatch: !1,
|
|
6
|
+
rangeOverflow: !1,
|
|
7
|
+
rangeUnderflow: !1,
|
|
8
|
+
stepMismatch: !1,
|
|
9
|
+
tooLong: !1,
|
|
10
|
+
tooShort: !1,
|
|
11
|
+
typeMismatch: !1,
|
|
12
|
+
valueMissing: !1,
|
|
13
|
+
valid: !0
|
|
14
|
+
}, L = {
|
|
15
|
+
...D,
|
|
16
|
+
customError: !0,
|
|
17
|
+
valid: !1
|
|
18
|
+
}, u = {
|
|
19
|
+
isInvalid: !1,
|
|
20
|
+
validationDetails: D,
|
|
21
|
+
validationErrors: []
|
|
22
|
+
}, B = U({}), h = "__formValidationState" + Date.now();
|
|
23
|
+
function P(a) {
|
|
24
|
+
if (a[h]) {
|
|
25
|
+
let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
|
|
26
|
+
return {
|
|
27
|
+
realtimeValidation: e,
|
|
28
|
+
displayValidation: t,
|
|
29
|
+
updateValidation: i,
|
|
30
|
+
resetValidation: o,
|
|
31
|
+
commitValidation: l
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return Q(a);
|
|
35
|
+
}
|
|
36
|
+
function Q(a) {
|
|
37
|
+
let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
|
|
38
|
+
t && (e || (e = t === "invalid"));
|
|
39
|
+
let v = e !== void 0 ? {
|
|
40
|
+
isInvalid: e,
|
|
41
|
+
validationErrors: [],
|
|
42
|
+
validationDetails: L
|
|
43
|
+
} : null, V = I(() => {
|
|
44
|
+
if (!d || o == null) return null;
|
|
45
|
+
let r = Y(d, o);
|
|
46
|
+
return C(r);
|
|
34
47
|
}, [
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
d,
|
|
49
|
+
o
|
|
37
50
|
]);
|
|
51
|
+
l != null && l.validationDetails.valid && (l = void 0);
|
|
52
|
+
let s = O(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
|
|
53
|
+
s,
|
|
54
|
+
i
|
|
55
|
+
]), [M, _] = f(s), [x, m] = f(!1);
|
|
56
|
+
s !== M && (_(s), m(!1));
|
|
57
|
+
let $ = I(() => C(x ? [] : A), [
|
|
58
|
+
x,
|
|
59
|
+
A
|
|
60
|
+
]), g = T(u), [b, E] = f(u), c = T(u), w = () => {
|
|
61
|
+
if (!F) return;
|
|
62
|
+
p(!1);
|
|
63
|
+
let r = V || l || g.current;
|
|
64
|
+
y(r, c.current) || (c.current = r, E(r));
|
|
65
|
+
}, [F, p] = f(!1);
|
|
66
|
+
return R(w), {
|
|
67
|
+
realtimeValidation: v || $ || V || l || u,
|
|
68
|
+
displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
|
|
69
|
+
updateValidation(r) {
|
|
70
|
+
n === "aria" && !y(b, r) ? E(r) : g.current = r;
|
|
71
|
+
},
|
|
72
|
+
resetValidation() {
|
|
73
|
+
let r = u;
|
|
74
|
+
y(r, c.current) || (c.current = r, E(r)), n === "native" && p(!1), m(!0);
|
|
75
|
+
},
|
|
76
|
+
commitValidation() {
|
|
77
|
+
n === "native" && p(!0), m(!0);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function S(a) {
|
|
82
|
+
return a ? Array.isArray(a) ? a : [
|
|
83
|
+
a
|
|
84
|
+
] : [];
|
|
85
|
+
}
|
|
86
|
+
function Y(a, e) {
|
|
87
|
+
if (typeof a == "function") {
|
|
88
|
+
let t = a(e);
|
|
89
|
+
if (t && typeof t != "boolean") return S(t);
|
|
90
|
+
}
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
function C(a) {
|
|
94
|
+
return a.length ? {
|
|
95
|
+
isInvalid: !0,
|
|
96
|
+
validationErrors: a,
|
|
97
|
+
validationDetails: L
|
|
98
|
+
} : null;
|
|
99
|
+
}
|
|
100
|
+
function y(a, e) {
|
|
101
|
+
return a === e ? !0 : !!a && !!e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
|
|
38
102
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
103
|
+
function k(...a) {
|
|
104
|
+
let e = /* @__PURE__ */ new Set(), t = !1, i = {
|
|
105
|
+
...D
|
|
106
|
+
};
|
|
107
|
+
for (let d of a) {
|
|
108
|
+
var o, l;
|
|
109
|
+
for (let n of d.validationErrors) e.add(n);
|
|
110
|
+
t || (t = d.isInvalid);
|
|
111
|
+
for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
|
|
44
112
|
}
|
|
45
|
-
return
|
|
113
|
+
return i.valid = !t, {
|
|
114
|
+
isInvalid: t,
|
|
115
|
+
validationErrors: [
|
|
116
|
+
...e
|
|
117
|
+
],
|
|
118
|
+
validationDetails: i
|
|
119
|
+
};
|
|
46
120
|
}
|
|
47
121
|
export {
|
|
48
|
-
|
|
122
|
+
u as DEFAULT_VALIDATION_RESULT,
|
|
123
|
+
B as FormValidationContext,
|
|
124
|
+
D as VALID_VALIDITY_STATE,
|
|
125
|
+
k as mergeValidation,
|
|
126
|
+
h as privateValidationStateProp,
|
|
127
|
+
P as useFormValidationState
|
|
49
128
|
};
|
package/index277.js
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
@layer {
|
|
3
|
-
* {
|
|
4
|
-
overscroll-behavior: contain;
|
|
5
|
-
}
|
|
6
|
-
}`.trim(),document.head.prepend(o);let i=c=>{if(!(c.touches.length===2||t)){if(!e||e===document.documentElement||e===document.body){c.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&c.preventDefault()}},u=c=>{let l=c.target,r=c.relatedTarget;if(r&&p.willOpenKeyboard(r))r.focus({preventScroll:!0}),g(r,p.willOpenKeyboard(l));else if(!r){var f;let v=(f=l.parentElement)===null||f===void 0?void 0:f.closest("[tabindex]");v==null||v.focus({preventScroll:!0})}},d=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(c){let l=document.activeElement!=null&&p.willOpenKeyboard(document.activeElement);d.call(this,{...c,preventScroll:!0}),(!c||!c.preventScroll)&&g(this,l)};let m=S.chain(b(document,"touchstart",n,{passive:!1,capture:!0}),b(document,"touchmove",i,{passive:!1,capture:!0}),b(document,"blur",u,!0));return()=>{m(),o.remove(),HTMLElement.prototype.focus=d}}function $(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}function b(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function g(e,t){t||!a?E(e):a.addEventListener("resize",()=>E(e),{once:!0})}function E(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let o=y.getScrollParent(n);if(o!==document.documentElement&&o!==document.body&&o!==n){let i=o.getBoundingClientRect(),u=n.getBoundingClientRect();if(u.top<i.top||u.bottom>i.top+n.clientHeight){let d=i.bottom;a&&(d=Math.min(d,a.offsetTop+a.height));let m=u.top-i.top-((d-i.top)/2-u.height/2);o.scrollTo({top:Math.max(0,Math.min(o.scrollHeight-o.clientHeight,o.scrollTop+m)),behavior:"smooth"})}}n=o.parentElement}}exports.usePreventScroll=H;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index331.js"),m=require("react"),E=require("./index236.js"),d=require("./index252.js");function y(n,e,t){let{validationBehavior:v,focus:s}=n;E.useLayoutEffect(()=>{if(v==="native"&&(t!=null&&t.current)&&!t.current.disabled){let a=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";t.current.setCustomValidity(a),t.current.hasAttribute("title")||(t.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(M(t.current))}});let l=m.useRef(!1),u=d.useEffectEvent(()=>{l.current||e.resetValidation()}),c=d.useEffectEvent(a=>{var i;e.displayValidation.isInvalid||e.commitValidation();let o=t==null||(i=t.current)===null||i===void 0?void 0:i.form;if(!a.defaultPrevented&&t&&o&&b(o)===t.current){var r;s?s():(r=t.current)===null||r===void 0||r.focus(),g.setInteractionModality("keyboard")}a.preventDefault()}),f=d.useEffectEvent(()=>{e.commitValidation()});m.useEffect(()=>{let a=t==null?void 0:t.current;if(!a)return;let i=a.form,o=i==null?void 0:i.reset;return i&&(i.reset=()=>{l.current=!window.event||window.event.type==="message"&&window.event.target instanceof MessagePort,o==null||o.call(i),l.current=!1}),a.addEventListener("invalid",c),a.addEventListener("change",f),i==null||i.addEventListener("reset",u),()=>{a.removeEventListener("invalid",c),a.removeEventListener("change",f),i==null||i.removeEventListener("reset",u),i&&(i.reset=o)}},[t,v])}function h(n){let e=n.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function M(n){return{isInvalid:!n.validity.valid,validationDetails:h(n),validationErrors:n.validationMessage?[n.validationMessage]:[]}}function b(n){for(let e=0;e<n.elements.length;e++){let t=n.elements[e];if(!t.validity.valid)return t}return null}exports.useFormValidation=y;
|