@okam/stack-ui 1.32.1 → 1.32.2
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/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +53 -55
- 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/index124.js +1 -1
- package/index124.mjs +1 -1
- package/index125.js +1 -1
- package/index125.mjs +3 -3
- package/index126.js +1 -1
- package/index126.mjs +3 -3
- package/index130.js +1 -1
- package/index130.mjs +2 -2
- package/index133.js +1 -1
- package/index133.mjs +1 -1
- package/index138.js +1 -1
- package/index138.mjs +12 -46
- package/index139.js +1 -1
- package/index139.mjs +46 -241
- package/index140.js +1 -2
- package/index140.mjs +241 -13
- package/index141.js +2 -1
- package/index141.mjs +12 -29
- package/index142.js +1 -1
- package/index142.mjs +30 -52
- package/index143.js +1 -1
- package/index143.mjs +52 -12
- package/index145.js +1 -1
- package/index145.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 +1 -1
- package/index151.js +1 -1
- package/index151.mjs +3 -3
- package/index152.js +1 -1
- package/index152.mjs +20 -106
- package/index153.js +1 -1
- package/index153.mjs +107 -83
- package/index154.js +1 -1
- package/index154.mjs +83 -26
- package/index155.js +1 -1
- package/index155.mjs +25 -20
- 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 +1 -1
- package/index170.js +1 -1
- package/index170.mjs +1 -1
- package/index171.js +1 -1
- package/index171.mjs +1 -1
- package/index178.js +1 -1
- package/index178.mjs +1 -1
- package/index180.js +1 -1
- package/index180.mjs +2 -2
- package/index182.js +1 -1
- package/index182.mjs +1 -1
- package/index198.js +1 -1
- package/index198.mjs +70 -201
- package/index199.js +1 -1
- package/index199.mjs +91 -60
- package/index200.js +1 -1
- package/index200.mjs +151 -139
- package/index201.js +1 -1
- package/index201.mjs +72 -125
- package/index202.js +1 -1
- package/index202.mjs +38 -220
- package/index203.js +1 -1
- package/index203.mjs +5 -190
- package/index204.js +1 -1
- package/index204.mjs +60 -68
- package/index205.js +1 -1
- package/index205.mjs +53 -273
- package/index206.js +1 -1
- package/index206.mjs +191 -86
- package/index207.js +1 -1
- package/index207.mjs +56 -180
- package/index208.js +1 -1
- package/index208.mjs +134 -75
- package/index209.js +1 -1
- package/index209.mjs +118 -52
- package/index210.js +1 -1
- package/index210.mjs +214 -116
- package/index211.js +1 -1
- package/index211.mjs +181 -107
- package/index212.js +1 -1
- package/index212.mjs +61 -114
- package/index213.js +1 -1
- package/index213.mjs +272 -65
- package/index214.js +1 -1
- package/index214.mjs +93 -105
- package/index215.js +1 -1
- package/index215.mjs +183 -47
- package/index216.js +1 -1
- package/index216.mjs +77 -86
- package/index217.js +1 -1
- package/index217.mjs +53 -65
- package/index218.js +1 -1
- package/index218.mjs +122 -52
- package/index219.js +1 -1
- package/index219.mjs +111 -94
- package/index220.js +1 -5
- package/index220.mjs +117 -75
- package/index221.js +1 -1
- package/index221.mjs +63 -2016
- package/index222.js +1 -1
- package/index222.mjs +105 -54
- package/index223.js +1 -1
- package/index223.mjs +50 -186
- package/index224.js +1 -1
- package/index224.mjs +89 -68
- package/index225.js +1 -1
- package/index225.mjs +68 -93
- package/index226.js +1 -1
- package/index226.mjs +52 -151
- package/index227.js +1 -1
- package/index227.mjs +100 -72
- package/index228.js +5 -1
- package/index228.mjs +78 -40
- package/index229.js +1 -1
- package/index229.mjs +2025 -5
- package/index230.js +1 -1
- package/index230.mjs +59 -61
- package/index231.js +1 -1
- package/index231.mjs +187 -58
- package/index270.js +1 -1
- package/index270.mjs +44 -126
- package/index271.js +1 -1
- package/index271.mjs +9 -190
- package/index272.js +1 -1
- package/index272.mjs +16 -10
- package/index273.js +1 -1
- package/index273.mjs +16 -4
- package/index274.js +1 -1
- package/index274.mjs +16 -37
- package/index275.js +1 -1
- package/index275.mjs +16 -6
- package/index276.js +1 -1
- package/index276.mjs +16 -30
- package/index277.js +1 -1
- package/index277.mjs +16 -7
- package/index278.js +1 -1
- package/index278.mjs +16 -49
- package/index279.js +1 -1
- package/index279.mjs +16 -10
- package/index280.js +1 -1
- package/index280.mjs +15 -15
- package/index281.js +1 -1
- package/index281.mjs +15 -15
- package/index282.js +1 -1
- package/index282.mjs +12 -12
- package/index283.js +1 -1
- package/index283.mjs +15 -15
- package/index284.js +1 -1
- package/index284.mjs +15 -15
- package/index285.js +1 -1
- package/index285.mjs +15 -15
- package/index286.js +1 -1
- package/index286.mjs +15 -15
- package/index287.js +1 -1
- package/index287.mjs +15 -15
- package/index288.js +1 -1
- package/index288.mjs +15 -15
- package/index289.js +1 -1
- package/index289.mjs +15 -15
- package/index290.js +1 -1
- package/index290.mjs +12 -12
- package/index291.js +1 -1
- package/index291.mjs +15 -15
- package/index292.js +1 -1
- package/index292.mjs +15 -15
- package/index293.js +1 -1
- package/index293.mjs +15 -15
- package/index294.js +1 -1
- package/index294.mjs +12 -12
- package/index295.js +1 -1
- package/index295.mjs +15 -15
- package/index296.js +1 -1
- package/index296.mjs +15 -15
- package/index297.js +1 -1
- package/index297.mjs +15 -15
- 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 +15 -15
- 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 +15 -15
- package/index304.js +1 -1
- package/index304.mjs +15 -15
- package/index305.js +1 -1
- package/index305.mjs +12 -12
- package/index306.js +1 -1
- package/index306.mjs +130 -15
- package/index307.js +1 -1
- package/index307.mjs +191 -16
- package/index308.js +1 -1
- package/index308.mjs +10 -16
- package/index309.js +1 -1
- package/index309.mjs +4 -16
- package/index310.js +1 -1
- package/index310.mjs +37 -16
- package/index311.js +1 -1
- package/index311.mjs +6 -16
- package/index312.js +1 -1
- package/index312.mjs +30 -16
- package/index313.js +1 -1
- package/index313.mjs +7 -16
- package/index315.js +1 -1
- package/index315.mjs +1 -1
- package/index318.js +1 -1
- package/index318.mjs +1 -1
- package/index325.js +1 -1
- package/index325.mjs +1 -1
- package/index330.js +1 -1
- package/index330.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/index99.js +1 -1
- package/index99.mjs +1 -1
- package/package.json +1 -1
package/index170.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CalendarDate as C, ZonedDateTime as b, CalendarDateTime as U } from "./index169.mjs";
|
|
2
2
|
import { constrain as M } from "./index185.mjs";
|
|
3
3
|
import { GregorianCalendar as h, getExtendedYear as p } from "./index184.mjs";
|
|
4
|
-
import { getLocalTimeZone as y } from "./
|
|
4
|
+
import { getLocalTimeZone as y } from "./index153.mjs";
|
|
5
5
|
function u(e) {
|
|
6
6
|
e = $(e, new h());
|
|
7
7
|
let t = p(e.era, e.year);
|
package/index171.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index143.js");function d(a,t){let{id:i,"aria-label":l,"aria-labelledby":e}=a;return i=r.useId(i),e&&l?e=[...new Set([i,...e.trim().split(/\s+/)])].join(" "):e&&(e=e.trim().split(/\s+/).join(" ")),!l&&!e&&t&&(l=t),{id:i,"aria-label":l,"aria-labelledby":e}}exports.useLabels=d;
|
package/index171.mjs
CHANGED
package/index178.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index346.js"),q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index346.js"),q=require("./index270.js"),f=require("react"),F=require("./index332.js"),S=require("./index336.js"),I=require("@react-aria/i18n");function M(o){return o&&o.__esModule?o.default:o}function R(o){const v=f.useRef(void 0);let{value:n,textValue:w,minValue:a,maxValue:u,isDisabled:T,isReadOnly:P,isRequired:B,onIncrement:t,onIncrementPage:s,onDecrement:r,onDecrementPage:l,onDecrementToMin:c,onIncrementToMax:d}=o;const L=I.useLocalizedStringFormatter(M(A),"@react-aria/spinbutton"),i=()=>clearTimeout(v.current);f.useEffect(()=>()=>i(),[]);let k=e=>{if(!(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||P))switch(e.key){case"PageUp":if(s){e.preventDefault(),s==null||s();break}case"ArrowUp":case"Up":t&&(e.preventDefault(),t==null||t());break;case"PageDown":if(l){e.preventDefault(),l==null||l();break}case"ArrowDown":case"Down":r&&(e.preventDefault(),r==null||r());break;case"Home":c&&(e.preventDefault(),c==null||c());break;case"End":d&&(e.preventDefault(),d==null||d());break}},m=f.useRef(!1),p=()=>{m.current=!0},D=()=>{m.current=!1},b=w===""?L.format("Empty"):(w||`${n}`).replace("-","−");f.useEffect(()=>{m.current&&(q.clearAnnouncer("assertive"),q.announce(b,"assertive"))},[b]);const y=S.useEffectEvent(e=>{i(),t==null||t(),v.current=window.setTimeout(()=>{(u===void 0||isNaN(u)||n===void 0||isNaN(n)||n<u)&&y(60)},e)}),x=S.useEffectEvent(e=>{i(),r==null||r(),v.current=window.setTimeout(()=>{(a===void 0||isNaN(a)||n===void 0||isNaN(n)||n>a)&&x(60)},e)});let E=e=>{e.preventDefault()},{addGlobalListener:g,removeAllGlobalListeners:N}=F.useGlobalListeners();return{spinButtonProps:{role:"spinbutton","aria-valuenow":n!==void 0&&!isNaN(n)?n:void 0,"aria-valuetext":b,"aria-valuemin":a,"aria-valuemax":u,"aria-disabled":T||void 0,"aria-readonly":P||void 0,"aria-required":B||void 0,onKeyDown:k,onFocus:p,onBlur:D},incrementButtonProps:{onPressStart:()=>{y(400),g(window,"contextmenu",E)},onPressEnd:()=>{i(),N()},onFocus:p,onBlur:D},decrementButtonProps:{onPressStart:()=>{x(400),g(window,"contextmenu",E)},onPressEnd:()=>{i(),N()},onFocus:p,onBlur:D}}}exports.useSpinButton=R;
|
package/index178.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import V from "./index346.mjs";
|
|
2
|
-
import { clearAnnouncer as A, announce as K } from "./
|
|
2
|
+
import { clearAnnouncer as A, announce as K } from "./index270.mjs";
|
|
3
3
|
import { useRef as g, useEffect as B } from "react";
|
|
4
4
|
import { useGlobalListeners as L } from "./index332.mjs";
|
|
5
5
|
import { useEffectEvent as T } from "./index336.mjs";
|
package/index180.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index266.js"),F=require("./index169.js"),s=require("./index170.js"),b=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index266.js"),F=require("./index169.js"),s=require("./index170.js"),b=require("./index153.js"),I=require("./index181.js"),y=require("./index267.js"),_=require("./index268.js"),$=require("./index156.js"),p=require("react");function O(e){return e&&e.__esModule?e.default:e}const w=new y.LocalizedStringDictionary(O(v));function L(){return typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US"}function h(e,t,a,r,n){let i=e!=null&&a!=null&&e.compare(a)>0,o=e!=null&&t!=null&&e.compare(t)<0,l=e!=null&&(r==null?void 0:r(e))||!1,d=i||o||l,u=[];if(d){let f=L(),c=y.LocalizedStringDictionary.getGlobalDictionaryForPackage("@react-stately/datepicker")||w,m=new _.LocalizedStringFormatter(f,c),g=new I.DateFormatter(f,S({},n)),D=g.resolvedOptions().timeZone;o&&t!=null&&u.push(m.format("rangeUnderflow",{minValue:g.format(t.toDate(D))})),i&&a!=null&&u.push(m.format("rangeOverflow",{maxValue:g.format(a.toDate(D))})),l&&u.push(m.format("unavailableDate"))}return{isInvalid:d,validationErrors:u,validationDetails:{badInput:l,customError:!1,patternMismatch:!1,rangeOverflow:i,rangeUnderflow:o,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!d}}}function x(e,t,a,r,n){var i;let o=h((i=e==null?void 0:e.start)!==null&&i!==void 0?i:null,t,a,r,n);var l;let d=h((l=e==null?void 0:e.end)!==null&&l!==void 0?l:null,t,a,r,n),u=$.mergeValidation(o,d);if((e==null?void 0:e.end)!=null&&e.start!=null&&e.end.compare(e.start)<0){let f=y.LocalizedStringDictionary.getGlobalDictionaryForPackage("@react-stately/datepicker")||w;u=$.mergeValidation(u,{isInvalid:!0,validationErrors:[f.getStringForLocale("rangeReversed",L())],validationDetails:{...$.VALID_VALIDITY_STATE,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return u}const q={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},E={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function S(e,t){e={...t.shouldForceLeadingZeros?E:q,...e};let r=t.granularity||"minute",n=Object.keys(e);var i;let o=n.indexOf((i=t.maxGranularity)!==null&&i!==void 0?i:"year");o<0&&(o=0);let l=n.indexOf(r);if(l<0&&(l=2),o>l)throw new Error("maxGranularity must be greater than granularity");let d=n.slice(o,l+1).reduce((f,c)=>(f[c]=e[c],f),{});return t.hourCycle!=null&&(d.hour12=t.hourCycle===12),d.timeZone=t.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&t.timeZone&&!t.hideTimeZone&&(d.timeZoneName="short"),t.showEra&&o===0&&(d.era="short"),d}function Z(e){return e&&"hour"in e?e:new F.Time}function T(e,t){if(e===null)return null;if(e)return s.toCalendar(e,t)}function C(e,t,a,r){if(e)return T(e,a);let n=s.toCalendar(b.now(r??b.getLocalTimeZone()).set({hour:0,minute:0,second:0,millisecond:0}),a);return t==="year"||t==="month"||t==="day"?s.toCalendarDate(n):r?n:s.toCalendarDateTime(n)}function P(e,t){let a=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw new Error("Invalid granularity "+t+" for value "+e.toString());let[n,i]=p.useState([r,a]);e&&(n[0]!==r||n[1]!==a)&&i([r,a]),t||(t=e?r:n[0]);let o=e?a:n[1];return[t,o]}exports.convertValue=T;exports.createPlaceholderDate=C;exports.getFormatOptions=S;exports.getPlaceholderTime=Z;exports.getRangeValidationResult=x;exports.getValidationResult=h;exports.useDefaultProps=P;
|
package/index180.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import w from "./index266.mjs";
|
|
2
2
|
import { Time as D } from "./index169.mjs";
|
|
3
3
|
import { toCalendar as h, toCalendarDate as T, toCalendarDateTime as I } from "./index170.mjs";
|
|
4
|
-
import { now as _, getLocalTimeZone as v } from "./
|
|
4
|
+
import { now as _, getLocalTimeZone as v } from "./index153.mjs";
|
|
5
5
|
import { DateFormatter as L } from "./index181.mjs";
|
|
6
6
|
import { LocalizedStringDictionary as m } from "./index267.mjs";
|
|
7
7
|
import { LocalizedStringFormatter as F } from "./index268.mjs";
|
|
8
|
-
import { mergeValidation as b, VALID_VALIDITY_STATE as O } from "./
|
|
8
|
+
import { mergeValidation as b, VALID_VALIDITY_STATE as O } from "./index156.mjs";
|
|
9
9
|
import { useState as E } from "react";
|
|
10
10
|
function S(e) {
|
|
11
11
|
return e && e.__esModule ? e.default : e;
|
package/index182.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),c=require("./index157.js");function r(t){let[n,e]=c.useControlledState(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const o=l.useCallback(()=>{e(!0)},[e]),s=l.useCallback(()=>{e(!1)},[e]),a=l.useCallback(()=>{e(!n)},[e,n]);return{isOpen:n,setOpen:e,open:o,close:s,toggle:a}}exports.useOverlayTriggerState=r;
|
package/index182.mjs
CHANGED
package/index198.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index199.js"),m=require("./index201.js"),c=require("./index270.js"),q=require("./index143.js"),R=require("./index158.js"),S=require("./index165.js"),p=require("./index171.js"),b=require("./index271.js"),x=require("@react-aria/i18n"),f=require("react");function y(e){return e&&e.__esModule?e.default:e}function M(e,i){let l=x.useLocalizedStringFormatter(y(m),"@react-aria/calendar"),g=S.filterDOMProps(e),D=a.useVisibleRangeDescription(i.visibleRange.start,i.visibleRange.end,i.timeZone,!1),s=a.useVisibleRangeDescription(i.visibleRange.start,i.visibleRange.end,i.timeZone,!0);b.useUpdateEffect(()=>{i.isFocused||c.announce(s)},[s]);let r=a.useSelectedDateDescription(i);b.useUpdateEffect(()=>{r&&c.announce(r,"polite",4e3)},[r]);let t=q.useSlotId([!!e.errorMessage,e.isInvalid,e.validationState]);a.hookData.set(i,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:t,selectedDateDescription:r});let[v,n]=f.useState(!1),o=e.isDisabled||i.isNextVisibleRangeInvalid();o&&v&&(n(!1),i.setFocused(!0));let[P,u]=f.useState(!1),d=e.isDisabled||i.isPreviousVisibleRangeInvalid();d&&P&&(u(!1),i.setFocused(!0));let F=p.useLabels({id:e.id,"aria-label":[e["aria-label"],s].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]});return{calendarProps:R.mergeProps(g,F,{role:"application","aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>i.focusNextPage(),"aria-label":l.format("next"),isDisabled:o,onFocusChange:n},prevButtonProps:{onPress:()=>i.focusPreviousPage(),"aria-label":l.format("previous"),isDisabled:d,onFocusChange:u},errorMessageProps:{id:t},title:D}}exports.useCalendarBase=M;
|
package/index198.mjs
CHANGED
|
@@ -1,206 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { useVisibleRangeDescription as n, useSelectedDateDescription as D, hookData as v } from "./index199.mjs";
|
|
2
|
+
import P from "./index201.mjs";
|
|
3
|
+
import { announce as c } from "./index270.mjs";
|
|
4
|
+
import { useSlotId as F } from "./index143.mjs";
|
|
5
|
+
import { mergeProps as R } from "./index158.mjs";
|
|
6
|
+
import { filterDOMProps as y } from "./index165.mjs";
|
|
7
|
+
import { useLabels as B } from "./index171.mjs";
|
|
8
|
+
import { useUpdateEffect as f } from "./index271.mjs";
|
|
9
|
+
import { useLocalizedStringFormatter as I } from "@react-aria/i18n";
|
|
10
|
+
import { useState as u } from "react";
|
|
11
|
+
function M(e) {
|
|
12
|
+
return e && e.__esModule ? e.default : e;
|
|
13
|
+
}
|
|
14
|
+
function z(e, a) {
|
|
15
|
+
let o = I(M(P), "@react-aria/calendar"), $ = y(e), m = n(a.visibleRange.start, a.visibleRange.end, a.timeZone, !1), r = n(a.visibleRange.start, a.visibleRange.end, a.timeZone, !0);
|
|
16
|
+
f(() => {
|
|
17
|
+
a.isFocused || c(r);
|
|
18
|
+
}, [
|
|
19
|
+
r
|
|
20
|
+
]);
|
|
21
|
+
let i = D(a);
|
|
22
|
+
f(() => {
|
|
23
|
+
i && c(i, "polite", 4e3);
|
|
24
|
+
}, [
|
|
25
|
+
i
|
|
26
|
+
]);
|
|
27
|
+
let l = F([
|
|
28
|
+
!!e.errorMessage,
|
|
29
|
+
e.isInvalid,
|
|
30
|
+
e.validationState
|
|
31
|
+
]);
|
|
32
|
+
v.set(a, {
|
|
33
|
+
ariaLabel: e["aria-label"],
|
|
34
|
+
ariaLabelledBy: e["aria-labelledby"],
|
|
35
|
+
errorMessageId: l,
|
|
36
|
+
selectedDateDescription: i
|
|
21
37
|
});
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
e.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function G(i, a) {
|
|
34
|
-
const r = e.params.virtual;
|
|
35
|
-
if (r.cache && e.virtual.cache[a])
|
|
36
|
-
return e.virtual.cache[a];
|
|
37
|
-
let s;
|
|
38
|
-
return r.renderSlide ? (s = r.renderSlide.call(e, i, a), typeof s == "string" && ($.innerHTML = s, s = $.children[0])) : e.isElement ? s = I("swiper-slide") : s = I("div", e.params.slideClass), s.setAttribute("data-swiper-slide-index", a), r.renderSlide || (s.innerHTML = i), r.cache && (e.virtual.cache[a] = s), s;
|
|
39
|
-
}
|
|
40
|
-
function o(i, a) {
|
|
41
|
-
const {
|
|
42
|
-
slidesPerView: r,
|
|
43
|
-
slidesPerGroup: s,
|
|
44
|
-
centeredSlides: d,
|
|
45
|
-
loop: n,
|
|
46
|
-
initialSlide: w
|
|
47
|
-
} = e.params;
|
|
48
|
-
if (a && !n && w > 0)
|
|
49
|
-
return;
|
|
50
|
-
const {
|
|
51
|
-
addSlidesBefore: m,
|
|
52
|
-
addSlidesAfter: g
|
|
53
|
-
} = e.params.virtual, {
|
|
54
|
-
from: P,
|
|
55
|
-
to: E,
|
|
56
|
-
slides: c,
|
|
57
|
-
slidesGrid: F,
|
|
58
|
-
offset: N
|
|
59
|
-
} = e.virtual;
|
|
60
|
-
e.params.cssMode || e.updateActiveIndex();
|
|
61
|
-
const b = e.activeIndex || 0;
|
|
62
|
-
let A;
|
|
63
|
-
e.rtlTranslate ? A = "right" : A = e.isHorizontal() ? "left" : "top";
|
|
64
|
-
let x, f;
|
|
65
|
-
d ? (x = Math.floor(r / 2) + s + g, f = Math.floor(r / 2) + s + m) : (x = r + (s - 1) + g, f = (n ? r : s) + m);
|
|
66
|
-
let u = b - f, p = b + x;
|
|
67
|
-
n || (u = Math.max(u, 0), p = Math.min(p, c.length - 1));
|
|
68
|
-
let h = (e.slidesGrid[u] || 0) - (e.slidesGrid[0] || 0);
|
|
69
|
-
n && b >= f ? (u -= f, d || (h += e.slidesGrid[0])) : n && b < f && (u = -f, d && (h += e.slidesGrid[0])), Object.assign(e.virtual, {
|
|
70
|
-
from: u,
|
|
71
|
-
to: p,
|
|
72
|
-
offset: h,
|
|
73
|
-
slidesGrid: e.slidesGrid,
|
|
74
|
-
slidesBefore: f,
|
|
75
|
-
slidesAfter: x
|
|
76
|
-
});
|
|
77
|
-
function j() {
|
|
78
|
-
e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), T("virtualUpdate");
|
|
79
|
-
}
|
|
80
|
-
if (P === u && E === p && !i) {
|
|
81
|
-
e.slidesGrid !== F && h !== N && e.slides.forEach((t) => {
|
|
82
|
-
t.style[A] = `${h - Math.abs(e.cssOverflowAdjustment())}px`;
|
|
83
|
-
}), e.updateProgress(), T("virtualUpdate");
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (e.params.virtual.renderExternal) {
|
|
87
|
-
e.params.virtual.renderExternal.call(e, {
|
|
88
|
-
offset: h,
|
|
89
|
-
from: u,
|
|
90
|
-
to: p,
|
|
91
|
-
slides: function() {
|
|
92
|
-
const l = [];
|
|
93
|
-
for (let v = u; v <= p; v += 1)
|
|
94
|
-
l.push(c[v]);
|
|
95
|
-
return l;
|
|
96
|
-
}()
|
|
97
|
-
}), e.params.virtual.renderExternalUpdate ? j() : T("virtualUpdate");
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const S = [], O = [], y = (t) => {
|
|
101
|
-
let l = t;
|
|
102
|
-
return t < 0 ? l = c.length + t : l >= c.length && (l = l - c.length), l;
|
|
103
|
-
};
|
|
104
|
-
if (i)
|
|
105
|
-
e.slides.filter((t) => t.matches(`.${e.params.slideClass}, swiper-slide`)).forEach((t) => {
|
|
106
|
-
t.remove();
|
|
107
|
-
});
|
|
108
|
-
else
|
|
109
|
-
for (let t = P; t <= E; t += 1)
|
|
110
|
-
if (t < u || t > p) {
|
|
111
|
-
const l = y(t);
|
|
112
|
-
e.slides.filter((v) => v.matches(`.${e.params.slideClass}[data-swiper-slide-index="${l}"], swiper-slide[data-swiper-slide-index="${l}"]`)).forEach((v) => {
|
|
113
|
-
v.remove();
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
const R = n ? -c.length : 0, _ = n ? c.length * 2 : c.length;
|
|
117
|
-
for (let t = R; t < _; t += 1)
|
|
118
|
-
if (t >= u && t <= p) {
|
|
119
|
-
const l = y(t);
|
|
120
|
-
typeof E > "u" || i ? O.push(l) : (t > E && O.push(l), t < P && S.push(l));
|
|
121
|
-
}
|
|
122
|
-
if (O.forEach((t) => {
|
|
123
|
-
e.slidesEl.append(G(c[t], t));
|
|
124
|
-
}), n)
|
|
125
|
-
for (let t = S.length - 1; t >= 0; t -= 1) {
|
|
126
|
-
const l = S[t];
|
|
127
|
-
e.slidesEl.prepend(G(c[l], l));
|
|
128
|
-
}
|
|
129
|
-
else
|
|
130
|
-
S.sort((t, l) => l - t), S.forEach((t) => {
|
|
131
|
-
e.slidesEl.prepend(G(c[t], t));
|
|
132
|
-
});
|
|
133
|
-
K(e.slidesEl, ".swiper-slide, swiper-slide").forEach((t) => {
|
|
134
|
-
t.style[A] = `${h - Math.abs(e.cssOverflowAdjustment())}px`;
|
|
135
|
-
}), j();
|
|
136
|
-
}
|
|
137
|
-
function H(i) {
|
|
138
|
-
if (typeof i == "object" && "length" in i)
|
|
139
|
-
for (let a = 0; a < i.length; a += 1)
|
|
140
|
-
i[a] && e.virtual.slides.push(i[a]);
|
|
141
|
-
else
|
|
142
|
-
e.virtual.slides.push(i);
|
|
143
|
-
o(!0);
|
|
144
|
-
}
|
|
145
|
-
function L(i) {
|
|
146
|
-
const a = e.activeIndex;
|
|
147
|
-
let r = a + 1, s = 1;
|
|
148
|
-
if (Array.isArray(i)) {
|
|
149
|
-
for (let d = 0; d < i.length; d += 1)
|
|
150
|
-
i[d] && e.virtual.slides.unshift(i[d]);
|
|
151
|
-
r = a + i.length, s = i.length;
|
|
152
|
-
} else
|
|
153
|
-
e.virtual.slides.unshift(i);
|
|
154
|
-
if (e.params.virtual.cache) {
|
|
155
|
-
const d = e.virtual.cache, n = {};
|
|
156
|
-
Object.keys(d).forEach((w) => {
|
|
157
|
-
const m = d[w], g = m.getAttribute("data-swiper-slide-index");
|
|
158
|
-
g && m.setAttribute("data-swiper-slide-index", parseInt(g, 10) + s), n[parseInt(w, 10) + s] = m;
|
|
159
|
-
}), e.virtual.cache = n;
|
|
160
|
-
}
|
|
161
|
-
o(!0), e.slideTo(r, 0);
|
|
162
|
-
}
|
|
163
|
-
function V(i) {
|
|
164
|
-
if (typeof i > "u" || i === null) return;
|
|
165
|
-
let a = e.activeIndex;
|
|
166
|
-
if (Array.isArray(i))
|
|
167
|
-
for (let r = i.length - 1; r >= 0; r -= 1)
|
|
168
|
-
e.params.virtual.cache && (delete e.virtual.cache[i[r]], Object.keys(e.virtual.cache).forEach((s) => {
|
|
169
|
-
s > i && (e.virtual.cache[s - 1] = e.virtual.cache[s], e.virtual.cache[s - 1].setAttribute("data-swiper-slide-index", s - 1), delete e.virtual.cache[s]);
|
|
170
|
-
})), e.virtual.slides.splice(i[r], 1), i[r] < a && (a -= 1), a = Math.max(a, 0);
|
|
171
|
-
else
|
|
172
|
-
e.params.virtual.cache && (delete e.virtual.cache[i], Object.keys(e.virtual.cache).forEach((r) => {
|
|
173
|
-
r > i && (e.virtual.cache[r - 1] = e.virtual.cache[r], e.virtual.cache[r - 1].setAttribute("data-swiper-slide-index", r - 1), delete e.virtual.cache[r]);
|
|
174
|
-
})), e.virtual.slides.splice(i, 1), i < a && (a -= 1), a = Math.max(a, 0);
|
|
175
|
-
o(!0), e.slideTo(a, 0);
|
|
176
|
-
}
|
|
177
|
-
function D() {
|
|
178
|
-
e.virtual.slides = [], e.params.virtual.cache && (e.virtual.cache = {}), o(!0), e.slideTo(0, 0);
|
|
179
|
-
}
|
|
180
|
-
M("beforeInit", () => {
|
|
181
|
-
if (!e.params.virtual.enabled) return;
|
|
182
|
-
let i;
|
|
183
|
-
if (typeof e.passedParams.virtual.slides > "u") {
|
|
184
|
-
const a = [...e.slidesEl.children].filter((r) => r.matches(`.${e.params.slideClass}, swiper-slide`));
|
|
185
|
-
a && a.length && (e.virtual.slides = [...a], i = !0, a.forEach((r, s) => {
|
|
186
|
-
r.setAttribute("data-swiper-slide-index", s), e.virtual.cache[s] = r, r.remove();
|
|
187
|
-
}));
|
|
188
|
-
}
|
|
189
|
-
i || (e.virtual.slides = e.params.virtual.slides), e.classNames.push(`${e.params.containerModifierClass}virtual`), e.params.watchSlidesProgress = !0, e.originalParams.watchSlidesProgress = !0, o(!1, !0);
|
|
190
|
-
}), M("setTranslate", () => {
|
|
191
|
-
e.params.virtual.enabled && (e.params.cssMode && !e._immediateVirtual ? (clearTimeout(C), C = setTimeout(() => {
|
|
192
|
-
o();
|
|
193
|
-
}, 100)) : o());
|
|
194
|
-
}), M("init update resize", () => {
|
|
195
|
-
e.params.virtual.enabled && e.params.cssMode && J(e.wrapperEl, "--swiper-virtual-size", `${e.virtualSize}px`);
|
|
196
|
-
}), Object.assign(e.virtual, {
|
|
197
|
-
appendSlide: H,
|
|
198
|
-
prependSlide: L,
|
|
199
|
-
removeSlide: V,
|
|
200
|
-
removeAllSlides: D,
|
|
201
|
-
update: o
|
|
38
|
+
let [p, s] = u(!1), t = e.isDisabled || a.isNextVisibleRangeInvalid();
|
|
39
|
+
t && p && (s(!1), a.setFocused(!0));
|
|
40
|
+
let [g, d] = u(!1), b = e.isDisabled || a.isPreviousVisibleRangeInvalid();
|
|
41
|
+
b && g && (d(!1), a.setFocused(!0));
|
|
42
|
+
let x = B({
|
|
43
|
+
id: e.id,
|
|
44
|
+
"aria-label": [
|
|
45
|
+
e["aria-label"],
|
|
46
|
+
r
|
|
47
|
+
].filter(Boolean).join(", "),
|
|
48
|
+
"aria-labelledby": e["aria-labelledby"]
|
|
202
49
|
});
|
|
50
|
+
return {
|
|
51
|
+
calendarProps: R($, x, {
|
|
52
|
+
role: "application",
|
|
53
|
+
"aria-describedby": e["aria-describedby"] || void 0
|
|
54
|
+
}),
|
|
55
|
+
nextButtonProps: {
|
|
56
|
+
onPress: () => a.focusNextPage(),
|
|
57
|
+
"aria-label": o.format("next"),
|
|
58
|
+
isDisabled: t,
|
|
59
|
+
onFocusChange: s
|
|
60
|
+
},
|
|
61
|
+
prevButtonProps: {
|
|
62
|
+
onPress: () => a.focusPreviousPage(),
|
|
63
|
+
"aria-label": o.format("previous"),
|
|
64
|
+
isDisabled: b,
|
|
65
|
+
onFocusChange: d
|
|
66
|
+
},
|
|
67
|
+
errorMessageProps: {
|
|
68
|
+
id: l
|
|
69
|
+
},
|
|
70
|
+
title: m
|
|
71
|
+
};
|
|
203
72
|
}
|
|
204
73
|
export {
|
|
205
|
-
|
|
74
|
+
z as useCalendarBase
|
|
206
75
|
};
|
package/index199.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index201.js"),f=require("./index153.js"),c=require("@react-aria/i18n"),$=require("react");function p(e){return e&&e.__esModule?e.default:e}const y=new WeakMap;function d(e){return(e==null?void 0:e.calendar.identifier)==="gregory"&&e.era==="BC"?"short":void 0}function R(e){let a=c.useLocalizedStringFormatter(p(h),"@react-aria/calendar"),r,t;var l;"highlightedRange"in e?{start:r,end:t}=e.highlightedRange||{}:r=t=(l=e.value)!==null&&l!==void 0?l:void 0;let n=c.useDateFormatter({weekday:"long",month:"long",year:"numeric",day:"numeric",era:d(r)||d(t),timeZone:e.timeZone}),o="anchorDate"in e?e.anchorDate:null;return $.useMemo(()=>{if(!o&&r&&t)if(f.isSameDay(r,t)){let u=n.format(r.toDate(e.timeZone));return a.format("selectedDateDescription",{date:u})}else{let u=g(n,a,r,t,e.timeZone);return a.format("selectedRangeDescription",{dateRange:u})}return""},[r,t,o,e.timeZone,a,n])}function F(e,a,r,t){let l=c.useLocalizedStringFormatter(p(h),"@react-aria/calendar"),n=d(e)||d(a),o=c.useDateFormatter({month:"long",year:"numeric",era:n,calendar:e.calendar.identifier,timeZone:r}),u=c.useDateFormatter({month:"long",year:"numeric",day:"numeric",era:n,calendar:e.calendar.identifier,timeZone:r});return $.useMemo(()=>{if(f.isSameDay(e,f.startOfMonth(e))){if(f.isSameDay(a,f.endOfMonth(e)))return o.format(e.toDate(r));if(f.isSameDay(a,f.endOfMonth(a)))return t?g(o,l,e,a,r):o.formatRange(e.toDate(r),a.toDate(r))}return t?g(u,l,e,a,r):u.formatRange(e.toDate(r),a.toDate(r))},[e,a,o,u,l,r,t])}function g(e,a,r,t,l){let n=e.formatRangeToParts(r.toDate(l),t.toDate(l)),o=-1;for(let i=0;i<n.length;i++){let m=n[i];if(m.source==="shared"&&m.type==="literal")o=i;else if(m.source==="endRange")break}let u="",s="";for(let i=0;i<n.length;i++)i<o?u+=n[i].value:i>o&&(s+=n[i].value);return a.format("dateRange",{startDate:u,endDate:s})}exports.getEraFormat=d;exports.hookData=y;exports.useSelectedDateDescription=R;exports.useVisibleRangeDescription=F;
|
package/index199.mjs
CHANGED
|
@@ -1,67 +1,98 @@
|
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
s && (n.left -= p.scrollLeft);
|
|
37
|
-
const P = [[n.left, n.top], [n.left + D, n.top], [n.left, n.top + E], [n.left + D, n.top + E]];
|
|
38
|
-
for (let w = 0; w < P.length; w += 1) {
|
|
39
|
-
const l = P[w];
|
|
40
|
-
if (l[0] >= 0 && l[0] <= N && l[1] >= 0 && l[1] <= A) {
|
|
41
|
-
if (l[0] === 0 && l[1] === 0) continue;
|
|
42
|
-
h = !0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (!h) return;
|
|
1
|
+
import s from "./index201.mjs";
|
|
2
|
+
import { isSameDay as c, startOfMonth as x, endOfMonth as p } from "./index153.mjs";
|
|
3
|
+
import { useLocalizedStringFormatter as h, useDateFormatter as m } from "@react-aria/i18n";
|
|
4
|
+
import { useMemo as R } from "react";
|
|
5
|
+
function b(e) {
|
|
6
|
+
return e && e.__esModule ? e.default : e;
|
|
7
|
+
}
|
|
8
|
+
const k = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
function d(e) {
|
|
10
|
+
return (e == null ? void 0 : e.calendar.identifier) === "gregory" && e.era === "BC" ? "short" : void 0;
|
|
11
|
+
}
|
|
12
|
+
function D(e) {
|
|
13
|
+
let a = h(b(s), "@react-aria/calendar"), r, t;
|
|
14
|
+
var i;
|
|
15
|
+
"highlightedRange" in e ? { start: r, end: t } = e.highlightedRange || {} : r = t = (i = e.value) !== null && i !== void 0 ? i : void 0;
|
|
16
|
+
let o = m({
|
|
17
|
+
weekday: "long",
|
|
18
|
+
month: "long",
|
|
19
|
+
year: "numeric",
|
|
20
|
+
day: "numeric",
|
|
21
|
+
era: d(r) || d(t),
|
|
22
|
+
timeZone: e.timeZone
|
|
23
|
+
}), n = "anchorDate" in e ? e.anchorDate : null;
|
|
24
|
+
return R(() => {
|
|
25
|
+
if (!n && r && t)
|
|
26
|
+
if (c(r, t)) {
|
|
27
|
+
let f = o.format(r.toDate(e.timeZone));
|
|
28
|
+
return a.format("selectedDateDescription", {
|
|
29
|
+
date: f
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
let f = g(o, a, r, t, e.timeZone);
|
|
33
|
+
return a.format("selectedRangeDescription", {
|
|
34
|
+
dateRange: f
|
|
35
|
+
});
|
|
46
36
|
}
|
|
47
|
-
|
|
37
|
+
return "";
|
|
38
|
+
}, [
|
|
39
|
+
r,
|
|
40
|
+
t,
|
|
41
|
+
n,
|
|
42
|
+
e.timeZone,
|
|
43
|
+
a,
|
|
44
|
+
o
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
function _(e, a, r, t) {
|
|
48
|
+
let i = h(b(s), "@react-aria/calendar"), o = d(e) || d(a), n = m({
|
|
49
|
+
month: "long",
|
|
50
|
+
year: "numeric",
|
|
51
|
+
era: o,
|
|
52
|
+
calendar: e.calendar.identifier,
|
|
53
|
+
timeZone: r
|
|
54
|
+
}), f = m({
|
|
55
|
+
month: "long",
|
|
56
|
+
year: "numeric",
|
|
57
|
+
day: "numeric",
|
|
58
|
+
era: o,
|
|
59
|
+
calendar: e.calendar.identifier,
|
|
60
|
+
timeZone: r
|
|
61
|
+
});
|
|
62
|
+
return R(() => {
|
|
63
|
+
if (c(e, x(e))) {
|
|
64
|
+
if (c(a, p(e))) return n.format(e.toDate(r));
|
|
65
|
+
if (c(a, p(a))) return t ? g(n, i, e, a, r) : n.formatRange(e.toDate(r), a.toDate(r));
|
|
48
66
|
}
|
|
67
|
+
return t ? g(f, i, e, a, r) : f.formatRange(e.toDate(r), a.toDate(r));
|
|
68
|
+
}, [
|
|
69
|
+
e,
|
|
70
|
+
a,
|
|
71
|
+
n,
|
|
72
|
+
f,
|
|
73
|
+
i,
|
|
74
|
+
r,
|
|
75
|
+
t
|
|
76
|
+
]);
|
|
77
|
+
}
|
|
78
|
+
function g(e, a, r, t, i) {
|
|
79
|
+
let o = e.formatRangeToParts(r.toDate(i), t.toDate(i)), n = -1;
|
|
80
|
+
for (let l = 0; l < o.length; l++) {
|
|
81
|
+
let u = o[l];
|
|
82
|
+
if (u.source === "shared" && u.type === "literal") n = l;
|
|
83
|
+
else if (u.source === "endRange") break;
|
|
49
84
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
b("init", () => {
|
|
57
|
-
e.params.keyboard.enabled && g();
|
|
58
|
-
}), b("destroy", () => {
|
|
59
|
-
e.keyboard.enabled && v();
|
|
60
|
-
}), Object.assign(e.keyboard, {
|
|
61
|
-
enable: g,
|
|
62
|
-
disable: v
|
|
85
|
+
let f = "", $ = "";
|
|
86
|
+
for (let l = 0; l < o.length; l++)
|
|
87
|
+
l < n ? f += o[l].value : l > n && ($ += o[l].value);
|
|
88
|
+
return a.format("dateRange", {
|
|
89
|
+
startDate: f,
|
|
90
|
+
endDate: $
|
|
63
91
|
});
|
|
64
92
|
}
|
|
65
93
|
export {
|
|
66
|
-
|
|
94
|
+
d as getEraFormat,
|
|
95
|
+
k as hookData,
|
|
96
|
+
D as useSelectedDateDescription,
|
|
97
|
+
_ as useVisibleRangeDescription
|
|
67
98
|
};
|
package/index200.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./index199.js"),E=require("./index201.js"),n=require("./index153.js"),Z=require("./index158.js"),$=require("./index202.js"),w=require("./index173.js"),A=require("./index166.js"),U=require("./index176.js"),k=require("./index203.js"),B=require("./index204.js"),j=require("./index160.js"),P=require("@react-aria/i18n"),l=require("react");function W(t){return t&&t.__esModule?t.default:t}function _(t,e,u){let{date:i,isDisabled:s}=t,{errorMessageId:T,selectedDateDescription:b}=I.hookData.get(e),a=P.useLocalizedStringFormatter(W(E),"@react-aria/calendar"),R=P.useDateFormatter({weekday:"long",day:"numeric",month:"long",year:"numeric",era:I.getEraFormat(i),timeZone:e.timeZone}),d=e.isSelected(i),f=e.isCellFocused(i);s=s||e.isCellDisabled(i);let S=e.isCellUnavailable(i),g=!s&&!S,c=e.isValueInvalid&&!!("highlightedRange"in e?!e.anchorDate&&e.highlightedRange&&i.compare(e.highlightedRange.start)>=0&&i.compare(e.highlightedRange.end)<=0:e.value&&n.isSameDay(e.value,i));c&&(d=!0),i=k.useDeepMemo(i,n.isEqualDay);let m=l.useMemo(()=>i.toDate(e.timeZone),[i,e.timeZone]),v=n.isToday(i,e.timeZone),M=l.useMemo(()=>{let r="";return"highlightedRange"in e&&e.value&&!e.anchorDate&&(n.isSameDay(i,e.value.start)||n.isSameDay(i,e.value.end))&&(r=b+", "),r+=R.format(m),v?r=a.format(d?"todayDateSelected":"todayDate",{date:r}):d&&(r=a.format("dateSelected",{date:r})),e.minValue&&n.isSameDay(i,e.minValue)?r+=", "+a.format("minimumDate"):e.maxValue&&n.isSameDay(i,e.maxValue)&&(r+=", "+a.format("maximumDate")),r},[R,m,a,d,v,i,e,b]),p="";"anchorDate"in e&&f&&!e.isReadOnly&&g&&(e.anchorDate?p=a.format("finishRangeSelectionPrompt"):p=a.format("startRangeSelectionPrompt"));let x=A.useDescription(p),y=l.useRef(!1),h=l.useRef(!1),D=l.useRef(void 0),{pressProps:C,isPressed:O}=j.usePress({shouldCancelOnPointerExit:"anchorDate"in e&&!!e.anchorDate,preventFocusOnPress:!0,isDisabled:!g||e.isReadOnly,onPressStart(r){if(e.isReadOnly){e.setFocusedDate(i);return}if("highlightedRange"in e&&!e.anchorDate&&(r.pointerType==="mouse"||r.pointerType==="touch")){if(e.highlightedRange&&!c){if(n.isSameDay(i,e.highlightedRange.start)){e.setAnchorDate(e.highlightedRange.end),e.setFocusedDate(i),e.setDragging(!0),h.current=!0;return}else if(n.isSameDay(i,e.highlightedRange.end)){e.setAnchorDate(e.highlightedRange.start),e.setFocusedDate(i),e.setDragging(!0),h.current=!0;return}}let o=()=>{e.setDragging(!0),D.current=void 0,e.selectDate(i),e.setFocusedDate(i),y.current=!0};r.pointerType==="touch"?D.current=setTimeout(o,200):o()}},onPressEnd(){h.current=!1,y.current=!1,clearTimeout(D.current),D.current=void 0},onPress(){!("anchorDate"in e)&&!e.isReadOnly&&(e.selectDate(i),e.setFocusedDate(i))},onPressUp(r){if(!e.isReadOnly&&("anchorDate"in e&&D.current&&(e.selectDate(i),e.setFocusedDate(i)),"anchorDate"in e))if(h.current)e.setAnchorDate(i);else if(e.anchorDate&&!y.current)e.selectDate(i),e.setFocusedDate(i);else if(r.pointerType==="keyboard"&&!e.anchorDate){e.selectDate(i);let o=i.add({days:1});e.isInvalid(o)&&(o=i.subtract({days:1})),e.isInvalid(o)||e.setFocusedDate(o)}else r.pointerType==="virtual"&&(e.selectDate(i),e.setFocusedDate(i))}}),F;s||(F=n.isSameDay(i,e.focusedDate)?0:-1),l.useEffect(()=>{f&&u.current&&($.focusWithoutScrolling(u.current),B.getInteractionModality()!=="pointer"&&document.activeElement===u.current&&U.scrollIntoViewport(u.current,{containingElement:w.getScrollParent(u.current)}))},[f,u]);let q=P.useDateFormatter({day:"numeric",timeZone:e.timeZone,calendar:i.calendar.identifier}),V=l.useMemo(()=>q.formatToParts(m).find(r=>r.type==="day").value,[q,m]);return{cellProps:{role:"gridcell","aria-disabled":!g||void 0,"aria-selected":d||void 0,"aria-invalid":c||void 0},buttonProps:Z.mergeProps(C,{onFocus(){s||e.setFocusedDate(i)},tabIndex:F,role:"button","aria-disabled":!g||void 0,"aria-label":M,"aria-invalid":c||void 0,"aria-describedby":[c?T:void 0,x["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(r){"highlightDate"in e&&(r.pointerType!=="touch"||e.isDragging)&&g&&e.highlightDate(i)},onPointerDown(r){"releasePointerCapture"in r.target&&r.target.releasePointerCapture(r.pointerId)},onContextMenu(r){r.preventDefault()}}),isPressed:O,isFocused:f,isSelected:d,isDisabled:s,isUnavailable:S,isOutsideVisibleRange:i.compare(e.visibleRange.start)<0||i.compare(e.visibleRange.end)>0,isInvalid:c,formattedDate:V}}exports.useCalendarCell=_;
|