@okam/stack-ui 1.42.2 → 1.42.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 +10 -0
- package/index100.js +1 -1
- package/index100.mjs +1 -1
- package/index101.js +1 -1
- package/index101.mjs +1 -1
- package/index102.js +1 -1
- package/index102.mjs +1 -1
- package/index153.js +1 -1
- package/index153.mjs +3 -3
- package/index154.js +1 -1
- package/index154.mjs +1 -1
- package/index156.js +1 -1
- package/index156.mjs +1 -1
- package/index161.js +1 -1
- package/index161.mjs +1 -1
- package/index172.js +1 -1
- package/index172.mjs +1 -1
- package/index176.js +1 -1
- package/index176.mjs +3 -3
- package/index177.js +1 -1
- package/index177.mjs +1 -1
- package/index178.js +1 -1
- package/index178.mjs +1 -1
- package/index179.js +1 -1
- package/index179.mjs +3 -3
- package/index181.js +1 -1
- package/index181.mjs +1 -1
- package/index238.js +1 -1
- package/index238.mjs +3 -3
- package/index239.js +1 -1
- package/index239.mjs +2 -2
- package/index242.js +1 -1
- package/index242.mjs +1 -1
- package/index251.js +1 -1
- package/index251.mjs +68 -22
- package/index252.js +1 -1
- package/index252.mjs +370 -62
- package/index253.js +1 -1
- package/index253.mjs +44 -379
- package/index254.js +1 -1
- package/index254.mjs +23 -45
- package/index255.js +1 -1
- package/index255.mjs +24 -24
- package/index256.js +1 -1
- package/index256.mjs +11 -23
- package/index257.js +1 -1
- package/index257.mjs +4 -12
- package/index258.js +1 -1
- package/index258.mjs +14 -4
- package/index259.js +1 -1
- package/index259.mjs +41 -13
- package/index260.js +1 -1
- package/index260.mjs +52 -37
- package/index261.js +1 -1
- package/index261.mjs +26 -55
- package/index262.js +1 -1
- package/index262.mjs +30 -27
- package/index263.js +1 -1
- package/index263.mjs +10 -31
- package/index264.js +1 -1
- package/index264.mjs +8 -9
- package/index265.js +1 -1
- package/index265.mjs +5 -9
- package/index266.js +1 -1
- package/index266.mjs +7 -5
- package/index267.js +1 -1
- package/index267.mjs +29 -7
- package/index268.js +1 -1
- package/index268.mjs +16 -27
- package/index269.js +1 -1
- package/index269.mjs +12 -17
- package/index270.js +1 -1
- package/index270.mjs +43 -13
- package/index271.js +1 -1
- package/index271.mjs +7 -42
- package/index272.js +1 -1
- package/index272.mjs +17 -8
- package/index273.js +1 -1
- package/index273.mjs +3 -18
- package/index274.js +1 -1
- package/index274.mjs +5 -3
- package/index275.js +1 -1
- package/index275.mjs +19 -4
- package/index276.js +1 -1
- package/index276.mjs +27 -19
- package/index277.js +1 -1
- package/index277.mjs +31 -5
- package/index278.js +1 -1
- package/index278.mjs +5 -121
- package/index279.js +1 -1
- package/index279.mjs +121 -43
- package/index280.js +1 -1
- package/index280.mjs +43 -230
- package/index281.js +1 -1
- package/index281.mjs +226 -27
- package/index325.js +1 -1
- package/index325.mjs +2 -2
- package/index326.js +1 -1
- package/index326.mjs +4 -4
- package/index327.js +1 -1
- package/index327.mjs +2 -2
- package/index330.js +1 -1
- package/index330.mjs +2 -2
- package/index333.js +1 -1
- package/index333.mjs +5 -5
- package/index334.js +1 -1
- package/index334.mjs +1 -1
- package/index335.js +1 -1
- package/index335.mjs +4 -4
- package/index336.js +1 -1
- package/index336.mjs +65 -20
- package/index337.js +1 -1
- package/index337.mjs +53 -29
- package/index338.js +1 -1
- package/index338.mjs +51 -63
- package/index339.js +1 -1
- package/index339.mjs +271 -43
- package/index340.js +1 -1
- package/index340.mjs +18 -52
- package/index341.js +1 -1
- package/index341.mjs +21 -281
- package/index342.js +1 -1
- package/index342.mjs +29 -20
- package/index99.js +1 -1
- package/index99.mjs +1 -1
- package/package.json +1 -1
package/index269.mjs
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let c = e.current;
|
|
8
|
-
return c.addEventListener(t, f, r), () => {
|
|
9
|
-
c.removeEventListener(t, f, r);
|
|
10
|
-
};
|
|
1
|
+
import { useLayoutEffect as f } from "./index235.mjs";
|
|
2
|
+
import { useRef as o, useCallback as a } from "react";
|
|
3
|
+
function s(r) {
|
|
4
|
+
const t = o(null);
|
|
5
|
+
return f(() => {
|
|
6
|
+
t.current = r;
|
|
11
7
|
}, [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
]);
|
|
8
|
+
r
|
|
9
|
+
]), a((...c) => {
|
|
10
|
+
const e = t.current;
|
|
11
|
+
return e == null ? void 0 : e(...c);
|
|
12
|
+
}, []);
|
|
18
13
|
}
|
|
19
14
|
export {
|
|
20
|
-
|
|
15
|
+
s as useEffectEvent
|
|
21
16
|
};
|
package/index270.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 W=require("./index266.js");function L(e,o){let d=T(e,o,"left"),t=T(e,o,"top"),l=o.offsetWidth,f=o.offsetHeight,r=e.scrollLeft,n=e.scrollTop,{borderTopWidth:i,borderLeftWidth:s,scrollPaddingTop:c,scrollPaddingRight:a,scrollPaddingBottom:$,scrollPaddingLeft:S}=getComputedStyle(e),I=r+parseInt(s,10),u=n+parseInt(i,10),b=I+e.clientWidth,P=u+e.clientHeight,p=parseInt(c,10)||0,v=parseInt($,10)||0,h=parseInt(a,10)||0,g=parseInt(S,10)||0;d<=r+g?r=d-parseInt(s,10)-g:d+l>b-h&&(r+=d+l-b+h),t<=u+p?n=t-parseInt(i,10)-p:t+f>P-v&&(n+=t+f-P+v),e.scrollLeft=r,e.scrollTop=n}function T(e,o,d){const t=d==="left"?"offsetLeft":"offsetTop";let l=0;for(;o.offsetParent&&(l+=o[t],o.offsetParent!==e);){if(o.offsetParent.contains(e)){l-=e[t];break}o=o.offsetParent}return l}function k(e,o){if(e&&document.contains(e)){let r=document.scrollingElement||document.documentElement;if(window.getComputedStyle(r).overflow==="hidden"){let i=W.getScrollParents(e);for(let s of i)L(s,e)}else{var d;let{left:i,top:s}=e.getBoundingClientRect();e==null||(d=e.scrollIntoView)===null||d===void 0||d.call(e,{block:"nearest"});let{left:c,top:a}=e.getBoundingClientRect();if(Math.abs(i-c)>1||Math.abs(s-a)>1){var t,l,f;o==null||(l=o.containingElement)===null||l===void 0||(t=l.scrollIntoView)===null||t===void 0||t.call(l,{block:"center",inline:"center"}),(f=e.scrollIntoView)===null||f===void 0||f.call(e,{block:"nearest"})}}}}exports.scrollIntoView=L;exports.scrollIntoViewport=k;
|
package/index270.mjs
CHANGED
|
@@ -1,16 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { getScrollParents as I } from "./index266.mjs";
|
|
2
|
+
function W(o, e) {
|
|
3
|
+
let t = L(o, e, "left"), d = L(o, e, "top"), l = e.offsetWidth, r = e.offsetHeight, f = o.scrollLeft, c = o.scrollTop, { borderTopWidth: i, borderLeftWidth: s, scrollPaddingTop: n, scrollPaddingRight: a, scrollPaddingBottom: T, scrollPaddingLeft: g } = getComputedStyle(o), x = f + parseInt(s, 10), u = c + parseInt(i, 10), b = x + o.clientWidth, p = u + o.clientHeight, P = parseInt(n, 10) || 0, v = parseInt(T, 10) || 0, h = parseInt(a, 10) || 0, $ = parseInt(g, 10) || 0;
|
|
4
|
+
t <= f + $ ? f = t - parseInt(s, 10) - $ : t + l > b - h && (f += t + l - b + h), d <= u + P ? c = d - parseInt(i, 10) - P : d + r > p - v && (c += d + r - p + v), o.scrollLeft = f, o.scrollTop = c;
|
|
5
|
+
}
|
|
6
|
+
function L(o, e, t) {
|
|
7
|
+
const d = t === "left" ? "offsetLeft" : "offsetTop";
|
|
8
|
+
let l = 0;
|
|
9
|
+
for (; e.offsetParent && (l += e[d], e.offsetParent !== o); ) {
|
|
10
|
+
if (e.offsetParent.contains(o)) {
|
|
11
|
+
l -= o[d];
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
e = e.offsetParent;
|
|
15
|
+
}
|
|
16
|
+
return l;
|
|
17
|
+
}
|
|
18
|
+
function B(o, e) {
|
|
19
|
+
if (o && document.contains(o)) {
|
|
20
|
+
let f = document.scrollingElement || document.documentElement;
|
|
21
|
+
if (window.getComputedStyle(f).overflow === "hidden") {
|
|
22
|
+
let i = I(o);
|
|
23
|
+
for (let s of i) W(s, o);
|
|
24
|
+
} else {
|
|
25
|
+
var t;
|
|
26
|
+
let { left: i, top: s } = o.getBoundingClientRect();
|
|
27
|
+
o == null || (t = o.scrollIntoView) === null || t === void 0 || t.call(o, {
|
|
28
|
+
block: "nearest"
|
|
29
|
+
});
|
|
30
|
+
let { left: n, top: a } = o.getBoundingClientRect();
|
|
31
|
+
if (Math.abs(i - n) > 1 || Math.abs(s - a) > 1) {
|
|
32
|
+
var d, l, r;
|
|
33
|
+
e == null || (l = e.containingElement) === null || l === void 0 || (d = l.scrollIntoView) === null || d === void 0 || d.call(l, {
|
|
34
|
+
block: "center",
|
|
35
|
+
inline: "center"
|
|
36
|
+
}), (r = o.scrollIntoView) === null || r === void 0 || r.call(o, {
|
|
37
|
+
block: "nearest"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
13
42
|
}
|
|
14
43
|
export {
|
|
15
|
-
|
|
44
|
+
W as scrollIntoView,
|
|
45
|
+
B as scrollIntoViewport
|
|
16
46
|
};
|
package/index271.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 i=require("./index243.js");function t(r){return r.mozInputSource===0&&r.isTrusted?!0:i.isAndroid()&&r.pointerType?r.type==="click"&&r.buttons===1:r.detail===0&&!r.pointerType}function o(r){return!i.isAndroid()&&r.width===0&&r.height===0||r.width===1&&r.height===1&&r.pressure===0&&r.detail===0&&r.pointerType==="mouse"}exports.isVirtualClick=t;exports.isVirtualPointerEvent=o;
|
package/index271.mjs
CHANGED
|
@@ -1,46 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
t <= f + $ ? f = t - parseInt(s, 10) - $ : t + l > b - h && (f += t + l - b + h), d <= u + P ? c = d - parseInt(i, 10) - P : d + r > p - v && (c += d + r - p + v), o.scrollLeft = f, o.scrollTop = c;
|
|
1
|
+
import { isAndroid as i } from "./index243.mjs";
|
|
2
|
+
function o(r) {
|
|
3
|
+
return r.mozInputSource === 0 && r.isTrusted ? !0 : i() && r.pointerType ? r.type === "click" && r.buttons === 1 : r.detail === 0 && !r.pointerType;
|
|
5
4
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
let l = 0;
|
|
9
|
-
for (; e.offsetParent && (l += e[d], e.offsetParent !== o); ) {
|
|
10
|
-
if (e.offsetParent.contains(o)) {
|
|
11
|
-
l -= o[d];
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
e = e.offsetParent;
|
|
15
|
-
}
|
|
16
|
-
return l;
|
|
17
|
-
}
|
|
18
|
-
function B(o, e) {
|
|
19
|
-
if (o && document.contains(o)) {
|
|
20
|
-
let f = document.scrollingElement || document.documentElement;
|
|
21
|
-
if (window.getComputedStyle(f).overflow === "hidden") {
|
|
22
|
-
let i = I(o);
|
|
23
|
-
for (let s of i) W(s, o);
|
|
24
|
-
} else {
|
|
25
|
-
var t;
|
|
26
|
-
let { left: i, top: s } = o.getBoundingClientRect();
|
|
27
|
-
o == null || (t = o.scrollIntoView) === null || t === void 0 || t.call(o, {
|
|
28
|
-
block: "nearest"
|
|
29
|
-
});
|
|
30
|
-
let { left: n, top: a } = o.getBoundingClientRect();
|
|
31
|
-
if (Math.abs(i - n) > 1 || Math.abs(s - a) > 1) {
|
|
32
|
-
var d, l, r;
|
|
33
|
-
e == null || (l = e.containingElement) === null || l === void 0 || (d = l.scrollIntoView) === null || d === void 0 || d.call(l, {
|
|
34
|
-
block: "center",
|
|
35
|
-
inline: "center"
|
|
36
|
-
}), (r = o.scrollIntoView) === null || r === void 0 || r.call(o, {
|
|
37
|
-
block: "nearest"
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
5
|
+
function u(r) {
|
|
6
|
+
return !i() && r.width === 0 && r.height === 0 || r.width === 1 && r.height === 1 && r.pressure === 0 && r.detail === 0 && r.pointerType === "mouse";
|
|
42
7
|
}
|
|
43
8
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
9
|
+
o as isVirtualClick,
|
|
10
|
+
u as isVirtualPointerEvent
|
|
46
11
|
};
|
package/index272.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 l=require("./index269.js"),o=require("react");function s(t,d,u){let i=o.useRef(d),r=l.useEffectEvent(()=>{u&&u(i.current)});o.useEffect(()=>{var n;let e=t==null||(n=t.current)===null||n===void 0?void 0:n.form;return e==null||e.addEventListener("reset",r),()=>{e==null||e.removeEventListener("reset",r)}},[t,r])}exports.useFormReset=s;
|
package/index272.mjs
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useEffectEvent as u } from "./index269.mjs";
|
|
2
|
+
import { useRef as a, useEffect as f } from "react";
|
|
3
|
+
function s(t, n, d) {
|
|
4
|
+
let i = a(n), r = u(() => {
|
|
5
|
+
d && d(i.current);
|
|
6
|
+
});
|
|
7
|
+
f(() => {
|
|
8
|
+
var o;
|
|
9
|
+
let e = t == null || (o = t.current) === null || o === void 0 ? void 0 : o.form;
|
|
10
|
+
return e == null || e.addEventListener("reset", r), () => {
|
|
11
|
+
e == null || e.removeEventListener("reset", r);
|
|
12
|
+
};
|
|
13
|
+
}, [
|
|
14
|
+
t,
|
|
15
|
+
r
|
|
16
|
+
]);
|
|
7
17
|
}
|
|
8
18
|
export {
|
|
9
|
-
|
|
10
|
-
u as isVirtualPointerEvent
|
|
19
|
+
s as useFormReset
|
|
11
20
|
};
|
package/index273.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 c="react-aria-clear-focus",e="react-aria-focus";exports.CLEAR_FOCUS_EVENT=c;exports.FOCUS_EVENT=e;
|
package/index273.mjs
CHANGED
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { useRef as a, useEffect as f } from "react";
|
|
3
|
-
function s(t, n, d) {
|
|
4
|
-
let i = a(n), r = u(() => {
|
|
5
|
-
d && d(i.current);
|
|
6
|
-
});
|
|
7
|
-
f(() => {
|
|
8
|
-
var o;
|
|
9
|
-
let e = t == null || (o = t.current) === null || o === void 0 ? void 0 : o.form;
|
|
10
|
-
return e == null || e.addEventListener("reset", r), () => {
|
|
11
|
-
e == null || e.removeEventListener("reset", r);
|
|
12
|
-
};
|
|
13
|
-
}, [
|
|
14
|
-
t,
|
|
15
|
-
r
|
|
16
|
-
]);
|
|
17
|
-
}
|
|
1
|
+
const a = "react-aria-clear-focus", c = "react-aria-focus";
|
|
18
2
|
export {
|
|
19
|
-
|
|
3
|
+
a as CLEAR_FOCUS_EVENT,
|
|
4
|
+
c as FOCUS_EVENT
|
|
20
5
|
};
|
package/index274.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 r=require("./index243.js");function t(e){return r.isMac()?e.metaKey:e.ctrlKey}exports.isCtrlKeyPressed=t;
|
package/index274.mjs
CHANGED
package/index275.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 e=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],b=e.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";e.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function n(t){return t.matches(b)}exports.isFocusable=n;
|
package/index275.mjs
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const e = [
|
|
2
|
+
"input:not([disabled]):not([type=hidden])",
|
|
3
|
+
"select:not([disabled])",
|
|
4
|
+
"textarea:not([disabled])",
|
|
5
|
+
"button:not([disabled])",
|
|
6
|
+
"a[href]",
|
|
7
|
+
"area[href]",
|
|
8
|
+
"summary",
|
|
9
|
+
"iframe",
|
|
10
|
+
"object",
|
|
11
|
+
"embed",
|
|
12
|
+
"audio[controls]",
|
|
13
|
+
"video[controls]",
|
|
14
|
+
'[contenteditable]:not([contenteditable^="false"])'
|
|
15
|
+
], b = e.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
|
16
|
+
e.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
17
|
+
function n(t) {
|
|
18
|
+
return t.matches(b);
|
|
4
19
|
}
|
|
5
20
|
export {
|
|
6
|
-
|
|
21
|
+
n as isFocusable
|
|
7
22
|
};
|
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 l=require("react");function m(o,p,s){let[b,u]=l.useState(o||p),i=l.useRef(o!==void 0),e=o!==void 0;l.useEffect(()=>{let t=i.current;t!==e&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${e?"controlled":"uncontrolled"}.`),i.current=e},[e]);let n=e?o:b,S=l.useCallback((t,...f)=>{let d=(r,...c)=>{s&&(Object.is(n,r)||s(r,...c)),e||(n=r)};typeof t=="function"?(process.env.NODE_ENV!=="production"&&console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),u((c,...V)=>{let a=t(e?n:c,...V);return d(a,...f),e?c:a})):(e||u(t),d(t,...f))},[e,n,s]);return[n,S]}exports.useControlledState=m;
|
package/index276.mjs
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useState as V, useRef as C, useEffect as E, useCallback as N } from "react";
|
|
2
|
+
function S(n, a, l) {
|
|
3
|
+
let [p, s] = V(n || a), i = C(n !== void 0), e = n !== void 0;
|
|
4
|
+
E(() => {
|
|
5
|
+
let t = i.current;
|
|
6
|
+
t !== e && process.env.NODE_ENV !== "production" && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), i.current = e;
|
|
7
|
+
}, [
|
|
8
|
+
e
|
|
9
|
+
]);
|
|
10
|
+
let o = e ? n : p, b = N((t, ...u) => {
|
|
11
|
+
let f = (r, ...c) => {
|
|
12
|
+
l && (Object.is(o, r) || l(r, ...c)), e || (o = r);
|
|
13
|
+
};
|
|
14
|
+
typeof t == "function" ? (process.env.NODE_ENV !== "production" && console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((c, ...m) => {
|
|
15
|
+
let d = t(e ? o : c, ...m);
|
|
16
|
+
return f(d, ...u), e ? c : d;
|
|
17
|
+
})) : (e || s(t), f(t, ...u));
|
|
18
|
+
}, [
|
|
19
|
+
e,
|
|
20
|
+
o,
|
|
21
|
+
l
|
|
22
|
+
]);
|
|
23
|
+
return [
|
|
24
|
+
o,
|
|
25
|
+
b
|
|
26
|
+
];
|
|
19
27
|
}
|
|
20
28
|
export {
|
|
21
|
-
|
|
29
|
+
S as useControlledState
|
|
22
30
|
};
|
package/index277.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 S=require("./index336.js"),y=require("./index276.js"),g=require("react");function K(t){var l;let[e,s]=y.useControlledState(t.selectedKey,(l=t.defaultSelectedKey)!==null&&l!==void 0?l:null,t.onSelectionChange),i=g.useMemo(()=>e!=null?[e]:[],[e]),{collection:a,disabledKeys:u,selectionManager:d}=S.useListState({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:o=>{if(o==="all")return;var n;let c=(n=o.values().next().value)!==null&&n!==void 0?n:null;c===e&&t.onSelectionChange&&t.onSelectionChange(c),s(c)}}),r=e!=null?a.getItem(e):null;return{collection:a,disabledKeys:u,selectionManager:d,selectedKey:e,setSelectedKey:s,selectedItem:r}}exports.useSingleSelectListState=K;
|
package/index277.mjs
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useListState as f } from "./index336.mjs";
|
|
2
|
+
import { useControlledState as S } from "./index276.mjs";
|
|
3
|
+
import { useMemo as y } from "react";
|
|
4
|
+
function g(l) {
|
|
5
|
+
var t;
|
|
6
|
+
let [e, c] = S(l.selectedKey, (t = l.defaultSelectedKey) !== null && t !== void 0 ? t : null, l.onSelectionChange), i = y(() => e != null ? [
|
|
7
|
+
e
|
|
8
|
+
] : [], [
|
|
9
|
+
e
|
|
10
|
+
]), { collection: o, disabledKeys: d, selectionManager: u } = f({
|
|
11
|
+
...l,
|
|
12
|
+
selectionMode: "single",
|
|
13
|
+
disallowEmptySelection: !0,
|
|
14
|
+
allowDuplicateSelectionEvents: !0,
|
|
15
|
+
selectedKeys: i,
|
|
16
|
+
onSelectionChange: (s) => {
|
|
17
|
+
if (s === "all") return;
|
|
18
|
+
var n;
|
|
19
|
+
let a = (n = s.values().next().value) !== null && n !== void 0 ? n : null;
|
|
20
|
+
a === e && l.onSelectionChange && l.onSelectionChange(a), c(a);
|
|
21
|
+
}
|
|
22
|
+
}), r = e != null ? o.getItem(e) : null;
|
|
23
|
+
return {
|
|
24
|
+
collection: o,
|
|
25
|
+
disabledKeys: d,
|
|
26
|
+
selectionManager: u,
|
|
27
|
+
selectedKey: e,
|
|
28
|
+
setSelectedKey: c,
|
|
29
|
+
selectedItem: r
|
|
30
|
+
};
|
|
4
31
|
}
|
|
5
32
|
export {
|
|
6
|
-
|
|
7
|
-
f as tabsIds
|
|
33
|
+
g as useSingleSelectListState
|
|
8
34
|
};
|
package/index278.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 r=new WeakMap;function a(t,e,f){return t?(typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${r.get(t)}-${f}-${e}`):""}exports.generateId=a;exports.tabsIds=r;
|
package/index278.mjs
CHANGED
|
@@ -1,124 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { focusSafely as z } from "./index335.mjs";
|
|
5
|
-
import { useId as G } from "./index181.mjs";
|
|
6
|
-
import { mergeProps as K } from "./index154.mjs";
|
|
7
|
-
import { useRouter as H, openLink as J } from "./index261.mjs";
|
|
8
|
-
import { isCtrlKeyPressed as Q } from "./index275.mjs";
|
|
9
|
-
import { moveVirtualFocus as W } from "@react-aria/focus";
|
|
10
|
-
import { useEffect as X, useRef as k } from "react";
|
|
11
|
-
function le(r) {
|
|
12
|
-
let { id: $, selectionManager: o, key: t, ref: s, shouldSelectOnPressUp: O, shouldUseVirtualFocus: l, focus: T, isDisabled: c, onAction: g, allowsDifferentPressOrigin: C, linkBehavior: p = "action" } = r, D = H();
|
|
13
|
-
$ = G($);
|
|
14
|
-
let a = (e) => {
|
|
15
|
-
if (e.pointerType === "keyboard" && N(e)) o.toggleSelection(t);
|
|
16
|
-
else {
|
|
17
|
-
if (o.selectionMode === "none") return;
|
|
18
|
-
if (o.isLink(t)) {
|
|
19
|
-
if (p === "selection" && s.current) {
|
|
20
|
-
let y = o.getItemProps(t);
|
|
21
|
-
D.open(s.current, e, y.href, y.routerOptions), o.setSelectedKeys(o.selectedKeys);
|
|
22
|
-
return;
|
|
23
|
-
} else if (p === "override" || p === "none") return;
|
|
24
|
-
}
|
|
25
|
-
o.selectionMode === "single" ? o.isSelected(t) && !o.disallowEmptySelection ? o.toggleSelection(t) : o.replaceSelection(t) : e && e.shiftKey ? o.extendSelection(t) : o.selectionBehavior === "toggle" || e && (Q(e) || e.pointerType === "touch" || e.pointerType === "virtual") ? o.toggleSelection(t) : o.replaceSelection(t);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
X(() => {
|
|
29
|
-
t === o.focusedKey && o.isFocused && (l ? W(s.current) : T ? T() : document.activeElement !== s.current && s.current && z(s.current));
|
|
30
|
-
}, [
|
|
31
|
-
s,
|
|
32
|
-
t,
|
|
33
|
-
o.focusedKey,
|
|
34
|
-
o.childFocusStrategy,
|
|
35
|
-
o.isFocused,
|
|
36
|
-
l
|
|
37
|
-
]), c = c || o.isDisabled(t);
|
|
38
|
-
let u = {};
|
|
39
|
-
!l && !c ? u = {
|
|
40
|
-
tabIndex: t === o.focusedKey ? 0 : -1,
|
|
41
|
-
onFocus(e) {
|
|
42
|
-
e.target === s.current && o.setFocusedKey(t);
|
|
43
|
-
}
|
|
44
|
-
} : c && (u.onMouseDown = (e) => {
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
});
|
|
47
|
-
let L = o.isLink(t) && p === "override", F = o.isLink(t) && p !== "selection" && p !== "none", i = !c && o.canSelectItem(t) && !L, S = (g || F) && !c, f = S && (o.selectionBehavior === "replace" ? !i : !i || o.isEmpty), v = S && i && o.selectionBehavior === "replace", d = f || v, b = k(null), m = d && i, h = k(!1), x = k(!1), P = (e) => {
|
|
48
|
-
if (g && g(), F && s.current) {
|
|
49
|
-
let y = o.getItemProps(t);
|
|
50
|
-
D.open(s.current, e, y.href, y.routerOptions);
|
|
51
|
-
}
|
|
52
|
-
}, n = {
|
|
53
|
-
ref: s
|
|
54
|
-
};
|
|
55
|
-
O ? (n.onPressStart = (e) => {
|
|
56
|
-
b.current = e.pointerType, h.current = m, e.pointerType === "keyboard" && (!d || A()) && a(e);
|
|
57
|
-
}, C ? (n.onPressUp = f ? void 0 : (e) => {
|
|
58
|
-
e.pointerType === "mouse" && i && a(e);
|
|
59
|
-
}, n.onPress = f ? P : (e) => {
|
|
60
|
-
e.pointerType !== "keyboard" && e.pointerType !== "mouse" && i && a(e);
|
|
61
|
-
}) : n.onPress = (e) => {
|
|
62
|
-
if (f || v && e.pointerType !== "mouse") {
|
|
63
|
-
if (e.pointerType === "keyboard" && !w()) return;
|
|
64
|
-
P(e);
|
|
65
|
-
} else e.pointerType !== "keyboard" && i && a(e);
|
|
66
|
-
}) : (n.onPressStart = (e) => {
|
|
67
|
-
b.current = e.pointerType, h.current = m, x.current = f, i && (e.pointerType === "mouse" && !f || e.pointerType === "keyboard" && (!S || A())) && a(e);
|
|
68
|
-
}, n.onPress = (e) => {
|
|
69
|
-
(e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && d && w() || e.pointerType === "mouse" && x.current) && (d ? P(e) : i && a(e));
|
|
70
|
-
}), u["data-collection"] = R(o.collection), u["data-key"] = t, n.preventFocusOnPress = l, l && (n = K(n, {
|
|
71
|
-
onPressStart(e) {
|
|
72
|
-
e.pointerType !== "touch" && (o.setFocused(!0), o.setFocusedKey(t));
|
|
73
|
-
},
|
|
74
|
-
onPress(e) {
|
|
75
|
-
e.pointerType === "touch" && (o.setFocused(!0), o.setFocusedKey(t));
|
|
76
|
-
}
|
|
77
|
-
}));
|
|
78
|
-
let { pressProps: E, isPressed: I } = j(n), B = v ? (e) => {
|
|
79
|
-
b.current === "mouse" && (e.stopPropagation(), e.preventDefault(), P(e));
|
|
80
|
-
} : void 0, { longPressProps: M } = q({
|
|
81
|
-
isDisabled: !m,
|
|
82
|
-
onLongPress(e) {
|
|
83
|
-
e.pointerType === "touch" && (a(e), o.setSelectionBehavior("toggle"));
|
|
84
|
-
}
|
|
85
|
-
}), U = (e) => {
|
|
86
|
-
b.current === "touch" && h.current && e.preventDefault();
|
|
87
|
-
}, V = o.isLink(t) ? (e) => {
|
|
88
|
-
J.isOpening || e.preventDefault();
|
|
89
|
-
} : void 0;
|
|
90
|
-
return {
|
|
91
|
-
itemProps: K(
|
|
92
|
-
u,
|
|
93
|
-
i || f || l ? E : {},
|
|
94
|
-
m ? M : {},
|
|
95
|
-
{
|
|
96
|
-
onDoubleClick: B,
|
|
97
|
-
onDragStartCapture: U,
|
|
98
|
-
onClick: V,
|
|
99
|
-
id: $
|
|
100
|
-
},
|
|
101
|
-
// Prevent DOM focus from moving on mouse down when using virtual focus
|
|
102
|
-
l ? {
|
|
103
|
-
onMouseDown: (e) => e.preventDefault()
|
|
104
|
-
} : void 0
|
|
105
|
-
),
|
|
106
|
-
isPressed: I,
|
|
107
|
-
isSelected: o.isSelected(t),
|
|
108
|
-
isFocused: o.isFocused && o.focusedKey === t,
|
|
109
|
-
isDisabled: c,
|
|
110
|
-
allowsSelection: i,
|
|
111
|
-
hasAction: d
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function w() {
|
|
115
|
-
let r = window.event;
|
|
116
|
-
return (r == null ? void 0 : r.key) === "Enter";
|
|
117
|
-
}
|
|
118
|
-
function A() {
|
|
119
|
-
let r = window.event;
|
|
120
|
-
return (r == null ? void 0 : r.key) === " " || (r == null ? void 0 : r.code) === "Space";
|
|
1
|
+
const f = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
function $(t, e, a) {
|
|
3
|
+
return t ? (typeof e == "string" && (e = e.replace(/\s+/g, "")), `${f.get(t)}-${a}-${e}`) : "";
|
|
121
4
|
}
|
|
122
5
|
export {
|
|
123
|
-
|
|
6
|
+
$ as generateId,
|
|
7
|
+
f as tabsIds
|
|
124
8
|
};
|
package/index279.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index341.js"),j=require("./index252.js"),N=require("./index333.js"),z=require("./index335.js"),G=require("./index181.js"),A=require("./index154.js"),L=require("./index260.js"),H=require("./index274.js"),J=require("@react-aria/focus"),v=require("react");function Q(r){let{id:b,selectionManager:t,key:o,ref:s,shouldSelectOnPressUp:C,shouldUseVirtualFocus:l,focus:D,isDisabled:c,onAction:m,allowsDifferentPressOrigin:I,linkBehavior:p="action"}=r,F=L.useRouter();b=G.useId(b);let u=e=>{if(e.pointerType==="keyboard"&&O.isNonContiguousSelectionModifier(e))t.toggleSelection(o);else{if(t.selectionMode==="none")return;if(t.isLink(o)){if(p==="selection"&&s.current){let y=t.getItemProps(o);F.open(s.current,e,y.href,y.routerOptions),t.setSelectedKeys(t.selectedKeys);return}else if(p==="override"||p==="none")return}t.selectionMode==="single"?t.isSelected(o)&&!t.disallowEmptySelection?t.toggleSelection(o):t.replaceSelection(o):e&&e.shiftKey?t.extendSelection(o):t.selectionBehavior==="toggle"||e&&(H.isCtrlKeyPressed(e)||e.pointerType==="touch"||e.pointerType==="virtual")?t.toggleSelection(o):t.replaceSelection(o)}};v.useEffect(()=>{o===t.focusedKey&&t.isFocused&&(l?J.moveVirtualFocus(s.current):D?D():document.activeElement!==s.current&&s.current&&z.focusSafely(s.current))},[s,o,t.focusedKey,t.childFocusStrategy,t.isFocused,l]),c=c||t.isDisabled(o);let d={};!l&&!c?d={tabIndex:o===t.focusedKey?0:-1,onFocus(e){e.target===s.current&&t.setFocusedKey(o)}}:c&&(d.onMouseDown=e=>{e.preventDefault()});let E=t.isLink(o)&&p==="override",K=t.isLink(o)&&p!=="selection"&&p!=="none",i=!c&&t.canSelectItem(o)&&!E,k=(m||K)&&!c,a=k&&(t.selectionBehavior==="replace"?!i:!i||t.isEmpty),h=k&&i&&t.selectionBehavior==="replace",f=a||h,P=v.useRef(null),g=f&&i,T=v.useRef(!1),w=v.useRef(!1),S=e=>{if(m&&m(),K&&s.current){let y=t.getItemProps(o);F.open(s.current,e,y.href,y.routerOptions)}},n={ref:s};C?(n.onPressStart=e=>{P.current=e.pointerType,T.current=g,e.pointerType==="keyboard"&&(!f||$())&&u(e)},I?(n.onPressUp=a?void 0:e=>{e.pointerType==="mouse"&&i&&u(e)},n.onPress=a?S:e=>{e.pointerType!=="keyboard"&&e.pointerType!=="mouse"&&i&&u(e)}):n.onPress=e=>{if(a||h&&e.pointerType!=="mouse"){if(e.pointerType==="keyboard"&&!q())return;S(e)}else e.pointerType!=="keyboard"&&i&&u(e)}):(n.onPressStart=e=>{P.current=e.pointerType,T.current=g,w.current=a,i&&(e.pointerType==="mouse"&&!a||e.pointerType==="keyboard"&&(!k||$()))&&u(e)},n.onPress=e=>{(e.pointerType==="touch"||e.pointerType==="pen"||e.pointerType==="virtual"||e.pointerType==="keyboard"&&f&&q()||e.pointerType==="mouse"&&w.current)&&(f?S(e):i&&u(e))}),d["data-collection"]=O.getCollectionId(t.collection),d["data-key"]=o,n.preventFocusOnPress=l,l&&(n=A.mergeProps(n,{onPressStart(e){e.pointerType!=="touch"&&(t.setFocused(!0),t.setFocusedKey(o))},onPress(e){e.pointerType==="touch"&&(t.setFocused(!0),t.setFocusedKey(o))}}));let{pressProps:M,isPressed:B}=j.usePress(n),R=h?e=>{P.current==="mouse"&&(e.stopPropagation(),e.preventDefault(),S(e))}:void 0,{longPressProps:U}=N.useLongPress({isDisabled:!g,onLongPress(e){e.pointerType==="touch"&&(u(e),t.setSelectionBehavior("toggle"))}}),x=e=>{P.current==="touch"&&T.current&&e.preventDefault()},V=t.isLink(o)?e=>{L.openLink.isOpening||e.preventDefault()}:void 0;return{itemProps:A.mergeProps(d,i||a||l?M:{},g?U:{},{onDoubleClick:R,onDragStartCapture:x,onClick:V,id:b},l?{onMouseDown:e=>e.preventDefault()}:void 0),isPressed:B,isSelected:t.isSelected(o),isFocused:t.isFocused&&t.focusedKey===o,isDisabled:c,allowsSelection:i,hasAction:f}}function q(){let r=window.event;return(r==null?void 0:r.key)==="Enter"}function $(){let r=window.event;return(r==null?void 0:r.key)===" "||(r==null?void 0:r.code)==="Space"}exports.useSelectableItem=Q;
|