@okam/stack-ui 1.32.5 → 1.32.7
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/index101.js +1 -1
- package/index101.mjs +1 -1
- package/index102.js +1 -1
- package/index102.mjs +3 -3
- package/index103.js +1 -1
- package/index103.mjs +1 -1
- package/index110.js +1 -1
- package/index110.mjs +5 -5
- package/index111.js +1 -1
- package/index111.mjs +2 -2
- package/index112.js +1 -1
- package/index112.mjs +1 -1
- package/index113.js +1 -1
- package/index113.mjs +2 -2
- package/index115.js +1 -1
- package/index115.mjs +4 -4
- package/index116.js +1 -1
- package/index116.mjs +2 -2
- package/index120.js +1 -1
- package/index120.mjs +4 -4
- package/index121.js +1 -1
- package/index121.mjs +2 -2
- package/index122.js +1 -1
- package/index122.mjs +2 -2
- package/index123.js +1 -1
- package/index123.mjs +8 -8
- package/index125.js +1 -1
- package/index125.mjs +2 -2
- package/index126.js +1 -1
- package/index126.mjs +3 -3
- package/index130.js +1 -1
- package/index130.mjs +2 -2
- package/index138.js +1 -1
- package/index138.mjs +52 -12
- package/index139.js +1 -1
- package/index139.mjs +46 -52
- package/index140.js +1 -1
- package/index140.mjs +241 -46
- package/index141.js +2 -1
- package/index141.mjs +13 -241
- package/index142.js +1 -2
- package/index142.mjs +29 -12
- package/index143.js +1 -1
- package/index143.mjs +11 -29
- package/index145.js +1 -1
- package/index145.mjs +1 -1
- package/index146.js +1 -1
- package/index146.mjs +1 -1
- package/index147.js +1 -1
- package/index147.mjs +2 -2
- package/index148.js +1 -1
- package/index148.mjs +3 -3
- package/index149.js +1 -1
- package/index149.mjs +3 -3
- package/index150.js +1 -1
- package/index150.mjs +107 -24
- package/index151.js +1 -1
- package/index151.mjs +79 -110
- package/index152.js +1 -1
- package/index152.mjs +25 -106
- package/index153.js +1 -1
- package/index153.mjs +23 -82
- package/index154.js +1 -1
- package/index154.mjs +113 -25
- package/index155.js +1 -1
- package/index155.mjs +2 -2
- package/index156.js +1 -1
- package/index156.mjs +123 -17
- package/index157.js +1 -1
- package/index157.mjs +24 -122
- package/index158.js +1 -1
- package/index158.mjs +17 -71
- package/index159.js +1 -1
- package/index159.mjs +62 -338
- package/index160.js +1 -1
- package/index160.mjs +346 -42
- package/index161.js +1 -1
- package/index161.mjs +43 -29
- package/index162.js +1 -1
- package/index162.mjs +28 -24
- package/index164.js +1 -1
- package/index164.mjs +2 -2
- package/index167.js +1 -1
- package/index167.mjs +3 -3
- package/index169.js +1 -1
- package/index169.mjs +4 -4
- package/index17.js +1 -1
- package/index17.mjs +15 -15
- package/index170.js +1 -1
- package/index170.mjs +2 -2
- package/index171.js +1 -1
- package/index171.mjs +1 -1
- package/index173.js +1 -1
- package/index173.mjs +1 -1
- package/index175.js +1 -1
- package/index175.mjs +1 -1
- package/index176.js +1 -1
- package/index176.mjs +1 -1
- package/index177.js +1 -1
- package/index177.mjs +1 -1
- package/index178.js +1 -1
- package/index178.mjs +4 -4
- package/index179.js +1 -1
- package/index179.mjs +1 -1
- package/index180.js +1 -1
- package/index180.mjs +2 -2
- package/index182.js +1 -1
- package/index182.mjs +1 -1
- package/index184.js +1 -1
- package/index184.mjs +1 -1
- package/index185.js +1 -1
- package/index185.mjs +197 -205
- package/index186.js +1 -1
- package/index186.mjs +64 -24
- package/index187.js +1 -1
- package/index187.mjs +143 -4
- package/index188.js +1 -1
- package/index188.mjs +124 -3
- package/index189.js +1 -1
- package/index189.mjs +215 -116
- package/index190.js +1 -1
- package/index190.mjs +184 -23
- package/index191.js +1 -1
- package/index191.mjs +69 -51
- package/index192.js +1 -1
- package/index192.mjs +278 -43
- package/index193.js +1 -1
- package/index193.mjs +92 -31
- package/index194.js +1 -1
- package/index194.mjs +184 -109
- package/index195.js +1 -1
- package/index195.mjs +84 -77
- package/index196.js +1 -1
- package/index196.mjs +58 -101
- package/index197.js +1 -1
- package/index197.mjs +127 -98
- package/index198.js +1 -1
- package/index198.mjs +101 -188
- package/index199.js +1 -1
- package/index199.mjs +110 -52
- package/index200.js +1 -1
- package/index200.mjs +67 -138
- package/index201.js +1 -1
- package/index201.mjs +105 -119
- package/index202.js +1 -1
- package/index202.mjs +47 -219
- package/index203.js +1 -1
- package/index203.mjs +88 -185
- package/index204.js +1 -1
- package/index204.mjs +63 -62
- package/index205.js +1 -1
- package/index205.mjs +52 -275
- package/index206.js +1 -1
- package/index206.mjs +94 -93
- package/index207.js +5 -1
- package/index207.mjs +75 -183
- package/index208.js +1 -1
- package/index208.mjs +2014 -73
- package/index209.js +1 -1
- package/index209.mjs +57 -56
- package/index21.js +1 -1
- package/index21.mjs +96 -92
- package/index210.js +1 -1
- package/index210.mjs +185 -123
- package/index211.js +1 -1
- package/index211.mjs +205 -110
- package/index212.js +1 -1
- package/index212.mjs +24 -122
- package/index213.js +1 -1
- package/index213.mjs +4 -72
- package/index214.js +1 -1
- package/index214.mjs +3 -110
- package/index215.js +1 -1
- package/index215.mjs +124 -51
- package/index216.js +1 -1
- package/index216.mjs +29 -93
- package/index217.js +1 -1
- package/index217.mjs +51 -70
- package/index218.js +1 -1
- package/index218.mjs +44 -56
- package/index219.js +1 -1
- package/index219.mjs +36 -98
- package/index220.js +1 -5
- package/index220.mjs +111 -78
- package/index221.js +1 -1
- package/index221.mjs +73 -2021
- package/index222.js +1 -1
- package/index222.mjs +99 -57
- package/index223.js +1 -1
- package/index223.mjs +98 -189
- package/index224.js +1 -1
- package/index224.mjs +4 -4
- package/index225.js +1 -1
- package/index225.mjs +1 -1
- package/index226.js +1 -1
- package/index226.mjs +3 -3
- package/index227.js +1 -1
- package/index227.mjs +34 -34
- package/index230.js +1 -1
- package/index230.mjs +2 -2
- package/index231.js +1 -1
- package/index231.mjs +1 -1
- package/index266.js +1 -1
- package/index266.mjs +34 -34
- package/index269.js +1 -1
- package/index269.mjs +130 -4
- package/index270.js +1 -1
- package/index270.mjs +188 -22
- package/index271.js +1 -1
- package/index271.mjs +8 -46
- package/index272.js +1 -1
- package/index272.mjs +3 -5
- package/index273.js +1 -1
- package/index273.mjs +37 -6
- package/index274.js +1 -1
- package/index274.mjs +5 -14
- package/index275.js +1 -1
- package/index275.mjs +29 -24
- package/index276.js +1 -1
- package/index276.mjs +6 -28
- package/index277.js +1 -1
- package/index277.mjs +4 -31
- package/index278.js +1 -1
- package/index278.mjs +48 -9
- package/index279.js +1 -1
- package/index279.mjs +9 -28
- package/index280.js +1 -1
- package/index280.mjs +16 -10
- package/index281.js +1 -1
- package/index281.mjs +16 -6
- package/index282.js +1 -1
- package/index282.mjs +16 -8
- package/index283.js +1 -1
- package/index283.mjs +16 -14
- package/index284.js +1 -1
- package/index284.mjs +16 -9
- package/index285.js +1 -1
- package/index285.mjs +15 -130
- package/index286.js +1 -1
- package/index286.mjs +16 -191
- package/index287.js +1 -1
- package/index287.mjs +16 -10
- package/index288.js +1 -1
- package/index288.mjs +16 -4
- package/index289.js +1 -1
- package/index289.mjs +16 -37
- package/index290.js +1 -1
- package/index290.mjs +16 -6
- package/index291.js +1 -1
- package/index291.mjs +16 -30
- package/index292.js +1 -1
- package/index292.mjs +16 -7
- package/index293.js +1 -1
- package/index293.mjs +16 -49
- package/index294.js +1 -1
- package/index294.mjs +15 -15
- package/index295.js +1 -1
- package/index295.mjs +12 -12
- package/index296.js +1 -1
- package/index296.mjs +15 -15
- package/index297.js +1 -1
- package/index297.mjs +12 -12
- package/index298.js +1 -1
- package/index298.mjs +12 -12
- package/index299.js +1 -1
- package/index299.mjs +15 -15
- package/index300.js +1 -1
- package/index300.mjs +12 -12
- package/index301.js +1 -1
- package/index301.mjs +15 -15
- package/index302.js +1 -1
- package/index302.mjs +12 -12
- package/index303.js +1 -1
- package/index303.mjs +12 -12
- package/index304.js +1 -1
- package/index304.mjs +12 -12
- package/index305.js +1 -1
- package/index305.mjs +15 -15
- package/index306.js +1 -1
- package/index306.mjs +15 -15
- package/index307.js +1 -1
- package/index307.mjs +15 -15
- package/index308.js +1 -1
- package/index308.mjs +15 -15
- package/index309.js +1 -1
- package/index309.mjs +15 -15
- package/index310.js +1 -1
- package/index310.mjs +15 -15
- package/index311.js +1 -1
- package/index311.mjs +15 -15
- package/index312.js +1 -1
- package/index312.mjs +15 -15
- package/index313.js +1 -1
- package/index313.mjs +15 -15
- package/index314.js +1 -1
- package/index314.mjs +25 -16
- package/index315.js +1 -1
- package/index315.mjs +48 -16
- package/index316.js +1 -1
- package/index316.mjs +6 -16
- package/index317.js +1 -1
- package/index317.mjs +6 -16
- package/index318.js +1 -1
- package/index318.mjs +15 -16
- package/index319.js +1 -1
- package/index319.mjs +25 -16
- package/index320.js +1 -1
- package/index320.mjs +29 -16
- package/index321.js +1 -1
- package/index321.mjs +32 -16
- package/index322.js +1 -1
- package/index322.mjs +29 -16
- package/index323.js +1 -1
- package/index323.mjs +10 -16
- package/index324.js +1 -1
- package/index324.mjs +6 -16
- package/index325.js +1 -1
- package/index325.mjs +8 -16
- package/index326.js +1 -1
- package/index326.mjs +14 -16
- package/index327.js +1 -1
- package/index327.mjs +9 -16
- package/index328.js +1 -1
- package/index328.mjs +1 -1
- package/index329.js +1 -1
- package/index329.mjs +1 -1
- package/index331.js +1 -1
- package/index331.mjs +1 -1
- package/index332.js +1 -1
- package/index332.mjs +2 -2
- package/index333.js +1 -1
- package/index333.mjs +1 -1
- package/index337.js +1 -1
- package/index337.mjs +1 -1
- package/index338.js +1 -1
- package/index338.mjs +4 -7
- package/index339.js +1 -1
- package/index339.mjs +6 -68
- package/index340.js +1 -1
- package/index340.mjs +65 -27
- package/index341.js +1 -1
- package/index341.mjs +30 -6
- package/index342.js +1 -1
- package/index342.mjs +6 -6
- package/index343.js +1 -1
- package/index343.mjs +6 -20
- package/index344.js +1 -1
- package/index344.mjs +20 -3
- package/index345.js +1 -1
- package/index345.mjs +117 -5
- package/index346.js +1 -1
- package/index346.mjs +71 -117
- package/index347.js +1 -1
- package/index347.mjs +7 -71
- package/index348.js +1 -1
- package/index348.mjs +7 -7
- package/index349.js +1 -1
- package/index349.mjs +7 -7
- package/index350.js +1 -1
- package/index350.mjs +7 -7
- package/index351.js +1 -1
- package/index351.mjs +4 -4
- package/index352.js +1 -1
- package/index352.mjs +7 -7
- package/index353.js +1 -1
- package/index353.mjs +7 -7
- package/index354.js +1 -1
- package/index354.mjs +4 -4
- package/index355.js +1 -1
- package/index355.mjs +4 -4
- package/index356.js +1 -1
- package/index356.mjs +4 -4
- package/index357.js +1 -1
- package/index357.mjs +4 -4
- package/index358.js +1 -1
- package/index358.mjs +7 -7
- package/index359.js +1 -1
- package/index359.mjs +7 -7
- package/index360.js +1 -1
- package/index360.mjs +7 -7
- package/index361.js +1 -1
- package/index361.mjs +4 -4
- package/index362.js +1 -1
- package/index362.mjs +7 -7
- package/index363.js +1 -1
- package/index363.mjs +7 -7
- package/index364.js +1 -1
- package/index364.mjs +7 -7
- package/index365.js +1 -1
- package/index365.mjs +7 -7
- package/index366.js +1 -1
- package/index366.mjs +7 -7
- package/index367.js +1 -1
- package/index367.mjs +4 -4
- package/index368.js +1 -1
- package/index368.mjs +7 -7
- package/index369.js +1 -1
- package/index369.mjs +7 -7
- package/index370.js +1 -1
- package/index370.mjs +3 -3
- package/index371.js +1 -1
- package/index371.mjs +4 -4
- package/index372.js +1 -1
- package/index372.mjs +7 -7
- package/index373.js +1 -1
- package/index373.mjs +7 -7
- package/index374.js +1 -1
- package/index374.mjs +7 -7
- package/index375.js +1 -1
- package/index375.mjs +4 -4
- package/index376.js +1 -1
- package/index376.mjs +7 -7
- package/index377.js +1 -1
- package/index377.mjs +4 -4
- package/index378.js +1 -1
- package/index378.mjs +4 -4
- package/index379.js +1 -1
- package/index379.mjs +7 -7
- package/index380.js +1 -1
- package/index380.mjs +4 -4
- package/index381.js +1 -1
- package/index381.mjs +6 -8
- package/index99.js +1 -1
- package/index99.mjs +1 -1
- package/package.json +1 -1
package/index143.mjs
CHANGED
|
@@ -1,32 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onPress: () => e == null ? void 0 : e.slideTo(t)
|
|
12
|
-
}), v = o[t], n = t === p, { title: r, id: x } = v, a = r && r.length > 0;
|
|
13
|
-
return /* @__PURE__ */ h(
|
|
14
|
-
g,
|
|
15
|
-
{
|
|
16
|
-
as: "button",
|
|
17
|
-
tabIndex: 0,
|
|
18
|
-
role: "button",
|
|
19
|
-
"aria-current": n ? "true" : "false",
|
|
20
|
-
"aria-disabled": n,
|
|
21
|
-
"aria-label": a ? void 0 : `${t + 1} / ${o.length}`,
|
|
22
|
-
"aria-labelledby": a ? x : void 0,
|
|
23
|
-
...b,
|
|
24
|
-
...f,
|
|
25
|
-
themeName: `${l}.bullet`,
|
|
26
|
-
tokens: { ...u, active: n }
|
|
27
|
-
}
|
|
28
|
-
);
|
|
1
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { useTransition as c, animated as g } from "@react-spring/web";
|
|
3
|
+
import l from "./index64.mjs";
|
|
4
|
+
const w = (e) => {
|
|
5
|
+
const { isVisible: t, children: o, themeName: r, tokens: i, customTheme: n, ...m } = e, s = c(t, {
|
|
6
|
+
from: { gridTemplateRows: "0fr", paddingTop: "0", paddingBottom: "0" },
|
|
7
|
+
enter: { gridTemplateRows: "1fr", paddingTop: "1rem", paddingBottom: "1rem" },
|
|
8
|
+
leave: { gridTemplateRows: "0fr", paddingTop: "0", paddingBottom: "0" }
|
|
9
|
+
}), a = l(r, i, n);
|
|
10
|
+
return s((d, p) => p && /* @__PURE__ */ T(g.div, { ...m, style: d, className: a, children: o }));
|
|
29
11
|
};
|
|
30
12
|
export {
|
|
31
|
-
|
|
13
|
+
w as default
|
|
32
14
|
};
|
package/index145.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index335.js"),P=require("./index328.js"),y=require("./index331.js"),f=require("./index333.js"),v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index335.js"),P=require("./index328.js"),y=require("./index331.js"),f=require("./index333.js"),v=require("./index158.js"),b=require("./index172.js");function m(i,e){let{triggerRef:l,popoverRef:r,isNonModal:s,isKeyboardDismissDisabled:n,shouldCloseOnInteractOutside:a,...o}=i,{overlayProps:t,underlayProps:u}=y.useOverlay({isOpen:e.isOpen&&!o["data-react-aria-top-layer"],onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!s,isKeyboardDismissDisabled:n,shouldCloseOnInteractOutside:a},r),{overlayProps:p,arrowProps:d,placement:c}=P.useOverlayPosition({...o,targetRef:l,overlayRef:r,isOpen:e.isOpen,onClose:s?e.close:void 0});return f.usePreventScroll({isDisabled:s||!e.isOpen}),b.useLayoutEffect(()=>{if(e.isOpen&&!s&&r.current)return O.ariaHideOutside([r.current])},[s,e.isOpen,r]),{popoverProps:v.mergeProps(t,p),arrowProps:d,underlayProps:u,placement:c}}exports.usePopover=m;
|
package/index145.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { ariaHideOutside as u } from "./index335.mjs";
|
|
|
2
2
|
import { useOverlayPosition as $ } from "./index328.mjs";
|
|
3
3
|
import { useOverlay as m } from "./index331.mjs";
|
|
4
4
|
import { usePreventScroll as O } from "./index333.mjs";
|
|
5
|
-
import { mergeProps as b } from "./
|
|
5
|
+
import { mergeProps as b } from "./index158.mjs";
|
|
6
6
|
import { useLayoutEffect as P } from "./index172.mjs";
|
|
7
7
|
function R(a, e) {
|
|
8
8
|
let { triggerRef: i, popoverRef: r, isNonModal: o, isKeyboardDismissDisabled: p, shouldCloseOnInteractOutside: d, ...s } = a, { overlayProps: l, underlayProps: t } = m({
|
package/index146.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index336.js"),f=require("./index337.js"),C=require("@react-aria/focus"),e=require("react"),S=require("react-dom"),b=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index336.js"),f=require("./index337.js"),C=require("@react-aria/focus"),e=require("react"),S=require("react-dom"),b=require("./index315.js"),l=e.createContext(null);function P(n){let c=b.useIsSSR(),{portalContainer:r=c?null:document.body,isExiting:s}=n,[o,a]=e.useState(!1),u=e.useMemo(()=>({contain:o,setContain:a}),[o,a]),{getContainer:i}=d.useUNSTABLE_PortalContext();if(!n.portalContainer&&i&&(r=i()),!r)return null;let t=n.children;return n.disableFocusManagement||(t=e.createElement(C.FocusScope,{restoreFocus:!0,contain:o&&!s},t)),t=e.createElement(l.Provider,{value:u},e.createElement(f.ClearPressResponder,null,t)),S.createPortal(t,r)}exports.Overlay=P;exports.OverlayContext=l;
|
package/index146.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { ClearPressResponder as m } from "./index337.mjs";
|
|
|
3
3
|
import { FocusScope as u } from "@react-aria/focus";
|
|
4
4
|
import o, { useState as $, useMemo as b } from "react";
|
|
5
5
|
import d from "react-dom";
|
|
6
|
-
import { useIsSSR as x } from "./
|
|
6
|
+
import { useIsSSR as x } from "./index315.mjs";
|
|
7
7
|
const p = /* @__PURE__ */ o.createContext(null);
|
|
8
8
|
function P(t) {
|
|
9
9
|
let i = x(), { portalContainer: a = i ? null : document.body, isExiting: c } = t, [r, n] = $(!1), s = b(() => ({
|
package/index147.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index148.js"),A=require("./index168.js"),G=require("./index169.js"),J=require("./index170.js"),Q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index148.js"),A=require("./index168.js"),G=require("./index169.js"),J=require("./index170.js"),Q=require("./index138.js"),X=require("./index158.js"),Y=require("./index171.js"),g=require("./index172.js"),ee=require("./index173.js"),R=require("./index174.js"),P=require("./index175.js"),re=require("./index176.js"),te=require("./index177.js"),u=require("react"),p=require("@react-aria/i18n"),ae=require("./index178.js");function ie(r,t,n){let l=u.useRef(""),{locale:x}=p.useLocale(),M=A.useDisplayNames(),{ariaLabel:D,ariaLabelledBy:V,ariaDescribedBy:w,focusManager:c}=z.hookData.get(t),f=r.isPlaceholder?"":r.text,h=u.useMemo(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),T=p.useDateFormatter({month:"long",timeZone:h.timeZone}),k=p.useDateFormatter({hour:"numeric",hour12:h.hour12,timeZone:h.timeZone});if(r.type==="month"&&!r.isPlaceholder){let e=T.format(t.dateValue);f=e!==f?`${f} – ${e}`:e}else r.type==="hour"&&!r.isPlaceholder&&(f=k.format(t.dateValue));let{spinButtonProps:I}=ae.useSpinButton({value:r.value,textValue:f,minValue:r.minValue,maxValue:r.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!r.isEditable,isRequired:t.isRequired,onIncrement:()=>{l.current="",t.increment(r.type)},onDecrement:()=>{l.current="",t.decrement(r.type)},onIncrementPage:()=>{l.current="",t.incrementPage(r.type)},onDecrementPage:()=>{l.current="",t.decrementPage(r.type)},onIncrementToMax:()=>{l.current="",r.maxValue!==void 0&&t.setSegment(r.type,r.maxValue)},onDecrementToMin:()=>{l.current="",r.minValue!==void 0&&t.setSegment(r.type,r.minValue)}}),d=u.useMemo(()=>new te.NumberParser(x,{maximumFractionDigits:0}),[x]),S=()=>{if(r.text===r.placeholder&&c.focusPrevious(),d.isValidPartialNumber(r.text)&&!t.isReadOnly&&!r.isPlaceholder){let e=r.text.slice(0,-1),a=d.parse(e);e=a===0?"":e,e.length===0||a===0?t.clearSegment(r.type):t.setSegment(r.type,a),l.current=e}else r.type==="dayPeriod"&&t.clearSegment(r.type)},O=e=>{if(e.key==="a"&&(R.isMac()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),S();break}},{startsWith:m}=p.useFilter({sensitivity:"base"}),y=p.useDateFormatter({hour:"numeric",hour12:!0}),q=u.useMemo(()=>{let e=new Date;return e.setHours(0),y.formatToParts(e).find(a=>a.type==="dayPeriod").value},[y]),C=u.useMemo(()=>{let e=new Date;return e.setHours(12),y.formatToParts(e).find(a=>a.type==="dayPeriod").value},[y]),F=p.useDateFormatter({year:"numeric",era:"narrow",timeZone:"UTC"}),$=u.useMemo(()=>{if(r.type!=="era")return[];let e=J.toCalendar(new G.CalendarDate(1,1,1),t.calendar),a=t.calendar.getEras().map(o=>{let b=e.set({year:1,month:1,day:1,era:o}).toDate("UTC"),_=F.formatToParts(b).find(j=>j.type==="era").value;return{era:o,formatted:_}}),i=ne(a.map(o=>o.formatted));if(i)for(let o of a)o.formatted=o.formatted.slice(i);return a},[F,t.calendar,r.type]),N=e=>{if(t.isDisabled||t.isReadOnly)return;let a=l.current+e;switch(r.type){case"dayPeriod":if(m(q,e))t.setSegment("dayPeriod",0);else if(m(C,e))t.setSegment("dayPeriod",12);else break;c.focusNext();break;case"era":{let i=$.find(o=>m(o.formatted,e));i&&(t.setSegment("era",i.era),c.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!d.isValidPartialNumber(a))return;let i=d.parse(a),o=i,b=r.minValue===0;if(r.type==="hour"&&t.dateFormatter.resolvedOptions().hour12){switch(t.dateFormatter.resolvedOptions().hourCycle){case"h11":i>11&&(o=d.parse(e));break;case"h12":b=!1,i>12&&(o=d.parse(e));break}r.value!==void 0&&r.value>=12&&i>1&&(i+=12)}else r.maxValue!==void 0&&i>r.maxValue&&(o=d.parse(e));if(isNaN(i))return;let v=o!==0||b;v&&t.setSegment(r.type,o),r.maxValue!==void 0&&(+(i+"0")>r.maxValue||a.length>=String(r.maxValue).length)?(l.current="",v&&c.focusNext()):l.current=a;break}}},L=()=>{l.current="",n.current&&re.scrollIntoViewport(n.current,{containingElement:ee.getScrollParent(n.current)});let e=window.getSelection();e==null||e.collapse(n.current)},B=u.useRef(typeof document<"u"?document:null);P.useEvent(B,"selectionchange",()=>{var e;let a=window.getSelection();a!=null&&a.anchorNode&&(!((e=n.current)===null||e===void 0)&&e.contains(a==null?void 0:a.anchorNode))&&a.collapse(n.current)});let E=u.useRef("");P.useEvent(n,"beforeinput",e=>{if(n.current)switch(e.preventDefault(),e.inputType){case"deleteContentBackward":case"deleteContentForward":d.isValidPartialNumber(r.text)&&!t.isReadOnly&&S();break;case"insertCompositionText":E.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:e.data!=null&&N(e.data);break}}),P.useEvent(n,"input",e=>{let{inputType:a,data:i}=e;switch(a){case"insertCompositionText":n.current&&(n.current.textContent=E.current),i!=null&&(m(q,i)||m(C,i))&&N(i);break}}),g.useLayoutEffect(()=>{let e=n.current;return()=>{document.activeElement===e&&(c.focusPrevious()||c.focusNext())}},[n,c]);let K=R.isIOS()||r.type==="timeZoneName"?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{},Z=u.useMemo(()=>t.segments.find(e=>e.isEditable),[t.segments]);r!==Z&&!t.isInvalid&&(w=void 0);let H=Q.useId(),s=!t.isDisabled&&!t.isReadOnly&&r.isEditable,W=r.type==="literal"?"":M.of(r.type),U=Y.useLabels({"aria-label":`${W}${D?`, ${D}`:""}${V?", ":""}`,"aria-labelledby":V});return r.type==="literal"?{segmentProps:{"aria-hidden":!0}}:{segmentProps:X.mergeProps(I,U,{id:H,...K,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":w,"aria-readonly":t.isReadOnly||!r.isEditable?"true":void 0,"data-placeholder":r.isPlaceholder||void 0,contentEditable:s,suppressContentEditableWarning:s,spellCheck:s?"false":void 0,autoCorrect:s?"off":void 0,[parseInt(u.version,10)>=17?"enterKeyHint":"enterkeyhint"]:s?"next":void 0,inputMode:t.isDisabled||r.type==="dayPeriod"||r.type==="era"||!s?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:O,onFocus:L,style:{caretColor:"transparent"},onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}function ne(r){r.sort();let t=r[0],n=r[r.length-1];for(let l=0;l<t.length;l++)if(t[l]!==n[l])return l;return 0}exports.useDateSegment=ie;
|
package/index147.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { hookData as z } from "./index148.mjs";
|
|
|
2
2
|
import { useDisplayNames as A } from "./index168.mjs";
|
|
3
3
|
import { CalendarDate as G } from "./index169.mjs";
|
|
4
4
|
import { toCalendar as J } from "./index170.mjs";
|
|
5
|
-
import { useId as Q } from "./
|
|
6
|
-
import { mergeProps as X } from "./
|
|
5
|
+
import { useId as Q } from "./index138.mjs";
|
|
6
|
+
import { mergeProps as X } from "./index158.mjs";
|
|
7
7
|
import { useLabels as Y } from "./index171.mjs";
|
|
8
8
|
import { useLayoutEffect as g } from "./index172.mjs";
|
|
9
9
|
import { getScrollParent as ee } from "./index173.mjs";
|
package/index148.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index163.js"),K=require("./index164.js"),V=require("@react-aria/focus"),D=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index163.js"),K=require("./index164.js"),V=require("@react-aria/focus"),D=require("./index158.js"),E=require("./index165.js"),O=require("./index166.js"),C=require("./index179.js"),l=require("react"),G=require("./index167.js"),I=require("./index162.js"),j=require("./index159.js"),L=require("@react-aria/i18n");function T(e){return e&&e.__esModule?e.default:e}const F=new WeakMap,t="__role_"+Date.now(),h="__focusManager_"+Date.now();function U(e,i,s){var u;let{isInvalid:f,validationErrors:b,validationDetails:M}=i.displayValidation,{labelProps:v,fieldProps:c,descriptionProps:p,errorMessageProps:q}=G.useField({...e,labelElementType:"span",isInvalid:f,errorMessage:e.errorMessage||b}),P=l.useRef(null),{focusWithinProps:_}=I.useFocusWithin({...e,onFocusWithin(r){var o;P.current=i.value,(o=e.onFocus)===null||o===void 0||o.call(e,r)},onBlurWithin:r=>{var o;i.confirmPlaceholder(),i.value!==P.current&&i.commitValidation(),(o=e.onBlur)===null||o===void 0||o.call(e,r)},onFocusWithinChange:e.onFocusChange}),$=L.useLocalizedStringFormatter(T(w),"@react-aria/datepicker"),B=i.maxGranularity==="hour"?"selectedTimeDescription":"selectedDateDescription",R=i.maxGranularity==="hour"?"time":"date",W=i.value?$.format(B,{[R]:i.formatValue({month:"long"})}):"",x=O.useDescription(W),m=e[t]==="presentation"?c["aria-describedby"]:[x["aria-describedby"],c["aria-describedby"]].filter(Boolean).join(" ")||void 0,g=e[h],n=l.useMemo(()=>g||V.createFocusManager(s),[g,s]),S=K.useDatePickerGroup(i,s,e[t]==="presentation");F.set(i,{ariaLabel:e["aria-label"],ariaLabelledBy:[v.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:m,focusManager:n});let y=l.useRef(e.autoFocus),d;e[t]==="presentation"?d={role:"presentation"}:d=D.mergeProps(c,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":m}),l.useEffect(()=>{y.current&&n.focusFirst(),y.current=!1},[n]),C.useFormReset(e.inputRef,i.value,i.setValue),j.useFormValidation({...e,focus(){n.focusFirst()}},i,e.inputRef);let a={type:"hidden",name:e.name,value:((u=i.value)===null||u===void 0?void 0:u.toString())||"",disabled:e.isDisabled};e.validationBehavior==="native"&&(a.type="text",a.hidden=!0,a.required=e.isRequired,a.onChange=()=>{});let k=E.filterDOMProps(e);return{labelProps:{...v,onClick:()=>{n.focusFirst()}},fieldProps:D.mergeProps(k,d,S,_,{onKeyDown(r){e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){e.onKeyUp&&e.onKeyUp(r)}}),inputProps:a,descriptionProps:p,errorMessageProps:q,isInvalid:f,validationErrors:b,validationDetails:M}}exports.focusManagerSymbol=h;exports.hookData=F;exports.roleSymbol=t;exports.useDateField=U;
|
package/index148.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import R from "./index163.mjs";
|
|
2
2
|
import { useDatePickerGroup as k } from "./index164.mjs";
|
|
3
3
|
import { createFocusManager as E } from "@react-aria/focus";
|
|
4
|
-
import { mergeProps as P } from "./
|
|
4
|
+
import { mergeProps as P } from "./index158.mjs";
|
|
5
5
|
import { filterDOMProps as V } from "./index165.mjs";
|
|
6
6
|
import { useDescription as C } from "./index166.mjs";
|
|
7
7
|
import { useFormReset as I } from "./index179.mjs";
|
|
8
8
|
import { useRef as g, useMemo as S, useEffect as G } from "react";
|
|
9
9
|
import { useField as L } from "./index167.mjs";
|
|
10
|
-
import { useFocusWithin as O } from "./
|
|
11
|
-
import { useFormValidation as U } from "./
|
|
10
|
+
import { useFocusWithin as O } from "./index162.mjs";
|
|
11
|
+
import { useFormValidation as U } from "./index159.mjs";
|
|
12
12
|
import { useLocalizedStringFormatter as j } from "@react-aria/i18n";
|
|
13
13
|
function q(e) {
|
|
14
14
|
return e && e.__esModule ? e.default : e;
|
package/index149.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index180.js"),te=require("./index183.js"),le=require("./index184.js"),J=require("./index170.js"),Q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index180.js"),te=require("./index183.js"),le=require("./index184.js"),J=require("./index170.js"),Q=require("./index150.js"),E=require("./index181.js"),re=require("./index156.js"),ne=require("./index157.js"),s=require("react"),k={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},W={year:5,month:2,day:7,hour:2,minute:15,second:15},ie={dayperiod:"dayPeriod"};function ue(a){let{locale:l,createCalendar:i,hideTimeZone:d,isDisabled:y=!1,isReadOnly:v=!1,isRequired:I=!1,minValue:R,maxValue:T,isDateUnavailable:_}=a,V=a.value||a.defaultValue||a.placeholderValue||null,[h,g]=m.useDefaultProps(V,a.granularity),Z=g||"UTC";if(V&&!(h in V))throw new Error("Invalid granularity "+h+" for value "+V.toString());let K=s.useMemo(()=>new E.DateFormatter(l),[l]),u=s.useMemo(()=>i(K.resolvedOptions().calendar),[i,K]);var C;let[O,j]=ne.useControlledState(a.value,(C=a.defaultValue)!==null&&C!==void 0?C:null,a.onChange),S=s.useMemo(()=>{var e;return(e=m.convertValue(O,u))!==null&&e!==void 0?e:null},[O,u]),[L,w]=s.useState(()=>m.createPlaceholderDate(a.placeholderValue,h,u,g)),X=S||L,U=u.identifier==="gregory"&&X.era==="BC",M=s.useMemo(()=>{var e;return{granularity:h,maxGranularity:(e=a.maxGranularity)!==null&&e!==void 0?e:"year",timeZone:g,hideTimeZone:d,hourCycle:a.hourCycle,showEra:U,shouldForceLeadingZeros:a.shouldForceLeadingZeros}},[a.maxGranularity,h,a.hourCycle,a.shouldForceLeadingZeros,g,d,U]),Y=s.useMemo(()=>m.getFormatOptions({},M),[M]),D=s.useMemo(()=>new E.DateFormatter(l,Y),[l,Y]),x=s.useMemo(()=>D.resolvedOptions(),[D]),c=s.useMemo(()=>D.formatToParts(new Date).filter(e=>k[e.type]).reduce((e,r)=>(e[r.type]=!0,e),{}),[D]),[t,P]=s.useState(()=>a.value||a.defaultValue?{...c}:{}),q=s.useRef(null),A=s.useRef(u.identifier);s.useEffect(()=>{u.identifier!==A.current&&(A.current=u.identifier,w(e=>Object.keys(t).length>0?J.toCalendar(e,u):m.createPlaceholderDate(a.placeholderValue,h,u,g)))},[u,h,t,g,a.placeholderValue]),O&&Object.keys(t).length<Object.keys(c).length&&(t={...c},P(t)),O==null&&Object.keys(t).length===Object.keys(c).length&&(t={},P(t),w(m.createPlaceholderDate(a.placeholderValue,h,u,g)));let n=S&&Object.keys(t).length>=Object.keys(c).length?S:L,b=e=>{if(a.isDisabled||a.isReadOnly)return;let r=Object.keys(t),o=Object.keys(c);e==null?(j(null),w(m.createPlaceholderDate(a.placeholderValue,h,u,g)),P({})):r.length>=o.length||r.length===o.length-1&&c.dayPeriod&&!t.dayPeriod&&q.current!=="dayPeriod"?(e=J.toCalendar(e,(V==null?void 0:V.calendar)||new le.GregorianCalendar),j(e)):w(e),q.current=null},$=s.useMemo(()=>n.toDate(Z),[n,Z]),p=s.useMemo(()=>D.formatToParts($).map(e=>{let r=k[e.type];e.type==="era"&&u.getEras().length===1&&(r=!1);let o=k[e.type]&&!t[e.type],f=k[e.type]?te.getPlaceholder(e.type,e.value,l):null;return{type:ie[e.type]||e.type,text:o?f:e.value,...oe(n,e.type,x),isPlaceholder:o,placeholder:f,isEditable:r}}),[$,t,D,x,n,u,l]);c.era&&t.year&&!t.era?(t.era=!0,P({...t})):!c.era&&t.era&&(delete t.era,P({...t}));let B=e=>{t[e]=!0,e==="year"&&c.era&&(t.era=!0),P({...t})},F=(e,r)=>{if(t[e])b(se(n,e,r,x));else{B(e);let o=Object.keys(t),f=Object.keys(c);(o.length>=f.length||o.length===f.length-1&&c.dayPeriod&&!t.dayPeriod)&&b(n)}},ee=s.useMemo(()=>m.getValidationResult(O,R,T,_,M),[O,R,T,_,M]),N=re.useFormValidationState({...a,value:O,builtinValidation:ee}),z=N.displayValidation.isInvalid,ae=a.validationState||(z?"invalid":null);var G;return{...N,value:S,dateValue:$,calendar:u,setValue:b,segments:p,dateFormatter:D,validationState:ae,isInvalid:z,granularity:h,maxGranularity:(G=a.maxGranularity)!==null&&G!==void 0?G:"year",isDisabled:y,isReadOnly:v,isRequired:I,increment(e){F(e,1)},decrement(e){F(e,-1)},incrementPage(e){F(e,W[e]||1)},decrementPage(e){F(e,-(W[e]||1))},setSegment(e,r){B(e),b(ce(n,e,r,x))},confirmPlaceholder(){if(a.isDisabled||a.isReadOnly)return;let e=Object.keys(t),r=Object.keys(c);e.length===r.length-1&&c.dayPeriod&&!t.dayPeriod&&(t={...c},P(t),b(n.copy()))},clearSegment(e){delete t[e],q.current=e,P({...t});let r=m.createPlaceholderDate(a.placeholderValue,h,u,g),o=n;if(e==="dayPeriod"&&"hour"in n&&"hour"in r){let f=n.hour>=12,H=r.hour>=12;f&&!H?o=n.set({hour:n.hour-12}):!f&&H&&(o=n.set({hour:n.hour+12}))}else e in n&&(o=n.set({[e]:r[e]}));j(null),b(o)},formatValue(e){if(!S)return"";let r=m.getFormatOptions(e,M);return new E.DateFormatter(l,r).format($)},getDateFormatter(e,r){let o={...M,...r},f=m.getFormatOptions({},o);return new E.DateFormatter(e,f)}}}function oe(a,l,i){switch(l){case"era":{let d=a.calendar.getEras();return{value:d.indexOf(a.era),minValue:0,maxValue:d.length-1}}case"year":return{value:a.year,minValue:1,maxValue:a.calendar.getYearsInEra(a)};case"month":return{value:a.month,minValue:Q.getMinimumMonthInYear(a),maxValue:a.calendar.getMonthsInYear(a)};case"day":return{value:a.day,minValue:Q.getMinimumDayInMonth(a),maxValue:a.calendar.getDaysInMonth(a)}}if("hour"in a)switch(l){case"dayPeriod":return{value:a.hour>=12?12:0,minValue:0,maxValue:12};case"hour":if(i.hour12){let d=a.hour>=12;return{value:a.hour,minValue:d?12:0,maxValue:d?23:11}}return{value:a.hour,minValue:0,maxValue:23};case"minute":return{value:a.minute,minValue:0,maxValue:59};case"second":return{value:a.second,minValue:0,maxValue:59}}return{}}function se(a,l,i,d){switch(l){case"era":case"year":case"month":case"day":return a.cycle(l,i,{round:l==="year"})}if("hour"in a)switch(l){case"dayPeriod":{let y=a.hour,v=y>=12;return a.set({hour:v?y-12:y+12})}case"hour":case"minute":case"second":return a.cycle(l,i,{round:l!=="hour",hourCycle:d.hour12?12:24})}throw new Error("Unknown segment: "+l)}function ce(a,l,i,d){switch(l){case"day":case"month":case"year":case"era":return a.set({[l]:i})}if("hour"in a&&typeof i=="number")switch(l){case"dayPeriod":{let y=a.hour,v=y>=12;return i>=12===v?a:a.set({hour:v?y-12:y+12})}case"hour":if(d.hour12){let v=a.hour>=12;!v&&i===12&&(i=0),v&&i<12&&(i+=12)}case"minute":case"second":return a.set({[l]:i})}throw new Error("Unknown segment: "+l)}exports.useDateFieldState=ue;
|
package/index149.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import { useDefaultProps as re, convertValue as ie, createPlaceholderDate as w,
|
|
|
2
2
|
import { getPlaceholder as ue } from "./index183.mjs";
|
|
3
3
|
import { GregorianCalendar as oe } from "./index184.mjs";
|
|
4
4
|
import { toCalendar as Q } from "./index170.mjs";
|
|
5
|
-
import { getMinimumDayInMonth as ce, getMinimumMonthInYear as de } from "./
|
|
5
|
+
import { getMinimumDayInMonth as ce, getMinimumMonthInYear as de } from "./index150.mjs";
|
|
6
6
|
import { DateFormatter as k } from "./index181.mjs";
|
|
7
|
-
import { useFormValidationState as se } from "./
|
|
8
|
-
import { useControlledState as fe } from "./
|
|
7
|
+
import { useFormValidationState as se } from "./index156.mjs";
|
|
8
|
+
import { useControlledState as fe } from "./index157.mjs";
|
|
9
9
|
import { useMemo as f, useState as W, useRef as X, useEffect as he } from "react";
|
|
10
10
|
const j = {
|
|
11
11
|
year: !0,
|
package/index150.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("./index170.js"),s=require("./index223.js");function $(e,n){return n=c.toCalendar(n,e.calendar),e.era===n.era&&e.year===n.year&&e.month===n.month&&e.day===n.day}function y(e,n){return e.calendar.identifier===n.calendar.identifier&&e.era===n.era&&e.year===n.year&&e.month===n.month&&e.day===n.day}function p(e,n){return $(e,l(n))}function f(e,n){let t=e.calendar.toJulianDay(e),r=Math.ceil(t+1-w(n))%7;return r<0&&(r+=7),r}function d(e){return c.fromAbsolute(Date.now(),e)}function l(e){return c.toCalendarDate(d(e))}function M(e,n){return e.calendar.toJulianDay(e)-n.calendar.toJulianDay(n)}function g(e,n){return i(e)-i(n)}function i(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let a=null;function h(){return a==null&&(a=new Intl.DateTimeFormat().resolvedOptions().timeZone),a}function o(e){return e.subtract({days:e.day-1})}function x(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function D(e){return o(e.subtract({months:e.month-1}))}function I(e){return e.calendar.getMinimumMonthInYear?e.calendar.getMinimumMonthInYear(e):1}function O(e){return e.calendar.getMinimumDayInMonth?e.calendar.getMinimumDayInMonth(e):1}function m(e,n){let t=f(e,n);return e.subtract({days:t})}function k(e,n){return m(e,n).add({days:6})}const u=new Map;function v(e){if(Intl.Locale){let t=u.get(e);return t||(t=new Intl.Locale(e).maximize().region,t&&u.set(e,t)),t}let n=e.split("-")[1];return n==="u"?void 0:n}function w(e){let n=v(e);return n&&s.weekStartData[n]||0}function T(e,n){let t=e.calendar.getDaysInMonth(e);return Math.ceil((f(o(e),n)+t)/7)}function W(e,n){return e&&n?e.compare(n)<=0?e:n:e||n}function b(e,n){return e&&n?e.compare(n)>=0?e:n:e||n}exports.compareDate=M;exports.compareTime=g;exports.endOfMonth=x;exports.endOfWeek=k;exports.getDayOfWeek=f;exports.getLocalTimeZone=h;exports.getMinimumDayInMonth=O;exports.getMinimumMonthInYear=I;exports.getWeeksInMonth=T;exports.isEqualDay=y;exports.isSameDay=$;exports.isToday=p;exports.maxDate=b;exports.minDate=W;exports.now=d;exports.startOfMonth=o;exports.startOfWeek=m;exports.startOfYear=D;exports.today=l;
|
package/index150.mjs
CHANGED
|
@@ -1,27 +1,110 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { toCalendar as i, toCalendarDate as u, fromAbsolute as d } from "./index170.mjs";
|
|
2
|
+
import { weekStartData as s } from "./index223.mjs";
|
|
3
|
+
function m(e, a) {
|
|
4
|
+
return a = i(a, e.calendar), e.era === a.era && e.year === a.year && e.month === a.month && e.day === a.day;
|
|
5
|
+
}
|
|
6
|
+
function D(e, a) {
|
|
7
|
+
return e.calendar.identifier === a.calendar.identifier && e.era === a.era && e.year === a.year && e.month === a.month && e.day === a.day;
|
|
8
|
+
}
|
|
9
|
+
function b(e, a) {
|
|
10
|
+
return m(e, p(a));
|
|
11
|
+
}
|
|
12
|
+
function o(e, a) {
|
|
13
|
+
let n = e.calendar.toJulianDay(e), t = Math.ceil(n + 1 - h(a)) % 7;
|
|
14
|
+
return t < 0 && (t += 7), t;
|
|
15
|
+
}
|
|
16
|
+
function l(e) {
|
|
17
|
+
return d(Date.now(), e);
|
|
18
|
+
}
|
|
19
|
+
function p(e) {
|
|
20
|
+
return u(l(e));
|
|
21
|
+
}
|
|
22
|
+
function I(e, a) {
|
|
23
|
+
return e.calendar.toJulianDay(e) - a.calendar.toJulianDay(a);
|
|
24
|
+
}
|
|
25
|
+
function O(e, a) {
|
|
26
|
+
return f(e) - f(a);
|
|
27
|
+
}
|
|
28
|
+
function f(e) {
|
|
29
|
+
return e.hour * 36e5 + e.minute * 6e4 + e.second * 1e3 + e.millisecond;
|
|
30
|
+
}
|
|
31
|
+
let r = null;
|
|
32
|
+
function k() {
|
|
33
|
+
return r == null && (r = new Intl.DateTimeFormat().resolvedOptions().timeZone), r;
|
|
34
|
+
}
|
|
35
|
+
function $(e) {
|
|
36
|
+
return e.subtract({
|
|
37
|
+
days: e.day - 1
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function W(e) {
|
|
41
|
+
return e.add({
|
|
42
|
+
days: e.calendar.getDaysInMonth(e) - e.day
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function v(e) {
|
|
46
|
+
return $(e.subtract({
|
|
47
|
+
months: e.month - 1
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
function w(e) {
|
|
51
|
+
return e.calendar.getMinimumMonthInYear ? e.calendar.getMinimumMonthInYear(e) : 1;
|
|
52
|
+
}
|
|
53
|
+
function T(e) {
|
|
54
|
+
return e.calendar.getMinimumDayInMonth ? e.calendar.getMinimumDayInMonth(e) : 1;
|
|
55
|
+
}
|
|
56
|
+
function y(e, a) {
|
|
57
|
+
let n = o(e, a);
|
|
58
|
+
return e.subtract({
|
|
59
|
+
days: n
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function Y(e, a) {
|
|
63
|
+
return y(e, a).add({
|
|
64
|
+
days: 6
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const c = /* @__PURE__ */ new Map();
|
|
68
|
+
function x(e) {
|
|
69
|
+
if (Intl.Locale) {
|
|
70
|
+
let n = c.get(e);
|
|
71
|
+
return n || (n = new Intl.Locale(e).maximize().region, n && c.set(e, n)), n;
|
|
72
|
+
}
|
|
73
|
+
let a = e.split("-")[1];
|
|
74
|
+
return a === "u" ? void 0 : a;
|
|
75
|
+
}
|
|
76
|
+
function h(e) {
|
|
77
|
+
let a = x(e);
|
|
78
|
+
return a && s[a] || 0;
|
|
79
|
+
}
|
|
80
|
+
function J(e, a) {
|
|
81
|
+
let n = e.calendar.getDaysInMonth(e);
|
|
82
|
+
return Math.ceil((o($(e), a) + n) / 7);
|
|
83
|
+
}
|
|
84
|
+
function L(e, a) {
|
|
85
|
+
return e && a ? e.compare(a) <= 0 ? e : a : e || a;
|
|
86
|
+
}
|
|
87
|
+
function S(e, a) {
|
|
88
|
+
return e && a ? e.compare(a) >= 0 ? e : a : e || a;
|
|
24
89
|
}
|
|
25
90
|
export {
|
|
26
|
-
|
|
91
|
+
I as compareDate,
|
|
92
|
+
O as compareTime,
|
|
93
|
+
W as endOfMonth,
|
|
94
|
+
Y as endOfWeek,
|
|
95
|
+
o as getDayOfWeek,
|
|
96
|
+
k as getLocalTimeZone,
|
|
97
|
+
T as getMinimumDayInMonth,
|
|
98
|
+
w as getMinimumMonthInYear,
|
|
99
|
+
J as getWeeksInMonth,
|
|
100
|
+
D as isEqualDay,
|
|
101
|
+
m as isSameDay,
|
|
102
|
+
b as isToday,
|
|
103
|
+
S as maxDate,
|
|
104
|
+
L as minDate,
|
|
105
|
+
l as now,
|
|
106
|
+
$ as startOfMonth,
|
|
107
|
+
y as startOfWeek,
|
|
108
|
+
v as startOfYear,
|
|
109
|
+
p as today
|
|
27
110
|
};
|
package/index151.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("./index225.js"),s=require("./index150.js"),k=require("react"),v=require("./index158.js"),w=require("./index171.js"),r=require("@react-aria/i18n");function m(o,e){let{startDate:u=e.visibleRange.start,endDate:c=e.visibleRange.end}=o,{direction:t}=r.useLocale(),d=a=>{switch(a.key){case"Enter":case" ":a.preventDefault(),e.selectFocusedDate();break;case"PageUp":a.preventDefault(),a.stopPropagation(),e.focusPreviousSection(a.shiftKey);break;case"PageDown":a.preventDefault(),a.stopPropagation(),e.focusNextSection(a.shiftKey);break;case"End":a.preventDefault(),a.stopPropagation(),e.focusSectionEnd();break;case"Home":a.preventDefault(),a.stopPropagation(),e.focusSectionStart();break;case"ArrowLeft":a.preventDefault(),a.stopPropagation(),t==="rtl"?e.focusNextDay():e.focusPreviousDay();break;case"ArrowUp":a.preventDefault(),a.stopPropagation(),e.focusPreviousRow();break;case"ArrowRight":a.preventDefault(),a.stopPropagation(),t==="rtl"?e.focusPreviousDay():e.focusNextDay();break;case"ArrowDown":a.preventDefault(),a.stopPropagation(),e.focusNextRow();break;case"Escape":"setAnchorDate"in e&&(a.preventDefault(),e.setAnchorDate(null));break}},f=l.useVisibleRangeDescription(u,c,e.timeZone,!0),{ariaLabel:p,ariaLabelledBy:D}=l.hookData.get(e),b=w.useLabels({"aria-label":[p,f].filter(Boolean).join(", "),"aria-labelledby":D}),i=r.useDateFormatter({weekday:o.weekdayStyle||"narrow",timeZone:e.timeZone}),{locale:n}=r.useLocale(),y=k.useMemo(()=>{let a=s.startOfWeek(s.today(e.timeZone),n);return[...new Array(7).keys()].map(g=>{let P=a.add({days:g}).toDate(e.timeZone);return i.format(P)})},[n,e.timeZone,i]);return{gridProps:v.mergeProps(b,{role:"grid","aria-readonly":e.isReadOnly||void 0,"aria-disabled":e.isDisabled||void 0,"aria-multiselectable":"highlightedRange"in e||void 0,onKeyDown:d,onFocus:()=>e.setFocused(!0),onBlur:()=>e.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:y}}exports.useCalendarGrid=m;
|
package/index151.mjs
CHANGED
|
@@ -1,117 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { useVisibleRangeDescription as y, hookData as g } from "./index225.mjs";
|
|
2
|
+
import { startOfWeek as $, today as k } from "./index150.mjs";
|
|
3
|
+
import { useMemo as w } from "react";
|
|
4
|
+
import { mergeProps as P } from "./index158.mjs";
|
|
5
|
+
import { useLabels as v } from "./index171.mjs";
|
|
6
|
+
import { useLocale as n, useDateFormatter as h } from "@react-aria/i18n";
|
|
7
|
+
function B(r, e) {
|
|
8
|
+
let { startDate: l = e.visibleRange.start, endDate: s = e.visibleRange.end } = r, { direction: o } = n(), f = (a) => {
|
|
9
|
+
switch (a.key) {
|
|
10
|
+
case "Enter":
|
|
11
|
+
case " ":
|
|
12
|
+
a.preventDefault(), e.selectFocusedDate();
|
|
13
|
+
break;
|
|
14
|
+
case "PageUp":
|
|
15
|
+
a.preventDefault(), a.stopPropagation(), e.focusPreviousSection(a.shiftKey);
|
|
16
|
+
break;
|
|
17
|
+
case "PageDown":
|
|
18
|
+
a.preventDefault(), a.stopPropagation(), e.focusNextSection(a.shiftKey);
|
|
19
|
+
break;
|
|
20
|
+
case "End":
|
|
21
|
+
a.preventDefault(), a.stopPropagation(), e.focusSectionEnd();
|
|
22
|
+
break;
|
|
23
|
+
case "Home":
|
|
24
|
+
a.preventDefault(), a.stopPropagation(), e.focusSectionStart();
|
|
25
|
+
break;
|
|
26
|
+
case "ArrowLeft":
|
|
27
|
+
a.preventDefault(), a.stopPropagation(), o === "rtl" ? e.focusNextDay() : e.focusPreviousDay();
|
|
28
|
+
break;
|
|
29
|
+
case "ArrowUp":
|
|
30
|
+
a.preventDefault(), a.stopPropagation(), e.focusPreviousRow();
|
|
31
|
+
break;
|
|
32
|
+
case "ArrowRight":
|
|
33
|
+
a.preventDefault(), a.stopPropagation(), o === "rtl" ? e.focusPreviousDay() : e.focusNextDay();
|
|
34
|
+
break;
|
|
35
|
+
case "ArrowDown":
|
|
36
|
+
a.preventDefault(), a.stopPropagation(), e.focusNextRow();
|
|
37
|
+
break;
|
|
38
|
+
case "Escape":
|
|
39
|
+
"setAnchorDate" in e && (a.preventDefault(), e.setAnchorDate(null));
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}, d = y(l, s, e.timeZone, !0), { ariaLabel: c, ariaLabelledBy: p } = g.get(e), u = v({
|
|
43
|
+
"aria-label": [
|
|
44
|
+
c,
|
|
45
|
+
d
|
|
46
|
+
].filter(Boolean).join(", "),
|
|
47
|
+
"aria-labelledby": p
|
|
48
|
+
}), t = h({
|
|
49
|
+
weekday: r.weekdayStyle || "narrow",
|
|
50
|
+
timeZone: e.timeZone
|
|
51
|
+
}), { locale: i } = n(), b = w(() => {
|
|
52
|
+
let a = $(k(e.timeZone), i);
|
|
53
|
+
return [
|
|
54
|
+
...new Array(7).keys()
|
|
55
|
+
].map((D) => {
|
|
56
|
+
let m = a.add({
|
|
57
|
+
days: D
|
|
58
|
+
}).toDate(e.timeZone);
|
|
59
|
+
return t.format(m);
|
|
15
60
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]), E = p(() => X(f, d == null ? void 0 : d.end), [
|
|
22
|
-
f,
|
|
23
|
-
d
|
|
24
|
-
]), n = K({
|
|
25
|
-
...M,
|
|
26
|
-
value: e && e.start,
|
|
27
|
-
createCalendar: L,
|
|
28
|
-
locale: A,
|
|
29
|
-
visibleDuration: m,
|
|
30
|
-
minValue: _,
|
|
31
|
-
maxValue: E,
|
|
32
|
-
selectionAlignment: I
|
|
33
|
-
}), D = (t) => {
|
|
34
|
-
if (t && a.isDateUnavailable && !a.allowsNonContiguousRanges) {
|
|
35
|
-
const s = G(t, n, -1), o = G(t, n, 1);
|
|
36
|
-
v.current = {
|
|
37
|
-
start: s,
|
|
38
|
-
end: o
|
|
39
|
-
}, y(v.current);
|
|
40
|
-
} else
|
|
41
|
-
v.current = null, y(null);
|
|
42
|
-
}, [F, N] = g(n.visibleRange);
|
|
43
|
-
(!q(n.visibleRange.start, F.start) || !q(n.visibleRange.end, F.end)) && (D(r), N(n.visibleRange));
|
|
44
|
-
let R = (t) => {
|
|
45
|
-
t ? (V(t), D(t)) : (V(null), D(null));
|
|
46
|
-
}, b = r ? C(r, n.focusedDate) : e && C(e.start, e.end), P = (t) => {
|
|
47
|
-
if (a.isReadOnly) return;
|
|
48
|
-
const s = H(t, _, E), o = J(s, n.visibleRange.start, a.isDateUnavailable);
|
|
49
|
-
if (o)
|
|
50
|
-
if (!r) R(o);
|
|
51
|
-
else {
|
|
52
|
-
let x = C(r, o);
|
|
53
|
-
x && U({
|
|
54
|
-
start: B(x.start, e == null ? void 0 : e.start),
|
|
55
|
-
end: B(x.end, e == null ? void 0 : e.end)
|
|
56
|
-
}), R(null);
|
|
57
|
-
}
|
|
58
|
-
}, [O, j] = g(!1), { isDateUnavailable: $ } = a, w = p(() => !e || r ? !1 : $ && ($(e.start) || $(e.end)) ? !0 : h(e.start, c, f) || h(e.end, c, f), [
|
|
59
|
-
$,
|
|
60
|
-
e,
|
|
61
|
-
r,
|
|
62
|
-
c,
|
|
63
|
-
f
|
|
64
|
-
]), k = a.isInvalid || a.validationState === "invalid" || w;
|
|
61
|
+
}, [
|
|
62
|
+
i,
|
|
63
|
+
e.timeZone,
|
|
64
|
+
t
|
|
65
|
+
]);
|
|
65
66
|
return {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
gridProps: P(u, {
|
|
68
|
+
role: "grid",
|
|
69
|
+
"aria-readonly": e.isReadOnly || void 0,
|
|
70
|
+
"aria-disabled": e.isDisabled || void 0,
|
|
71
|
+
"aria-multiselectable": "highlightedRange" in e || void 0,
|
|
72
|
+
onKeyDown: f,
|
|
73
|
+
onFocus: () => e.setFocused(!0),
|
|
74
|
+
onBlur: () => e.setFocused(!1)
|
|
75
|
+
}),
|
|
76
|
+
headerProps: {
|
|
77
|
+
// Column headers are hidden to screen readers to make navigating with a touch screen reader easier.
|
|
78
|
+
// The day names are already included in the label of each cell, so there's no need to announce them twice.
|
|
79
|
+
"aria-hidden": !0
|
|
76
80
|
},
|
|
77
|
-
|
|
78
|
-
highlightDate(t) {
|
|
79
|
-
r && n.setFocusedDate(t);
|
|
80
|
-
},
|
|
81
|
-
isSelected(t) {
|
|
82
|
-
return !!(b && t.compare(b.start) >= 0 && t.compare(b.end) <= 0 && !n.isCellDisabled(t) && !n.isCellUnavailable(t));
|
|
83
|
-
},
|
|
84
|
-
isInvalid(t) {
|
|
85
|
-
var s, o;
|
|
86
|
-
return n.isInvalid(t) || h(t, (s = v.current) === null || s === void 0 ? void 0 : s.start, (o = v.current) === null || o === void 0 ? void 0 : o.end);
|
|
87
|
-
},
|
|
88
|
-
isDragging: O,
|
|
89
|
-
setDragging: j
|
|
81
|
+
weekDays: b
|
|
90
82
|
};
|
|
91
83
|
}
|
|
92
|
-
function C(a, l) {
|
|
93
|
-
return !a || !l ? null : (l.compare(a) < 0 && ([a, l] = [
|
|
94
|
-
l,
|
|
95
|
-
a
|
|
96
|
-
]), {
|
|
97
|
-
start: S(a),
|
|
98
|
-
end: S(l)
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function B(a, l) {
|
|
102
|
-
return a = T(a, (l == null ? void 0 : l.calendar) || new Q()), l && "hour" in l ? l.set(a) : a;
|
|
103
|
-
}
|
|
104
|
-
function G(a, l, u) {
|
|
105
|
-
let i = a.add({
|
|
106
|
-
days: u
|
|
107
|
-
});
|
|
108
|
-
for (; (u < 0 ? i.compare(l.visibleRange.start) >= 0 : i.compare(l.visibleRange.end) <= 0) && !l.isCellUnavailable(i); ) i = i.add({
|
|
109
|
-
days: u
|
|
110
|
-
});
|
|
111
|
-
if (l.isCellUnavailable(i)) return i.add({
|
|
112
|
-
days: -u
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
84
|
export {
|
|
116
|
-
|
|
85
|
+
B as useCalendarGrid
|
|
117
86
|
};
|
package/index152.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),r=require("./index150.js"),$=require("./index226.js"),F=require("@react-aria/focus"),I=require("./index158.js"),L=require("react"),T=require("react-aria"),t=require("./index64.js");function V({themeName:i="calendar",tokens:l,state:n,date:e}){const a=L.useRef(null),{cellProps:C,buttonProps:g,isSelected:c,isOutsideVisibleRange:m,isDisabled:u,formattedDate:y,isInvalid:d}=$.useCalendarCell({date:e},n,a),s=n==null?void 0:n.highlightedRange,f=s==null?void 0:s.start,h=s==null?void 0:s.end,D=s&&f?r.isSameDay(e,f):c,q=s&&h?r.isSameDay(e,h):c,{locale:p}=T.useLocale(),R=r.getDayOfWeek(e,p),S=c&&(D||R===0||e.day===1),b=c&&(q||R===6||e.day===e.calendar.getDaysInMonth(e)),{focusProps:x,isFocusVisible:P}=F.useFocusRing(),j=t(`${i}.cellContainer`,{...l,isFocusVisible:P}),v=t(`${i}.cell`,{...l,isSelected:c,isInvalid:d,isDisabled:u,isRoundedLeft:S,isRoundedRight:b}),O=t(`${i}.cellDate`,{...l,isSelected:c,isInvalid:d,isDisabled:u,isSelectionStart:D,isSelectionEnd:q});return o.jsx("td",{...C,"aria-disabled":!1,className:j,children:o.jsx("div",{...I.mergeProps(g,x),ref:a,hidden:m,className:v,children:o.jsx("div",{className:O,children:y})})})}module.exports=V;
|