@react-stately/datepicker 3.0.0-nightly.3180 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +44 -42
- package/dist/main.js.map +1 -1
- package/dist/module.js +40 -26
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +14 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +9 -4
- package/src/useDateFieldState.ts +5 -2
- package/src/useDatePickerState.ts +7 -6
- package/src/useDateRangePickerState.ts +43 -11
- package/src/useTimeFieldState.ts +2 -2
package/dist/main.js
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
var $h2qOe$internationalizeddate = require("@internationalized/date");
|
|
2
2
|
var $h2qOe$reactstatelyutils = require("@react-stately/utils");
|
|
3
|
+
var $h2qOe$reactstatelyoverlays = require("@react-stately/overlays");
|
|
3
4
|
var $h2qOe$react = require("react");
|
|
4
5
|
|
|
5
|
-
function $parcel$exportWildcard(dest, source) {
|
|
6
|
-
Object.keys(source).forEach(function(key) {
|
|
7
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(dest, key, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function get() {
|
|
14
|
-
return source[key];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return dest;
|
|
20
|
-
}
|
|
21
6
|
function $parcel$export(e, n, v, s) {
|
|
22
7
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
23
8
|
}
|
|
24
|
-
var $aaab7a647e17e1fd$exports = {};
|
|
25
9
|
|
|
26
|
-
$parcel$export(
|
|
10
|
+
$parcel$export(module.exports, "useDatePickerState", () => $aaab7a647e17e1fd$export$87194bb378cc3ac2);
|
|
11
|
+
$parcel$export(module.exports, "useDateFieldState", () => $596a1f0f523d6752$export$60e84778edff6d26);
|
|
12
|
+
$parcel$export(module.exports, "useDateRangePickerState", () => $7072d26f58deb33b$export$e50a61c1de9f574);
|
|
13
|
+
$parcel$export(module.exports, "useTimeFieldState", () => $2654e87be0231a69$export$fd53cef0cc796101);
|
|
27
14
|
|
|
28
15
|
|
|
29
16
|
|
|
@@ -102,9 +89,10 @@ function $50d5d6a623389320$export$2440da353cedad43(v, granularity) {
|
|
|
102
89
|
|
|
103
90
|
|
|
104
91
|
|
|
92
|
+
|
|
105
93
|
function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
|
|
106
94
|
var ref;
|
|
107
|
-
let
|
|
95
|
+
let overlayState = $h2qOe$reactstatelyoverlays.useOverlayTriggerState(props);
|
|
108
96
|
let [value, setValue] = $h2qOe$reactstatelyutils.useControlledState(props.value, props.defaultValue || null, props.onChange);
|
|
109
97
|
let v = value || props.placeholderValue;
|
|
110
98
|
let [granularity, defaultTimeZone] = $50d5d6a623389320$export$2440da353cedad43(v, props.granularity);
|
|
@@ -130,7 +118,7 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
|
|
|
130
118
|
if (selectedTime || shouldClose) commitValue(newValue, selectedTime || $50d5d6a623389320$export$c5221a78ef73c5e9(props.placeholderValue));
|
|
131
119
|
else setSelectedDate(newValue);
|
|
132
120
|
} else setValue(newValue);
|
|
133
|
-
if (shouldClose) setOpen(false);
|
|
121
|
+
if (shouldClose) overlayState.setOpen(false);
|
|
134
122
|
};
|
|
135
123
|
let selectTime = (newValue)=>{
|
|
136
124
|
if (selectedDate) commitValue(selectedDate, newValue);
|
|
@@ -146,13 +134,13 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
|
|
|
146
134
|
setTimeValue: selectTime,
|
|
147
135
|
granularity: granularity,
|
|
148
136
|
hasTime: hasTime,
|
|
149
|
-
isOpen:
|
|
137
|
+
isOpen: overlayState.isOpen,
|
|
150
138
|
setOpen (isOpen) {
|
|
151
139
|
// Commit the selected date when the calendar is closed. Use a placeholder time if one wasn't set.
|
|
152
140
|
// If only the time was set and not the date, don't commit. The state will be preserved until
|
|
153
141
|
// the user opens the popover again.
|
|
154
142
|
if (!isOpen && !value && selectedDate && hasTime) commitValue(selectedDate, selectedTime || $50d5d6a623389320$export$c5221a78ef73c5e9(props.placeholderValue));
|
|
155
|
-
setOpen(isOpen);
|
|
143
|
+
overlayState.setOpen(isOpen);
|
|
156
144
|
},
|
|
157
145
|
validationState: validationState,
|
|
158
146
|
formatValue (locale, fieldOptions) {
|
|
@@ -170,9 +158,6 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
|
|
|
170
158
|
}
|
|
171
159
|
|
|
172
160
|
|
|
173
|
-
var $596a1f0f523d6752$exports = {};
|
|
174
|
-
|
|
175
|
-
$parcel$export($596a1f0f523d6752$exports, "useDateFieldState", () => $596a1f0f523d6752$export$60e84778edff6d26);
|
|
176
161
|
|
|
177
162
|
|
|
178
163
|
|
|
@@ -347,6 +332,7 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
|
|
|
347
332
|
setValue($596a1f0f523d6752$var$addSegment(displayValue, type, amount, resolvedOptions));
|
|
348
333
|
};
|
|
349
334
|
let validationState = props.validationState || ($50d5d6a623389320$export$eac50920cf2fd59a(calendarValue, props.minValue, props.maxValue) ? 'invalid' : null);
|
|
335
|
+
var _maxGranularity1;
|
|
350
336
|
return {
|
|
351
337
|
value: calendarValue,
|
|
352
338
|
dateValue: dateValue,
|
|
@@ -355,6 +341,7 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
|
|
|
355
341
|
dateFormatter: dateFormatter,
|
|
356
342
|
validationState: validationState,
|
|
357
343
|
granularity: granularity,
|
|
344
|
+
maxGranularity: (_maxGranularity1 = props.maxGranularity) !== null && _maxGranularity1 !== void 0 ? _maxGranularity1 : 'year',
|
|
358
345
|
isDisabled: isDisabled,
|
|
359
346
|
isReadOnly: isReadOnly,
|
|
360
347
|
isRequired: isRequired,
|
|
@@ -555,16 +542,14 @@ function $596a1f0f523d6752$var$setSegment(value, part, segmentValue, options) {
|
|
|
555
542
|
}
|
|
556
543
|
|
|
557
544
|
|
|
558
|
-
var $7072d26f58deb33b$exports = {};
|
|
559
545
|
|
|
560
|
-
$parcel$export($7072d26f58deb33b$exports, "useDateRangePickerState", () => $7072d26f58deb33b$export$e50a61c1de9f574);
|
|
561
546
|
|
|
562
547
|
|
|
563
548
|
|
|
564
549
|
|
|
565
550
|
function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
566
551
|
var ref, ref1;
|
|
567
|
-
let
|
|
552
|
+
let overlayState = $h2qOe$reactstatelyoverlays.useOverlayTriggerState(props);
|
|
568
553
|
let [controlledValue, setControlledValue] = $h2qOe$reactstatelyutils.useControlledState(props.value, props.defaultValue || null, props.onChange);
|
|
569
554
|
let [placeholderValue, setPlaceholderValue] = $h2qOe$react.useState(()=>controlledValue || {
|
|
570
555
|
start: null,
|
|
@@ -616,7 +601,7 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
|
616
601
|
else setSelectedDateRange(range);
|
|
617
602
|
} else if (range.start && range.end) setValue(range);
|
|
618
603
|
else setSelectedDateRange(range);
|
|
619
|
-
if (shouldClose) setOpen(false);
|
|
604
|
+
if (shouldClose) overlayState.setOpen(false);
|
|
620
605
|
};
|
|
621
606
|
let setTimeRange = (range)=>{
|
|
622
607
|
if ((dateRange1 === null || dateRange1 === void 0 ? void 0 : dateRange1.start) && (dateRange1 === null || dateRange1 === void 0 ? void 0 : dateRange1.end) && range.start && range.end) commitValue(dateRange1, range);
|
|
@@ -650,7 +635,7 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
|
650
635
|
},
|
|
651
636
|
setDateRange: setDateRange,
|
|
652
637
|
setTimeRange: setTimeRange,
|
|
653
|
-
isOpen:
|
|
638
|
+
isOpen: overlayState.isOpen,
|
|
654
639
|
setOpen (isOpen) {
|
|
655
640
|
// Commit the selected date range when the calendar is closed. Use a placeholder time if one wasn't set.
|
|
656
641
|
// If only the time range was set and not the date range, don't commit. The state will be preserved until
|
|
@@ -659,11 +644,11 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
|
659
644
|
start: (timeRange1 === null || timeRange1 === void 0 ? void 0 : timeRange1.start) || $50d5d6a623389320$export$c5221a78ef73c5e9(props.placeholderValue),
|
|
660
645
|
end: (timeRange1 === null || timeRange1 === void 0 ? void 0 : timeRange1.end) || $50d5d6a623389320$export$c5221a78ef73c5e9(props.placeholderValue)
|
|
661
646
|
});
|
|
662
|
-
setOpen(isOpen);
|
|
647
|
+
overlayState.setOpen(isOpen);
|
|
663
648
|
},
|
|
664
649
|
validationState: validationState,
|
|
665
650
|
formatValue (locale, fieldOptions) {
|
|
666
|
-
if (!value1 || !value1.start || !value1.end) return
|
|
651
|
+
if (!value1 || !value1.start || !value1.end) return null;
|
|
667
652
|
let startTimeZone = 'timeZone' in value1.start ? value1.start.timeZone : undefined;
|
|
668
653
|
let startGranularity = props.granularity || (value1.start && 'minute' in value1.start ? 'minute' : 'day');
|
|
669
654
|
let endTimeZone = 'timeZone' in value1.end ? value1.end.timeZone : undefined;
|
|
@@ -674,14 +659,35 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
|
674
659
|
hideTimeZone: props.hideTimeZone,
|
|
675
660
|
hourCycle: props.hourCycle
|
|
676
661
|
});
|
|
662
|
+
let startDate = value1.start.toDate(startTimeZone || 'UTC');
|
|
663
|
+
let endDate = value1.end.toDate(endTimeZone || 'UTC');
|
|
677
664
|
let startFormatter = new $h2qOe$internationalizeddate.DateFormatter(locale, startOptions);
|
|
678
665
|
let endFormatter;
|
|
679
|
-
if (startTimeZone === endTimeZone && startGranularity === endGranularity) {
|
|
666
|
+
if (startTimeZone === endTimeZone && startGranularity === endGranularity && value1.start.compare(value1.end) !== 0) {
|
|
680
667
|
// Use formatRange, as it results in shorter output when some of the fields
|
|
681
668
|
// are shared between the start and end dates (e.g. the same month).
|
|
682
669
|
// Formatting will fail if the end date is before the start date. Fall back below when that happens.
|
|
683
670
|
try {
|
|
684
|
-
|
|
671
|
+
let parts = startFormatter.formatRangeToParts(startDate, endDate);
|
|
672
|
+
// Find the separator between the start and end date. This is determined
|
|
673
|
+
// by finding the last shared literal before the end range.
|
|
674
|
+
let separatorIndex = -1;
|
|
675
|
+
for(let i = 0; i < parts.length; i++){
|
|
676
|
+
let part = parts[i];
|
|
677
|
+
if (part.source === 'shared' && part.type === 'literal') separatorIndex = i;
|
|
678
|
+
else if (part.source === 'endRange') break;
|
|
679
|
+
}
|
|
680
|
+
// Now we can combine the parts into start and end strings.
|
|
681
|
+
let start = '';
|
|
682
|
+
let end = '';
|
|
683
|
+
for(let i1 = 0; i1 < parts.length; i1++){
|
|
684
|
+
if (i1 < separatorIndex) start += parts[i1].value;
|
|
685
|
+
else if (i1 > separatorIndex) end += parts[i1].value;
|
|
686
|
+
}
|
|
687
|
+
return {
|
|
688
|
+
start: start,
|
|
689
|
+
end: end
|
|
690
|
+
};
|
|
685
691
|
} catch (e) {
|
|
686
692
|
// ignore
|
|
687
693
|
}
|
|
@@ -695,7 +701,10 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
|
695
701
|
});
|
|
696
702
|
endFormatter = new $h2qOe$internationalizeddate.DateFormatter(locale, endOptions);
|
|
697
703
|
}
|
|
698
|
-
return
|
|
704
|
+
return {
|
|
705
|
+
start: startFormatter.format(startDate),
|
|
706
|
+
end: endFormatter.format(endDate)
|
|
707
|
+
};
|
|
699
708
|
},
|
|
700
709
|
confirmPlaceholder () {
|
|
701
710
|
// Need to use ref value here because the value can be set in the same tick as
|
|
@@ -714,9 +723,6 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
|
|
|
714
723
|
}
|
|
715
724
|
|
|
716
725
|
|
|
717
|
-
var $2654e87be0231a69$exports = {};
|
|
718
|
-
|
|
719
|
-
$parcel$export($2654e87be0231a69$exports, "useTimeFieldState", () => $2654e87be0231a69$export$fd53cef0cc796101);
|
|
720
726
|
|
|
721
727
|
|
|
722
728
|
|
|
@@ -768,10 +774,6 @@ function $2654e87be0231a69$var$convertValue(value, date = $h2qOe$internationaliz
|
|
|
768
774
|
}
|
|
769
775
|
|
|
770
776
|
|
|
771
|
-
$parcel$exportWildcard(module.exports, $aaab7a647e17e1fd$exports);
|
|
772
|
-
$parcel$exportWildcard(module.exports, $596a1f0f523d6752$exports);
|
|
773
|
-
$parcel$exportWildcard(module.exports, $7072d26f58deb33b$exports);
|
|
774
|
-
$parcel$exportWildcard(module.exports, $2654e87be0231a69$exports);
|
|
775
777
|
|
|
776
778
|
|
|
777
779
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;SEgBgB,yCAAS,CAAC,KAAgB,EAAE,QAAmB,EAAE,QAAmB,EAAE,CAAC;IACrF,MAAM,CAAC,KAAK,IAAI,IAAI,KACjB,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,IAC/C,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC;AAEpD,CAAC;AAWD,KAAK,CAAC,2CAAqB,GAAiB,CAAC;IAC3C,IAAI,EAAE,CAAS;IACf,KAAK,EAAE,CAAS;IAChB,GAAG,EAAE,CAAS;IACd,IAAI,EAAE,CAAS;IACf,MAAM,EAAE,CAAS;IACjB,MAAM,EAAE,CAAS;AACnB,CAAC;SAEe,yCAAgB,CAC9B,YAA0B,EAC1B,OAAyB,EACG,CAAC;IAC7B,YAAY,GAAG,CAAC;WAAG,2CAAqB;WAAK,YAAY;IAAA,CAAC;IAC1D,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,CAAQ;IACjD,GAAG,CAAC,IAAI,GAAG,MAAM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c,MAAQ,GAAG,CAAC,8CAAiB;IAC7C,CAAC;AACH,CAAC;SAEQ,kCAAY,CAAC,KAAgB,EAAE,IAAe,GAAG,kCAAK,CAAC,6CAAgB,KAAK,CAAC;IACpF,EAAE,GAAG,KAAK,EACR,MAAM,CAAC,IAAI;IAGb,EAAE,EAAE,CAAK,QAAI,KAAK,EAChB,MAAM,CAAC,KAAK;IAGd,MAAM,CAAC,+CAAkB,CAAC,IAAI,EAAE,KAAK;AACvC,CAAC;;","sources":["packages/@react-stately/datepicker/src/index.ts","packages/@react-stately/datepicker/src/useDatePickerState.ts","packages/@react-stately/datepicker/src/utils.ts","packages/@react-stately/datepicker/src/useDateFieldState.ts","packages/@react-stately/datepicker/src/useDateRangePickerState.ts","packages/@react-stately/datepicker/src/useTimeFieldState.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\nexport * from './useDatePickerState';\nexport * from './useDateFieldState';\nexport * from './useDateRangePickerState';\nexport * from './useTimeFieldState';\n","/*\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 {CalendarDate, DateFormatter, toCalendarDate, toCalendarDateTime} from '@internationalized/date';\nimport {DatePickerProps, DateValue, Granularity, TimeValue} from '@react-types/datepicker';\nimport {FieldOptions, getFormatOptions, getPlaceholderTime, useDefaultProps} from './utils';\nimport {isInvalid} from './utils';\nimport {useControlledState} from '@react-stately/utils';\nimport {useState} from 'react';\nimport {ValidationState} from '@react-types/shared';\n\nexport interface DatePickerOptions extends DatePickerProps<DateValue> {\n /**\n * Determines whether the date picker popover should close automatically when a date is selected.\n * @default true\n */\n shouldCloseOnSelect?: boolean | (() => boolean)\n}\n\nexport interface DatePickerState {\n /** The currently selected date. */\n value: DateValue,\n /** Sets the selected date. */\n setValue(value: DateValue): void,\n /**\n * The date portion of the value. This may be set prior to `value` if the user has\n * selected a date but has not yet selected a time.\n */\n dateValue: DateValue,\n /** Sets the date portion of the value. */\n setDateValue(value: CalendarDate): void,\n /**\n * The time portion of the value. This may be set prior to `value` if the user has\n * selected a time but has not yet selected a date.\n */\n timeValue: TimeValue,\n /** Sets the time portion of the value. */\n setTimeValue(value: TimeValue): void,\n /** The granularity for the field, based on the `granularity` prop and current value. */\n granularity: Granularity,\n /** Whether the date picker supports selecting a time, according to the `granularity` prop and current value. */\n hasTime: boolean,\n /** Whether the calendar popover is currently open. */\n isOpen: boolean,\n /** Sets whether the calendar popover is open. */\n setOpen(isOpen: boolean): void,\n /** The current validation state of the date picker, based on the `validationState`, `minValue`, and `maxValue` props. */\n validationState: ValidationState,\n /** Formats the selected value using the given options. */\n formatValue(locale: string, fieldOptions: FieldOptions): string\n}\n\n/**\n * Provides state management for a date picker component.\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport function useDatePickerState(props: DatePickerOptions): DatePickerState {\n let [isOpen, setOpen] = useState(false);\n let [value, setValue] = useControlledState<DateValue>(props.value, props.defaultValue || null, props.onChange);\n\n let v = (value || props.placeholderValue);\n let [granularity, defaultTimeZone] = useDefaultProps(v, props.granularity);\n let dateValue = value != null ? value.toDate(defaultTimeZone ?? 'UTC') : null;\n let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second' || granularity === 'millisecond';\n let shouldCloseOnSelect = props.shouldCloseOnSelect ?? true;\n\n let [selectedDate, setSelectedDate] = useState<DateValue>(null);\n let [selectedTime, setSelectedTime] = useState<TimeValue>(null);\n\n if (value) {\n selectedDate = value;\n if ('hour' in value) {\n selectedTime = value;\n }\n }\n\n // props.granularity must actually exist in the value if one is provided.\n if (v && !(granularity in v)) {\n throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());\n }\n\n let commitValue = (date: DateValue, time: TimeValue) => {\n setValue('timeZone' in time ? time.set(toCalendarDate(date)) : toCalendarDateTime(date, time));\n };\n\n // Intercept setValue to make sure the Time section is not changed by date selection in Calendar\n let selectDate = (newValue: CalendarDate) => {\n let shouldClose = typeof shouldCloseOnSelect === 'function' ? shouldCloseOnSelect() : shouldCloseOnSelect;\n if (hasTime) {\n if (selectedTime || shouldClose) {\n commitValue(newValue, selectedTime || getPlaceholderTime(props.placeholderValue));\n } else {\n setSelectedDate(newValue);\n }\n } else {\n setValue(newValue);\n }\n\n if (shouldClose) {\n setOpen(false);\n }\n };\n\n let selectTime = (newValue: TimeValue) => {\n if (selectedDate) {\n commitValue(selectedDate, newValue);\n } else {\n setSelectedTime(newValue);\n }\n };\n\n let validationState: ValidationState = props.validationState ||\n (isInvalid(value, props.minValue, props.maxValue) ? 'invalid' : null) ||\n (value && props.isDateUnavailable?.(value) ? 'invalid' : null);\n\n return {\n value,\n setValue,\n dateValue: selectedDate,\n timeValue: selectedTime,\n setDateValue: selectDate,\n setTimeValue: selectTime,\n granularity,\n hasTime,\n isOpen,\n setOpen(isOpen) {\n // Commit the selected date when the calendar is closed. Use a placeholder time if one wasn't set.\n // If only the time was set and not the date, don't commit. The state will be preserved until\n // the user opens the popover again.\n if (!isOpen && !value && selectedDate && hasTime) {\n commitValue(selectedDate, selectedTime || getPlaceholderTime(props.placeholderValue));\n }\n\n setOpen(isOpen);\n },\n validationState,\n formatValue(locale, fieldOptions) {\n if (!dateValue) {\n return '';\n }\n\n let formatOptions = getFormatOptions(fieldOptions, {\n granularity,\n timeZone: defaultTimeZone,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle\n });\n\n let formatter = new DateFormatter(locale, formatOptions);\n return formatter.format(dateValue);\n }\n };\n}\n","/*\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 {Calendar, now, Time, toCalendar, toCalendarDate, toCalendarDateTime} from '@internationalized/date';\nimport {DatePickerProps, DateValue, Granularity, TimeValue} from '@react-types/datepicker';\nimport {useRef} from 'react';\n\nexport function isInvalid(value: DateValue, minValue: DateValue, maxValue: DateValue) {\n return value != null && (\n (minValue != null && value.compare(minValue) < 0) ||\n (maxValue != null && value.compare(maxValue) > 0)\n );\n}\n\nexport type FieldOptions = Pick<Intl.DateTimeFormatOptions, 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second'>;\ninterface FormatterOptions {\n timeZone?: string,\n hideTimeZone?: boolean,\n granularity?: DatePickerProps<any>['granularity'],\n maxGranularity?: 'year' | 'month' | DatePickerProps<any>['granularity'],\n hourCycle?: 12 | 24\n}\n\nconst DEFAULT_FIELD_OPTIONS: FieldOptions = {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n};\n\nexport function getFormatOptions(\n fieldOptions: FieldOptions,\n options: FormatterOptions\n): Intl.DateTimeFormatOptions {\n fieldOptions = {...DEFAULT_FIELD_OPTIONS, ...fieldOptions};\n let granularity = options.granularity || 'minute';\n let keys = Object.keys(fieldOptions);\n let startIdx = keys.indexOf(options.maxGranularity ?? 'year');\n if (startIdx < 0) {\n startIdx = 0;\n }\n\n let endIdx = keys.indexOf(granularity);\n if (endIdx < 0) {\n endIdx = 2;\n }\n\n if (startIdx > endIdx) {\n throw new Error('maxGranularity must be greater than granularity');\n }\n\n let opts: Intl.DateTimeFormatOptions = keys.slice(startIdx, endIdx + 1).reduce((opts, key) => {\n opts[key] = fieldOptions[key];\n return opts;\n }, {});\n\n if (options.hourCycle != null) {\n opts.hour12 = options.hourCycle === 12;\n }\n\n opts.timeZone = options.timeZone || 'UTC';\n\n let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second';\n if (hasTime && options.timeZone && !options.hideTimeZone) {\n opts.timeZoneName = 'short';\n }\n\n return opts;\n}\n\nexport function getPlaceholderTime(placeholderValue: DateValue): TimeValue {\n if (placeholderValue && 'hour' in placeholderValue) {\n return placeholderValue;\n }\n\n return new Time();\n}\n\nexport function convertValue(value: DateValue, calendar: Calendar): DateValue {\n if (value === null) {\n return null;\n }\n\n if (!value) {\n return undefined;\n }\n\n return toCalendar(value, calendar);\n}\n\n\nexport function createPlaceholderDate(placeholderValue: DateValue, granularity: string, calendar: Calendar, timeZone: string) {\n if (placeholderValue) {\n return convertValue(placeholderValue, calendar);\n }\n\n let date = toCalendar(now(timeZone).set({\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0\n }), calendar);\n\n if (granularity === 'year' || granularity === 'month' || granularity === 'day') {\n return toCalendarDate(date);\n }\n\n if (!timeZone) {\n return toCalendarDateTime(date);\n }\n\n return date;\n}\n\nexport function useDefaultProps(v: DateValue, granularity: Granularity): [Granularity, string] {\n // Compute default granularity and time zone from the value. If the value becomes null, keep the last values.\n let lastValue = useRef(v);\n if (v) {\n lastValue.current = v;\n }\n\n v = lastValue.current;\n let defaultTimeZone = (v && 'timeZone' in v ? v.timeZone : undefined);\n granularity = granularity || (v && 'minute' in v ? 'minute' : 'day');\n\n // props.granularity must actually exist in the value if one is provided.\n if (v && !(granularity in v)) {\n throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());\n }\n\n return [granularity, defaultTimeZone];\n}\n","/*\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 {Calendar, DateFormatter, getMinimumDayInMonth, getMinimumMonthInYear, GregorianCalendar, toCalendar} from '@internationalized/date';\nimport {convertValue, createPlaceholderDate, FieldOptions, getFormatOptions, isInvalid, useDefaultProps} from './utils';\nimport {DatePickerProps, DateValue, Granularity} from '@react-types/datepicker';\nimport {useControlledState} from '@react-stately/utils';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {ValidationState} from '@react-types/shared';\n\nexport type SegmentType = 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName';\nexport interface DateSegment {\n /** The type of segment. */\n type: SegmentType,\n /** The formatted text for the segment. */\n text: string,\n /** The numeric value for the segment, if applicable. */\n value?: number,\n /** The minimum numeric value for the segment, if applicable. */\n minValue?: number,\n /** The maximum numeric value for the segment, if applicable. */\n maxValue?: number,\n /** Whether the value is a placeholder. */\n isPlaceholder: boolean,\n /** Whether the segment is editable. */\n isEditable: boolean\n}\n\nexport interface DateFieldState {\n /** The current field value. */\n value: DateValue,\n /** The current value, converted to a native JavaScript `Date` object. */\n dateValue: Date,\n /** Sets the field's value. */\n setValue(value: DateValue): void,\n /** A list of segments for the current value. */\n segments: DateSegment[],\n /** A date formatter configured for the current locale and format. */\n dateFormatter: DateFormatter,\n /** The current validation state of the date field, based on the `validationState`, `minValue`, and `maxValue` props. */\n validationState: ValidationState,\n /** The granularity for the field, based on the `granularity` prop and current value. */\n granularity: Granularity,\n /** Whether the field is disabled. */\n isDisabled: boolean,\n /** Whether the field is read only. */\n isReadOnly: boolean,\n /** Whether the field is required. */\n isRequired: boolean,\n /** Increments the given segment. Upon reaching the minimum or maximum value, the value wraps around to the opposite limit. */\n increment(type: SegmentType): void,\n /** Decrements the given segment. Upon reaching the minimum or maximum value, the value wraps around to the opposite limit. */\n decrement(type: SegmentType): void,\n /**\n * Increments the given segment by a larger amount, rounding it to the nearest increment.\n * The amount to increment by depends on the field, for example 15 minutes, 7 days, and 5 years.\n * Upon reaching the minimum or maximum value, the value wraps around to the opposite limit.\n */\n incrementPage(type: SegmentType): void,\n /**\n * Decrements the given segment by a larger amount, rounding it to the nearest increment.\n * The amount to decrement by depends on the field, for example 15 minutes, 7 days, and 5 years.\n * Upon reaching the minimum or maximum value, the value wraps around to the opposite limit.\n */\n decrementPage(type: SegmentType): void,\n /** Sets the value of the given segment. */\n setSegment(type: SegmentType, value: number): void,\n /**\n * Replaces the value of the date field with the placeholder value.\n * If a segment type is provided, only that segment is confirmed. Otherwise, all segments that have not been entered yet are confirmed.\n */\n confirmPlaceholder(type?: SegmentType): void,\n /** Clears the value of the given segment, reverting it to the placeholder. */\n clearSegment(type: SegmentType): void,\n /** Formats the current date value using the given options. */\n formatValue(fieldOptions: FieldOptions): string\n}\n\nconst EDITABLE_SEGMENTS = {\n year: true,\n month: true,\n day: true,\n hour: true,\n minute: true,\n second: true,\n dayPeriod: true,\n era: true\n};\n\nconst PAGE_STEP = {\n year: 5,\n month: 2,\n day: 7,\n hour: 2,\n minute: 15,\n second: 15\n};\n\n// Node seems to convert everything to lowercase...\nconst TYPE_MAPPING = {\n dayperiod: 'dayPeriod'\n};\n\ninterface DatePickerFieldProps extends DatePickerProps<DateValue> {\n /**\n * The maximum unit to display in the date field.\n * @default 'year'\n */\n maxGranularity?: 'year' | 'month' | Granularity,\n /** The locale to display and edit the value according to. */\n locale: string,\n /**\n * A function that creates a [Calendar](../internationalized/date/Calendar.html)\n * object for a given calendar identifier. Such a function may be imported from the\n * `@internationalized/date` package, or manually implemented to include support for\n * only certain calendars.\n */\n createCalendar: (name: string) => Calendar\n}\n\n/**\n * Provides state management for a date field component.\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport function useDateFieldState(props: DatePickerFieldProps): DateFieldState {\n let {\n locale,\n createCalendar,\n hideTimeZone,\n isDisabled,\n isReadOnly,\n isRequired\n } = props;\n\n let v: DateValue = (props.value || props.defaultValue || props.placeholderValue);\n let [granularity, defaultTimeZone] = useDefaultProps(v, props.granularity);\n let timeZone = defaultTimeZone || 'UTC';\n\n // props.granularity must actually exist in the value if one is provided.\n if (v && !(granularity in v)) {\n throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());\n }\n\n let formatOpts = useMemo(() => ({\n granularity,\n maxGranularity: props.maxGranularity ?? 'year',\n timeZone: defaultTimeZone,\n hideTimeZone,\n hourCycle: props.hourCycle\n }), [props.maxGranularity, granularity, props.hourCycle, defaultTimeZone, hideTimeZone]);\n let opts = useMemo(() => getFormatOptions({}, formatOpts), [formatOpts]);\n\n let dateFormatter = useMemo(() => new DateFormatter(locale, opts), [locale, opts]);\n let resolvedOptions = useMemo(() => dateFormatter.resolvedOptions(), [dateFormatter]);\n let calendar = useMemo(() => createCalendar(resolvedOptions.calendar), [createCalendar, resolvedOptions.calendar]);\n\n // Determine how many editable segments there are for validation purposes.\n // The result is cached for performance.\n let allSegments = useMemo(() =>\n dateFormatter.formatToParts(new Date())\n .filter(seg => EDITABLE_SEGMENTS[seg.type])\n .reduce((p, seg) => (p[seg.type] = true, p), {})\n , [dateFormatter]);\n\n let [validSegments, setValidSegments] = useState<Partial<typeof EDITABLE_SEGMENTS>>(\n () => props.value || props.defaultValue ? {...allSegments} : {}\n );\n\n // We keep track of the placeholder date separately in state so that onChange is not called\n // until all segments are set. If the value === null (not undefined), then assume the component\n // is controlled, so use the placeholder as the value until all segments are entered so it doesn't\n // change from uncontrolled to controlled and emit a warning.\n let [placeholderDate, setPlaceholderDate] = useState(\n () => createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)\n );\n\n // Reset placeholder when calendar changes\n let lastCalendarIdentifier = useRef(calendar.identifier);\n useEffect(() => {\n if (calendar.identifier !== lastCalendarIdentifier.current) {\n lastCalendarIdentifier.current = calendar.identifier;\n setPlaceholderDate(placeholder =>\n Object.keys(validSegments).length > 0\n ? toCalendar(placeholder, calendar)\n : createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)\n );\n }\n }, [calendar, granularity, validSegments, defaultTimeZone, props.placeholderValue]);\n\n let [value, setDate] = useControlledState<DateValue>(\n props.value,\n props.defaultValue,\n props.onChange\n );\n\n let calendarValue = useMemo(() => convertValue(value, calendar), [value, calendar]);\n\n // If there is a value prop, and some segments were previously placeholders, mark them all as valid.\n if (value && Object.keys(validSegments).length < Object.keys(allSegments).length) {\n validSegments = {...allSegments};\n setValidSegments(validSegments);\n }\n\n // If the value is set to null and all segments are valid, reset the placeholder.\n if (value == null && Object.keys(validSegments).length === Object.keys(allSegments).length) {\n validSegments = {};\n setValidSegments(validSegments);\n setPlaceholderDate(createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone));\n }\n\n // If all segments are valid, use the date from state, otherwise use the placeholder date.\n let displayValue = calendarValue && Object.keys(validSegments).length >= Object.keys(allSegments).length ? calendarValue : placeholderDate;\n let setValue = (newValue: DateValue) => {\n if (props.isDisabled || props.isReadOnly) {\n return;\n }\n\n if (Object.keys(validSegments).length >= Object.keys(allSegments).length) {\n // The display calendar should not have any effect on the emitted value.\n // Emit dates in the same calendar as the original value, if any, otherwise gregorian.\n newValue = toCalendar(newValue, v?.calendar || new GregorianCalendar());\n setDate(newValue);\n } else {\n setPlaceholderDate(newValue);\n }\n };\n\n let dateValue = useMemo(() => displayValue.toDate(timeZone), [displayValue, timeZone]);\n let segments = useMemo(() =>\n dateFormatter.formatToParts(dateValue)\n .map(segment => {\n let isEditable = EDITABLE_SEGMENTS[segment.type];\n if (segment.type === 'era' && calendar.getEras().length === 1) {\n isEditable = false;\n }\n\n return {\n type: TYPE_MAPPING[segment.type] || segment.type,\n text: segment.value,\n ...getSegmentLimits(displayValue, segment.type, resolvedOptions),\n isPlaceholder: EDITABLE_SEGMENTS[segment.type] && !validSegments[segment.type],\n isEditable\n } as DateSegment;\n })\n , [dateValue, validSegments, dateFormatter, resolvedOptions, displayValue, calendar]);\n\n let hasEra = useMemo(() => segments.some(s => s.type === 'era'), [segments]);\n\n let markValid = (part: Intl.DateTimeFormatPartTypes) => {\n validSegments[part] = true;\n if (part === 'year' && hasEra) {\n validSegments.era = true;\n }\n setValidSegments({...validSegments});\n };\n\n let adjustSegment = (type: Intl.DateTimeFormatPartTypes, amount: number) => {\n markValid(type);\n setValue(addSegment(displayValue, type, amount, resolvedOptions));\n };\n\n let validationState: ValidationState = props.validationState ||\n (isInvalid(calendarValue, props.minValue, props.maxValue) ? 'invalid' : null);\n\n return {\n value: calendarValue,\n dateValue,\n setValue,\n segments,\n dateFormatter,\n validationState,\n granularity,\n isDisabled,\n isReadOnly,\n isRequired,\n increment(part) {\n adjustSegment(part, 1);\n },\n decrement(part) {\n adjustSegment(part, -1);\n },\n incrementPage(part) {\n adjustSegment(part, PAGE_STEP[part] || 1);\n },\n decrementPage(part) {\n adjustSegment(part, -(PAGE_STEP[part] || 1));\n },\n setSegment(part, v) {\n markValid(part);\n setValue(setSegment(displayValue, part, v, resolvedOptions));\n },\n confirmPlaceholder(part) {\n if (props.isDisabled || props.isReadOnly) {\n return;\n }\n\n if (!part) {\n // Confirm the rest of the placeholder if any of the segments are valid.\n let numValid = Object.keys(validSegments).length;\n if (numValid > 0 && numValid < Object.keys(allSegments).length) {\n validSegments = {...allSegments};\n setValidSegments(validSegments);\n setValue(displayValue.copy());\n }\n } else if (!validSegments[part]) {\n markValid(part);\n setValue(displayValue.copy());\n }\n },\n clearSegment(part) {\n delete validSegments[part];\n setValidSegments({...validSegments});\n\n let placeholder = createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone);\n let value = displayValue;\n\n // Reset day period to default without changing the hour.\n if (part === 'dayPeriod' && 'hour' in displayValue && 'hour' in placeholder) {\n let isPM = displayValue.hour >= 12;\n let shouldBePM = placeholder.hour >= 12;\n if (isPM && !shouldBePM) {\n value = displayValue.set({hour: displayValue.hour - 12});\n } else if (!isPM && shouldBePM) {\n value = displayValue.set({hour: displayValue.hour + 12});\n }\n } else if (part in displayValue) {\n value = displayValue.set({[part]: placeholder[part]});\n }\n\n setDate(null);\n setValue(value);\n },\n formatValue(fieldOptions: FieldOptions) {\n if (!calendarValue) {\n return '';\n }\n\n let formatOptions = getFormatOptions(fieldOptions, formatOpts);\n let formatter = new DateFormatter(locale, formatOptions);\n return formatter.format(dateValue);\n }\n };\n}\n\nfunction getSegmentLimits(date: DateValue, type: string, options: Intl.ResolvedDateTimeFormatOptions) {\n switch (type) {\n case 'era': {\n let eras = date.calendar.getEras();\n return {\n value: eras.indexOf(date.era),\n minValue: 0,\n maxValue: eras.length - 1\n };\n }\n case 'year':\n return {\n value: date.year,\n minValue: 1,\n maxValue: date.calendar.getYearsInEra(date)\n };\n case 'month':\n return {\n value: date.month,\n minValue: getMinimumMonthInYear(date),\n maxValue: date.calendar.getMonthsInYear(date)\n };\n case 'day':\n return {\n value: date.day,\n minValue: getMinimumDayInMonth(date),\n maxValue: date.calendar.getDaysInMonth(date)\n };\n }\n\n if ('hour' in date) {\n switch (type) {\n case 'dayPeriod':\n return {\n value: date.hour >= 12 ? 12 : 0,\n minValue: 0,\n maxValue: 12\n };\n case 'hour':\n if (options.hour12) {\n let isPM = date.hour >= 12;\n return {\n value: date.hour,\n minValue: isPM ? 12 : 0,\n maxValue: isPM ? 23 : 11\n };\n }\n\n return {\n value: date.hour,\n minValue: 0,\n maxValue: 23\n };\n case 'minute':\n return {\n value: date.minute,\n minValue: 0,\n maxValue: 59\n };\n case 'second':\n return {\n value: date.second,\n minValue: 0,\n maxValue: 59\n };\n }\n }\n\n return {};\n}\n\nfunction addSegment(value: DateValue, part: string, amount: number, options: Intl.ResolvedDateTimeFormatOptions) {\n switch (part) {\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return value.cycle(part, amount, {round: part === 'year'});\n }\n\n if ('hour' in value) {\n switch (part) {\n case 'dayPeriod': {\n let hours = value.hour;\n let isPM = hours >= 12;\n return value.set({hour: isPM ? hours - 12 : hours + 12});\n }\n case 'hour':\n case 'minute':\n case 'second':\n return value.cycle(part, amount, {\n round: part !== 'hour',\n hourCycle: options.hour12 ? 12 : 24\n });\n }\n }\n}\n\nfunction setSegment(value: DateValue, part: string, segmentValue: number, options: Intl.ResolvedDateTimeFormatOptions) {\n switch (part) {\n case 'day':\n case 'month':\n case 'year':\n return value.set({[part]: segmentValue});\n }\n\n if ('hour' in value) {\n switch (part) {\n case 'dayPeriod': {\n let hours = value.hour;\n let wasPM = hours >= 12;\n let isPM = segmentValue >= 12;\n if (isPM === wasPM) {\n return value;\n }\n return value.set({hour: wasPM ? hours - 12 : hours + 12});\n }\n case 'hour':\n // In 12 hour time, ensure that AM/PM does not change\n if (options.hour12) {\n let hours = value.hour;\n let wasPM = hours >= 12;\n if (!wasPM && segmentValue === 12) {\n segmentValue = 0;\n }\n if (wasPM && segmentValue < 12) {\n segmentValue += 12;\n }\n }\n // fallthrough\n case 'minute':\n case 'second':\n return value.set({[part]: segmentValue});\n }\n }\n}\n","/*\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 {createPlaceholderDate, FieldOptions, getFormatOptions, getPlaceholderTime, isInvalid, useDefaultProps} from './utils';\nimport {DateFormatter, toCalendarDate, toCalendarDateTime} from '@internationalized/date';\nimport {DateRange, DateRangePickerProps, DateValue, Granularity, TimeValue} from '@react-types/datepicker';\nimport {RangeValue, ValidationState} from '@react-types/shared';\nimport {useControlledState} from '@react-stately/utils';\nimport {useRef, useState} from 'react';\n\nexport interface DateRangePickerOptions extends DateRangePickerProps<DateValue> {\n /**\n * Determines whether the date picker popover should close automatically when a date is selected.\n * @default true\n */\n shouldCloseOnSelect?: boolean | (() => boolean)\n}\n\ntype TimeRange = RangeValue<TimeValue>;\nexport interface DateRangePickerState {\n /** The currently selected date range. */\n value: DateRange,\n /** Sets the selected date range. */\n setValue(value: DateRange): void,\n /**\n * The date portion of the selected range. This may be set prior to `value` if the user has\n * selected a date range but has not yet selected a time range.\n */\n dateRange: DateRange,\n /** Sets the date portion of the selected range. */\n setDateRange(value: DateRange): void,\n /**\n * The time portion of the selected range. This may be set prior to `value` if the user has\n * selected a time range but has not yet selected a date range.\n */\n timeRange: TimeRange,\n /** Sets the time portion of the selected range. */\n setTimeRange(value: TimeRange): void,\n /** Sets the date portion of either the start or end of the selected range. */\n setDate(part: 'start' | 'end', value: DateValue): void,\n /** Sets the time portion of either the start or end of the selected range. */\n setTime(part: 'start' | 'end', value: TimeValue): void,\n /** Sets the date and time of either the start or end of the selected range. */\n setDateTime(part: 'start' | 'end', value: DateValue): void,\n /** The granularity for the field, based on the `granularity` prop and current value. */\n granularity: Granularity,\n /** Whether the date range picker supports selecting times, according to the `granularity` prop and current value. */\n hasTime: boolean,\n /** Whether the calendar popover is currently open. */\n isOpen: boolean,\n /** Sets whether the calendar popover is open. */\n setOpen(isOpen: boolean): void,\n /** The current validation state of the date picker, based on the `validationState`, `minValue`, and `maxValue` props. */\n validationState: ValidationState,\n /** Formats the selected range using the given options. */\n formatValue(locale: string, fieldOptions: FieldOptions): string,\n /** Replaces the start and/or end value of the selected range with the placeholder value if unentered. */\n confirmPlaceholder(): void\n}\n\n/**\n * Provides state management for a date range picker component.\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport function useDateRangePickerState(props: DateRangePickerOptions): DateRangePickerState {\n let [isOpen, setOpen] = useState(false);\n let [controlledValue, setControlledValue] = useControlledState<DateRange>(props.value, props.defaultValue || null, props.onChange);\n let [placeholderValue, setPlaceholderValue] = useState(() => controlledValue || {start: null, end: null});\n\n // Reset the placeholder if the value prop is set to null.\n if (controlledValue == null && placeholderValue.start && placeholderValue.end) {\n placeholderValue = {start: null, end: null};\n setPlaceholderValue(placeholderValue);\n }\n\n let value = controlledValue || placeholderValue;\n let valueRef = useRef(value);\n valueRef.current = value;\n\n let setValue = (value: DateRange) => {\n valueRef.current = value;\n setPlaceholderValue(value);\n if (value?.start && value.end) {\n setControlledValue(value);\n } else {\n setControlledValue(null);\n }\n };\n\n let v = (value?.start || value?.end || props.placeholderValue);\n let [granularity, defaultTimeZone] = useDefaultProps(v, props.granularity);\n let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second' || granularity === 'millisecond';\n let shouldCloseOnSelect = props.shouldCloseOnSelect ?? true;\n\n let [dateRange, setSelectedDateRange] = useState<DateRange>(null);\n let [timeRange, setSelectedTimeRange] = useState<TimeRange>(null);\n\n if (value && value.start && value.end) {\n dateRange = value;\n if ('hour' in value.start) {\n timeRange = value as TimeRange;\n }\n }\n\n let commitValue = (dateRange: DateRange, timeRange: TimeRange) => {\n setValue({\n start: 'timeZone' in timeRange.start ? timeRange.start.set(toCalendarDate(dateRange.start)) : toCalendarDateTime(dateRange.start, timeRange.start),\n end: 'timeZone' in timeRange.end ? timeRange.end.set(toCalendarDate(dateRange.end)) : toCalendarDateTime(dateRange.end, timeRange.end)\n });\n };\n\n // Intercept setValue to make sure the Time section is not changed by date selection in Calendar\n let setDateRange = (range: DateRange) => {\n let shouldClose = typeof shouldCloseOnSelect === 'function' ? shouldCloseOnSelect() : shouldCloseOnSelect;\n if (hasTime) {\n if (shouldClose || (range.start && range.end && timeRange?.start && timeRange?.end)) {\n commitValue(range, {\n start: timeRange?.start || getPlaceholderTime(props.placeholderValue),\n end: timeRange?.end || getPlaceholderTime(props.placeholderValue)\n });\n } else {\n setSelectedDateRange(range);\n }\n } else if (range.start && range.end) {\n setValue(range);\n } else {\n setSelectedDateRange(range);\n }\n\n if (shouldClose) {\n setOpen(false);\n }\n };\n\n let setTimeRange = (range: TimeRange) => {\n if (dateRange?.start && dateRange?.end && range.start && range.end) {\n commitValue(dateRange, range);\n } else {\n setSelectedTimeRange(range);\n }\n };\n\n let validationState: ValidationState = props.validationState\n || (value != null && (\n isInvalid(value.start, props.minValue, props.maxValue) ||\n isInvalid(value.end, props.minValue, props.maxValue) ||\n (value.end != null && value.start != null && value.end.compare(value.start) < 0) ||\n (value?.start && props.isDateUnavailable?.(value.start)) ||\n (value?.end && props.isDateUnavailable?.(value.end))\n ) ? 'invalid' : null);\n\n return {\n value,\n setValue,\n dateRange,\n timeRange,\n granularity,\n hasTime,\n setDate(part, date) {\n setDateRange({...dateRange, [part]: date});\n },\n setTime(part, time) {\n setTimeRange({...timeRange, [part]: time});\n },\n setDateTime(part, dateTime) {\n setValue({...value, [part]: dateTime});\n },\n setDateRange,\n setTimeRange,\n isOpen,\n setOpen(isOpen) {\n // Commit the selected date range when the calendar is closed. Use a placeholder time if one wasn't set.\n // If only the time range was set and not the date range, don't commit. The state will be preserved until\n // the user opens the popover again.\n if (!isOpen && !(value?.start && value?.end) && dateRange?.start && dateRange?.end && hasTime) {\n commitValue(dateRange, {\n start: timeRange?.start || getPlaceholderTime(props.placeholderValue),\n end: timeRange?.end || getPlaceholderTime(props.placeholderValue)\n });\n }\n\n setOpen(isOpen);\n },\n validationState,\n formatValue(locale, fieldOptions) {\n if (!value || !value.start || !value.end) {\n return '';\n }\n\n let startTimeZone = 'timeZone' in value.start ? value.start.timeZone : undefined;\n let startGranularity = props.granularity || (value.start && 'minute' in value.start ? 'minute' : 'day');\n let endTimeZone = 'timeZone' in value.end ? value.end.timeZone : undefined;\n let endGranularity = props.granularity || (value.end && 'minute' in value.end ? 'minute' : 'day');\n\n let startOptions = getFormatOptions(fieldOptions, {\n granularity: startGranularity,\n timeZone: startTimeZone,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle\n });\n\n let startFormatter = new DateFormatter(locale, startOptions);\n let endFormatter: Intl.DateTimeFormat;\n if (startTimeZone === endTimeZone && startGranularity === endGranularity) {\n // Use formatRange, as it results in shorter output when some of the fields\n // are shared between the start and end dates (e.g. the same month).\n // Formatting will fail if the end date is before the start date. Fall back below when that happens.\n try {\n return startFormatter.formatRange(value.start.toDate(startTimeZone), value.end.toDate(endTimeZone));\n } catch (e) {\n // ignore\n }\n\n endFormatter = startFormatter;\n } else {\n let endOptions = getFormatOptions(fieldOptions, {\n granularity: endGranularity,\n timeZone: endTimeZone,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle\n });\n\n endFormatter = new DateFormatter(locale, endOptions);\n }\n\n return `${startFormatter.format(value.start.toDate(startTimeZone))} – ${endFormatter.format(value.end.toDate(endTimeZone))}`;\n },\n confirmPlaceholder() {\n // Need to use ref value here because the value can be set in the same tick as\n // a blur, which means the component won't have re-rendered yet.\n let value = valueRef.current;\n if (value && Boolean(value.start) !== Boolean(value.end)) {\n let calendar = (value.start || value.end).calendar;\n let placeholder = createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone);\n setValue({\n start: value.start || placeholder,\n end: value.end || placeholder\n });\n }\n }\n };\n}\n","/*\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 {DateFieldState, useDateFieldState} from '.';\nimport {DateValue, TimePickerProps, TimeValue} from '@react-types/datepicker';\nimport {getLocalTimeZone, GregorianCalendar, Time, toCalendarDateTime, today, toTime} from '@internationalized/date';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo} from 'react';\n\ninterface TimeFieldProps extends TimePickerProps<TimeValue> {\n /** The locale to display and edit the value according to. */\n locale: string\n}\n\n/**\n * Provides state management for a time field component.\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport function useTimeFieldState(props: TimeFieldProps): DateFieldState {\n let {\n placeholderValue = new Time(),\n minValue,\n maxValue,\n granularity\n } = props;\n\n let [value, setValue] = useControlledState<TimeValue>(\n props.value,\n props.defaultValue,\n props.onChange\n );\n\n let v = value || placeholderValue;\n let day = v && 'day' in v ? v : undefined;\n let placeholderDate = useMemo(() => convertValue(placeholderValue), [placeholderValue]);\n let minDate = useMemo(() => convertValue(minValue, day), [minValue, day]);\n let maxDate = useMemo(() => convertValue(maxValue, day), [maxValue, day]);\n\n let dateTime = useMemo(() => value == null ? null : convertValue(value), [value]);\n let onChange = newValue => {\n setValue(v && 'day' in v ? newValue : newValue && toTime(newValue));\n };\n\n return useDateFieldState({\n ...props,\n value: dateTime,\n defaultValue: undefined,\n minValue: minDate,\n maxValue: maxDate,\n onChange,\n granularity: granularity || 'minute',\n maxGranularity: 'hour',\n placeholderValue: placeholderDate,\n // Calendar should not matter for time fields.\n createCalendar: () => new GregorianCalendar()\n });\n}\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (!value) {\n return null;\n }\n\n if ('day' in value) {\n return value;\n }\n\n return toCalendarDateTime(date, value);\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;SEgBgB,yCAAS,CAAC,KAAgB,EAAE,QAAmB,EAAE,QAAmB,EAAE,CAAC;IACrF,MAAM,CAAC,KAAK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AG,CAAC,QAAQ,GAAG,oBAAO,KAAO,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,kCAAY,CAAC,KAAK;MAAG,CAAC;QAAA,KAAK;IAAA,CAAC;IAChF,GAAG,CAAC,QAAQ,IAAG,QAAQ,GAAI,CAAC;QAC1B,QAAQ,CAAC,CAAC,IAAI,CAAK,QAAI,CAAC,GAAG,QAAQ,GAAG,QAAQ,IAAI,mCAAM,CAAC,QAAQ;IACnE,CAAC;IAED,MAAM,CAAC,yCAAiB,CAAC,CAAC;WACrB,KAAK;QACR,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,SAAS;QACvB,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,OAAO;kBACjB,QAAQ;QACR,WAAW,EAAE,WAAW,IAAI,CAAQ;QACpC,cAAc,EAAE,CAAM;QACtB,gBAAgB,EAAE,eAAe;QACjC,EAA8C,AAA9C,4CAA8C;QAC9C,cAAc,MAAQ,GAAG,CAAC,8CAAiB;IAC7C,CAAC;AACH,CAAC;SAEQ,kCAAY,CAAC,KAAgB,EAAE,IAAe,GAAG,kCAAK,CAAC,6CAAgB,KAAK,CAAC;IACpF,EAAE,GAAG,KAAK,EACR,MAAM,CAAC,IAAI;IAGb,EAAE,EAAE,CAAK,QAAI,KAAK,EAChB,MAAM,CAAC,KAAK;IAGd,MAAM,CAAC,+CAAkB,CAAC,IAAI,EAAE,KAAK;AACvC,CAAC;;","sources":["packages/@react-stately/datepicker/src/index.ts","packages/@react-stately/datepicker/src/useDatePickerState.ts","packages/@react-stately/datepicker/src/utils.ts","packages/@react-stately/datepicker/src/useDateFieldState.ts","packages/@react-stately/datepicker/src/useDateRangePickerState.ts","packages/@react-stately/datepicker/src/useTimeFieldState.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\nexport {useDatePickerState} from './useDatePickerState';\nexport {useDateFieldState} from './useDateFieldState';\nexport {useDateRangePickerState} from './useDateRangePickerState';\nexport {useTimeFieldState} from './useTimeFieldState';\n\nexport type {DateFieldStateOptions, DateFieldState, DateSegment, SegmentType} from './useDateFieldState';\nexport type {DatePickerStateOptions, DatePickerState} from './useDatePickerState';\nexport type {DateRangePickerStateOptions, DateRangePickerState} from './useDateRangePickerState';\nexport type {TimeFieldStateOptions} from './useTimeFieldState';\n","/*\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 {CalendarDate, DateFormatter, toCalendarDate, toCalendarDateTime} from '@internationalized/date';\nimport {DatePickerProps, DateValue, Granularity, TimeValue} from '@react-types/datepicker';\nimport {FieldOptions, getFormatOptions, getPlaceholderTime, useDefaultProps} from './utils';\nimport {isInvalid} from './utils';\nimport {useControlledState} from '@react-stately/utils';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\nimport {useState} from 'react';\nimport {ValidationState} from '@react-types/shared';\n\nexport interface DatePickerStateOptions extends DatePickerProps<DateValue> {\n /**\n * Determines whether the date picker popover should close automatically when a date is selected.\n * @default true\n */\n shouldCloseOnSelect?: boolean | (() => boolean)\n}\n\nexport interface DatePickerState {\n /** The currently selected date. */\n value: DateValue,\n /** Sets the selected date. */\n setValue(value: DateValue): void,\n /**\n * The date portion of the value. This may be set prior to `value` if the user has\n * selected a date but has not yet selected a time.\n */\n dateValue: DateValue,\n /** Sets the date portion of the value. */\n setDateValue(value: CalendarDate): void,\n /**\n * The time portion of the value. This may be set prior to `value` if the user has\n * selected a time but has not yet selected a date.\n */\n timeValue: TimeValue,\n /** Sets the time portion of the value. */\n setTimeValue(value: TimeValue): void,\n /** The granularity for the field, based on the `granularity` prop and current value. */\n granularity: Granularity,\n /** Whether the date picker supports selecting a time, according to the `granularity` prop and current value. */\n hasTime: boolean,\n /** Whether the calendar popover is currently open. */\n isOpen: boolean,\n /** Sets whether the calendar popover is open. */\n setOpen(isOpen: boolean): void,\n /** The current validation state of the date picker, based on the `validationState`, `minValue`, and `maxValue` props. */\n validationState: ValidationState,\n /** Formats the selected value using the given options. */\n formatValue(locale: string, fieldOptions: FieldOptions): string\n}\n\n/**\n * Provides state management for a date picker component.\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport function useDatePickerState(props: DatePickerStateOptions): DatePickerState {\n let overlayState = useOverlayTriggerState(props);\n let [value, setValue] = useControlledState<DateValue>(props.value, props.defaultValue || null, props.onChange);\n\n let v = (value || props.placeholderValue);\n let [granularity, defaultTimeZone] = useDefaultProps(v, props.granularity);\n let dateValue = value != null ? value.toDate(defaultTimeZone ?? 'UTC') : null;\n let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second' || granularity === 'millisecond';\n let shouldCloseOnSelect = props.shouldCloseOnSelect ?? true;\n\n let [selectedDate, setSelectedDate] = useState<DateValue>(null);\n let [selectedTime, setSelectedTime] = useState<TimeValue>(null);\n\n if (value) {\n selectedDate = value;\n if ('hour' in value) {\n selectedTime = value;\n }\n }\n\n // props.granularity must actually exist in the value if one is provided.\n if (v && !(granularity in v)) {\n throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());\n }\n\n let commitValue = (date: DateValue, time: TimeValue) => {\n setValue('timeZone' in time ? time.set(toCalendarDate(date)) : toCalendarDateTime(date, time));\n };\n\n // Intercept setValue to make sure the Time section is not changed by date selection in Calendar\n let selectDate = (newValue: CalendarDate) => {\n let shouldClose = typeof shouldCloseOnSelect === 'function' ? shouldCloseOnSelect() : shouldCloseOnSelect;\n if (hasTime) {\n if (selectedTime || shouldClose) {\n commitValue(newValue, selectedTime || getPlaceholderTime(props.placeholderValue));\n } else {\n setSelectedDate(newValue);\n }\n } else {\n setValue(newValue);\n }\n\n if (shouldClose) {\n overlayState.setOpen(false);\n }\n };\n\n let selectTime = (newValue: TimeValue) => {\n if (selectedDate) {\n commitValue(selectedDate, newValue);\n } else {\n setSelectedTime(newValue);\n }\n };\n\n let validationState: ValidationState = props.validationState ||\n (isInvalid(value, props.minValue, props.maxValue) ? 'invalid' : null) ||\n (value && props.isDateUnavailable?.(value) ? 'invalid' : null);\n\n return {\n value,\n setValue,\n dateValue: selectedDate,\n timeValue: selectedTime,\n setDateValue: selectDate,\n setTimeValue: selectTime,\n granularity,\n hasTime,\n isOpen: overlayState.isOpen,\n setOpen(isOpen) {\n // Commit the selected date when the calendar is closed. Use a placeholder time if one wasn't set.\n // If only the time was set and not the date, don't commit. The state will be preserved until\n // the user opens the popover again.\n if (!isOpen && !value && selectedDate && hasTime) {\n commitValue(selectedDate, selectedTime || getPlaceholderTime(props.placeholderValue));\n }\n\n overlayState.setOpen(isOpen);\n },\n validationState,\n formatValue(locale, fieldOptions) {\n if (!dateValue) {\n return '';\n }\n\n let formatOptions = getFormatOptions(fieldOptions, {\n granularity,\n timeZone: defaultTimeZone,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle\n });\n\n let formatter = new DateFormatter(locale, formatOptions);\n return formatter.format(dateValue);\n }\n };\n}\n","/*\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 {Calendar, now, Time, toCalendar, toCalendarDate, toCalendarDateTime} from '@internationalized/date';\nimport {DatePickerProps, DateValue, Granularity, TimeValue} from '@react-types/datepicker';\nimport {useRef} from 'react';\n\nexport function isInvalid(value: DateValue, minValue: DateValue, maxValue: DateValue) {\n return value != null && (\n (minValue != null && value.compare(minValue) < 0) ||\n (maxValue != null && value.compare(maxValue) > 0)\n );\n}\n\nexport type FieldOptions = Pick<Intl.DateTimeFormatOptions, 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second'>;\ninterface FormatterOptions {\n timeZone?: string,\n hideTimeZone?: boolean,\n granularity?: DatePickerProps<any>['granularity'],\n maxGranularity?: 'year' | 'month' | DatePickerProps<any>['granularity'],\n hourCycle?: 12 | 24\n}\n\nconst DEFAULT_FIELD_OPTIONS: FieldOptions = {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n};\n\nexport function getFormatOptions(\n fieldOptions: FieldOptions,\n options: FormatterOptions\n): Intl.DateTimeFormatOptions {\n fieldOptions = {...DEFAULT_FIELD_OPTIONS, ...fieldOptions};\n let granularity = options.granularity || 'minute';\n let keys = Object.keys(fieldOptions);\n let startIdx = keys.indexOf(options.maxGranularity ?? 'year');\n if (startIdx < 0) {\n startIdx = 0;\n }\n\n let endIdx = keys.indexOf(granularity);\n if (endIdx < 0) {\n endIdx = 2;\n }\n\n if (startIdx > endIdx) {\n throw new Error('maxGranularity must be greater than granularity');\n }\n\n let opts: Intl.DateTimeFormatOptions = keys.slice(startIdx, endIdx + 1).reduce((opts, key) => {\n opts[key] = fieldOptions[key];\n return opts;\n }, {});\n\n if (options.hourCycle != null) {\n opts.hour12 = options.hourCycle === 12;\n }\n\n opts.timeZone = options.timeZone || 'UTC';\n\n let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second';\n if (hasTime && options.timeZone && !options.hideTimeZone) {\n opts.timeZoneName = 'short';\n }\n\n return opts;\n}\n\nexport function getPlaceholderTime(placeholderValue: DateValue): TimeValue {\n if (placeholderValue && 'hour' in placeholderValue) {\n return placeholderValue;\n }\n\n return new Time();\n}\n\nexport function convertValue(value: DateValue, calendar: Calendar): DateValue {\n if (value === null) {\n return null;\n }\n\n if (!value) {\n return undefined;\n }\n\n return toCalendar(value, calendar);\n}\n\n\nexport function createPlaceholderDate(placeholderValue: DateValue, granularity: string, calendar: Calendar, timeZone: string) {\n if (placeholderValue) {\n return convertValue(placeholderValue, calendar);\n }\n\n let date = toCalendar(now(timeZone).set({\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0\n }), calendar);\n\n if (granularity === 'year' || granularity === 'month' || granularity === 'day') {\n return toCalendarDate(date);\n }\n\n if (!timeZone) {\n return toCalendarDateTime(date);\n }\n\n return date;\n}\n\nexport function useDefaultProps(v: DateValue, granularity: Granularity): [Granularity, string] {\n // Compute default granularity and time zone from the value. If the value becomes null, keep the last values.\n let lastValue = useRef(v);\n if (v) {\n lastValue.current = v;\n }\n\n v = lastValue.current;\n let defaultTimeZone = (v && 'timeZone' in v ? v.timeZone : undefined);\n granularity = granularity || (v && 'minute' in v ? 'minute' : 'day');\n\n // props.granularity must actually exist in the value if one is provided.\n if (v && !(granularity in v)) {\n throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());\n }\n\n return [granularity, defaultTimeZone];\n}\n","/*\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 {Calendar, DateFormatter, getMinimumDayInMonth, getMinimumMonthInYear, GregorianCalendar, toCalendar} from '@internationalized/date';\nimport {convertValue, createPlaceholderDate, FieldOptions, getFormatOptions, isInvalid, useDefaultProps} from './utils';\nimport {DatePickerProps, DateValue, Granularity} from '@react-types/datepicker';\nimport {useControlledState} from '@react-stately/utils';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {ValidationState} from '@react-types/shared';\n\nexport type SegmentType = 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName';\nexport interface DateSegment {\n /** The type of segment. */\n type: SegmentType,\n /** The formatted text for the segment. */\n text: string,\n /** The numeric value for the segment, if applicable. */\n value?: number,\n /** The minimum numeric value for the segment, if applicable. */\n minValue?: number,\n /** The maximum numeric value for the segment, if applicable. */\n maxValue?: number,\n /** Whether the value is a placeholder. */\n isPlaceholder: boolean,\n /** Whether the segment is editable. */\n isEditable: boolean\n}\n\nexport interface DateFieldState {\n /** The current field value. */\n value: DateValue,\n /** The current value, converted to a native JavaScript `Date` object. */\n dateValue: Date,\n /** Sets the field's value. */\n setValue(value: DateValue): void,\n /** A list of segments for the current value. */\n segments: DateSegment[],\n /** A date formatter configured for the current locale and format. */\n dateFormatter: DateFormatter,\n /** The current validation state of the date field, based on the `validationState`, `minValue`, and `maxValue` props. */\n validationState: ValidationState,\n /** The granularity for the field, based on the `granularity` prop and current value. */\n granularity: Granularity,\n /** The maximum date or time unit that is displayed in the field. */\n maxGranularity: 'year' | 'month' | Granularity,\n /** Whether the field is disabled. */\n isDisabled: boolean,\n /** Whether the field is read only. */\n isReadOnly: boolean,\n /** Whether the field is required. */\n isRequired: boolean,\n /** Increments the given segment. Upon reaching the minimum or maximum value, the value wraps around to the opposite limit. */\n increment(type: SegmentType): void,\n /** Decrements the given segment. Upon reaching the minimum or maximum value, the value wraps around to the opposite limit. */\n decrement(type: SegmentType): void,\n /**\n * Increments the given segment by a larger amount, rounding it to the nearest increment.\n * The amount to increment by depends on the field, for example 15 minutes, 7 days, and 5 years.\n * Upon reaching the minimum or maximum value, the value wraps around to the opposite limit.\n */\n incrementPage(type: SegmentType): void,\n /**\n * Decrements the given segment by a larger amount, rounding it to the nearest increment.\n * The amount to decrement by depends on the field, for example 15 minutes, 7 days, and 5 years.\n * Upon reaching the minimum or maximum value, the value wraps around to the opposite limit.\n */\n decrementPage(type: SegmentType): void,\n /** Sets the value of the given segment. */\n setSegment(type: SegmentType, value: number): void,\n /**\n * Replaces the value of the date field with the placeholder value.\n * If a segment type is provided, only that segment is confirmed. Otherwise, all segments that have not been entered yet are confirmed.\n */\n confirmPlaceholder(type?: SegmentType): void,\n /** Clears the value of the given segment, reverting it to the placeholder. */\n clearSegment(type: SegmentType): void,\n /** Formats the current date value using the given options. */\n formatValue(fieldOptions: FieldOptions): string\n}\n\nconst EDITABLE_SEGMENTS = {\n year: true,\n month: true,\n day: true,\n hour: true,\n minute: true,\n second: true,\n dayPeriod: true,\n era: true\n};\n\nconst PAGE_STEP = {\n year: 5,\n month: 2,\n day: 7,\n hour: 2,\n minute: 15,\n second: 15\n};\n\n// Node seems to convert everything to lowercase...\nconst TYPE_MAPPING = {\n dayperiod: 'dayPeriod'\n};\n\nexport interface DateFieldStateOptions extends DatePickerProps<DateValue> {\n /**\n * The maximum unit to display in the date field.\n * @default 'year'\n */\n maxGranularity?: 'year' | 'month' | Granularity,\n /** The locale to display and edit the value according to. */\n locale: string,\n /**\n * A function that creates a [Calendar](../internationalized/date/Calendar.html)\n * object for a given calendar identifier. Such a function may be imported from the\n * `@internationalized/date` package, or manually implemented to include support for\n * only certain calendars.\n */\n createCalendar: (name: string) => Calendar\n}\n\n/**\n * Provides state management for a date field component.\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport function useDateFieldState(props: DateFieldStateOptions): DateFieldState {\n let {\n locale,\n createCalendar,\n hideTimeZone,\n isDisabled,\n isReadOnly,\n isRequired\n } = props;\n\n let v: DateValue = (props.value || props.defaultValue || props.placeholderValue);\n let [granularity, defaultTimeZone] = useDefaultProps(v, props.granularity);\n let timeZone = defaultTimeZone || 'UTC';\n\n // props.granularity must actually exist in the value if one is provided.\n if (v && !(granularity in v)) {\n throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());\n }\n\n let formatOpts = useMemo(() => ({\n granularity,\n maxGranularity: props.maxGranularity ?? 'year',\n timeZone: defaultTimeZone,\n hideTimeZone,\n hourCycle: props.hourCycle\n }), [props.maxGranularity, granularity, props.hourCycle, defaultTimeZone, hideTimeZone]);\n let opts = useMemo(() => getFormatOptions({}, formatOpts), [formatOpts]);\n\n let dateFormatter = useMemo(() => new DateFormatter(locale, opts), [locale, opts]);\n let resolvedOptions = useMemo(() => dateFormatter.resolvedOptions(), [dateFormatter]);\n let calendar = useMemo(() => createCalendar(resolvedOptions.calendar), [createCalendar, resolvedOptions.calendar]);\n\n // Determine how many editable segments there are for validation purposes.\n // The result is cached for performance.\n let allSegments = useMemo(() =>\n dateFormatter.formatToParts(new Date())\n .filter(seg => EDITABLE_SEGMENTS[seg.type])\n .reduce((p, seg) => (p[seg.type] = true, p), {})\n , [dateFormatter]);\n\n let [validSegments, setValidSegments] = useState<Partial<typeof EDITABLE_SEGMENTS>>(\n () => props.value || props.defaultValue ? {...allSegments} : {}\n );\n\n // We keep track of the placeholder date separately in state so that onChange is not called\n // until all segments are set. If the value === null (not undefined), then assume the component\n // is controlled, so use the placeholder as the value until all segments are entered so it doesn't\n // change from uncontrolled to controlled and emit a warning.\n let [placeholderDate, setPlaceholderDate] = useState(\n () => createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)\n );\n\n // Reset placeholder when calendar changes\n let lastCalendarIdentifier = useRef(calendar.identifier);\n useEffect(() => {\n if (calendar.identifier !== lastCalendarIdentifier.current) {\n lastCalendarIdentifier.current = calendar.identifier;\n setPlaceholderDate(placeholder =>\n Object.keys(validSegments).length > 0\n ? toCalendar(placeholder, calendar)\n : createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)\n );\n }\n }, [calendar, granularity, validSegments, defaultTimeZone, props.placeholderValue]);\n\n let [value, setDate] = useControlledState<DateValue>(\n props.value,\n props.defaultValue,\n props.onChange\n );\n\n let calendarValue = useMemo(() => convertValue(value, calendar), [value, calendar]);\n\n // If there is a value prop, and some segments were previously placeholders, mark them all as valid.\n if (value && Object.keys(validSegments).length < Object.keys(allSegments).length) {\n validSegments = {...allSegments};\n setValidSegments(validSegments);\n }\n\n // If the value is set to null and all segments are valid, reset the placeholder.\n if (value == null && Object.keys(validSegments).length === Object.keys(allSegments).length) {\n validSegments = {};\n setValidSegments(validSegments);\n setPlaceholderDate(createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone));\n }\n\n // If all segments are valid, use the date from state, otherwise use the placeholder date.\n let displayValue = calendarValue && Object.keys(validSegments).length >= Object.keys(allSegments).length ? calendarValue : placeholderDate;\n let setValue = (newValue: DateValue) => {\n if (props.isDisabled || props.isReadOnly) {\n return;\n }\n\n if (Object.keys(validSegments).length >= Object.keys(allSegments).length) {\n // The display calendar should not have any effect on the emitted value.\n // Emit dates in the same calendar as the original value, if any, otherwise gregorian.\n newValue = toCalendar(newValue, v?.calendar || new GregorianCalendar());\n setDate(newValue);\n } else {\n setPlaceholderDate(newValue);\n }\n };\n\n let dateValue = useMemo(() => displayValue.toDate(timeZone), [displayValue, timeZone]);\n let segments = useMemo(() =>\n dateFormatter.formatToParts(dateValue)\n .map(segment => {\n let isEditable = EDITABLE_SEGMENTS[segment.type];\n if (segment.type === 'era' && calendar.getEras().length === 1) {\n isEditable = false;\n }\n\n return {\n type: TYPE_MAPPING[segment.type] || segment.type,\n text: segment.value,\n ...getSegmentLimits(displayValue, segment.type, resolvedOptions),\n isPlaceholder: EDITABLE_SEGMENTS[segment.type] && !validSegments[segment.type],\n isEditable\n } as DateSegment;\n })\n , [dateValue, validSegments, dateFormatter, resolvedOptions, displayValue, calendar]);\n\n let hasEra = useMemo(() => segments.some(s => s.type === 'era'), [segments]);\n\n let markValid = (part: Intl.DateTimeFormatPartTypes) => {\n validSegments[part] = true;\n if (part === 'year' && hasEra) {\n validSegments.era = true;\n }\n setValidSegments({...validSegments});\n };\n\n let adjustSegment = (type: Intl.DateTimeFormatPartTypes, amount: number) => {\n markValid(type);\n setValue(addSegment(displayValue, type, amount, resolvedOptions));\n };\n\n let validationState: ValidationState = props.validationState ||\n (isInvalid(calendarValue, props.minValue, props.maxValue) ? 'invalid' : null);\n\n return {\n value: calendarValue,\n dateValue,\n setValue,\n segments,\n dateFormatter,\n validationState,\n granularity,\n maxGranularity: props.maxGranularity ?? 'year',\n isDisabled,\n isReadOnly,\n isRequired,\n increment(part) {\n adjustSegment(part, 1);\n },\n decrement(part) {\n adjustSegment(part, -1);\n },\n incrementPage(part) {\n adjustSegment(part, PAGE_STEP[part] || 1);\n },\n decrementPage(part) {\n adjustSegment(part, -(PAGE_STEP[part] || 1));\n },\n setSegment(part, v) {\n markValid(part);\n setValue(setSegment(displayValue, part, v, resolvedOptions));\n },\n confirmPlaceholder(part) {\n if (props.isDisabled || props.isReadOnly) {\n return;\n }\n\n if (!part) {\n // Confirm the rest of the placeholder if any of the segments are valid.\n let numValid = Object.keys(validSegments).length;\n if (numValid > 0 && numValid < Object.keys(allSegments).length) {\n validSegments = {...allSegments};\n setValidSegments(validSegments);\n setValue(displayValue.copy());\n }\n } else if (!validSegments[part]) {\n markValid(part);\n setValue(displayValue.copy());\n }\n },\n clearSegment(part) {\n delete validSegments[part];\n setValidSegments({...validSegments});\n\n let placeholder = createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone);\n let value = displayValue;\n\n // Reset day period to default without changing the hour.\n if (part === 'dayPeriod' && 'hour' in displayValue && 'hour' in placeholder) {\n let isPM = displayValue.hour >= 12;\n let shouldBePM = placeholder.hour >= 12;\n if (isPM && !shouldBePM) {\n value = displayValue.set({hour: displayValue.hour - 12});\n } else if (!isPM && shouldBePM) {\n value = displayValue.set({hour: displayValue.hour + 12});\n }\n } else if (part in displayValue) {\n value = displayValue.set({[part]: placeholder[part]});\n }\n\n setDate(null);\n setValue(value);\n },\n formatValue(fieldOptions: FieldOptions) {\n if (!calendarValue) {\n return '';\n }\n\n let formatOptions = getFormatOptions(fieldOptions, formatOpts);\n let formatter = new DateFormatter(locale, formatOptions);\n return formatter.format(dateValue);\n }\n };\n}\n\nfunction getSegmentLimits(date: DateValue, type: string, options: Intl.ResolvedDateTimeFormatOptions) {\n switch (type) {\n case 'era': {\n let eras = date.calendar.getEras();\n return {\n value: eras.indexOf(date.era),\n minValue: 0,\n maxValue: eras.length - 1\n };\n }\n case 'year':\n return {\n value: date.year,\n minValue: 1,\n maxValue: date.calendar.getYearsInEra(date)\n };\n case 'month':\n return {\n value: date.month,\n minValue: getMinimumMonthInYear(date),\n maxValue: date.calendar.getMonthsInYear(date)\n };\n case 'day':\n return {\n value: date.day,\n minValue: getMinimumDayInMonth(date),\n maxValue: date.calendar.getDaysInMonth(date)\n };\n }\n\n if ('hour' in date) {\n switch (type) {\n case 'dayPeriod':\n return {\n value: date.hour >= 12 ? 12 : 0,\n minValue: 0,\n maxValue: 12\n };\n case 'hour':\n if (options.hour12) {\n let isPM = date.hour >= 12;\n return {\n value: date.hour,\n minValue: isPM ? 12 : 0,\n maxValue: isPM ? 23 : 11\n };\n }\n\n return {\n value: date.hour,\n minValue: 0,\n maxValue: 23\n };\n case 'minute':\n return {\n value: date.minute,\n minValue: 0,\n maxValue: 59\n };\n case 'second':\n return {\n value: date.second,\n minValue: 0,\n maxValue: 59\n };\n }\n }\n\n return {};\n}\n\nfunction addSegment(value: DateValue, part: string, amount: number, options: Intl.ResolvedDateTimeFormatOptions) {\n switch (part) {\n case 'era':\n case 'year':\n case 'month':\n case 'day':\n return value.cycle(part, amount, {round: part === 'year'});\n }\n\n if ('hour' in value) {\n switch (part) {\n case 'dayPeriod': {\n let hours = value.hour;\n let isPM = hours >= 12;\n return value.set({hour: isPM ? hours - 12 : hours + 12});\n }\n case 'hour':\n case 'minute':\n case 'second':\n return value.cycle(part, amount, {\n round: part !== 'hour',\n hourCycle: options.hour12 ? 12 : 24\n });\n }\n }\n}\n\nfunction setSegment(value: DateValue, part: string, segmentValue: number, options: Intl.ResolvedDateTimeFormatOptions) {\n switch (part) {\n case 'day':\n case 'month':\n case 'year':\n return value.set({[part]: segmentValue});\n }\n\n if ('hour' in value) {\n switch (part) {\n case 'dayPeriod': {\n let hours = value.hour;\n let wasPM = hours >= 12;\n let isPM = segmentValue >= 12;\n if (isPM === wasPM) {\n return value;\n }\n return value.set({hour: wasPM ? hours - 12 : hours + 12});\n }\n case 'hour':\n // In 12 hour time, ensure that AM/PM does not change\n if (options.hour12) {\n let hours = value.hour;\n let wasPM = hours >= 12;\n if (!wasPM && segmentValue === 12) {\n segmentValue = 0;\n }\n if (wasPM && segmentValue < 12) {\n segmentValue += 12;\n }\n }\n // fallthrough\n case 'minute':\n case 'second':\n return value.set({[part]: segmentValue});\n }\n }\n}\n","/*\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 {createPlaceholderDate, FieldOptions, getFormatOptions, getPlaceholderTime, isInvalid, useDefaultProps} from './utils';\nimport {DateFormatter, toCalendarDate, toCalendarDateTime} from '@internationalized/date';\nimport {DateRange, DateRangePickerProps, DateValue, Granularity, TimeValue} from '@react-types/datepicker';\nimport {RangeValue, ValidationState} from '@react-types/shared';\nimport {useControlledState} from '@react-stately/utils';\nimport {useOverlayTriggerState} from '@react-stately/overlays';\nimport {useRef, useState} from 'react';\n\nexport interface DateRangePickerStateOptions extends DateRangePickerProps<DateValue> {\n /**\n * Determines whether the date picker popover should close automatically when a date is selected.\n * @default true\n */\n shouldCloseOnSelect?: boolean | (() => boolean)\n}\n\ntype TimeRange = RangeValue<TimeValue>;\nexport interface DateRangePickerState {\n /** The currently selected date range. */\n value: DateRange,\n /** Sets the selected date range. */\n setValue(value: DateRange): void,\n /**\n * The date portion of the selected range. This may be set prior to `value` if the user has\n * selected a date range but has not yet selected a time range.\n */\n dateRange: DateRange,\n /** Sets the date portion of the selected range. */\n setDateRange(value: DateRange): void,\n /**\n * The time portion of the selected range. This may be set prior to `value` if the user has\n * selected a time range but has not yet selected a date range.\n */\n timeRange: TimeRange,\n /** Sets the time portion of the selected range. */\n setTimeRange(value: TimeRange): void,\n /** Sets the date portion of either the start or end of the selected range. */\n setDate(part: 'start' | 'end', value: DateValue): void,\n /** Sets the time portion of either the start or end of the selected range. */\n setTime(part: 'start' | 'end', value: TimeValue): void,\n /** Sets the date and time of either the start or end of the selected range. */\n setDateTime(part: 'start' | 'end', value: DateValue): void,\n /** The granularity for the field, based on the `granularity` prop and current value. */\n granularity: Granularity,\n /** Whether the date range picker supports selecting times, according to the `granularity` prop and current value. */\n hasTime: boolean,\n /** Whether the calendar popover is currently open. */\n isOpen: boolean,\n /** Sets whether the calendar popover is open. */\n setOpen(isOpen: boolean): void,\n /** The current validation state of the date picker, based on the `validationState`, `minValue`, and `maxValue` props. */\n validationState: ValidationState,\n /** Formats the selected range using the given options. */\n formatValue(locale: string, fieldOptions: FieldOptions): {start: string, end: string},\n /** Replaces the start and/or end value of the selected range with the placeholder value if unentered. */\n confirmPlaceholder(): void\n}\n\n/**\n * Provides state management for a date range picker component.\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport function useDateRangePickerState(props: DateRangePickerStateOptions): DateRangePickerState {\n let overlayState = useOverlayTriggerState(props);\n let [controlledValue, setControlledValue] = useControlledState<DateRange>(props.value, props.defaultValue || null, props.onChange);\n let [placeholderValue, setPlaceholderValue] = useState(() => controlledValue || {start: null, end: null});\n\n // Reset the placeholder if the value prop is set to null.\n if (controlledValue == null && placeholderValue.start && placeholderValue.end) {\n placeholderValue = {start: null, end: null};\n setPlaceholderValue(placeholderValue);\n }\n\n let value = controlledValue || placeholderValue;\n let valueRef = useRef(value);\n valueRef.current = value;\n\n let setValue = (value: DateRange) => {\n valueRef.current = value;\n setPlaceholderValue(value);\n if (value?.start && value.end) {\n setControlledValue(value);\n } else {\n setControlledValue(null);\n }\n };\n\n let v = (value?.start || value?.end || props.placeholderValue);\n let [granularity, defaultTimeZone] = useDefaultProps(v, props.granularity);\n let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second' || granularity === 'millisecond';\n let shouldCloseOnSelect = props.shouldCloseOnSelect ?? true;\n\n let [dateRange, setSelectedDateRange] = useState<DateRange>(null);\n let [timeRange, setSelectedTimeRange] = useState<TimeRange>(null);\n\n if (value && value.start && value.end) {\n dateRange = value;\n if ('hour' in value.start) {\n timeRange = value as TimeRange;\n }\n }\n\n let commitValue = (dateRange: DateRange, timeRange: TimeRange) => {\n setValue({\n start: 'timeZone' in timeRange.start ? timeRange.start.set(toCalendarDate(dateRange.start)) : toCalendarDateTime(dateRange.start, timeRange.start),\n end: 'timeZone' in timeRange.end ? timeRange.end.set(toCalendarDate(dateRange.end)) : toCalendarDateTime(dateRange.end, timeRange.end)\n });\n };\n\n // Intercept setValue to make sure the Time section is not changed by date selection in Calendar\n let setDateRange = (range: DateRange) => {\n let shouldClose = typeof shouldCloseOnSelect === 'function' ? shouldCloseOnSelect() : shouldCloseOnSelect;\n if (hasTime) {\n if (shouldClose || (range.start && range.end && timeRange?.start && timeRange?.end)) {\n commitValue(range, {\n start: timeRange?.start || getPlaceholderTime(props.placeholderValue),\n end: timeRange?.end || getPlaceholderTime(props.placeholderValue)\n });\n } else {\n setSelectedDateRange(range);\n }\n } else if (range.start && range.end) {\n setValue(range);\n } else {\n setSelectedDateRange(range);\n }\n\n if (shouldClose) {\n overlayState.setOpen(false);\n }\n };\n\n let setTimeRange = (range: TimeRange) => {\n if (dateRange?.start && dateRange?.end && range.start && range.end) {\n commitValue(dateRange, range);\n } else {\n setSelectedTimeRange(range);\n }\n };\n\n let validationState: ValidationState = props.validationState\n || (value != null && (\n isInvalid(value.start, props.minValue, props.maxValue) ||\n isInvalid(value.end, props.minValue, props.maxValue) ||\n (value.end != null && value.start != null && value.end.compare(value.start) < 0) ||\n (value?.start && props.isDateUnavailable?.(value.start)) ||\n (value?.end && props.isDateUnavailable?.(value.end))\n ) ? 'invalid' : null);\n\n return {\n value,\n setValue,\n dateRange,\n timeRange,\n granularity,\n hasTime,\n setDate(part, date) {\n setDateRange({...dateRange, [part]: date});\n },\n setTime(part, time) {\n setTimeRange({...timeRange, [part]: time});\n },\n setDateTime(part, dateTime) {\n setValue({...value, [part]: dateTime});\n },\n setDateRange,\n setTimeRange,\n isOpen: overlayState.isOpen,\n setOpen(isOpen) {\n // Commit the selected date range when the calendar is closed. Use a placeholder time if one wasn't set.\n // If only the time range was set and not the date range, don't commit. The state will be preserved until\n // the user opens the popover again.\n if (!isOpen && !(value?.start && value?.end) && dateRange?.start && dateRange?.end && hasTime) {\n commitValue(dateRange, {\n start: timeRange?.start || getPlaceholderTime(props.placeholderValue),\n end: timeRange?.end || getPlaceholderTime(props.placeholderValue)\n });\n }\n\n overlayState.setOpen(isOpen);\n },\n validationState,\n formatValue(locale, fieldOptions) {\n if (!value || !value.start || !value.end) {\n return null;\n }\n\n let startTimeZone = 'timeZone' in value.start ? value.start.timeZone : undefined;\n let startGranularity = props.granularity || (value.start && 'minute' in value.start ? 'minute' : 'day');\n let endTimeZone = 'timeZone' in value.end ? value.end.timeZone : undefined;\n let endGranularity = props.granularity || (value.end && 'minute' in value.end ? 'minute' : 'day');\n\n let startOptions = getFormatOptions(fieldOptions, {\n granularity: startGranularity,\n timeZone: startTimeZone,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle\n });\n\n let startDate = value.start.toDate(startTimeZone || 'UTC');\n let endDate = value.end.toDate(endTimeZone || 'UTC');\n\n let startFormatter = new DateFormatter(locale, startOptions);\n let endFormatter: Intl.DateTimeFormat;\n if (startTimeZone === endTimeZone && startGranularity === endGranularity && value.start.compare(value.end) !== 0) {\n // Use formatRange, as it results in shorter output when some of the fields\n // are shared between the start and end dates (e.g. the same month).\n // Formatting will fail if the end date is before the start date. Fall back below when that happens.\n try {\n let parts = startFormatter.formatRangeToParts(startDate, endDate);\n\n // Find the separator between the start and end date. This is determined\n // by finding the last shared literal before the end range.\n let separatorIndex = -1;\n for (let i = 0; i < parts.length; i++) {\n let part = parts[i];\n if (part.source === 'shared' && part.type === 'literal') {\n separatorIndex = i;\n } else if (part.source === 'endRange') {\n break;\n }\n }\n\n // Now we can combine the parts into start and end strings.\n let start = '';\n let end = '';\n for (let i = 0; i < parts.length; i++) {\n if (i < separatorIndex) {\n start += parts[i].value;\n } else if (i > separatorIndex) {\n end += parts[i].value;\n }\n }\n\n return {start, end};\n } catch (e) {\n // ignore\n }\n\n endFormatter = startFormatter;\n } else {\n let endOptions = getFormatOptions(fieldOptions, {\n granularity: endGranularity,\n timeZone: endTimeZone,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle\n });\n\n endFormatter = new DateFormatter(locale, endOptions);\n }\n\n return {\n start: startFormatter.format(startDate),\n end: endFormatter.format(endDate)\n };\n },\n confirmPlaceholder() {\n // Need to use ref value here because the value can be set in the same tick as\n // a blur, which means the component won't have re-rendered yet.\n let value = valueRef.current;\n if (value && Boolean(value.start) !== Boolean(value.end)) {\n let calendar = (value.start || value.end).calendar;\n let placeholder = createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone);\n setValue({\n start: value.start || placeholder,\n end: value.end || placeholder\n });\n }\n }\n };\n}\n","/*\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 {DateFieldState, useDateFieldState} from '.';\nimport {DateValue, TimePickerProps, TimeValue} from '@react-types/datepicker';\nimport {getLocalTimeZone, GregorianCalendar, Time, toCalendarDateTime, today, toTime} from '@internationalized/date';\nimport {useControlledState} from '@react-stately/utils';\nimport {useMemo} from 'react';\n\nexport interface TimeFieldStateOptions extends TimePickerProps<TimeValue> {\n /** The locale to display and edit the value according to. */\n locale: string\n}\n\n/**\n * Provides state management for a time field component.\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport function useTimeFieldState(props: TimeFieldStateOptions): DateFieldState {\n let {\n placeholderValue = new Time(),\n minValue,\n maxValue,\n granularity\n } = props;\n\n let [value, setValue] = useControlledState<TimeValue>(\n props.value,\n props.defaultValue,\n props.onChange\n );\n\n let v = value || placeholderValue;\n let day = v && 'day' in v ? v : undefined;\n let placeholderDate = useMemo(() => convertValue(placeholderValue), [placeholderValue]);\n let minDate = useMemo(() => convertValue(minValue, day), [minValue, day]);\n let maxDate = useMemo(() => convertValue(maxValue, day), [maxValue, day]);\n\n let dateTime = useMemo(() => value == null ? null : convertValue(value), [value]);\n let onChange = newValue => {\n setValue(v && 'day' in v ? newValue : newValue && toTime(newValue));\n };\n\n return useDateFieldState({\n ...props,\n value: dateTime,\n defaultValue: undefined,\n minValue: minDate,\n maxValue: maxDate,\n onChange,\n granularity: granularity || 'minute',\n maxGranularity: 'hour',\n placeholderValue: placeholderDate,\n // Calendar should not matter for time fields.\n createCalendar: () => new GregorianCalendar()\n });\n}\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (!value) {\n return null;\n }\n\n if ('day' in value) {\n return value;\n }\n\n return toCalendarDateTime(date, value);\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|