@okam/stack-ui 1.29.0 → 1.30.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/components/Accordion/components/AccordionItem.d.ts +1 -0
- package/components/Accordion/index.d.ts +2 -1
- package/components/Accordion/interface.d.ts +3 -2
- package/components/Alerts/components/AlertsCloseButton.d.ts +1 -1
- package/components/Alerts/index.d.ts +2 -1
- package/components/Alerts/interface.d.ts +4 -3
- package/components/Box/index.d.ts +3 -2
- package/components/Button/index.d.ts +8 -4
- package/components/Button/interface.d.ts +3 -2
- package/components/Calendar/index.d.ts +5 -1
- package/components/Calendar/interface.d.ts +2 -1
- package/components/Carousel/components/CarouselNavigationButton.d.ts +3 -3
- package/components/Date/index.d.ts +2 -1
- package/components/Date/interface.d.ts +2 -1
- package/components/Icon/index.d.ts +2 -1
- package/components/Icon/interface.d.ts +2 -1
- package/components/Lightbox/hooks/overlay/index.d.ts +75 -0
- package/components/Lightbox/index.d.ts +2 -1
- package/components/Lightbox/interface.d.ts +3 -2
- package/components/Menu/Menu.d.ts +2 -1
- package/components/Menu/interface.d.ts +5 -4
- package/components/Modal/index.d.ts +2 -1
- package/components/Modal/interface.d.ts +2 -1
- package/components/Popover/index.d.ts +2 -1
- package/components/Popover/interface.d.ts +3 -2
- package/components/ShareButton/index.d.ts +2 -1
- package/components/ShareButton/interface.d.ts +2 -2
- package/components/SidePanel/index.d.ts +3 -3
- package/components/SidePanel/interface.d.ts +5 -4
- package/components/Typography/index.d.ts +3 -2
- package/components/Video/index.d.ts +2 -1
- package/components/Video/interface.d.ts +2 -1
- package/components/WysiwygBlock/attributes.d.ts +2 -0
- package/components/WysiwygBlock/index.d.ts +2 -1
- package/components/WysiwygBlock/interface.d.ts +2 -1
- package/components/fields/Checkbox/Checkbox.interface.d.ts +2 -1
- package/components/fields/Checkbox/index.d.ts +2 -1
- package/components/fields/CheckboxGroup/index.d.ts +2 -1
- package/components/fields/CheckboxGroup/interface.d.ts +2 -1
- package/components/fields/DatePicker/index.d.ts +2 -1
- package/components/fields/DatePicker/interface.d.ts +2 -1
- package/components/fields/Radio/Radio.interface.d.ts +3 -2
- package/components/fields/Radio/index.d.ts +3 -2
- package/components/fields/RadioGroup/index.d.ts +2 -1
- package/components/fields/RadioGroup/interface.d.ts +2 -1
- package/components/fields/SearchField/index.d.ts +2 -1
- package/components/fields/SearchField/interface.d.ts +2 -1
- package/components/fields/Select/Select.d.ts +2 -1
- package/components/fields/Select/Select.interface.d.ts +3 -2
- package/components/fields/TextArea/index.d.ts +2 -1
- package/components/fields/TextInputField/interface.d.ts +3 -2
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +41 -38
- package/index100.js +1 -2
- package/index100.mjs +22 -21
- package/index101.js +2 -1
- package/index101.mjs +22 -63
- package/index102.js +1 -1
- package/index102.mjs +58 -24
- package/index103.js +1 -1
- package/index103.mjs +29 -4
- package/index104.js +1 -1
- package/index104.mjs +52 -11
- package/index105.js +1 -1
- package/index105.mjs +4 -14
- package/index106.js +1 -1
- package/index106.mjs +11 -23
- package/index107.js +1 -1
- package/index107.mjs +13 -22
- package/index108.js +1 -1
- package/index108.mjs +23 -39
- package/index109.js +1 -2
- package/index109.mjs +22 -12
- package/index11.js +1 -1
- package/index11.mjs +2 -2
- package/index110.js +1 -1
- package/index110.mjs +38 -7
- package/index111.js +2 -1
- package/index111.mjs +12 -21
- package/index112.js +1 -1
- package/index112.mjs +7 -38
- package/index113.js +1 -1
- package/index113.mjs +20 -48
- package/index114.js +1 -1
- package/index114.mjs +38 -40
- package/index115.js +1 -1
- package/index115.mjs +47 -11
- package/index116.js +1 -1
- package/index116.mjs +41 -26
- package/index117.js +1 -1
- package/index117.mjs +14 -20
- package/index118.js +1 -1
- package/index118.mjs +30 -8
- package/index119.js +1 -1
- package/index119.mjs +20 -30
- package/index120.js +1 -1
- package/index120.mjs +8 -14
- package/index121.js +1 -1
- package/index121.mjs +29 -16
- package/index122.js +1 -1
- package/index122.mjs +15 -21
- package/index123.js +1 -1
- package/index123.mjs +17 -11
- package/index124.js +1 -2
- package/index124.mjs +20 -21
- package/index125.js +1 -1
- package/index125.mjs +11 -12
- package/index126.js +2 -1
- package/index126.mjs +22 -46
- package/index127.js +1 -1
- package/index127.mjs +12 -241
- package/index128.js +1 -2
- package/index128.mjs +46 -13
- package/index129.js +1 -1
- package/index129.mjs +239 -28
- package/index13.js +1 -1
- package/index13.mjs +8 -5
- package/index130.js +2 -1
- package/index130.mjs +13 -51
- package/index131.js +1 -1
- package/index131.mjs +30 -27
- package/index132.js +1 -1
- package/index132.mjs +49 -19
- package/index133.js +1 -1
- package/index133.mjs +26 -61
- package/index134.js +1 -1
- package/index134.mjs +17 -91
- package/index135.js +1 -1
- package/index135.mjs +59 -29
- package/index136.js +1 -1
- package/index136.mjs +90 -117
- package/index137.js +1 -1
- package/index137.mjs +32 -26
- package/index138.js +1 -1
- package/index138.mjs +118 -121
- package/index139.js +1 -1
- package/index139.mjs +27 -134
- package/index14.js +1 -1
- package/index14.mjs +3 -3
- package/index140.js +1 -1
- package/index140.mjs +122 -12
- package/index141.js +1 -1
- package/index141.mjs +131 -92
- package/index142.js +1 -1
- package/index142.mjs +12 -104
- package/index143.js +1 -1
- package/index143.mjs +95 -5
- package/index144.js +1 -1
- package/index144.mjs +106 -3
- package/index145.js +1 -1
- package/index145.mjs +5 -125
- package/index146.js +1 -1
- package/index146.mjs +3 -29
- package/index147.js +1 -1
- package/index147.mjs +113 -39
- package/index148.js +1 -1
- package/index148.mjs +19 -34
- package/index149.js +1 -1
- package/index149.mjs +40 -26
- package/index150.js +1 -1
- package/index150.mjs +29 -98
- package/index151.js +1 -1
- package/index151.mjs +28 -68
- package/index152.js +1 -1
- package/index152.mjs +90 -78
- package/index153.js +1 -1
- package/index153.mjs +78 -98
- package/index154.js +1 -1
- package/index154.mjs +101 -199
- package/index155.js +1 -1
- package/index155.mjs +98 -65
- package/index156.js +1 -1
- package/index156.mjs +185 -127
- package/index157.js +1 -1
- package/index157.mjs +54 -109
- package/index158.js +1 -1
- package/index158.mjs +126 -202
- package/index159.js +1 -1
- package/index159.mjs +104 -175
- package/index16.js +1 -1
- package/index16.mjs +2 -2
- package/index160.js +1 -1
- package/index160.mjs +208 -60
- package/index161.js +1 -1
- package/index161.mjs +178 -246
- package/index162.js +1 -1
- package/index162.mjs +63 -91
- package/index163.js +1 -1
- package/index163.mjs +250 -166
- package/index164.js +1 -1
- package/index164.mjs +91 -78
- package/index165.js +1 -1
- package/index165.mjs +170 -54
- package/index166.js +1 -1
- package/index166.mjs +72 -114
- package/index167.js +1 -1
- package/index167.mjs +51 -109
- package/index168.js +1 -1
- package/index168.mjs +112 -108
- package/index169.js +1 -1
- package/index169.mjs +109 -65
- package/index170.js +1 -1
- package/index170.mjs +117 -105
- package/index171.js +1 -1
- package/index171.mjs +68 -48
- package/index172.js +1 -1
- package/index172.mjs +108 -91
- package/index173.js +1 -1
- package/index173.mjs +37 -55
- package/index174.js +1 -1
- package/index174.mjs +80 -43
- package/index175.js +1 -1
- package/index175.mjs +52 -81
- package/index176.js +1 -5
- package/index176.mjs +42 -66
- package/index177.js +1 -1
- package/index177.mjs +87 -1999
- package/index178.js +5 -1
- package/index178.mjs +79 -58
- package/index179.js +1 -1
- package/index179.mjs +1998 -175
- package/index18.js +1 -1
- package/index18.mjs +7 -7
- package/index180.js +1 -1
- package/index180.mjs +59 -5
- package/index181.js +1 -1
- package/index181.mjs +183 -125
- package/index182.js +1 -1
- package/index182.mjs +5 -179
- package/index183.js +1 -1
- package/index183.mjs +129 -8
- package/index184.js +1 -1
- package/index184.mjs +179 -3
- package/index185.js +1 -1
- package/index185.mjs +8 -35
- package/index186.js +1 -1
- package/index186.mjs +3 -5
- package/index187.js +1 -1
- package/index187.mjs +35 -28
- package/index188.js +1 -1
- package/index188.mjs +5 -6
- package/index189.js +1 -1
- package/index189.mjs +26 -310
- package/index19.js +1 -1
- package/index19.mjs +2 -2
- package/index190.js +1 -1
- package/index190.mjs +6 -192
- package/index191.js +1 -1
- package/index191.mjs +339 -7
- package/index192.js +1 -1
- package/index192.mjs +180 -23
- package/index193.js +1 -1
- package/index193.mjs +6 -53
- package/index194.js +1 -1
- package/index194.mjs +24 -44
- package/index195.js +1 -1
- package/index195.mjs +55 -124
- package/index196.js +1 -1
- package/index196.mjs +46 -5
- package/index197.js +1 -1
- package/index197.mjs +108 -26
- package/index198.js +1 -1
- package/index198.mjs +32 -6
- package/index199.js +1 -1
- package/index199.mjs +5 -7
- package/index2.js +1 -1
- package/index2.mjs +19 -19
- package/index20.js +1 -1
- package/index20.mjs +1 -1
- package/index200.js +1 -1
- package/index200.mjs +28 -7
- package/index201.js +1 -1
- package/index201.mjs +7 -5
- package/index202.js +1 -1
- package/index202.mjs +7 -5
- package/index203.js +1 -1
- package/index203.mjs +7 -9
- package/index204.js +1 -0
- package/index204.mjs +7 -0
- package/index205.js +1 -0
- package/index205.mjs +8 -0
- package/index206.js +1 -0
- package/index206.mjs +12 -0
- package/index21.js +1 -1
- package/index21.mjs +8 -8
- package/index22.js +1 -1
- package/index22.mjs +2 -2
- package/index23.js +1 -1
- package/index23.mjs +3 -3
- package/index24.js +1 -1
- package/index24.mjs +14 -14
- package/index26.js +1 -1
- package/index26.mjs +28 -21
- package/index27.js +1 -1
- package/index27.mjs +12 -12
- package/index28.js +1 -1
- package/index28.mjs +6 -6
- package/index29.js +1 -1
- package/index29.mjs +1 -1
- package/index30.js +1 -1
- package/index30.mjs +14 -8
- package/index31.js +1 -1
- package/index31.mjs +18 -18
- package/index32.js +1 -1
- package/index32.mjs +1 -1
- package/index33.mjs +43 -43
- package/index34.js +1 -1
- package/index34.mjs +1 -1
- package/index35.js +1 -1
- package/index35.mjs +3 -3
- package/index36.mjs +10 -10
- package/index4.js +1 -1
- package/index4.mjs +3 -3
- package/index6.js +1 -1
- package/index6.mjs +34 -33
- package/index65.js +1 -1
- package/index65.mjs +1 -1
- package/index66.js +1 -1
- package/index66.mjs +2 -2
- package/index67.js +1 -1
- package/index67.mjs +1 -1
- package/index69.js +1 -1
- package/index69.mjs +1 -1
- package/index7.mjs +4 -4
- package/index70.js +1 -1
- package/index70.mjs +1 -1
- package/index71.js +1 -1
- package/index71.mjs +1 -1
- package/index72.js +2 -1
- package/index72.mjs +27 -2
- package/index73.js +1 -2
- package/index73.mjs +2 -9
- package/index74.js +1 -1
- package/index74.mjs +7 -6
- package/index75.js +1 -1
- package/index75.mjs +6 -6
- package/index76.js +1 -1
- package/index76.mjs +6 -6
- package/index77.js +2 -1
- package/index77.mjs +8 -25
- package/index78.js +1 -1
- package/index78.mjs +25 -2
- package/index79.js +1 -6
- package/index79.mjs +2 -94
- package/index8.js +1 -1
- package/index8.mjs +42 -23
- package/index80.js +6 -1
- package/index80.mjs +79 -54
- package/index81.js +1 -1
- package/index81.mjs +61 -33
- package/index82.js +1 -42
- package/index82.mjs +34 -67
- package/index83.js +42 -1
- package/index83.mjs +69 -154
- package/index84.js +1 -9
- package/index84.mjs +149 -47
- package/index85.js +9 -1
- package/index85.mjs +48 -36
- package/index86.js +1 -1
- package/index86.mjs +40 -8
- package/index87.js +1 -1
- package/index87.mjs +9 -31
- package/index88.js +1 -1
- package/index88.mjs +35 -6
- package/index89.js +1 -12
- package/index89.mjs +6 -40
- package/index9.js +1 -1
- package/index9.mjs +7 -7
- package/index90.js +12 -1
- package/index90.mjs +36 -25
- package/index91.js +1 -1
- package/index91.mjs +24 -8
- package/index92.js +1 -7
- package/index92.mjs +7 -13
- package/index93.js +6 -14
- package/index93.mjs +13 -65
- package/index94.js +15 -1
- package/index94.mjs +71 -7
- package/index95.js +1 -16
- package/index95.mjs +7 -25
- package/index96.js +16 -1
- package/index96.mjs +20 -37
- package/index97.js +1 -1
- package/index97.mjs +40 -43
- package/index98.js +1 -1
- package/index98.mjs +44 -47
- package/index99.js +1 -1
- package/index99.mjs +48 -17
- package/package.json +1 -1
- package/providers/Translation/index.d.ts +4 -0
- package/providers/Translation/interface.d.ts +16 -0
- package/theme/Accordion/index.d.ts +12 -12
- package/theme/Alerts/index.d.ts +22 -22
- package/theme/Box/index.d.ts +8 -8
- package/theme/Button/index.d.ts +2 -2
- package/theme/Calendar/index.d.ts +12 -12
- package/theme/Carousel/index.d.ts +11 -11
- package/theme/Checkbox/index.d.ts +8 -8
- package/theme/CheckboxGroup/index.d.ts +3 -3
- package/theme/DatePicker/index.d.ts +9 -9
- package/theme/Image/index.d.ts +1 -1
- package/theme/LightBox/index.d.ts +9 -9
- package/theme/Radio/index.d.ts +6 -6
- package/theme/RadioGroup/index.d.ts +3 -3
- package/theme/Search/index.d.ts +3 -3
- package/theme/ShareButton/index.d.ts +10 -10
- package/theme/SidePanel/index.d.ts +3 -3
- package/theme/TextArea/index.d.ts +2 -2
- package/theme/Typography/index.d.ts +2 -2
- package/transitions/ModalTransition.d.ts +3 -6
- package/transitions/RenderWithSlide.d.ts +3 -6
- package/transitions/SidePanelTransition.d.ts +3 -6
package/index134.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 d=require("./index199.js"),l=require("@react-aria/utils"),u=require("@react-aria/focus");function t(a,e,r){let n=u.useHasTabbableChild(r)?void 0:0;var i;const b=d.generateId(e,(i=a.id)!==null&&i!==void 0?i:e==null?void 0:e.selectedKey,"tabpanel"),o=l.useLabels({...a,id:b,"aria-labelledby":d.generateId(e,e==null?void 0:e.selectedKey,"tab")});return{tabPanelProps:l.mergeProps(o,{tabIndex:n,role:"tabpanel","aria-describedby":a["aria-describedby"],"aria-details":a["aria-details"]})}}exports.useTabPanel=t;
|
package/index134.mjs
CHANGED
|
@@ -1,97 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (t.selectionMode === "none") return;
|
|
12
|
-
if (t.isLink(o)) {
|
|
13
|
-
if (a === "selection") {
|
|
14
|
-
let f = t.getItemProps(o);
|
|
15
|
-
T.open(c.current, e, f.href, f.routerOptions), t.setSelectedKeys(t.selectedKeys);
|
|
16
|
-
return;
|
|
17
|
-
} else if (a === "override" || a === "none") return;
|
|
18
|
-
}
|
|
19
|
-
t.selectionMode === "single" ? t.isSelected(o) && !t.disallowEmptySelection ? t.toggleSelection(o) : t.replaceSelection(o) : e && e.shiftKey ? t.extendSelection(o) : t.selectionBehavior === "toggle" || e && (R(e) || e.pointerType === "touch" || e.pointerType === "virtual") ? t.toggleSelection(o) : t.replaceSelection(o);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
H(() => {
|
|
23
|
-
o === t.focusedKey && t.isFocused && !d && ($ ? $() : document.activeElement !== c.current && V(c.current));
|
|
24
|
-
}, [
|
|
25
|
-
c,
|
|
26
|
-
o,
|
|
27
|
-
t.focusedKey,
|
|
28
|
-
t.childFocusStrategy,
|
|
29
|
-
t.isFocused,
|
|
30
|
-
d
|
|
31
|
-
]), n = n || t.isDisabled(o);
|
|
32
|
-
let y = {};
|
|
33
|
-
!d && !n ? y = {
|
|
34
|
-
tabIndex: o === t.focusedKey ? 0 : -1,
|
|
35
|
-
onFocus(e) {
|
|
36
|
-
e.target === c.current && t.setFocusedKey(o);
|
|
37
|
-
}
|
|
38
|
-
} : n && (y.onMouseDown = (e) => {
|
|
39
|
-
e.preventDefault();
|
|
1
|
+
import { generateId as i } from "./index199.mjs";
|
|
2
|
+
import { useLabels as n, mergeProps as c } from "@react-aria/utils";
|
|
3
|
+
import { useHasTabbableChild as f } from "@react-aria/focus";
|
|
4
|
+
function m(a, e, l) {
|
|
5
|
+
let r = f(l) ? void 0 : 0;
|
|
6
|
+
var d;
|
|
7
|
+
const b = i(e, (d = a.id) !== null && d !== void 0 ? d : e == null ? void 0 : e.selectedKey, "tabpanel"), o = n({
|
|
8
|
+
...a,
|
|
9
|
+
id: b,
|
|
10
|
+
"aria-labelledby": i(e, e == null ? void 0 : e.selectedKey, "tab")
|
|
40
11
|
});
|
|
41
|
-
let L = t.isLink(o) && a === "override", D = t.isLink(o) && a !== "selection" && a !== "none", i = !n && t.canSelectItem(o) && !L, S = (g || D) && !n, l = S && (t.selectionBehavior === "replace" ? !i : !i || t.isEmpty), v = S && i && t.selectionBehavior === "replace", u = l || v, P = h(null), m = u && i, k = h(!1), F = h(!1), b = (e) => {
|
|
42
|
-
if (g && g(), D) {
|
|
43
|
-
let f = t.getItemProps(o);
|
|
44
|
-
T.open(c.current, e, f.href, f.routerOptions);
|
|
45
|
-
}
|
|
46
|
-
}, s = {};
|
|
47
|
-
K ? (s.onPressStart = (e) => {
|
|
48
|
-
P.current = e.pointerType, k.current = m, e.pointerType === "keyboard" && (!u || A()) && p(e);
|
|
49
|
-
}, O ? (s.onPressUp = l ? null : (e) => {
|
|
50
|
-
e.pointerType !== "keyboard" && i && p(e);
|
|
51
|
-
}, s.onPress = l ? b : null) : s.onPress = (e) => {
|
|
52
|
-
if (l || v && e.pointerType !== "mouse") {
|
|
53
|
-
if (e.pointerType === "keyboard" && !w()) return;
|
|
54
|
-
b(e);
|
|
55
|
-
} else e.pointerType !== "keyboard" && i && p(e);
|
|
56
|
-
}) : (s.onPressStart = (e) => {
|
|
57
|
-
P.current = e.pointerType, k.current = m, F.current = l, i && (e.pointerType === "mouse" && !l || e.pointerType === "keyboard" && (!S || A())) && p(e);
|
|
58
|
-
}, s.onPress = (e) => {
|
|
59
|
-
(e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && u && w() || e.pointerType === "mouse" && F.current) && (u ? b(e) : i && p(e));
|
|
60
|
-
}), y["data-key"] = o, s.preventFocusOnPress = d;
|
|
61
|
-
let { pressProps: x, isPressed: C } = z(s), E = v ? (e) => {
|
|
62
|
-
P.current === "mouse" && (e.stopPropagation(), e.preventDefault(), b(e));
|
|
63
|
-
} : void 0, { longPressProps: B } = G({
|
|
64
|
-
isDisabled: !m,
|
|
65
|
-
onLongPress(e) {
|
|
66
|
-
e.pointerType === "touch" && (p(e), t.setSelectionBehavior("toggle"));
|
|
67
|
-
}
|
|
68
|
-
}), I = (e) => {
|
|
69
|
-
P.current === "touch" && k.current && e.preventDefault();
|
|
70
|
-
}, M = t.isLink(o) ? (e) => {
|
|
71
|
-
j.isOpening || e.preventDefault();
|
|
72
|
-
} : void 0;
|
|
73
12
|
return {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
isSelected: t.isSelected(o),
|
|
81
|
-
isFocused: t.isFocused && t.focusedKey === o,
|
|
82
|
-
isDisabled: n,
|
|
83
|
-
allowsSelection: i,
|
|
84
|
-
hasAction: u
|
|
13
|
+
tabPanelProps: c(o, {
|
|
14
|
+
tabIndex: r,
|
|
15
|
+
role: "tabpanel",
|
|
16
|
+
"aria-describedby": a["aria-describedby"],
|
|
17
|
+
"aria-details": a["aria-details"]
|
|
18
|
+
})
|
|
85
19
|
};
|
|
86
20
|
}
|
|
87
|
-
function w() {
|
|
88
|
-
let r = window.event;
|
|
89
|
-
return (r == null ? void 0 : r.key) === "Enter";
|
|
90
|
-
}
|
|
91
|
-
function A() {
|
|
92
|
-
let r = window.event;
|
|
93
|
-
return (r == null ? void 0 : r.key) === " " || (r == null ? void 0 : r.code) === "Space";
|
|
94
|
-
}
|
|
95
21
|
export {
|
|
96
|
-
|
|
22
|
+
m as useTabPanel
|
|
97
23
|
};
|
package/index135.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 a=require("@react-aria/utils"),O=require("@react-aria/focus"),m=require("./index191.js");function S(s,o){let{elementType:r="button",isDisabled:e,onPress:l,onPressStart:u,onPressEnd:P,onPressUp:p,onPressChange:c,preventFocusOnPress:b,allowFocusWhenDisabled:f,onClick:i,href:g,target:h,rel:y,type:d="button"}=s,n;r==="button"?n={type:d,disabled:e}:n={role:"button",tabIndex:e?void 0:0,href:r==="a"&&e?void 0:g,target:r==="a"?h:void 0,type:r==="input"?d:void 0,disabled:r==="input"?e:void 0,"aria-disabled":!e||r==="input"?void 0:e,rel:r==="a"?y:void 0};let{pressProps:C,isPressed:x}=m.usePress({onPressStart:u,onPressEnd:P,onPressChange:c,onPress:l,onPressUp:p,isDisabled:e,preventFocusOnPress:b,ref:o}),{focusableProps:t}=O.useFocusable(s,o);f&&(t.tabIndex=e?-1:t.tabIndex);let D=a.mergeProps(t,C,a.filterDOMProps(s,{labelable:!0}));return{isPressed:x,buttonProps:a.mergeProps(n,D,{"aria-haspopup":s["aria-haspopup"],"aria-expanded":s["aria-expanded"],"aria-controls":s["aria-controls"],"aria-pressed":s["aria-pressed"],onClick:F=>{i&&(i(F),console.warn("onClick is deprecated, please use onPress"))}})}}exports.useButton=S;
|
package/index135.mjs
CHANGED
|
@@ -1,34 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { mergeProps as i, filterDOMProps as F } from "@react-aria/utils";
|
|
2
|
+
import { useFocusable as $ } from "@react-aria/focus";
|
|
3
|
+
import { usePress as O } from "./index191.mjs";
|
|
4
|
+
function E(s, t) {
|
|
5
|
+
let {
|
|
6
|
+
elementType: r = "button",
|
|
7
|
+
isDisabled: e,
|
|
8
|
+
onPress: l,
|
|
9
|
+
onPressStart: u,
|
|
10
|
+
onPressEnd: p,
|
|
11
|
+
onPressUp: P,
|
|
12
|
+
onPressChange: c,
|
|
13
|
+
preventFocusOnPress: f,
|
|
14
|
+
allowFocusWhenDisabled: b,
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
onClick: o,
|
|
17
|
+
href: h,
|
|
18
|
+
target: m,
|
|
19
|
+
rel: x,
|
|
20
|
+
type: d = "button"
|
|
21
|
+
} = s, n;
|
|
22
|
+
r === "button" ? n = {
|
|
23
|
+
type: d,
|
|
24
|
+
disabled: e
|
|
25
|
+
} : n = {
|
|
26
|
+
role: "button",
|
|
27
|
+
tabIndex: e ? void 0 : 0,
|
|
28
|
+
href: r === "a" && e ? void 0 : h,
|
|
29
|
+
target: r === "a" ? m : void 0,
|
|
30
|
+
type: r === "input" ? d : void 0,
|
|
31
|
+
disabled: r === "input" ? e : void 0,
|
|
32
|
+
"aria-disabled": !e || r === "input" ? void 0 : e,
|
|
33
|
+
rel: r === "a" ? x : void 0
|
|
34
|
+
};
|
|
35
|
+
let { pressProps: g, isPressed: C } = O({
|
|
36
|
+
onPressStart: u,
|
|
37
|
+
onPressEnd: p,
|
|
38
|
+
onPressChange: c,
|
|
39
|
+
onPress: l,
|
|
40
|
+
onPressUp: P,
|
|
41
|
+
isDisabled: e,
|
|
42
|
+
preventFocusOnPress: f,
|
|
43
|
+
ref: t
|
|
44
|
+
}), { focusableProps: a } = $(s, t);
|
|
45
|
+
b && (a.tabIndex = e ? -1 : a.tabIndex);
|
|
46
|
+
let y = i(a, g, F(s, {
|
|
47
|
+
labelable: !0
|
|
48
|
+
}));
|
|
28
49
|
return {
|
|
29
|
-
|
|
50
|
+
isPressed: C,
|
|
51
|
+
buttonProps: i(n, y, {
|
|
52
|
+
"aria-haspopup": s["aria-haspopup"],
|
|
53
|
+
"aria-expanded": s["aria-expanded"],
|
|
54
|
+
"aria-controls": s["aria-controls"],
|
|
55
|
+
"aria-pressed": s["aria-pressed"],
|
|
56
|
+
onClick: (D) => {
|
|
57
|
+
o && (o(D), console.warn("onClick is deprecated, please use onPress"));
|
|
58
|
+
}
|
|
59
|
+
})
|
|
30
60
|
};
|
|
31
61
|
}
|
|
32
62
|
export {
|
|
33
|
-
|
|
63
|
+
E as useButton
|
|
34
64
|
};
|
package/index136.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 A=require("./index193.js"),x=require("@react-aria/focus"),T=require("@react-aria/utils"),V=require("./index191.js"),j=require("./index196.js"),v=require("react");function N(o){let{selectionManager:t,key:s,ref:c,shouldSelectOnPressUp:L,shouldUseVirtualFocus:d,focus:D,isDisabled:n,onAction:b,allowsDifferentPressOrigin:C,linkBehavior:u="action"}=o,F=T.useRouter(),a=e=>{if(e.pointerType==="keyboard"&&A.isNonContiguousSelectionModifier(e))t.toggleSelection(s);else{if(t.selectionMode==="none")return;if(t.isLink(s)){if(u==="selection"){let f=t.getItemProps(s);F.open(c.current,e,f.href,f.routerOptions),t.setSelectedKeys(t.selectedKeys);return}else if(u==="override"||u==="none")return}t.selectionMode==="single"?t.isSelected(s)&&!t.disallowEmptySelection?t.toggleSelection(s):t.replaceSelection(s):e&&e.shiftKey?t.extendSelection(s):t.selectionBehavior==="toggle"||e&&(A.isCtrlKeyPressed(e)||e.pointerType==="touch"||e.pointerType==="virtual")?t.toggleSelection(s):t.replaceSelection(s)}};v.useEffect(()=>{s===t.focusedKey&&t.isFocused&&!d&&(D?D():document.activeElement!==c.current&&x.focusSafely(c.current))},[c,s,t.focusedKey,t.childFocusStrategy,t.isFocused,d]),n=n||t.isDisabled(s);let y={};!d&&!n?y={tabIndex:s===t.focusedKey?0:-1,onFocus(e){e.target===c.current&&t.setFocusedKey(s)}}:n&&(y.onMouseDown=e=>{e.preventDefault()});let E=t.isLink(s)&&u==="override",O=t.isLink(s)&&u!=="selection"&&u!=="none",r=!n&&t.canSelectItem(s)&&!E,k=(b||O)&&!n,l=k&&(t.selectionBehavior==="replace"?!r:!r||t.isEmpty),h=k&&r&&t.selectionBehavior==="replace",p=l||h,P=v.useRef(null),g=p&&r,m=v.useRef(!1),w=v.useRef(!1),S=e=>{if(b&&b(),O){let f=t.getItemProps(s);F.open(c.current,e,f.href,f.routerOptions)}},i={};L?(i.onPressStart=e=>{P.current=e.pointerType,m.current=g,e.pointerType==="keyboard"&&(!p||$())&&a(e)},C?(i.onPressUp=l?null:e=>{e.pointerType!=="keyboard"&&r&&a(e)},i.onPress=l?S:null):i.onPress=e=>{if(l||h&&e.pointerType!=="mouse"){if(e.pointerType==="keyboard"&&!K())return;S(e)}else e.pointerType!=="keyboard"&&r&&a(e)}):(i.onPressStart=e=>{P.current=e.pointerType,m.current=g,w.current=l,r&&(e.pointerType==="mouse"&&!l||e.pointerType==="keyboard"&&(!k||$()))&&a(e)},i.onPress=e=>{(e.pointerType==="touch"||e.pointerType==="pen"||e.pointerType==="virtual"||e.pointerType==="keyboard"&&p&&K()||e.pointerType==="mouse"&&w.current)&&(p?S(e):r&&a(e))}),y["data-key"]=s,i.preventFocusOnPress=d;let{pressProps:q,isPressed:B}=V.usePress(i),M=h?e=>{P.current==="mouse"&&(e.stopPropagation(),e.preventDefault(),S(e))}:void 0,{longPressProps:I}=j.useLongPress({isDisabled:!g,onLongPress(e){e.pointerType==="touch"&&(a(e),t.setSelectionBehavior("toggle"))}}),R=e=>{P.current==="touch"&&m.current&&e.preventDefault()},U=t.isLink(s)?e=>{T.openLink.isOpening||e.preventDefault()}:void 0;return{itemProps:T.mergeProps(y,r||l?q:{},g?I:{},{onDoubleClick:M,onDragStartCapture:R,onClick:U}),isPressed:B,isSelected:t.isSelected(s),isFocused:t.isFocused&&t.focusedKey===s,isDisabled:n,allowsSelection:r,hasAction:p}}function K(){let o=window.event;return(o==null?void 0:o.key)==="Enter"}function $(){let o=window.event;return(o==null?void 0:o.key)===" "||(o==null?void 0:o.code)==="Space"}exports.useSelectableItem=N;
|
package/index136.mjs
CHANGED
|
@@ -1,124 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
validationDetails: D,
|
|
21
|
-
validationErrors: []
|
|
22
|
-
}, B = O({}), 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(() => C(Y(d, o)), [
|
|
44
|
-
d,
|
|
45
|
-
o
|
|
46
|
-
]);
|
|
47
|
-
l != null && l.validationDetails.valid && (l = null);
|
|
48
|
-
let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
|
|
49
|
-
s,
|
|
50
|
-
i
|
|
51
|
-
]), [M, _] = f(s), [x, m] = f(!1);
|
|
52
|
-
s !== M && (_(s), m(!1));
|
|
53
|
-
let $ = I(() => C(x ? [] : A), [
|
|
54
|
-
x,
|
|
55
|
-
A
|
|
56
|
-
]), g = T(c), [b, E] = f(c), u = T(c), w = () => {
|
|
57
|
-
if (!F) return;
|
|
58
|
-
p(!1);
|
|
59
|
-
let r = V || l || g.current;
|
|
60
|
-
y(r, u.current) || (u.current = r, E(r));
|
|
61
|
-
}, [F, p] = f(!1);
|
|
62
|
-
return R(w), {
|
|
63
|
-
realtimeValidation: v || $ || V || l || c,
|
|
64
|
-
displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
|
|
65
|
-
updateValidation(r) {
|
|
66
|
-
n === "aria" && !y(b, r) ? E(r) : g.current = r;
|
|
67
|
-
},
|
|
68
|
-
resetValidation() {
|
|
69
|
-
let r = c;
|
|
70
|
-
y(r, u.current) || (u.current = r, E(r)), n === "native" && p(!1), m(!0);
|
|
71
|
-
},
|
|
72
|
-
commitValidation() {
|
|
73
|
-
n === "native" && p(!0), m(!0);
|
|
1
|
+
import { isNonContiguousSelectionModifier as U, isCtrlKeyPressed as R } from "./index193.mjs";
|
|
2
|
+
import { focusSafely as V } from "@react-aria/focus";
|
|
3
|
+
import { useRouter as N, openLink as j, mergeProps as q } from "@react-aria/utils";
|
|
4
|
+
import { usePress as z } from "./index191.mjs";
|
|
5
|
+
import { useLongPress as G } from "./index196.mjs";
|
|
6
|
+
import { useEffect as H, useRef as h } from "react";
|
|
7
|
+
function _(r) {
|
|
8
|
+
let { selectionManager: t, key: o, ref: c, shouldSelectOnPressUp: K, shouldUseVirtualFocus: d, focus: $, isDisabled: n, onAction: g, allowsDifferentPressOrigin: O, linkBehavior: a = "action" } = r, T = N(), p = (e) => {
|
|
9
|
+
if (e.pointerType === "keyboard" && U(e)) t.toggleSelection(o);
|
|
10
|
+
else {
|
|
11
|
+
if (t.selectionMode === "none") return;
|
|
12
|
+
if (t.isLink(o)) {
|
|
13
|
+
if (a === "selection") {
|
|
14
|
+
let f = t.getItemProps(o);
|
|
15
|
+
T.open(c.current, e, f.href, f.routerOptions), t.setSelectedKeys(t.selectedKeys);
|
|
16
|
+
return;
|
|
17
|
+
} else if (a === "override" || a === "none") return;
|
|
18
|
+
}
|
|
19
|
+
t.selectionMode === "single" ? t.isSelected(o) && !t.disallowEmptySelection ? t.toggleSelection(o) : t.replaceSelection(o) : e && e.shiftKey ? t.extendSelection(o) : t.selectionBehavior === "toggle" || e && (R(e) || e.pointerType === "touch" || e.pointerType === "virtual") ? t.toggleSelection(o) : t.replaceSelection(o);
|
|
74
20
|
}
|
|
75
21
|
};
|
|
22
|
+
H(() => {
|
|
23
|
+
o === t.focusedKey && t.isFocused && !d && ($ ? $() : document.activeElement !== c.current && V(c.current));
|
|
24
|
+
}, [
|
|
25
|
+
c,
|
|
26
|
+
o,
|
|
27
|
+
t.focusedKey,
|
|
28
|
+
t.childFocusStrategy,
|
|
29
|
+
t.isFocused,
|
|
30
|
+
d
|
|
31
|
+
]), n = n || t.isDisabled(o);
|
|
32
|
+
let y = {};
|
|
33
|
+
!d && !n ? y = {
|
|
34
|
+
tabIndex: o === t.focusedKey ? 0 : -1,
|
|
35
|
+
onFocus(e) {
|
|
36
|
+
e.target === c.current && t.setFocusedKey(o);
|
|
37
|
+
}
|
|
38
|
+
} : n && (y.onMouseDown = (e) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
});
|
|
41
|
+
let L = t.isLink(o) && a === "override", D = t.isLink(o) && a !== "selection" && a !== "none", i = !n && t.canSelectItem(o) && !L, S = (g || D) && !n, l = S && (t.selectionBehavior === "replace" ? !i : !i || t.isEmpty), v = S && i && t.selectionBehavior === "replace", u = l || v, P = h(null), m = u && i, k = h(!1), F = h(!1), b = (e) => {
|
|
42
|
+
if (g && g(), D) {
|
|
43
|
+
let f = t.getItemProps(o);
|
|
44
|
+
T.open(c.current, e, f.href, f.routerOptions);
|
|
45
|
+
}
|
|
46
|
+
}, s = {};
|
|
47
|
+
K ? (s.onPressStart = (e) => {
|
|
48
|
+
P.current = e.pointerType, k.current = m, e.pointerType === "keyboard" && (!u || A()) && p(e);
|
|
49
|
+
}, O ? (s.onPressUp = l ? null : (e) => {
|
|
50
|
+
e.pointerType !== "keyboard" && i && p(e);
|
|
51
|
+
}, s.onPress = l ? b : null) : s.onPress = (e) => {
|
|
52
|
+
if (l || v && e.pointerType !== "mouse") {
|
|
53
|
+
if (e.pointerType === "keyboard" && !w()) return;
|
|
54
|
+
b(e);
|
|
55
|
+
} else e.pointerType !== "keyboard" && i && p(e);
|
|
56
|
+
}) : (s.onPressStart = (e) => {
|
|
57
|
+
P.current = e.pointerType, k.current = m, F.current = l, i && (e.pointerType === "mouse" && !l || e.pointerType === "keyboard" && (!S || A())) && p(e);
|
|
58
|
+
}, s.onPress = (e) => {
|
|
59
|
+
(e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && u && w() || e.pointerType === "mouse" && F.current) && (u ? b(e) : i && p(e));
|
|
60
|
+
}), y["data-key"] = o, s.preventFocusOnPress = d;
|
|
61
|
+
let { pressProps: x, isPressed: C } = z(s), E = v ? (e) => {
|
|
62
|
+
P.current === "mouse" && (e.stopPropagation(), e.preventDefault(), b(e));
|
|
63
|
+
} : void 0, { longPressProps: B } = G({
|
|
64
|
+
isDisabled: !m,
|
|
65
|
+
onLongPress(e) {
|
|
66
|
+
e.pointerType === "touch" && (p(e), t.setSelectionBehavior("toggle"));
|
|
67
|
+
}
|
|
68
|
+
}), I = (e) => {
|
|
69
|
+
P.current === "touch" && k.current && e.preventDefault();
|
|
70
|
+
}, M = t.isLink(o) ? (e) => {
|
|
71
|
+
j.isOpening || e.preventDefault();
|
|
72
|
+
} : void 0;
|
|
73
|
+
return {
|
|
74
|
+
itemProps: q(y, i || l ? x : {}, m ? B : {}, {
|
|
75
|
+
onDoubleClick: E,
|
|
76
|
+
onDragStartCapture: I,
|
|
77
|
+
onClick: M
|
|
78
|
+
}),
|
|
79
|
+
isPressed: C,
|
|
80
|
+
isSelected: t.isSelected(o),
|
|
81
|
+
isFocused: t.isFocused && t.focusedKey === o,
|
|
82
|
+
isDisabled: n,
|
|
83
|
+
allowsSelection: i,
|
|
84
|
+
hasAction: u
|
|
85
|
+
};
|
|
76
86
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
] : [];
|
|
81
|
-
}
|
|
82
|
-
function Y(a, e) {
|
|
83
|
-
if (typeof a == "function") {
|
|
84
|
-
let t = a(e);
|
|
85
|
-
if (t && typeof t != "boolean") return S(t);
|
|
86
|
-
}
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
function C(a) {
|
|
90
|
-
return a.length ? {
|
|
91
|
-
isInvalid: !0,
|
|
92
|
-
validationErrors: a,
|
|
93
|
-
validationDetails: L
|
|
94
|
-
} : null;
|
|
95
|
-
}
|
|
96
|
-
function y(a, e) {
|
|
97
|
-
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);
|
|
87
|
+
function w() {
|
|
88
|
+
let r = window.event;
|
|
89
|
+
return (r == null ? void 0 : r.key) === "Enter";
|
|
98
90
|
}
|
|
99
|
-
function
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
for (let d of a) {
|
|
104
|
-
var o, l;
|
|
105
|
-
for (let n of d.validationErrors) e.add(n);
|
|
106
|
-
t || (t = d.isInvalid);
|
|
107
|
-
for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
|
|
108
|
-
}
|
|
109
|
-
return i.valid = !t, {
|
|
110
|
-
isInvalid: t,
|
|
111
|
-
validationErrors: [
|
|
112
|
-
...e
|
|
113
|
-
],
|
|
114
|
-
validationDetails: i
|
|
115
|
-
};
|
|
91
|
+
function A() {
|
|
92
|
+
let r = window.event;
|
|
93
|
+
return (r == null ? void 0 : r.key) === " " || (r == null ? void 0 : r.code) === "Space";
|
|
116
94
|
}
|
|
117
95
|
export {
|
|
118
|
-
|
|
119
|
-
B as FormValidationContext,
|
|
120
|
-
D as VALID_VALIDITY_STATE,
|
|
121
|
-
k as mergeValidation,
|
|
122
|
-
h as privateValidationStateProp,
|
|
123
|
-
P as useFormValidationState
|
|
96
|
+
_ as useSelectableItem
|
|
124
97
|
};
|
package/index137.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 b=require("./index192.js"),u=require("./index197.js"),g=require("@react-aria/i18n"),y=require("react");function D(l){let{selectionManager:t,collection:o,disabledKeys:a,ref:e,keyboardDelegate:r,layoutDelegate:i}=l,s=g.useCollator({usage:"search",sensitivity:"base"}),c=t.disabledBehavior,n=y.useMemo(()=>r||new u.ListKeyboardDelegate({collection:o,disabledKeys:a,disabledBehavior:c,ref:e,collator:s,layoutDelegate:i}),[r,i,o,a,e,s,c]),{collectionProps:d}=b.useSelectableCollection({...l,ref:e,selectionManager:t,keyboardDelegate:n});return{listProps:d}}exports.useSelectableList=D;
|
package/index137.mjs
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useSelectableCollection as n } from "./index192.mjs";
|
|
2
|
+
import { ListKeyboardDelegate as g } from "./index197.mjs";
|
|
3
|
+
import { useCollator as f } from "@react-aria/i18n";
|
|
4
|
+
import { useMemo as y } from "react";
|
|
5
|
+
function D(a) {
|
|
6
|
+
let { selectionManager: l, collection: o, disabledKeys: t, ref: e, keyboardDelegate: r, layoutDelegate: i } = a, s = f({
|
|
7
|
+
usage: "search",
|
|
8
|
+
sensitivity: "base"
|
|
9
|
+
}), d = l.disabledBehavior, c = y(() => r || new g({
|
|
10
|
+
collection: o,
|
|
11
|
+
disabledKeys: t,
|
|
12
|
+
disabledBehavior: d,
|
|
13
|
+
ref: e,
|
|
14
|
+
collator: s,
|
|
15
|
+
layoutDelegate: i
|
|
16
|
+
}), [
|
|
17
|
+
r,
|
|
18
|
+
i,
|
|
19
|
+
o,
|
|
20
|
+
t,
|
|
19
21
|
e,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
])
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
s,
|
|
23
|
+
d
|
|
24
|
+
]), { collectionProps: b } = n({
|
|
25
|
+
...a,
|
|
26
|
+
ref: e,
|
|
27
|
+
selectionManager: l,
|
|
28
|
+
keyboardDelegate: c
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
listProps: b
|
|
32
|
+
};
|
|
27
33
|
}
|
|
28
34
|
export {
|
|
29
|
-
|
|
35
|
+
D as useSelectableList
|
|
30
36
|
};
|
package/index138.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:s,commitValidation:l}=e[I];return{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:s,commitValidation:l}}return w(e)}function w(e){let{isInvalid:a,validationState:t,name:i,value:s,builtinValidation:l,validate:d,validationBehavior:o="aria"}=e;t&&(a||(a=t==="invalid"));let V=a!==void 0?{isInvalid:a,validationErrors:[],validationDetails:x}:null,m=n.useMemo(()=>T(F(d,s)),[d,s]);l!=null&&l.validationDetails.valid&&(l=null);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 d of e){var s,l;for(let o of d.validationErrors)a.add(o);t||(t=d.isInvalid);for(let o in i)(s=i)[l=o]||(s[l]=d.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;
|