@okam/stack-ui 1.43.0 → 1.44.0
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 +23 -0
- package/index180.js +1 -1
- package/index180.mjs +3 -3
- package/index181.js +1 -1
- package/index181.mjs +1 -1
- package/index182.js +1 -1
- package/index182.mjs +1 -1
- package/index183.js +1 -1
- package/index183.mjs +2 -2
- package/index282.js +1 -1
- package/index282.mjs +9 -31
- package/index283.js +1 -1
- package/index283.mjs +133 -9
- package/index284.js +1 -1
- package/index284.mjs +43 -133
- package/index285.js +1 -1
- package/index285.mjs +231 -43
- package/index286.js +1 -1
- package/index286.mjs +27 -227
- package/index341.js +1 -1
- package/index341.mjs +20 -65
- package/index342.js +1 -1
- package/index342.mjs +29 -54
- package/index343.js +1 -1
- package/index343.mjs +63 -51
- package/index344.js +1 -1
- package/index344.mjs +44 -271
- package/index345.js +1 -1
- package/index345.mjs +52 -18
- package/index346.js +1 -1
- package/index346.mjs +281 -21
- package/index347.js +1 -1
- package/index347.mjs +20 -29
- package/index8.js +1 -1
- package/index8.mjs +1 -1
- package/package.json +1 -1
package/index341.mjs
CHANGED
|
@@ -1,69 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useCollection as D } from "./index345.mjs";
|
|
6
|
-
function L(e) {
|
|
7
|
-
let { filter: t, layoutDelegate: o } = e, r = x(e), f = m(() => e.disabledKeys ? new Set(e.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
8
|
-
e.disabledKeys
|
|
9
|
-
]), v = w((c) => t ? new p(t(c)) : new p(c), [
|
|
10
|
-
t
|
|
11
|
-
]), y = m(() => ({
|
|
12
|
-
suppressTextValueWarning: e.suppressTextValueWarning
|
|
13
|
-
}), [
|
|
14
|
-
e.suppressTextValueWarning
|
|
15
|
-
]), n = D(e, v, y), s = m(() => new S(n, r, {
|
|
16
|
-
layoutDelegate: o
|
|
17
|
-
}), [
|
|
18
|
-
n,
|
|
19
|
-
r,
|
|
20
|
-
o
|
|
21
|
-
]);
|
|
22
|
-
return R(n, s), {
|
|
23
|
-
collection: n,
|
|
24
|
-
disabledKeys: f,
|
|
25
|
-
selectionManager: s
|
|
26
|
-
};
|
|
1
|
+
import { useId as l } from "./index185.mjs";
|
|
2
|
+
import { isAppleDevice as a } from "./index250.mjs";
|
|
3
|
+
function d(e) {
|
|
4
|
+
return a() ? e.altKey : e.ctrlKey;
|
|
27
5
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const i = e.getItem(a);
|
|
41
|
-
return (i == null ? void 0 : i.type) === "item" ? i : null;
|
|
42
|
-
}).filter((a) => a !== null);
|
|
43
|
-
var r, f;
|
|
44
|
-
const K = ((r = $ == null ? void 0 : $.length) !== null && r !== void 0 ? r : 0) - ((f = u == null ? void 0 : u.length) !== null && f !== void 0 ? f : 0);
|
|
45
|
-
var v, y, n;
|
|
46
|
-
let d = Math.min(K > 1 ? Math.max(((v = l == null ? void 0 : l.index) !== null && v !== void 0 ? v : 0) - K + 1, 0) : (y = l == null ? void 0 : l.index) !== null && y !== void 0 ? y : 0, ((n = u == null ? void 0 : u.length) !== null && n !== void 0 ? n : 0) - 1), b = null, g = !1;
|
|
47
|
-
for (; d >= 0; ) {
|
|
48
|
-
if (!t.isDisabled(u[d].key)) {
|
|
49
|
-
b = u[d];
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
if (d < u.length - 1 && !g) d++;
|
|
53
|
-
else {
|
|
54
|
-
g = !0;
|
|
55
|
-
var s, c;
|
|
56
|
-
d > ((s = l == null ? void 0 : l.index) !== null && s !== void 0 ? s : 0) && (d = (c = l == null ? void 0 : l.index) !== null && c !== void 0 ? c : 0), d--;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
t.setFocusedKey(b ? b.key : null);
|
|
60
|
-
}
|
|
61
|
-
o.current = e;
|
|
62
|
-
}, [
|
|
63
|
-
e,
|
|
64
|
-
t
|
|
65
|
-
]);
|
|
6
|
+
function u(e, t) {
|
|
7
|
+
var o, f;
|
|
8
|
+
let c = `[data-key="${CSS.escape(String(t))}"]`, r = (o = e.current) === null || o === void 0 ? void 0 : o.dataset.collection;
|
|
9
|
+
return r && (c = `[data-collection="${CSS.escape(r)}"]${c}`), (f = e.current) === null || f === void 0 ? void 0 : f.querySelector(c);
|
|
10
|
+
}
|
|
11
|
+
const n = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
function b(e) {
|
|
13
|
+
let t = l();
|
|
14
|
+
return n.set(e, t), t;
|
|
15
|
+
}
|
|
16
|
+
function s(e) {
|
|
17
|
+
return n.get(e);
|
|
66
18
|
}
|
|
67
19
|
export {
|
|
68
|
-
|
|
20
|
+
s as getCollectionId,
|
|
21
|
+
u as getItemElement,
|
|
22
|
+
d as isNonContiguousSelectionModifier,
|
|
23
|
+
b as useCollectionId
|
|
69
24
|
};
|
package/index342.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 l=require("react"),s=1e3;function f(r){let{keyboardDelegate:o,selectionManager:c,onTypeSelect:i}=r,e=l.useRef({search:"",timeout:void 0}).current,u=t=>{let a=g(t.key);if(!(!a||t.ctrlKey||t.metaKey||!t.currentTarget.contains(t.target)||e.search.length===0&&a===" ")){if(a===" "&&e.search.trim().length>0&&(t.preventDefault(),"continuePropagation"in t||t.stopPropagation()),e.search+=a,o.getKeyForSearch!=null){let n=o.getKeyForSearch(e.search,c.focusedKey);n==null&&(n=o.getKeyForSearch(e.search)),n!=null&&(c.setFocusedKey(n),i&&i(n))}clearTimeout(e.timeout),e.timeout=setTimeout(()=>{e.search=""},s)}};return{typeSelectProps:{onKeyDownCapture:o.getKeyForSearch?u:void 0}}}function g(r){return r.length===1||!/^[A-Z]/i.test(r)?r:""}exports.useTypeSelect=f;
|
package/index342.mjs
CHANGED
|
@@ -1,57 +1,32 @@
|
|
|
1
|
-
|
|
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
|
-
return (e = this.keyMap.get(i)) !== null && e !== void 0 ? e : null;
|
|
30
|
-
}
|
|
31
|
-
at(i) {
|
|
32
|
-
const e = [
|
|
33
|
-
...this.getKeys()
|
|
34
|
-
];
|
|
35
|
-
return this.getItem(e[i]);
|
|
36
|
-
}
|
|
37
|
-
getChildren(i) {
|
|
38
|
-
let e = this.keyMap.get(i);
|
|
39
|
-
return (e == null ? void 0 : e.childNodes) || [];
|
|
40
|
-
}
|
|
41
|
-
constructor(i) {
|
|
42
|
-
this.keyMap = /* @__PURE__ */ new Map(), this.firstKey = null, this.lastKey = null, this.iterable = i;
|
|
43
|
-
let e = (l) => {
|
|
44
|
-
if (this.keyMap.set(l.key, l), l.childNodes && l.type === "section") for (let s of l.childNodes) e(s);
|
|
45
|
-
};
|
|
46
|
-
for (let l of i) e(l);
|
|
47
|
-
let t = null, y = 0, n = 0;
|
|
48
|
-
for (let [l, s] of this.keyMap)
|
|
49
|
-
t ? (t.nextKey = l, s.prevKey = t.key) : (this.firstKey = l, s.prevKey = void 0), s.type === "item" && (s.index = y++), (s.type === "section" || s.type === "item") && n++, t = s, t.nextKey = void 0;
|
|
50
|
-
this._size = n;
|
|
51
|
-
var r;
|
|
52
|
-
this.lastKey = (r = t == null ? void 0 : t.key) !== null && r !== void 0 ? r : null;
|
|
53
|
-
}
|
|
1
|
+
import { useRef as u } from "react";
|
|
2
|
+
const f = 1e3;
|
|
3
|
+
function y(r) {
|
|
4
|
+
let { keyboardDelegate: o, selectionManager: c, onTypeSelect: i } = r, e = u({
|
|
5
|
+
search: "",
|
|
6
|
+
timeout: void 0
|
|
7
|
+
}).current, l = (t) => {
|
|
8
|
+
let a = s(t.key);
|
|
9
|
+
if (!(!a || t.ctrlKey || t.metaKey || !t.currentTarget.contains(t.target) || e.search.length === 0 && a === " ")) {
|
|
10
|
+
if (a === " " && e.search.trim().length > 0 && (t.preventDefault(), "continuePropagation" in t || t.stopPropagation()), e.search += a, o.getKeyForSearch != null) {
|
|
11
|
+
let n = o.getKeyForSearch(e.search, c.focusedKey);
|
|
12
|
+
n == null && (n = o.getKeyForSearch(e.search)), n != null && (c.setFocusedKey(n), i && i(n));
|
|
13
|
+
}
|
|
14
|
+
clearTimeout(e.timeout), e.timeout = setTimeout(() => {
|
|
15
|
+
e.search = "";
|
|
16
|
+
}, f);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
typeSelectProps: {
|
|
21
|
+
// Using a capturing listener to catch the keydown event before
|
|
22
|
+
// other hooks in order to handle the Spacebar event.
|
|
23
|
+
onKeyDownCapture: o.getKeyForSearch ? l : void 0
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function s(r) {
|
|
28
|
+
return r.length === 1 || !/^[A-Z]/i.test(r) ? r : "";
|
|
54
29
|
}
|
|
55
30
|
export {
|
|
56
|
-
|
|
31
|
+
y as useTypeSelect
|
|
57
32
|
};
|
package/index343.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=require("./index344.js"),M=require("./index345.js"),$=require("./index346.js"),v=require("react"),m=require("./index347.js");function q(e){let{filter:t,layoutDelegate:n}=e,c=M.useMultipleSelectionState(e),f=v.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),y=v.useCallback(a=>t?new C.ListCollection(t(a)):new C.ListCollection(a),[t]),S=v.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),o=m.useCollection(e,y,S),r=v.useMemo(()=>new $.SelectionManager(o,c,{layoutDelegate:n}),[o,c,n]);return k(o,r),{collection:o,disabledKeys:f,selectionManager:r}}function k(e,t){const n=v.useRef(null);v.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){const l=n.current.getItem(t.focusedKey),g=[...n.current.getKeys()].map(s=>{const i=n.current.getItem(s);return(i==null?void 0:i.type)==="item"?i:null}).filter(s=>s!==null),u=[...e.getKeys()].map(s=>{const i=e.getItem(s);return(i==null?void 0:i.type)==="item"?i:null}).filter(s=>s!==null);var c,f;const b=((c=g==null?void 0:g.length)!==null&&c!==void 0?c:0)-((f=u==null?void 0:u.length)!==null&&f!==void 0?f:0);var y,S,o;let d=Math.min(b>1?Math.max(((y=l==null?void 0:l.index)!==null&&y!==void 0?y:0)-b+1,0):(S=l==null?void 0:l.index)!==null&&S!==void 0?S:0,((o=u==null?void 0:u.length)!==null&&o!==void 0?o:0)-1),K=null,w=!1;for(;d>=0;){if(!t.isDisabled(u[d].key)){K=u[d];break}if(d<u.length-1&&!w)d++;else{w=!0;var r,a;d>((r=l==null?void 0:l.index)!==null&&r!==void 0?r:0)&&(d=(a=l==null?void 0:l.index)!==null&&a!==void 0?a:0),d--}}t.setFocusedKey(K?K.key:null)}n.current=e},[e,t])}exports.useListState=q;
|
package/index343.mjs
CHANGED
|
@@ -1,57 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return !0;
|
|
9
|
-
}
|
|
10
|
-
function C(e) {
|
|
11
|
-
let { selectionMode: s = "none", disallowEmptySelection: c = !1, allowDuplicateSelectionEvents: v, selectionBehavior: l = "toggle", disabledBehavior: $ = "all" } = e, d = a(!1), [, h] = r(!1), u = a(null), f = a(null), [, m] = r(null), g = n(() => b(e.selectedKeys), [
|
|
12
|
-
e.selectedKeys
|
|
13
|
-
]), w = n(() => b(e.defaultSelectedKeys, new K()), [
|
|
14
|
-
e.defaultSelectedKeys
|
|
15
|
-
]), [o, B] = M(g, w, e.onSelectionChange), F = n(() => e.disabledKeys ? new Set(e.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
1
|
+
import { ListCollection as p } from "./index344.mjs";
|
|
2
|
+
import { useMultipleSelectionState as x } from "./index345.mjs";
|
|
3
|
+
import { SelectionManager as S } from "./index346.mjs";
|
|
4
|
+
import { useMemo as m, useCallback as w, useRef as k, useEffect as C } from "react";
|
|
5
|
+
import { useCollection as D } from "./index347.mjs";
|
|
6
|
+
function L(e) {
|
|
7
|
+
let { filter: t, layoutDelegate: o } = e, r = x(e), f = m(() => e.disabledKeys ? new Set(e.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
16
8
|
e.disabledKeys
|
|
17
|
-
]),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
get focusedKey() {
|
|
36
|
-
return u.current;
|
|
37
|
-
},
|
|
38
|
-
get childFocusStrategy() {
|
|
39
|
-
return f.current;
|
|
40
|
-
},
|
|
41
|
-
setFocusedKey(t, E = "first") {
|
|
42
|
-
u.current = t, f.current = E, m(t);
|
|
43
|
-
},
|
|
44
|
-
selectedKeys: o,
|
|
45
|
-
setSelectedKeys(t) {
|
|
46
|
-
(v || !R(t, o)) && B(t);
|
|
47
|
-
},
|
|
48
|
-
disabledKeys: F,
|
|
49
|
-
disabledBehavior: $
|
|
9
|
+
]), v = w((c) => t ? new p(t(c)) : new p(c), [
|
|
10
|
+
t
|
|
11
|
+
]), y = m(() => ({
|
|
12
|
+
suppressTextValueWarning: e.suppressTextValueWarning
|
|
13
|
+
}), [
|
|
14
|
+
e.suppressTextValueWarning
|
|
15
|
+
]), n = D(e, v, y), s = m(() => new S(n, r, {
|
|
16
|
+
layoutDelegate: o
|
|
17
|
+
}), [
|
|
18
|
+
n,
|
|
19
|
+
r,
|
|
20
|
+
o
|
|
21
|
+
]);
|
|
22
|
+
return R(n, s), {
|
|
23
|
+
collection: n,
|
|
24
|
+
disabledKeys: f,
|
|
25
|
+
selectionManager: s
|
|
50
26
|
};
|
|
51
27
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
28
|
+
function R(e, t) {
|
|
29
|
+
const o = k(null);
|
|
30
|
+
C(() => {
|
|
31
|
+
if (t.focusedKey != null && !e.getItem(t.focusedKey) && o.current) {
|
|
32
|
+
const l = o.current.getItem(t.focusedKey), $ = [
|
|
33
|
+
...o.current.getKeys()
|
|
34
|
+
].map((a) => {
|
|
35
|
+
const i = o.current.getItem(a);
|
|
36
|
+
return (i == null ? void 0 : i.type) === "item" ? i : null;
|
|
37
|
+
}).filter((a) => a !== null), u = [
|
|
38
|
+
...e.getKeys()
|
|
39
|
+
].map((a) => {
|
|
40
|
+
const i = e.getItem(a);
|
|
41
|
+
return (i == null ? void 0 : i.type) === "item" ? i : null;
|
|
42
|
+
}).filter((a) => a !== null);
|
|
43
|
+
var r, f;
|
|
44
|
+
const K = ((r = $ == null ? void 0 : $.length) !== null && r !== void 0 ? r : 0) - ((f = u == null ? void 0 : u.length) !== null && f !== void 0 ? f : 0);
|
|
45
|
+
var v, y, n;
|
|
46
|
+
let d = Math.min(K > 1 ? Math.max(((v = l == null ? void 0 : l.index) !== null && v !== void 0 ? v : 0) - K + 1, 0) : (y = l == null ? void 0 : l.index) !== null && y !== void 0 ? y : 0, ((n = u == null ? void 0 : u.length) !== null && n !== void 0 ? n : 0) - 1), b = null, g = !1;
|
|
47
|
+
for (; d >= 0; ) {
|
|
48
|
+
if (!t.isDisabled(u[d].key)) {
|
|
49
|
+
b = u[d];
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
if (d < u.length - 1 && !g) d++;
|
|
53
|
+
else {
|
|
54
|
+
g = !0;
|
|
55
|
+
var s, c;
|
|
56
|
+
d > ((s = l == null ? void 0 : l.index) !== null && s !== void 0 ? s : 0) && (d = (c = l == null ? void 0 : l.index) !== null && c !== void 0 ? c : 0), d--;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
t.setFocusedKey(b ? b.key : null);
|
|
60
|
+
}
|
|
61
|
+
o.current = e;
|
|
62
|
+
}, [
|
|
63
|
+
e,
|
|
64
|
+
t
|
|
65
|
+
]);
|
|
54
66
|
}
|
|
55
67
|
export {
|
|
56
|
-
|
|
68
|
+
L as useListState
|
|
57
69
|
};
|
package/index344.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(i){let e=this.keyMap.get(i);var t;return e&&(t=e.prevKey)!==null&&t!==void 0?t:null}getKeyAfter(i){let e=this.keyMap.get(i);var t;return e&&(t=e.nextKey)!==null&&t!==void 0?t:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(i){var e;return(e=this.keyMap.get(i))!==null&&e!==void 0?e:null}at(i){const e=[...this.getKeys()];return this.getItem(e[i])}getChildren(i){let e=this.keyMap.get(i);return(e==null?void 0:e.childNodes)||[]}constructor(i){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=i;let e=l=>{if(this.keyMap.set(l.key,l),l.childNodes&&l.type==="section")for(let s of l.childNodes)e(s)};for(let l of i)e(l);let t=null,y=0,n=0;for(let[l,s]of this.keyMap)t?(t.nextKey=l,s.prevKey=t.key):(this.firstKey=l,s.prevKey=void 0),s.type==="item"&&(s.index=y++),(s.type==="section"||s.type==="item")&&n++,t=s,t.nextKey=void 0;this._size=n;var r;this.lastKey=(r=t==null?void 0:t.key)!==null&&r!==void 0?r:null}}exports.ListCollection=o;
|