@react-aria/calendar 3.5.7 → 3.5.9
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/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts +3 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useCalendar.mjs +1 -1
- package/dist/useCalendarBase.main.js +13 -13
- package/dist/useCalendarBase.mjs +14 -14
- package/dist/useCalendarBase.module.js +13 -13
- package/dist/useCalendarCell.main.js +41 -41
- package/dist/useCalendarCell.main.js.map +1 -1
- package/dist/useCalendarCell.mjs +42 -42
- package/dist/useCalendarCell.module.js +41 -41
- package/dist/useCalendarCell.module.js.map +1 -1
- package/dist/useCalendarGrid.main.js +23 -23
- package/dist/useCalendarGrid.mjs +24 -24
- package/dist/useCalendarGrid.module.js +23 -23
- package/dist/useRangeCalendar.main.js +5 -5
- package/dist/useRangeCalendar.main.js.map +1 -1
- package/dist/useRangeCalendar.mjs +6 -6
- package/dist/useRangeCalendar.module.js +5 -5
- package/dist/useRangeCalendar.module.js.map +1 -1
- package/dist/utils.main.js +22 -22
- package/dist/utils.mjs +23 -23
- package/dist/utils.module.js +22 -22
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +13 -13
- package/src/useCalendarCell.ts +3 -3
- package/src/useRangeCalendar.ts +3 -3
|
@@ -24,56 +24,56 @@ function $e3031d1f8c9d64eb$export$cb95147730a423f5(props, state) {
|
|
|
24
24
|
let { direction: direction } = (0, $NQfxu$useLocale)();
|
|
25
25
|
let onKeyDown = (e)=>{
|
|
26
26
|
switch(e.key){
|
|
27
|
-
case
|
|
28
|
-
case
|
|
27
|
+
case 'Enter':
|
|
28
|
+
case ' ':
|
|
29
29
|
e.preventDefault();
|
|
30
30
|
state.selectFocusedDate();
|
|
31
31
|
break;
|
|
32
|
-
case
|
|
32
|
+
case 'PageUp':
|
|
33
33
|
e.preventDefault();
|
|
34
34
|
e.stopPropagation();
|
|
35
35
|
state.focusPreviousSection(e.shiftKey);
|
|
36
36
|
break;
|
|
37
|
-
case
|
|
37
|
+
case 'PageDown':
|
|
38
38
|
e.preventDefault();
|
|
39
39
|
e.stopPropagation();
|
|
40
40
|
state.focusNextSection(e.shiftKey);
|
|
41
41
|
break;
|
|
42
|
-
case
|
|
42
|
+
case 'End':
|
|
43
43
|
e.preventDefault();
|
|
44
44
|
e.stopPropagation();
|
|
45
45
|
state.focusSectionEnd();
|
|
46
46
|
break;
|
|
47
|
-
case
|
|
47
|
+
case 'Home':
|
|
48
48
|
e.preventDefault();
|
|
49
49
|
e.stopPropagation();
|
|
50
50
|
state.focusSectionStart();
|
|
51
51
|
break;
|
|
52
|
-
case
|
|
52
|
+
case 'ArrowLeft':
|
|
53
53
|
e.preventDefault();
|
|
54
54
|
e.stopPropagation();
|
|
55
|
-
if (direction ===
|
|
55
|
+
if (direction === 'rtl') state.focusNextDay();
|
|
56
56
|
else state.focusPreviousDay();
|
|
57
57
|
break;
|
|
58
|
-
case
|
|
58
|
+
case 'ArrowUp':
|
|
59
59
|
e.preventDefault();
|
|
60
60
|
e.stopPropagation();
|
|
61
61
|
state.focusPreviousRow();
|
|
62
62
|
break;
|
|
63
|
-
case
|
|
63
|
+
case 'ArrowRight':
|
|
64
64
|
e.preventDefault();
|
|
65
65
|
e.stopPropagation();
|
|
66
|
-
if (direction ===
|
|
66
|
+
if (direction === 'rtl') state.focusPreviousDay();
|
|
67
67
|
else state.focusNextDay();
|
|
68
68
|
break;
|
|
69
|
-
case
|
|
69
|
+
case 'ArrowDown':
|
|
70
70
|
e.preventDefault();
|
|
71
71
|
e.stopPropagation();
|
|
72
72
|
state.focusNextRow();
|
|
73
73
|
break;
|
|
74
|
-
case
|
|
74
|
+
case 'Escape':
|
|
75
75
|
// Cancel the selection.
|
|
76
|
-
if (
|
|
76
|
+
if ('setAnchorDate' in state) {
|
|
77
77
|
e.preventDefault();
|
|
78
78
|
state.setAnchorDate(null);
|
|
79
79
|
}
|
|
@@ -83,14 +83,14 @@ function $e3031d1f8c9d64eb$export$cb95147730a423f5(props, state) {
|
|
|
83
83
|
let visibleRangeDescription = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(startDate, endDate, state.timeZone, true);
|
|
84
84
|
let { ariaLabel: ariaLabel, ariaLabelledBy: ariaLabelledBy } = (0, $a074e1e2d0f0a665$export$653eddfc964b0f8a).get(state);
|
|
85
85
|
let labelProps = (0, $NQfxu$useLabels)({
|
|
86
|
-
|
|
86
|
+
'aria-label': [
|
|
87
87
|
ariaLabel,
|
|
88
88
|
visibleRangeDescription
|
|
89
|
-
].filter(Boolean).join(
|
|
90
|
-
|
|
89
|
+
].filter(Boolean).join(', '),
|
|
90
|
+
'aria-labelledby': ariaLabelledBy
|
|
91
91
|
});
|
|
92
92
|
let dayFormatter = (0, $NQfxu$useDateFormatter)({
|
|
93
|
-
weekday: props.weekdayStyle ||
|
|
93
|
+
weekday: props.weekdayStyle || 'narrow',
|
|
94
94
|
timeZone: state.timeZone
|
|
95
95
|
});
|
|
96
96
|
let { locale: locale } = (0, $NQfxu$useLocale)();
|
|
@@ -112,10 +112,10 @@ function $e3031d1f8c9d64eb$export$cb95147730a423f5(props, state) {
|
|
|
112
112
|
]);
|
|
113
113
|
return {
|
|
114
114
|
gridProps: (0, $NQfxu$mergeProps)(labelProps, {
|
|
115
|
-
role:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
role: 'grid',
|
|
116
|
+
'aria-readonly': state.isReadOnly || null,
|
|
117
|
+
'aria-disabled': state.isDisabled || null,
|
|
118
|
+
'aria-multiselectable': 'highlightedRange' in state || undefined,
|
|
119
119
|
onKeyDown: onKeyDown,
|
|
120
120
|
onFocus: ()=>state.setFocused(true),
|
|
121
121
|
onBlur: ()=>state.setFocused(false)
|
|
@@ -123,7 +123,7 @@ function $e3031d1f8c9d64eb$export$cb95147730a423f5(props, state) {
|
|
|
123
123
|
headerProps: {
|
|
124
124
|
// Column headers are hidden to screen readers to make navigating with a touch screen reader easier.
|
|
125
125
|
// The day names are already included in the label of each cell, so there's no need to announce them twice.
|
|
126
|
-
|
|
126
|
+
'aria-hidden': true
|
|
127
127
|
},
|
|
128
128
|
weekDays: weekDays
|
|
129
129
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $02ef492a56b91cb2$exports = require("./useCalendarBase.main.js");
|
|
2
|
-
var $3kfPe$react = require("react");
|
|
3
2
|
var $3kfPe$reactariautils = require("@react-aria/utils");
|
|
3
|
+
var $3kfPe$react = require("react");
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
function $parcel$export(e, n, v, s) {
|
|
@@ -30,8 +30,8 @@ function $c49ada48cbc48220$export$87e0539f600c24e5(props, state, ref) {
|
|
|
30
30
|
// We need to match that here otherwise this will fire before the press event in
|
|
31
31
|
// useCalendarCell, causing range selection to not work properly.
|
|
32
32
|
let isVirtualClick = (0, $3kfPe$react.useRef)(false);
|
|
33
|
-
let windowRef = (0, $3kfPe$react.useRef)(typeof window !==
|
|
34
|
-
(0, $3kfPe$reactariautils.useEvent)(windowRef,
|
|
33
|
+
let windowRef = (0, $3kfPe$react.useRef)(typeof window !== 'undefined' ? window : null);
|
|
34
|
+
(0, $3kfPe$reactariautils.useEvent)(windowRef, 'pointerdown', (e)=>{
|
|
35
35
|
isVirtualClick.current = e.width === 0 && e.height === 0;
|
|
36
36
|
});
|
|
37
37
|
// Stop range selection when pressing or releasing a pointer outside the calendar body,
|
|
@@ -46,14 +46,14 @@ function $c49ada48cbc48220$export$87e0539f600c24e5(props, state, ref) {
|
|
|
46
46
|
let target = e.target;
|
|
47
47
|
if (ref.current && ref.current.contains(document.activeElement) && (!ref.current.contains(target) || !target.closest('button, [role="button"]'))) state.selectFocusedDate();
|
|
48
48
|
};
|
|
49
|
-
(0, $3kfPe$reactariautils.useEvent)(windowRef,
|
|
49
|
+
(0, $3kfPe$reactariautils.useEvent)(windowRef, 'pointerup', endDragging);
|
|
50
50
|
// Also stop range selection on blur, e.g. tabbing away from the calendar.
|
|
51
51
|
res.calendarProps.onBlur = (e)=>{
|
|
52
52
|
if (!ref.current) return;
|
|
53
53
|
if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) state.selectFocusedDate();
|
|
54
54
|
};
|
|
55
55
|
// Prevent touch scrolling while dragging
|
|
56
|
-
(0, $3kfPe$reactariautils.useEvent)(ref,
|
|
56
|
+
(0, $3kfPe$reactariautils.useEvent)(ref, 'touchmove', (e)=>{
|
|
57
57
|
if (state.isDragging) e.preventDefault();
|
|
58
58
|
}, {
|
|
59
59
|
passive: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAsC,KAAgC,EAAE,KAAyB,EAAE,
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAsC,KAAgC,EAAE,KAAyB,EAAE,GAAuC;IACxJ,IAAI,MAAM,CAAA,GAAA,yCAAc,EAAE,OAAO;IAEjC,6EAA6E;IAC7E,iDAAiD;IACjD,iDAAiD;IACjD,iFAAiF;IACjF,gFAAgF;IAChF,iEAAiE;IACjE,IAAI,iBAAiB,CAAA,GAAA,mBAAK,EAAE;IAC5B,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE,OAAO,WAAW,cAAc,SAAS;IAChE,CAAA,GAAA,8BAAO,EAAE,WAAW,eAAe,CAAA;QACjC,eAAe,OAAO,GAAG,EAAE,KAAK,KAAK,KAAK,EAAE,MAAM,KAAK;IACzD;IAEA,uFAAuF;IACvF,sEAAsE;IACtE,IAAI,cAAc,CAAC;QACjB,IAAI,eAAe,OAAO,EAAE;YAC1B,eAAe,OAAO,GAAG;YACzB;QACF;QAEA,MAAM,WAAW,CAAC;QAClB,IAAI,CAAC,MAAM,UAAU,EACnB;QAGF,IAAI,SAAS,EAAE,MAAM;QACrB,IACE,IAAI,OAAO,IACX,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,aAAa,KAC1C,CAAA,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,0BAAyB,GAE3E,MAAM,iBAAiB;IAE3B;IAEA,CAAA,GAAA,8BAAO,EAAE,WAAW,aAAa;IAEjC,0EAA0E;IAC1E,IAAI,aAAa,CAAC,MAAM,GAAG,CAAA;QACzB,IAAI,CAAC,IAAI,OAAO,EACd;QAEF,IAAI,AAAC,CAAA,CAAC,EAAE,aAAa,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA,KAAM,MAAM,UAAU,EAClF,MAAM,iBAAiB;IAE3B;IAEA,yCAAyC;IACzC,CAAA,GAAA,8BAAO,EAAE,KAAK,aAAa,CAAA;QACzB,IAAI,MAAM,UAAU,EAClB,EAAE,cAAc;IAEpB,GAAG;QAAC,SAAS;QAAO,SAAS;IAAI;IAEjC,OAAO;AACT","sources":["packages/@react-aria/calendar/src/useRangeCalendar.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaRangeCalendarProps, DateValue} from '@react-types/calendar';\nimport {CalendarAria, useCalendarBase} from './useCalendarBase';\nimport {FocusableElement, RefObject} from '@react-types/shared';\nimport {RangeCalendarState} from '@react-stately/calendar';\nimport {useEvent} from '@react-aria/utils';\nimport {useRef} from 'react';\n\n/**\n * Provides the behavior and accessibility implementation for a range calendar component.\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport function useRangeCalendar<T extends DateValue>(props: AriaRangeCalendarProps<T>, state: RangeCalendarState, ref: RefObject<FocusableElement | null>): CalendarAria {\n let res = useCalendarBase(props, state);\n\n // We need to ignore virtual pointer events from VoiceOver due to these bugs.\n // https://bugs.webkit.org/show_bug.cgi?id=222627\n // https://bugs.webkit.org/show_bug.cgi?id=223202\n // usePress also does this and waits for the following click event before firing.\n // We need to match that here otherwise this will fire before the press event in\n // useCalendarCell, causing range selection to not work properly.\n let isVirtualClick = useRef(false);\n let windowRef = useRef(typeof window !== 'undefined' ? window : null);\n useEvent(windowRef, 'pointerdown', e => {\n isVirtualClick.current = e.width === 0 && e.height === 0;\n });\n\n // Stop range selection when pressing or releasing a pointer outside the calendar body,\n // except when pressing the next or previous buttons to switch months.\n let endDragging = (e: PointerEvent) => {\n if (isVirtualClick.current) {\n isVirtualClick.current = false;\n return;\n }\n\n state.setDragging(false);\n if (!state.anchorDate) {\n return;\n }\n\n let target = e.target as Element;\n if (\n ref.current &&\n ref.current.contains(document.activeElement) &&\n (!ref.current.contains(target) || !target.closest('button, [role=\"button\"]'))\n ) {\n state.selectFocusedDate();\n }\n };\n\n useEvent(windowRef, 'pointerup', endDragging);\n\n // Also stop range selection on blur, e.g. tabbing away from the calendar.\n res.calendarProps.onBlur = e => {\n if (!ref.current) {\n return;\n }\n if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) {\n state.selectFocusedDate();\n }\n };\n\n // Prevent touch scrolling while dragging\n useEvent(ref, 'touchmove', e => {\n if (state.isDragging) {\n e.preventDefault();\n }\n }, {passive: false, capture: true});\n\n return res;\n}\n"],"names":[],"version":3,"file":"useRangeCalendar.main.js.map"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {useCalendarBase as $c4acc1de3ab169cf$export$d652b3ea2d672d5b} from "./useCalendarBase.mjs";
|
|
2
|
-
import {useRef as $juhpn$useRef} from "react";
|
|
3
2
|
import {useEvent as $juhpn$useEvent} from "@react-aria/utils";
|
|
3
|
+
import {useRef as $juhpn$useRef} from "react";
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -24,8 +24,8 @@ function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
|
24
24
|
// We need to match that here otherwise this will fire before the press event in
|
|
25
25
|
// useCalendarCell, causing range selection to not work properly.
|
|
26
26
|
let isVirtualClick = (0, $juhpn$useRef)(false);
|
|
27
|
-
let windowRef = (0, $juhpn$useRef)(typeof window !==
|
|
28
|
-
(0, $juhpn$useEvent)(windowRef,
|
|
27
|
+
let windowRef = (0, $juhpn$useRef)(typeof window !== 'undefined' ? window : null);
|
|
28
|
+
(0, $juhpn$useEvent)(windowRef, 'pointerdown', (e)=>{
|
|
29
29
|
isVirtualClick.current = e.width === 0 && e.height === 0;
|
|
30
30
|
});
|
|
31
31
|
// Stop range selection when pressing or releasing a pointer outside the calendar body,
|
|
@@ -40,14 +40,14 @@ function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
|
40
40
|
let target = e.target;
|
|
41
41
|
if (ref.current && ref.current.contains(document.activeElement) && (!ref.current.contains(target) || !target.closest('button, [role="button"]'))) state.selectFocusedDate();
|
|
42
42
|
};
|
|
43
|
-
(0, $juhpn$useEvent)(windowRef,
|
|
43
|
+
(0, $juhpn$useEvent)(windowRef, 'pointerup', endDragging);
|
|
44
44
|
// Also stop range selection on blur, e.g. tabbing away from the calendar.
|
|
45
45
|
res.calendarProps.onBlur = (e)=>{
|
|
46
46
|
if (!ref.current) return;
|
|
47
47
|
if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) state.selectFocusedDate();
|
|
48
48
|
};
|
|
49
49
|
// Prevent touch scrolling while dragging
|
|
50
|
-
(0, $juhpn$useEvent)(ref,
|
|
50
|
+
(0, $juhpn$useEvent)(ref, 'touchmove', (e)=>{
|
|
51
51
|
if (state.isDragging) e.preventDefault();
|
|
52
52
|
}, {
|
|
53
53
|
passive: false,
|
|
@@ -58,4 +58,4 @@ function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
export {$46a4342aab3d8076$export$87e0539f600c24e5 as useRangeCalendar};
|
|
61
|
-
//# sourceMappingURL=useRangeCalendar.
|
|
61
|
+
//# sourceMappingURL=useRangeCalendar.module.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {useCalendarBase as $c4acc1de3ab169cf$export$d652b3ea2d672d5b} from "./useCalendarBase.module.js";
|
|
2
|
-
import {useRef as $juhpn$useRef} from "react";
|
|
3
2
|
import {useEvent as $juhpn$useEvent} from "@react-aria/utils";
|
|
3
|
+
import {useRef as $juhpn$useRef} from "react";
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright 2020 Adobe. All rights reserved.
|
|
@@ -24,8 +24,8 @@ function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
|
24
24
|
// We need to match that here otherwise this will fire before the press event in
|
|
25
25
|
// useCalendarCell, causing range selection to not work properly.
|
|
26
26
|
let isVirtualClick = (0, $juhpn$useRef)(false);
|
|
27
|
-
let windowRef = (0, $juhpn$useRef)(typeof window !==
|
|
28
|
-
(0, $juhpn$useEvent)(windowRef,
|
|
27
|
+
let windowRef = (0, $juhpn$useRef)(typeof window !== 'undefined' ? window : null);
|
|
28
|
+
(0, $juhpn$useEvent)(windowRef, 'pointerdown', (e)=>{
|
|
29
29
|
isVirtualClick.current = e.width === 0 && e.height === 0;
|
|
30
30
|
});
|
|
31
31
|
// Stop range selection when pressing or releasing a pointer outside the calendar body,
|
|
@@ -40,14 +40,14 @@ function $46a4342aab3d8076$export$87e0539f600c24e5(props, state, ref) {
|
|
|
40
40
|
let target = e.target;
|
|
41
41
|
if (ref.current && ref.current.contains(document.activeElement) && (!ref.current.contains(target) || !target.closest('button, [role="button"]'))) state.selectFocusedDate();
|
|
42
42
|
};
|
|
43
|
-
(0, $juhpn$useEvent)(windowRef,
|
|
43
|
+
(0, $juhpn$useEvent)(windowRef, 'pointerup', endDragging);
|
|
44
44
|
// Also stop range selection on blur, e.g. tabbing away from the calendar.
|
|
45
45
|
res.calendarProps.onBlur = (e)=>{
|
|
46
46
|
if (!ref.current) return;
|
|
47
47
|
if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) state.selectFocusedDate();
|
|
48
48
|
};
|
|
49
49
|
// Prevent touch scrolling while dragging
|
|
50
|
-
(0, $juhpn$useEvent)(ref,
|
|
50
|
+
(0, $juhpn$useEvent)(ref, 'touchmove', (e)=>{
|
|
51
51
|
if (state.isDragging) e.preventDefault();
|
|
52
52
|
}, {
|
|
53
53
|
passive: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAsC,KAAgC,EAAE,KAAyB,EAAE,
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,SAAS,0CAAsC,KAAgC,EAAE,KAAyB,EAAE,GAAuC;IACxJ,IAAI,MAAM,CAAA,GAAA,yCAAc,EAAE,OAAO;IAEjC,6EAA6E;IAC7E,iDAAiD;IACjD,iDAAiD;IACjD,iFAAiF;IACjF,gFAAgF;IAChF,iEAAiE;IACjE,IAAI,iBAAiB,CAAA,GAAA,aAAK,EAAE;IAC5B,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE,OAAO,WAAW,cAAc,SAAS;IAChE,CAAA,GAAA,eAAO,EAAE,WAAW,eAAe,CAAA;QACjC,eAAe,OAAO,GAAG,EAAE,KAAK,KAAK,KAAK,EAAE,MAAM,KAAK;IACzD;IAEA,uFAAuF;IACvF,sEAAsE;IACtE,IAAI,cAAc,CAAC;QACjB,IAAI,eAAe,OAAO,EAAE;YAC1B,eAAe,OAAO,GAAG;YACzB;QACF;QAEA,MAAM,WAAW,CAAC;QAClB,IAAI,CAAC,MAAM,UAAU,EACnB;QAGF,IAAI,SAAS,EAAE,MAAM;QACrB,IACE,IAAI,OAAO,IACX,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,aAAa,KAC1C,CAAA,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,0BAAyB,GAE3E,MAAM,iBAAiB;IAE3B;IAEA,CAAA,GAAA,eAAO,EAAE,WAAW,aAAa;IAEjC,0EAA0E;IAC1E,IAAI,aAAa,CAAC,MAAM,GAAG,CAAA;QACzB,IAAI,CAAC,IAAI,OAAO,EACd;QAEF,IAAI,AAAC,CAAA,CAAC,EAAE,aAAa,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA,KAAM,MAAM,UAAU,EAClF,MAAM,iBAAiB;IAE3B;IAEA,yCAAyC;IACzC,CAAA,GAAA,eAAO,EAAE,KAAK,aAAa,CAAA;QACzB,IAAI,MAAM,UAAU,EAClB,EAAE,cAAc;IAEpB,GAAG;QAAC,SAAS;QAAO,SAAS;IAAI;IAEjC,OAAO;AACT","sources":["packages/@react-aria/calendar/src/useRangeCalendar.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaRangeCalendarProps, DateValue} from '@react-types/calendar';\nimport {CalendarAria, useCalendarBase} from './useCalendarBase';\nimport {FocusableElement, RefObject} from '@react-types/shared';\nimport {RangeCalendarState} from '@react-stately/calendar';\nimport {useEvent} from '@react-aria/utils';\nimport {useRef} from 'react';\n\n/**\n * Provides the behavior and accessibility implementation for a range calendar component.\n * A range calendar displays one or more date grids and allows users to select a contiguous range of dates.\n */\nexport function useRangeCalendar<T extends DateValue>(props: AriaRangeCalendarProps<T>, state: RangeCalendarState, ref: RefObject<FocusableElement | null>): CalendarAria {\n let res = useCalendarBase(props, state);\n\n // We need to ignore virtual pointer events from VoiceOver due to these bugs.\n // https://bugs.webkit.org/show_bug.cgi?id=222627\n // https://bugs.webkit.org/show_bug.cgi?id=223202\n // usePress also does this and waits for the following click event before firing.\n // We need to match that here otherwise this will fire before the press event in\n // useCalendarCell, causing range selection to not work properly.\n let isVirtualClick = useRef(false);\n let windowRef = useRef(typeof window !== 'undefined' ? window : null);\n useEvent(windowRef, 'pointerdown', e => {\n isVirtualClick.current = e.width === 0 && e.height === 0;\n });\n\n // Stop range selection when pressing or releasing a pointer outside the calendar body,\n // except when pressing the next or previous buttons to switch months.\n let endDragging = (e: PointerEvent) => {\n if (isVirtualClick.current) {\n isVirtualClick.current = false;\n return;\n }\n\n state.setDragging(false);\n if (!state.anchorDate) {\n return;\n }\n\n let target = e.target as Element;\n if (\n ref.current &&\n ref.current.contains(document.activeElement) &&\n (!ref.current.contains(target) || !target.closest('button, [role=\"button\"]'))\n ) {\n state.selectFocusedDate();\n }\n };\n\n useEvent(windowRef, 'pointerup', endDragging);\n\n // Also stop range selection on blur, e.g. tabbing away from the calendar.\n res.calendarProps.onBlur = e => {\n if (!ref.current) {\n return;\n }\n if ((!e.relatedTarget || !ref.current.contains(e.relatedTarget)) && state.anchorDate) {\n state.selectFocusedDate();\n }\n };\n\n // Prevent touch scrolling while dragging\n useEvent(ref, 'touchmove', e => {\n if (state.isDragging) {\n e.preventDefault();\n }\n }, {passive: false, capture: true});\n\n return res;\n}\n"],"names":[],"version":3,"file":"useRangeCalendar.module.js.map"}
|
package/dist/utils.main.js
CHANGED
|
@@ -32,22 +32,22 @@ $parcel$export(module.exports, "useVisibleRangeDescription", () => $df1d8e967e73
|
|
|
32
32
|
|
|
33
33
|
const $df1d8e967e73ec8e$export$653eddfc964b0f8a = new WeakMap();
|
|
34
34
|
function $df1d8e967e73ec8e$export$134cbb7fb09a9522(date) {
|
|
35
|
-
return (date === null || date === void 0 ? void 0 : date.calendar.identifier) ===
|
|
35
|
+
return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === 'gregory' && date.era === 'BC' ? 'short' : undefined;
|
|
36
36
|
}
|
|
37
37
|
function $df1d8e967e73ec8e$export$b6df97c887c38e1a(state) {
|
|
38
|
-
let stringFormatter = (0, $idq92$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($bd6dc95a3c5ee5cd$exports))),
|
|
38
|
+
let stringFormatter = (0, $idq92$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($bd6dc95a3c5ee5cd$exports))), '@react-aria/calendar');
|
|
39
39
|
let start, end;
|
|
40
|
-
if (
|
|
40
|
+
if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
|
|
41
41
|
else start = end = state.value;
|
|
42
42
|
let dateFormatter = (0, $idq92$reactariai18n.useDateFormatter)({
|
|
43
|
-
weekday:
|
|
44
|
-
month:
|
|
45
|
-
year:
|
|
46
|
-
day:
|
|
43
|
+
weekday: 'long',
|
|
44
|
+
month: 'long',
|
|
45
|
+
year: 'numeric',
|
|
46
|
+
day: 'numeric',
|
|
47
47
|
era: $df1d8e967e73ec8e$export$134cbb7fb09a9522(start) || $df1d8e967e73ec8e$export$134cbb7fb09a9522(end),
|
|
48
48
|
timeZone: state.timeZone
|
|
49
49
|
});
|
|
50
|
-
let anchorDate =
|
|
50
|
+
let anchorDate = 'anchorDate' in state ? state.anchorDate : null;
|
|
51
51
|
return (0, $idq92$react.useMemo)(()=>{
|
|
52
52
|
// No message if currently selecting a range, or there is nothing highlighted.
|
|
53
53
|
if (!anchorDate && start && end) {
|
|
@@ -55,17 +55,17 @@ function $df1d8e967e73ec8e$export$b6df97c887c38e1a(state) {
|
|
|
55
55
|
// otherwise include both dates.
|
|
56
56
|
if ((0, $idq92$internationalizeddate.isSameDay)(start, end)) {
|
|
57
57
|
let date = dateFormatter.format(start.toDate(state.timeZone));
|
|
58
|
-
return stringFormatter.format(
|
|
58
|
+
return stringFormatter.format('selectedDateDescription', {
|
|
59
59
|
date: date
|
|
60
60
|
});
|
|
61
61
|
} else {
|
|
62
62
|
let dateRange = $df1d8e967e73ec8e$var$formatRange(dateFormatter, stringFormatter, start, end, state.timeZone);
|
|
63
|
-
return stringFormatter.format(
|
|
63
|
+
return stringFormatter.format('selectedRangeDescription', {
|
|
64
64
|
dateRange: dateRange
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return '';
|
|
69
69
|
}, [
|
|
70
70
|
start,
|
|
71
71
|
end,
|
|
@@ -76,19 +76,19 @@ function $df1d8e967e73ec8e$export$b6df97c887c38e1a(state) {
|
|
|
76
76
|
]);
|
|
77
77
|
}
|
|
78
78
|
function $df1d8e967e73ec8e$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
|
|
79
|
-
let stringFormatter = (0, $idq92$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($bd6dc95a3c5ee5cd$exports))),
|
|
79
|
+
let stringFormatter = (0, $idq92$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($bd6dc95a3c5ee5cd$exports))), '@react-aria/calendar');
|
|
80
80
|
let era = $df1d8e967e73ec8e$export$134cbb7fb09a9522(startDate) || $df1d8e967e73ec8e$export$134cbb7fb09a9522(endDate);
|
|
81
81
|
let monthFormatter = (0, $idq92$reactariai18n.useDateFormatter)({
|
|
82
|
-
month:
|
|
83
|
-
year:
|
|
82
|
+
month: 'long',
|
|
83
|
+
year: 'numeric',
|
|
84
84
|
era: era,
|
|
85
85
|
calendar: startDate.calendar.identifier,
|
|
86
86
|
timeZone: timeZone
|
|
87
87
|
});
|
|
88
88
|
let dateFormatter = (0, $idq92$reactariai18n.useDateFormatter)({
|
|
89
|
-
month:
|
|
90
|
-
year:
|
|
91
|
-
day:
|
|
89
|
+
month: 'long',
|
|
90
|
+
year: 'numeric',
|
|
91
|
+
day: 'numeric',
|
|
92
92
|
era: era,
|
|
93
93
|
calendar: startDate.calendar.identifier,
|
|
94
94
|
timeZone: timeZone
|
|
@@ -118,17 +118,17 @@ function $df1d8e967e73ec8e$var$formatRange(dateFormatter, stringFormatter, start
|
|
|
118
118
|
let separatorIndex = -1;
|
|
119
119
|
for(let i = 0; i < parts.length; i++){
|
|
120
120
|
let part = parts[i];
|
|
121
|
-
if (part.source ===
|
|
122
|
-
else if (part.source ===
|
|
121
|
+
if (part.source === 'shared' && part.type === 'literal') separatorIndex = i;
|
|
122
|
+
else if (part.source === 'endRange') break;
|
|
123
123
|
}
|
|
124
124
|
// Now we can combine the parts into start and end strings.
|
|
125
|
-
let startValue =
|
|
126
|
-
let endValue =
|
|
125
|
+
let startValue = '';
|
|
126
|
+
let endValue = '';
|
|
127
127
|
for(let i = 0; i < parts.length; i++){
|
|
128
128
|
if (i < separatorIndex) startValue += parts[i].value;
|
|
129
129
|
else if (i > separatorIndex) endValue += parts[i].value;
|
|
130
130
|
}
|
|
131
|
-
return stringFormatter.format(
|
|
131
|
+
return stringFormatter.format('dateRange', {
|
|
132
132
|
startDate: startValue,
|
|
133
133
|
endDate: endValue
|
|
134
134
|
});
|
package/dist/utils.mjs
CHANGED
|
@@ -23,22 +23,22 @@ function $parcel$interopDefault(a) {
|
|
|
23
23
|
|
|
24
24
|
const $a074e1e2d0f0a665$export$653eddfc964b0f8a = new WeakMap();
|
|
25
25
|
function $a074e1e2d0f0a665$export$134cbb7fb09a9522(date) {
|
|
26
|
-
return (date === null || date === void 0 ? void 0 : date.calendar.identifier) ===
|
|
26
|
+
return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === 'gregory' && date.era === 'BC' ? 'short' : undefined;
|
|
27
27
|
}
|
|
28
28
|
function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
|
|
29
|
-
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))),
|
|
29
|
+
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
|
|
30
30
|
let start, end;
|
|
31
|
-
if (
|
|
31
|
+
if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
|
|
32
32
|
else start = end = state.value;
|
|
33
33
|
let dateFormatter = (0, $3HATx$useDateFormatter)({
|
|
34
|
-
weekday:
|
|
35
|
-
month:
|
|
36
|
-
year:
|
|
37
|
-
day:
|
|
34
|
+
weekday: 'long',
|
|
35
|
+
month: 'long',
|
|
36
|
+
year: 'numeric',
|
|
37
|
+
day: 'numeric',
|
|
38
38
|
era: $a074e1e2d0f0a665$export$134cbb7fb09a9522(start) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(end),
|
|
39
39
|
timeZone: state.timeZone
|
|
40
40
|
});
|
|
41
|
-
let anchorDate =
|
|
41
|
+
let anchorDate = 'anchorDate' in state ? state.anchorDate : null;
|
|
42
42
|
return (0, $3HATx$useMemo)(()=>{
|
|
43
43
|
// No message if currently selecting a range, or there is nothing highlighted.
|
|
44
44
|
if (!anchorDate && start && end) {
|
|
@@ -46,17 +46,17 @@ function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
|
|
|
46
46
|
// otherwise include both dates.
|
|
47
47
|
if ((0, $3HATx$isSameDay)(start, end)) {
|
|
48
48
|
let date = dateFormatter.format(start.toDate(state.timeZone));
|
|
49
|
-
return stringFormatter.format(
|
|
49
|
+
return stringFormatter.format('selectedDateDescription', {
|
|
50
50
|
date: date
|
|
51
51
|
});
|
|
52
52
|
} else {
|
|
53
53
|
let dateRange = $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start, end, state.timeZone);
|
|
54
|
-
return stringFormatter.format(
|
|
54
|
+
return stringFormatter.format('selectedRangeDescription', {
|
|
55
55
|
dateRange: dateRange
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return '';
|
|
60
60
|
}, [
|
|
61
61
|
start,
|
|
62
62
|
end,
|
|
@@ -67,19 +67,19 @@ function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
|
|
|
67
67
|
]);
|
|
68
68
|
}
|
|
69
69
|
function $a074e1e2d0f0a665$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
|
|
70
|
-
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))),
|
|
70
|
+
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
|
|
71
71
|
let era = $a074e1e2d0f0a665$export$134cbb7fb09a9522(startDate) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(endDate);
|
|
72
72
|
let monthFormatter = (0, $3HATx$useDateFormatter)({
|
|
73
|
-
month:
|
|
74
|
-
year:
|
|
73
|
+
month: 'long',
|
|
74
|
+
year: 'numeric',
|
|
75
75
|
era: era,
|
|
76
76
|
calendar: startDate.calendar.identifier,
|
|
77
77
|
timeZone: timeZone
|
|
78
78
|
});
|
|
79
79
|
let dateFormatter = (0, $3HATx$useDateFormatter)({
|
|
80
|
-
month:
|
|
81
|
-
year:
|
|
82
|
-
day:
|
|
80
|
+
month: 'long',
|
|
81
|
+
year: 'numeric',
|
|
82
|
+
day: 'numeric',
|
|
83
83
|
era: era,
|
|
84
84
|
calendar: startDate.calendar.identifier,
|
|
85
85
|
timeZone: timeZone
|
|
@@ -109,17 +109,17 @@ function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start
|
|
|
109
109
|
let separatorIndex = -1;
|
|
110
110
|
for(let i = 0; i < parts.length; i++){
|
|
111
111
|
let part = parts[i];
|
|
112
|
-
if (part.source ===
|
|
113
|
-
else if (part.source ===
|
|
112
|
+
if (part.source === 'shared' && part.type === 'literal') separatorIndex = i;
|
|
113
|
+
else if (part.source === 'endRange') break;
|
|
114
114
|
}
|
|
115
115
|
// Now we can combine the parts into start and end strings.
|
|
116
|
-
let startValue =
|
|
117
|
-
let endValue =
|
|
116
|
+
let startValue = '';
|
|
117
|
+
let endValue = '';
|
|
118
118
|
for(let i = 0; i < parts.length; i++){
|
|
119
119
|
if (i < separatorIndex) startValue += parts[i].value;
|
|
120
120
|
else if (i > separatorIndex) endValue += parts[i].value;
|
|
121
121
|
}
|
|
122
|
-
return stringFormatter.format(
|
|
122
|
+
return stringFormatter.format('dateRange', {
|
|
123
123
|
startDate: startValue,
|
|
124
124
|
endDate: endValue
|
|
125
125
|
});
|
|
@@ -127,4 +127,4 @@ function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
export {$a074e1e2d0f0a665$export$653eddfc964b0f8a as hookData, $a074e1e2d0f0a665$export$134cbb7fb09a9522 as getEraFormat, $a074e1e2d0f0a665$export$b6df97c887c38e1a as useSelectedDateDescription, $a074e1e2d0f0a665$export$31afe65d91ef6e8 as useVisibleRangeDescription};
|
|
130
|
-
//# sourceMappingURL=utils.
|
|
130
|
+
//# sourceMappingURL=utils.module.js.map
|
package/dist/utils.module.js
CHANGED
|
@@ -23,22 +23,22 @@ function $parcel$interopDefault(a) {
|
|
|
23
23
|
|
|
24
24
|
const $a074e1e2d0f0a665$export$653eddfc964b0f8a = new WeakMap();
|
|
25
25
|
function $a074e1e2d0f0a665$export$134cbb7fb09a9522(date) {
|
|
26
|
-
return (date === null || date === void 0 ? void 0 : date.calendar.identifier) ===
|
|
26
|
+
return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === 'gregory' && date.era === 'BC' ? 'short' : undefined;
|
|
27
27
|
}
|
|
28
28
|
function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
|
|
29
|
-
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))),
|
|
29
|
+
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
|
|
30
30
|
let start, end;
|
|
31
|
-
if (
|
|
31
|
+
if ('highlightedRange' in state) ({ start: start, end: end } = state.highlightedRange || {});
|
|
32
32
|
else start = end = state.value;
|
|
33
33
|
let dateFormatter = (0, $3HATx$useDateFormatter)({
|
|
34
|
-
weekday:
|
|
35
|
-
month:
|
|
36
|
-
year:
|
|
37
|
-
day:
|
|
34
|
+
weekday: 'long',
|
|
35
|
+
month: 'long',
|
|
36
|
+
year: 'numeric',
|
|
37
|
+
day: 'numeric',
|
|
38
38
|
era: $a074e1e2d0f0a665$export$134cbb7fb09a9522(start) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(end),
|
|
39
39
|
timeZone: state.timeZone
|
|
40
40
|
});
|
|
41
|
-
let anchorDate =
|
|
41
|
+
let anchorDate = 'anchorDate' in state ? state.anchorDate : null;
|
|
42
42
|
return (0, $3HATx$useMemo)(()=>{
|
|
43
43
|
// No message if currently selecting a range, or there is nothing highlighted.
|
|
44
44
|
if (!anchorDate && start && end) {
|
|
@@ -46,17 +46,17 @@ function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
|
|
|
46
46
|
// otherwise include both dates.
|
|
47
47
|
if ((0, $3HATx$isSameDay)(start, end)) {
|
|
48
48
|
let date = dateFormatter.format(start.toDate(state.timeZone));
|
|
49
|
-
return stringFormatter.format(
|
|
49
|
+
return stringFormatter.format('selectedDateDescription', {
|
|
50
50
|
date: date
|
|
51
51
|
});
|
|
52
52
|
} else {
|
|
53
53
|
let dateRange = $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start, end, state.timeZone);
|
|
54
|
-
return stringFormatter.format(
|
|
54
|
+
return stringFormatter.format('selectedRangeDescription', {
|
|
55
55
|
dateRange: dateRange
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return '';
|
|
60
60
|
}, [
|
|
61
61
|
start,
|
|
62
62
|
end,
|
|
@@ -67,19 +67,19 @@ function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
|
|
|
67
67
|
]);
|
|
68
68
|
}
|
|
69
69
|
function $a074e1e2d0f0a665$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
|
|
70
|
-
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))),
|
|
70
|
+
let stringFormatter = (0, $3HATx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3HATx$intlStringsmodulejs))), '@react-aria/calendar');
|
|
71
71
|
let era = $a074e1e2d0f0a665$export$134cbb7fb09a9522(startDate) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(endDate);
|
|
72
72
|
let monthFormatter = (0, $3HATx$useDateFormatter)({
|
|
73
|
-
month:
|
|
74
|
-
year:
|
|
73
|
+
month: 'long',
|
|
74
|
+
year: 'numeric',
|
|
75
75
|
era: era,
|
|
76
76
|
calendar: startDate.calendar.identifier,
|
|
77
77
|
timeZone: timeZone
|
|
78
78
|
});
|
|
79
79
|
let dateFormatter = (0, $3HATx$useDateFormatter)({
|
|
80
|
-
month:
|
|
81
|
-
year:
|
|
82
|
-
day:
|
|
80
|
+
month: 'long',
|
|
81
|
+
year: 'numeric',
|
|
82
|
+
day: 'numeric',
|
|
83
83
|
era: era,
|
|
84
84
|
calendar: startDate.calendar.identifier,
|
|
85
85
|
timeZone: timeZone
|
|
@@ -109,17 +109,17 @@ function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start
|
|
|
109
109
|
let separatorIndex = -1;
|
|
110
110
|
for(let i = 0; i < parts.length; i++){
|
|
111
111
|
let part = parts[i];
|
|
112
|
-
if (part.source ===
|
|
113
|
-
else if (part.source ===
|
|
112
|
+
if (part.source === 'shared' && part.type === 'literal') separatorIndex = i;
|
|
113
|
+
else if (part.source === 'endRange') break;
|
|
114
114
|
}
|
|
115
115
|
// Now we can combine the parts into start and end strings.
|
|
116
|
-
let startValue =
|
|
117
|
-
let endValue =
|
|
116
|
+
let startValue = '';
|
|
117
|
+
let endValue = '';
|
|
118
118
|
for(let i = 0; i < parts.length; i++){
|
|
119
119
|
if (i < separatorIndex) startValue += parts[i].value;
|
|
120
120
|
else if (i > separatorIndex) endValue += parts[i].value;
|
|
121
121
|
}
|
|
122
|
-
return stringFormatter.format(
|
|
122
|
+
return stringFormatter.format('dateRange', {
|
|
123
123
|
startDate: startValue,
|
|
124
124
|
endDate: endValue
|
|
125
125
|
});
|
package/dist/zh-CN.mjs
CHANGED
package/dist/zh-TW.mjs
CHANGED