@react-aria/calendar 3.0.0-nightly.2912 → 3.0.0-nightly.2917
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/useCalendarBase.main.js +13 -13
- package/dist/useCalendarBase.mjs +13 -13
- package/dist/useCalendarBase.module.js +13 -13
- package/dist/useCalendarCell.main.js +40 -40
- package/dist/useCalendarCell.mjs +40 -40
- package/dist/useCalendarCell.module.js +40 -40
- package/dist/useCalendarGrid.main.js +23 -23
- package/dist/useCalendarGrid.mjs +23 -23
- package/dist/useCalendarGrid.module.js +23 -23
- package/dist/useRangeCalendar.main.js +4 -4
- package/dist/useRangeCalendar.mjs +4 -4
- package/dist/useRangeCalendar.module.js +4 -4
- package/dist/utils.main.js +22 -22
- package/dist/utils.mjs +22 -22
- package/dist/utils.module.js +22 -22
- package/package.json +11 -11
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
|
});
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/calendar",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.2917+c34886769",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@internationalized/date": "3.5.
|
|
26
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
27
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
28
|
-
"@react-aria/live-announcer": "3.0.0-nightly.
|
|
29
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
30
|
-
"@react-stately/calendar": "3.0.0-nightly.
|
|
31
|
-
"@react-types/button": "3.9.
|
|
32
|
-
"@react-types/calendar": "3.0.0-nightly.
|
|
33
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
25
|
+
"@internationalized/date": "3.5.5-nightly.4629+c34886769",
|
|
26
|
+
"@react-aria/i18n": "3.0.0-nightly.2917+c34886769",
|
|
27
|
+
"@react-aria/interactions": "3.0.0-nightly.2917+c34886769",
|
|
28
|
+
"@react-aria/live-announcer": "3.0.0-nightly.2917+c34886769",
|
|
29
|
+
"@react-aria/utils": "3.0.0-nightly.2917+c34886769",
|
|
30
|
+
"@react-stately/calendar": "3.0.0-nightly.2917+c34886769",
|
|
31
|
+
"@react-types/button": "3.9.5-nightly.4629+c34886769",
|
|
32
|
+
"@react-types/calendar": "3.0.0-nightly.2917+c34886769",
|
|
33
|
+
"@react-types/shared": "3.0.0-nightly.2917+c34886769",
|
|
34
34
|
"@swc/helpers": "^0.5.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c34886769d3e69bb56553a02eead6a0fd877e754"
|
|
44
44
|
}
|