@react-stately/datepicker 3.0.0-nightly.3175 → 3.0.0-nightly.3180
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 +25 -22
- package/dist/main.js.map +1 -1
- package/dist/module.js +25 -22
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +138 -30
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/index.ts +1 -1
- package/src/{useDatePickerFieldState.ts → useDateFieldState.ts} +76 -17
- package/src/useDatePickerState.ts +28 -6
- package/src/useDateRangePickerState.ts +36 -9
- package/src/useTimeFieldState.ts +10 -4
package/dist/main.js
CHANGED
|
@@ -170,14 +170,14 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
var $
|
|
173
|
+
var $596a1f0f523d6752$exports = {};
|
|
174
174
|
|
|
175
|
-
$parcel$export($
|
|
175
|
+
$parcel$export($596a1f0f523d6752$exports, "useDateFieldState", () => $596a1f0f523d6752$export$60e84778edff6d26);
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
|
|
179
179
|
|
|
180
|
-
const $
|
|
180
|
+
const $596a1f0f523d6752$var$EDITABLE_SEGMENTS = {
|
|
181
181
|
year: true,
|
|
182
182
|
month: true,
|
|
183
183
|
day: true,
|
|
@@ -187,7 +187,7 @@ const $6d4e641deb83cb9e$var$EDITABLE_SEGMENTS = {
|
|
|
187
187
|
dayPeriod: true,
|
|
188
188
|
era: true
|
|
189
189
|
};
|
|
190
|
-
const $
|
|
190
|
+
const $596a1f0f523d6752$var$PAGE_STEP = {
|
|
191
191
|
year: 5,
|
|
192
192
|
month: 2,
|
|
193
193
|
day: 7,
|
|
@@ -196,10 +196,10 @@ const $6d4e641deb83cb9e$var$PAGE_STEP = {
|
|
|
196
196
|
second: 15
|
|
197
197
|
};
|
|
198
198
|
// Node seems to convert everything to lowercase...
|
|
199
|
-
const $
|
|
199
|
+
const $596a1f0f523d6752$var$TYPE_MAPPING = {
|
|
200
200
|
dayperiod: 'dayPeriod'
|
|
201
201
|
};
|
|
202
|
-
function $
|
|
202
|
+
function $596a1f0f523d6752$export$60e84778edff6d26(props) {
|
|
203
203
|
let { locale: locale , createCalendar: createCalendar , hideTimeZone: hideTimeZone , isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired } = props;
|
|
204
204
|
let v1 = props.value || props.defaultValue || props.placeholderValue;
|
|
205
205
|
let [granularity, defaultTimeZone] = $50d5d6a623389320$export$2440da353cedad43(v1, props.granularity);
|
|
@@ -242,7 +242,7 @@ function $6d4e641deb83cb9e$export$714a241b39a650d6(props) {
|
|
|
242
242
|
]);
|
|
243
243
|
// Determine how many editable segments there are for validation purposes.
|
|
244
244
|
// The result is cached for performance.
|
|
245
|
-
let allSegments = $h2qOe$react.useMemo(()=>dateFormatter.formatToParts(new Date()).filter((seg)=>$
|
|
245
|
+
let allSegments = $h2qOe$react.useMemo(()=>dateFormatter.formatToParts(new Date()).filter((seg)=>$596a1f0f523d6752$var$EDITABLE_SEGMENTS[seg.type]
|
|
246
246
|
).reduce((p, seg)=>(p[seg.type] = true, p)
|
|
247
247
|
, {
|
|
248
248
|
})
|
|
@@ -312,13 +312,13 @@ function $6d4e641deb83cb9e$export$714a241b39a650d6(props) {
|
|
|
312
312
|
timeZone
|
|
313
313
|
]);
|
|
314
314
|
let segments = $h2qOe$react.useMemo(()=>dateFormatter.formatToParts(dateValue).map((segment)=>{
|
|
315
|
-
let isEditable = $
|
|
315
|
+
let isEditable = $596a1f0f523d6752$var$EDITABLE_SEGMENTS[segment.type];
|
|
316
316
|
if (segment.type === 'era' && calendar.getEras().length === 1) isEditable = false;
|
|
317
317
|
return {
|
|
318
|
-
type: $
|
|
318
|
+
type: $596a1f0f523d6752$var$TYPE_MAPPING[segment.type] || segment.type,
|
|
319
319
|
text: segment.value,
|
|
320
|
-
...$
|
|
321
|
-
isPlaceholder: $
|
|
320
|
+
...$596a1f0f523d6752$var$getSegmentLimits(displayValue, segment.type, resolvedOptions),
|
|
321
|
+
isPlaceholder: $596a1f0f523d6752$var$EDITABLE_SEGMENTS[segment.type] && !validSegments[segment.type],
|
|
322
322
|
isEditable: isEditable
|
|
323
323
|
};
|
|
324
324
|
})
|
|
@@ -344,7 +344,7 @@ function $6d4e641deb83cb9e$export$714a241b39a650d6(props) {
|
|
|
344
344
|
};
|
|
345
345
|
let adjustSegment = (type, amount)=>{
|
|
346
346
|
markValid(type);
|
|
347
|
-
setValue($
|
|
347
|
+
setValue($596a1f0f523d6752$var$addSegment(displayValue, type, amount, resolvedOptions));
|
|
348
348
|
};
|
|
349
349
|
let validationState = props.validationState || ($50d5d6a623389320$export$eac50920cf2fd59a(calendarValue, props.minValue, props.maxValue) ? 'invalid' : null);
|
|
350
350
|
return {
|
|
@@ -365,14 +365,14 @@ function $6d4e641deb83cb9e$export$714a241b39a650d6(props) {
|
|
|
365
365
|
adjustSegment(part, -1);
|
|
366
366
|
},
|
|
367
367
|
incrementPage (part) {
|
|
368
|
-
adjustSegment(part, $
|
|
368
|
+
adjustSegment(part, $596a1f0f523d6752$var$PAGE_STEP[part] || 1);
|
|
369
369
|
},
|
|
370
370
|
decrementPage (part) {
|
|
371
|
-
adjustSegment(part, -($
|
|
371
|
+
adjustSegment(part, -($596a1f0f523d6752$var$PAGE_STEP[part] || 1));
|
|
372
372
|
},
|
|
373
373
|
setSegment (part, v) {
|
|
374
374
|
markValid(part);
|
|
375
|
-
setValue($
|
|
375
|
+
setValue($596a1f0f523d6752$var$setSegment(displayValue, part, v, resolvedOptions));
|
|
376
376
|
},
|
|
377
377
|
confirmPlaceholder (part) {
|
|
378
378
|
if (props.isDisabled || props.isReadOnly) return;
|
|
@@ -414,12 +414,15 @@ function $6d4e641deb83cb9e$export$714a241b39a650d6(props) {
|
|
|
414
414
|
setDate(null);
|
|
415
415
|
setValue(value);
|
|
416
416
|
},
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
formatValue (fieldOptions) {
|
|
418
|
+
if (!calendarValue) return '';
|
|
419
|
+
let formatOptions = $50d5d6a623389320$export$7e319ea407e63bc0(fieldOptions, formatOpts);
|
|
420
|
+
let formatter = new $h2qOe$internationalizeddate.DateFormatter(locale, formatOptions);
|
|
421
|
+
return formatter.format(dateValue);
|
|
419
422
|
}
|
|
420
423
|
};
|
|
421
424
|
}
|
|
422
|
-
function $
|
|
425
|
+
function $596a1f0f523d6752$var$getSegmentLimits(date, type, options) {
|
|
423
426
|
switch(type){
|
|
424
427
|
case 'era':
|
|
425
428
|
{
|
|
@@ -486,7 +489,7 @@ function $6d4e641deb83cb9e$var$getSegmentLimits(date, type, options) {
|
|
|
486
489
|
return {
|
|
487
490
|
};
|
|
488
491
|
}
|
|
489
|
-
function $
|
|
492
|
+
function $596a1f0f523d6752$var$addSegment(value, part, amount, options) {
|
|
490
493
|
switch(part){
|
|
491
494
|
case 'era':
|
|
492
495
|
case 'year':
|
|
@@ -514,7 +517,7 @@ function $6d4e641deb83cb9e$var$addSegment(value, part, amount, options) {
|
|
|
514
517
|
});
|
|
515
518
|
}
|
|
516
519
|
}
|
|
517
|
-
function $
|
|
520
|
+
function $596a1f0f523d6752$var$setSegment(value, part, segmentValue, options) {
|
|
518
521
|
switch(part){
|
|
519
522
|
case 'day':
|
|
520
523
|
case 'month':
|
|
@@ -744,7 +747,7 @@ function $2654e87be0231a69$export$fd53cef0cc796101(props) {
|
|
|
744
747
|
let onChange = (newValue)=>{
|
|
745
748
|
setValue(v && 'day' in v ? newValue : newValue && $h2qOe$internationalizeddate.toTime(newValue));
|
|
746
749
|
};
|
|
747
|
-
return $
|
|
750
|
+
return $596a1f0f523d6752$export$60e84778edff6d26({
|
|
748
751
|
...props,
|
|
749
752
|
value: dateTime,
|
|
750
753
|
defaultValue: undefined,
|
|
@@ -766,7 +769,7 @@ function $2654e87be0231a69$var$convertValue(value, date = $h2qOe$internationaliz
|
|
|
766
769
|
|
|
767
770
|
|
|
768
771
|
$parcel$exportWildcard(module.exports, $aaab7a647e17e1fd$exports);
|
|
769
|
-
$parcel$exportWildcard(module.exports, $
|
|
772
|
+
$parcel$exportWildcard(module.exports, $596a1f0f523d6752$exports);
|
|
770
773
|
$parcel$exportWildcard(module.exports, $7072d26f58deb33b$exports);
|
|
771
774
|
$parcel$exportWildcard(module.exports, $2654e87be0231a69$exports);
|
|
772
775
|
|
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,CAAC,IAAI,CAAC,YAAY;QACP,eAAsB;IAAlD,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAC,eAAsB,GAAtB,OAAO,CAAC,cAAc,cAAtB,eAAsB,cAAtB,eAAsB,GAAI,CAAM;IAC5D,EAAE,EAAE,QAAQ,GAAG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epicker/src/utils.ts","packages/@react-stately/datepicker/src/useDatePickerFieldState.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 './useDatePickerFieldState';\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 value: DateValue,\n setValue: (value: DateValue) => void,\n dateValue: DateValue,\n setDateValue: (value: CalendarDate) => void,\n timeValue: TimeValue,\n setTimeValue: (value: TimeValue) => void,\n hasTime: boolean,\n isOpen: boolean,\n setOpen: (isOpen: boolean) => void,\n validationState: ValidationState,\n formatValue(locale: string, fieldOptions: FieldOptions): string,\n granularity: Granularity\n}\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, CalendarDateTime, 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 interface DateSegment {\n type: Intl.DateTimeFormatPartTypes,\n text: string,\n value?: number,\n minValue?: number,\n maxValue?: number,\n isPlaceholder: boolean,\n isEditable: boolean\n}\n\nexport interface DatePickerFieldState {\n value: DateValue,\n dateValue: Date,\n setValue: (value: CalendarDateTime) => void,\n segments: DateSegment[],\n dateFormatter: DateFormatter,\n validationState: ValidationState,\n granularity: Granularity,\n isDisabled: boolean,\n isReadOnly: boolean,\n isRequired: boolean,\n increment: (type: Intl.DateTimeFormatPartTypes) => void,\n decrement: (type: Intl.DateTimeFormatPartTypes) => void,\n incrementPage: (type: Intl.DateTimeFormatPartTypes) => void,\n decrementPage: (type: Intl.DateTimeFormatPartTypes) => void,\n setSegment: (type: Intl.DateTimeFormatPartTypes, value: number) => void,\n confirmPlaceholder: (type?: Intl.DateTimeFormatPartTypes) => void,\n clearSegment: (type?: Intl.DateTimeFormatPartTypes) => void,\n getFormatOptions(fieldOptions: FieldOptions): Intl.DateTimeFormatOptions\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<T extends DateValue> extends DatePickerProps<T> {\n maxGranularity?: 'year' | 'month' | DatePickerProps<T>['granularity'],\n locale: string,\n createCalendar: (name: string) => Calendar\n}\n\nexport function useDatePickerFieldState<T extends DateValue>(props: DatePickerFieldProps<T>): DatePickerFieldState {\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 getFormatOptions(fieldOptions: FieldOptions) {\n return getFormatOptions(fieldOptions, formatOpts);\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 value: DateRange,\n setValue: (value: DateRange) => void,\n setDate: (part: keyof DateRange, value: DateValue) => void,\n setTime: (part: keyof TimeRange, value: TimeValue) => void,\n setDateTime: (part: keyof DateRange, value: DateValue) => void,\n dateRange: DateRange,\n setDateRange: (value: DateRange) => void,\n timeRange: TimeRange,\n setTimeRange: (value: TimeRange) => void,\n hasTime: boolean,\n isOpen: boolean,\n setOpen: (isOpen: boolean) => void,\n validationState: ValidationState,\n formatValue(locale: string, fieldOptions: FieldOptions): string,\n confirmPlaceholder(): void,\n granularity: Granularity\n}\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 {DateValue, TimePickerProps, TimeValue} from '@react-types/datepicker';\nimport {getLocalTimeZone, GregorianCalendar, Time, toCalendarDateTime, today, toTime} from '@internationalized/date';\nimport {useControlledState} from '@react-stately/utils';\nimport {useDatePickerFieldState} from '.';\nimport {useMemo} from 'react';\n\ninterface TimeFieldProps<T extends TimeValue> extends TimePickerProps<T> {\n locale: string\n}\n\nexport function useTimeFieldState<T extends TimeValue>(props: TimeFieldProps<T>) {\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 useDatePickerFieldState({\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,IAAI,IAAI,KACjB,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,IAC/C,QAAQ,I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AAC;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 * 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"}
|
package/dist/module.js
CHANGED
|
@@ -154,14 +154,14 @@ function $ab5bf3f618090389$export$87194bb378cc3ac2(props) {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
var $
|
|
157
|
+
var $3c0fc76039f1c516$exports = {};
|
|
158
158
|
|
|
159
|
-
$parcel$export($
|
|
159
|
+
$parcel$export($3c0fc76039f1c516$exports, "useDateFieldState", () => $3c0fc76039f1c516$export$60e84778edff6d26);
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
const $
|
|
164
|
+
const $3c0fc76039f1c516$var$EDITABLE_SEGMENTS = {
|
|
165
165
|
year: true,
|
|
166
166
|
month: true,
|
|
167
167
|
day: true,
|
|
@@ -171,7 +171,7 @@ const $09e80d602234613d$var$EDITABLE_SEGMENTS = {
|
|
|
171
171
|
dayPeriod: true,
|
|
172
172
|
era: true
|
|
173
173
|
};
|
|
174
|
-
const $
|
|
174
|
+
const $3c0fc76039f1c516$var$PAGE_STEP = {
|
|
175
175
|
year: 5,
|
|
176
176
|
month: 2,
|
|
177
177
|
day: 7,
|
|
@@ -180,10 +180,10 @@ const $09e80d602234613d$var$PAGE_STEP = {
|
|
|
180
180
|
second: 15
|
|
181
181
|
};
|
|
182
182
|
// Node seems to convert everything to lowercase...
|
|
183
|
-
const $
|
|
183
|
+
const $3c0fc76039f1c516$var$TYPE_MAPPING = {
|
|
184
184
|
dayperiod: 'dayPeriod'
|
|
185
185
|
};
|
|
186
|
-
function $
|
|
186
|
+
function $3c0fc76039f1c516$export$60e84778edff6d26(props) {
|
|
187
187
|
let { locale: locale , createCalendar: createCalendar , hideTimeZone: hideTimeZone , isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired } = props;
|
|
188
188
|
let v1 = props.value || props.defaultValue || props.placeholderValue;
|
|
189
189
|
let [granularity, defaultTimeZone] = $35a22f14a1f04b11$export$2440da353cedad43(v1, props.granularity);
|
|
@@ -226,7 +226,7 @@ function $09e80d602234613d$export$714a241b39a650d6(props) {
|
|
|
226
226
|
]);
|
|
227
227
|
// Determine how many editable segments there are for validation purposes.
|
|
228
228
|
// The result is cached for performance.
|
|
229
|
-
let allSegments = $7UzoM$useMemo(()=>dateFormatter.formatToParts(new Date()).filter((seg)=>$
|
|
229
|
+
let allSegments = $7UzoM$useMemo(()=>dateFormatter.formatToParts(new Date()).filter((seg)=>$3c0fc76039f1c516$var$EDITABLE_SEGMENTS[seg.type]
|
|
230
230
|
).reduce((p, seg)=>(p[seg.type] = true, p)
|
|
231
231
|
, {
|
|
232
232
|
})
|
|
@@ -296,13 +296,13 @@ function $09e80d602234613d$export$714a241b39a650d6(props) {
|
|
|
296
296
|
timeZone
|
|
297
297
|
]);
|
|
298
298
|
let segments = $7UzoM$useMemo(()=>dateFormatter.formatToParts(dateValue).map((segment)=>{
|
|
299
|
-
let isEditable = $
|
|
299
|
+
let isEditable = $3c0fc76039f1c516$var$EDITABLE_SEGMENTS[segment.type];
|
|
300
300
|
if (segment.type === 'era' && calendar.getEras().length === 1) isEditable = false;
|
|
301
301
|
return {
|
|
302
|
-
type: $
|
|
302
|
+
type: $3c0fc76039f1c516$var$TYPE_MAPPING[segment.type] || segment.type,
|
|
303
303
|
text: segment.value,
|
|
304
|
-
...$
|
|
305
|
-
isPlaceholder: $
|
|
304
|
+
...$3c0fc76039f1c516$var$getSegmentLimits(displayValue, segment.type, resolvedOptions),
|
|
305
|
+
isPlaceholder: $3c0fc76039f1c516$var$EDITABLE_SEGMENTS[segment.type] && !validSegments[segment.type],
|
|
306
306
|
isEditable: isEditable
|
|
307
307
|
};
|
|
308
308
|
})
|
|
@@ -328,7 +328,7 @@ function $09e80d602234613d$export$714a241b39a650d6(props) {
|
|
|
328
328
|
};
|
|
329
329
|
let adjustSegment = (type, amount)=>{
|
|
330
330
|
markValid(type);
|
|
331
|
-
setValue($
|
|
331
|
+
setValue($3c0fc76039f1c516$var$addSegment(displayValue, type, amount, resolvedOptions));
|
|
332
332
|
};
|
|
333
333
|
let validationState = props.validationState || ($35a22f14a1f04b11$export$eac50920cf2fd59a(calendarValue, props.minValue, props.maxValue) ? 'invalid' : null);
|
|
334
334
|
return {
|
|
@@ -349,14 +349,14 @@ function $09e80d602234613d$export$714a241b39a650d6(props) {
|
|
|
349
349
|
adjustSegment(part, -1);
|
|
350
350
|
},
|
|
351
351
|
incrementPage (part) {
|
|
352
|
-
adjustSegment(part, $
|
|
352
|
+
adjustSegment(part, $3c0fc76039f1c516$var$PAGE_STEP[part] || 1);
|
|
353
353
|
},
|
|
354
354
|
decrementPage (part) {
|
|
355
|
-
adjustSegment(part, -($
|
|
355
|
+
adjustSegment(part, -($3c0fc76039f1c516$var$PAGE_STEP[part] || 1));
|
|
356
356
|
},
|
|
357
357
|
setSegment (part, v) {
|
|
358
358
|
markValid(part);
|
|
359
|
-
setValue($
|
|
359
|
+
setValue($3c0fc76039f1c516$var$setSegment(displayValue, part, v, resolvedOptions));
|
|
360
360
|
},
|
|
361
361
|
confirmPlaceholder (part) {
|
|
362
362
|
if (props.isDisabled || props.isReadOnly) return;
|
|
@@ -398,12 +398,15 @@ function $09e80d602234613d$export$714a241b39a650d6(props) {
|
|
|
398
398
|
setDate(null);
|
|
399
399
|
setValue(value);
|
|
400
400
|
},
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
formatValue (fieldOptions) {
|
|
402
|
+
if (!calendarValue) return '';
|
|
403
|
+
let formatOptions = $35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, formatOpts);
|
|
404
|
+
let formatter = new $7UzoM$DateFormatter(locale, formatOptions);
|
|
405
|
+
return formatter.format(dateValue);
|
|
403
406
|
}
|
|
404
407
|
};
|
|
405
408
|
}
|
|
406
|
-
function $
|
|
409
|
+
function $3c0fc76039f1c516$var$getSegmentLimits(date, type, options) {
|
|
407
410
|
switch(type){
|
|
408
411
|
case 'era':
|
|
409
412
|
{
|
|
@@ -470,7 +473,7 @@ function $09e80d602234613d$var$getSegmentLimits(date, type, options) {
|
|
|
470
473
|
return {
|
|
471
474
|
};
|
|
472
475
|
}
|
|
473
|
-
function $
|
|
476
|
+
function $3c0fc76039f1c516$var$addSegment(value, part, amount, options) {
|
|
474
477
|
switch(part){
|
|
475
478
|
case 'era':
|
|
476
479
|
case 'year':
|
|
@@ -498,7 +501,7 @@ function $09e80d602234613d$var$addSegment(value, part, amount, options) {
|
|
|
498
501
|
});
|
|
499
502
|
}
|
|
500
503
|
}
|
|
501
|
-
function $
|
|
504
|
+
function $3c0fc76039f1c516$var$setSegment(value, part, segmentValue, options) {
|
|
502
505
|
switch(part){
|
|
503
506
|
case 'day':
|
|
504
507
|
case 'month':
|
|
@@ -728,7 +731,7 @@ function $eff5d8ee529ac4bb$export$fd53cef0cc796101(props) {
|
|
|
728
731
|
let onChange = (newValue)=>{
|
|
729
732
|
setValue(v && 'day' in v ? newValue : newValue && $7UzoM$toTime(newValue));
|
|
730
733
|
};
|
|
731
|
-
return $
|
|
734
|
+
return $3c0fc76039f1c516$export$60e84778edff6d26({
|
|
732
735
|
...props,
|
|
733
736
|
value: dateTime,
|
|
734
737
|
defaultValue: undefined,
|
|
@@ -751,5 +754,5 @@ function $eff5d8ee529ac4bb$var$convertValue(value, date = $7UzoM$today($7UzoM$ge
|
|
|
751
754
|
|
|
752
755
|
|
|
753
756
|
|
|
754
|
-
export {$ab5bf3f618090389$export$87194bb378cc3ac2 as useDatePickerState, $
|
|
757
|
+
export {$ab5bf3f618090389$export$87194bb378cc3ac2 as useDatePickerState, $3c0fc76039f1c516$export$60e84778edff6d26 as useDateFieldState, $93c38a5e28be6249$export$e50a61c1de9f574 as useDateRangePickerState, $eff5d8ee529ac4bb$export$fd53cef0cc796101 as useTimeFieldState};
|
|
755
758
|
//# sourceMappingURL=module.js.map
|