@react-stately/datepicker 3.0.0-rc.0 → 3.0.0-rc.1

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 CHANGED
@@ -47,6 +47,7 @@ function $50d5d6a623389320$export$7e319ea407e63bc0(fieldOptions, options) {
47
47
  opts1.timeZone = options.timeZone || 'UTC';
48
48
  let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second';
49
49
  if (hasTime && options.timeZone && !options.hideTimeZone) opts1.timeZoneName = 'short';
50
+ if (options.showEra && startIdx === 0) opts1.era = 'short';
50
51
  return opts1;
51
52
  }
52
53
  function $50d5d6a623389320$export$c5221a78ef73c5e9(placeholderValue) {
@@ -149,7 +150,8 @@ function $aaab7a647e17e1fd$export$87194bb378cc3ac2(props) {
149
150
  granularity: granularity,
150
151
  timeZone: defaultTimeZone,
151
152
  hideTimeZone: props.hideTimeZone,
152
- hourCycle: props.hourCycle
153
+ hourCycle: props.hourCycle,
154
+ showEra: value.calendar.identifier === 'gregory' && value.era === 'BC'
153
155
  });
154
156
  let formatter = new $h2qOe$internationalizeddate.DateFormatter(locale, formatOptions);
155
157
  return formatter.format(dateValue);
@@ -191,20 +193,45 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
191
193
  let timeZone = defaultTimeZone || 'UTC';
192
194
  // props.granularity must actually exist in the value if one is provided.
193
195
  if (v1 && !(granularity in v1)) throw new Error('Invalid granularity ' + granularity + ' for value ' + v1.toString());
196
+ let defaultFormatter = $h2qOe$react.useMemo(()=>new $h2qOe$internationalizeddate.DateFormatter(locale)
197
+ , [
198
+ locale
199
+ ]);
200
+ let calendar = $h2qOe$react.useMemo(()=>createCalendar(defaultFormatter.resolvedOptions().calendar)
201
+ , [
202
+ createCalendar,
203
+ defaultFormatter
204
+ ]);
205
+ let [value1, setDate] = $h2qOe$reactstatelyutils.useControlledState(props.value, props.defaultValue, props.onChange);
206
+ let calendarValue = $h2qOe$react.useMemo(()=>$50d5d6a623389320$export$61a490a80c552550(value1, calendar)
207
+ , [
208
+ value1,
209
+ calendar
210
+ ]);
211
+ // We keep track of the placeholder date separately in state so that onChange is not called
212
+ // until all segments are set. If the value === null (not undefined), then assume the component
213
+ // is controlled, so use the placeholder as the value until all segments are entered so it doesn't
214
+ // change from uncontrolled to controlled and emit a warning.
215
+ let [placeholderDate, setPlaceholderDate] = $h2qOe$react.useState(()=>$50d5d6a623389320$export$66aa2b09de4b1ea5(props.placeholderValue, granularity, calendar, defaultTimeZone)
216
+ );
217
+ let val = calendarValue || placeholderDate;
218
+ let showEra = calendar.identifier === 'gregory' && val.era === 'BC';
194
219
  var _maxGranularity;
195
220
  let formatOpts = $h2qOe$react.useMemo(()=>({
196
221
  granularity: granularity,
197
222
  maxGranularity: (_maxGranularity = props.maxGranularity) !== null && _maxGranularity !== void 0 ? _maxGranularity : 'year',
198
223
  timeZone: defaultTimeZone,
199
224
  hideTimeZone: hideTimeZone,
200
- hourCycle: props.hourCycle
225
+ hourCycle: props.hourCycle,
226
+ showEra: showEra
201
227
  })
202
228
  , [
203
229
  props.maxGranularity,
204
230
  granularity,
205
231
  props.hourCycle,
206
232
  defaultTimeZone,
207
- hideTimeZone
233
+ hideTimeZone,
234
+ showEra
208
235
  ]);
209
236
  let opts = $h2qOe$react.useMemo(()=>$50d5d6a623389320$export$7e319ea407e63bc0({
210
237
  }, formatOpts)
@@ -220,11 +247,6 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
220
247
  , [
221
248
  dateFormatter
222
249
  ]);
223
- let calendar = $h2qOe$react.useMemo(()=>createCalendar(resolvedOptions.calendar)
224
- , [
225
- createCalendar,
226
- resolvedOptions.calendar
227
- ]);
228
250
  // Determine how many editable segments there are for validation purposes.
229
251
  // The result is cached for performance.
230
252
  let allSegments = $h2qOe$react.useMemo(()=>dateFormatter.formatToParts(new Date()).filter((seg)=>$596a1f0f523d6752$var$EDITABLE_SEGMENTS[seg.type]
@@ -239,12 +261,6 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
239
261
  } : {
240
262
  }
241
263
  );
242
- // We keep track of the placeholder date separately in state so that onChange is not called
243
- // until all segments are set. If the value === null (not undefined), then assume the component
244
- // is controlled, so use the placeholder as the value until all segments are entered so it doesn't
245
- // change from uncontrolled to controlled and emit a warning.
246
- let [placeholderDate, setPlaceholderDate] = $h2qOe$react.useState(()=>$50d5d6a623389320$export$66aa2b09de4b1ea5(props.placeholderValue, granularity, calendar, defaultTimeZone)
247
- );
248
264
  // Reset placeholder when calendar changes
249
265
  let lastCalendarIdentifier = $h2qOe$react.useRef(calendar.identifier);
250
266
  $h2qOe$react.useEffect(()=>{
@@ -260,12 +276,6 @@ function $596a1f0f523d6752$export$60e84778edff6d26(props) {
260
276
  defaultTimeZone,
261
277
  props.placeholderValue
262
278
  ]);
263
- let [value1, setDate] = $h2qOe$reactstatelyutils.useControlledState(props.value, props.defaultValue, props.onChange);
264
- let calendarValue = $h2qOe$react.useMemo(()=>$50d5d6a623389320$export$61a490a80c552550(value1, calendar)
265
- , [
266
- value1,
267
- calendar
268
- ]);
269
279
  // If there is a value prop, and some segments were previously placeholders, mark them all as valid.
270
280
  if (value1 && Object.keys(validSegments).length < Object.keys(allSegments).length) {
271
281
  validSegments = {
@@ -657,7 +667,8 @@ function $7072d26f58deb33b$export$e50a61c1de9f574(props) {
657
667
  granularity: startGranularity,
658
668
  timeZone: startTimeZone,
659
669
  hideTimeZone: props.hideTimeZone,
660
- hourCycle: props.hourCycle
670
+ hourCycle: props.hourCycle,
671
+ showEra: value1.start.calendar.identifier === 'gregory' && value1.start.era === 'BC' || value1.end.calendar.identifier === 'gregory' && value1.end.era === 'BC'
661
672
  });
662
673
  let startDate = value1.start.toDate(startTimeZone || 'UTC');
663
674
  let endDate = value1.end.toDate(endTimeZone || 'UTC');
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;SEgBgB,yCAAS,CAAC,KAAgB,EAAE,Q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G,CAAC;QAAA,QAAQ;QAAE,GAAG;IAAA,CAAC;IAExE,GAAG,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"}
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;AAYD,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,CAAC,EACd,QAAQ,GAAG,CAAC;IAGd,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW;IACrC,EAAE,EAAE,MAAM,GAAG,CAAC,EACZ,MAAM,GAAG,CAAC;IAGZ,EAAE,EAAE,QAAQ,GAAG,MAAM,EACnB,KAAK,CAAC,GAAG,CAAC,KAAK,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C;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 showEra: value.calendar.identifier === 'gregory' && value.era === 'BC'\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 showEra?: boolean\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 if (options.showEra && startIdx === 0) {\n opts.era = '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 defaultFormatter = useMemo(() => new DateFormatter(locale), [locale]);\n let calendar = useMemo(() => createCalendar(defaultFormatter.resolvedOptions().calendar), [createCalendar, defaultFormatter]);\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 // 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 let val = calendarValue || placeholderDate;\n let showEra = calendar.identifier === 'gregory' && val.era === 'BC';\n let formatOpts = useMemo(() => ({\n granularity,\n maxGranularity: props.maxGranularity ?? 'year',\n timeZone: defaultTimeZone,\n hideTimeZone,\n hourCycle: props.hourCycle,\n showEra\n }), [props.maxGranularity, granularity, props.hourCycle, defaultTimeZone, hideTimeZone, showEra]);\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\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 // 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 // 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 showEra: (value.start.calendar.identifier === 'gregory' && value.start.era === 'BC') ||\n (value.end.calendar.identifier === 'gregory' && value.end.era === 'BC')\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"}
package/dist/module.js CHANGED
@@ -39,6 +39,7 @@ function $35a22f14a1f04b11$export$7e319ea407e63bc0(fieldOptions, options) {
39
39
  opts1.timeZone = options.timeZone || 'UTC';
40
40
  let hasTime = granularity === 'hour' || granularity === 'minute' || granularity === 'second';
41
41
  if (hasTime && options.timeZone && !options.hideTimeZone) opts1.timeZoneName = 'short';
42
+ if (options.showEra && startIdx === 0) opts1.era = 'short';
42
43
  return opts1;
43
44
  }
44
45
  function $35a22f14a1f04b11$export$c5221a78ef73c5e9(placeholderValue) {
@@ -141,7 +142,8 @@ function $ab5bf3f618090389$export$87194bb378cc3ac2(props) {
141
142
  granularity: granularity,
142
143
  timeZone: defaultTimeZone,
143
144
  hideTimeZone: props.hideTimeZone,
144
- hourCycle: props.hourCycle
145
+ hourCycle: props.hourCycle,
146
+ showEra: value.calendar.identifier === 'gregory' && value.era === 'BC'
145
147
  });
146
148
  let formatter = new $7UzoM$DateFormatter(locale, formatOptions);
147
149
  return formatter.format(dateValue);
@@ -183,20 +185,45 @@ function $3c0fc76039f1c516$export$60e84778edff6d26(props) {
183
185
  let timeZone = defaultTimeZone || 'UTC';
184
186
  // props.granularity must actually exist in the value if one is provided.
185
187
  if (v1 && !(granularity in v1)) throw new Error('Invalid granularity ' + granularity + ' for value ' + v1.toString());
188
+ let defaultFormatter = $7UzoM$useMemo(()=>new $7UzoM$DateFormatter(locale)
189
+ , [
190
+ locale
191
+ ]);
192
+ let calendar = $7UzoM$useMemo(()=>createCalendar(defaultFormatter.resolvedOptions().calendar)
193
+ , [
194
+ createCalendar,
195
+ defaultFormatter
196
+ ]);
197
+ let [value1, setDate] = $7UzoM$useControlledState(props.value, props.defaultValue, props.onChange);
198
+ let calendarValue = $7UzoM$useMemo(()=>$35a22f14a1f04b11$export$61a490a80c552550(value1, calendar)
199
+ , [
200
+ value1,
201
+ calendar
202
+ ]);
203
+ // We keep track of the placeholder date separately in state so that onChange is not called
204
+ // until all segments are set. If the value === null (not undefined), then assume the component
205
+ // is controlled, so use the placeholder as the value until all segments are entered so it doesn't
206
+ // change from uncontrolled to controlled and emit a warning.
207
+ let [placeholderDate, setPlaceholderDate] = $7UzoM$useState(()=>$35a22f14a1f04b11$export$66aa2b09de4b1ea5(props.placeholderValue, granularity, calendar, defaultTimeZone)
208
+ );
209
+ let val = calendarValue || placeholderDate;
210
+ let showEra = calendar.identifier === 'gregory' && val.era === 'BC';
186
211
  var _maxGranularity;
187
212
  let formatOpts = $7UzoM$useMemo(()=>({
188
213
  granularity: granularity,
189
214
  maxGranularity: (_maxGranularity = props.maxGranularity) !== null && _maxGranularity !== void 0 ? _maxGranularity : 'year',
190
215
  timeZone: defaultTimeZone,
191
216
  hideTimeZone: hideTimeZone,
192
- hourCycle: props.hourCycle
217
+ hourCycle: props.hourCycle,
218
+ showEra: showEra
193
219
  })
194
220
  , [
195
221
  props.maxGranularity,
196
222
  granularity,
197
223
  props.hourCycle,
198
224
  defaultTimeZone,
199
- hideTimeZone
225
+ hideTimeZone,
226
+ showEra
200
227
  ]);
201
228
  let opts = $7UzoM$useMemo(()=>$35a22f14a1f04b11$export$7e319ea407e63bc0({
202
229
  }, formatOpts)
@@ -212,11 +239,6 @@ function $3c0fc76039f1c516$export$60e84778edff6d26(props) {
212
239
  , [
213
240
  dateFormatter
214
241
  ]);
215
- let calendar = $7UzoM$useMemo(()=>createCalendar(resolvedOptions.calendar)
216
- , [
217
- createCalendar,
218
- resolvedOptions.calendar
219
- ]);
220
242
  // Determine how many editable segments there are for validation purposes.
221
243
  // The result is cached for performance.
222
244
  let allSegments = $7UzoM$useMemo(()=>dateFormatter.formatToParts(new Date()).filter((seg)=>$3c0fc76039f1c516$var$EDITABLE_SEGMENTS[seg.type]
@@ -231,12 +253,6 @@ function $3c0fc76039f1c516$export$60e84778edff6d26(props) {
231
253
  } : {
232
254
  }
233
255
  );
234
- // We keep track of the placeholder date separately in state so that onChange is not called
235
- // until all segments are set. If the value === null (not undefined), then assume the component
236
- // is controlled, so use the placeholder as the value until all segments are entered so it doesn't
237
- // change from uncontrolled to controlled and emit a warning.
238
- let [placeholderDate, setPlaceholderDate] = $7UzoM$useState(()=>$35a22f14a1f04b11$export$66aa2b09de4b1ea5(props.placeholderValue, granularity, calendar, defaultTimeZone)
239
- );
240
256
  // Reset placeholder when calendar changes
241
257
  let lastCalendarIdentifier = $7UzoM$useRef(calendar.identifier);
242
258
  $7UzoM$useEffect(()=>{
@@ -252,12 +268,6 @@ function $3c0fc76039f1c516$export$60e84778edff6d26(props) {
252
268
  defaultTimeZone,
253
269
  props.placeholderValue
254
270
  ]);
255
- let [value1, setDate] = $7UzoM$useControlledState(props.value, props.defaultValue, props.onChange);
256
- let calendarValue = $7UzoM$useMemo(()=>$35a22f14a1f04b11$export$61a490a80c552550(value1, calendar)
257
- , [
258
- value1,
259
- calendar
260
- ]);
261
271
  // If there is a value prop, and some segments were previously placeholders, mark them all as valid.
262
272
  if (value1 && Object.keys(validSegments).length < Object.keys(allSegments).length) {
263
273
  validSegments = {
@@ -649,7 +659,8 @@ function $93c38a5e28be6249$export$e50a61c1de9f574(props) {
649
659
  granularity: startGranularity,
650
660
  timeZone: startTimeZone,
651
661
  hideTimeZone: props.hideTimeZone,
652
- hourCycle: props.hourCycle
662
+ hourCycle: props.hourCycle,
663
+ showEra: value1.start.calendar.identifier === 'gregory' && value1.start.era === 'BC' || value1.end.calendar.identifier === 'gregory' && value1.end.era === 'BC'
653
664
  });
654
665
  let startDate = value1.start.toDate(startTimeZone || 'UTC');
655
666
  let endDate = value1.end.toDate(endTimeZone || 'UTC');
@@ -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/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C;IAChF,GAAG,CAAC,QAAQ,IAAG,QAAQ,GAAI,CAAC;QAC1B,QAAQ,CAAC,CAAC,IAAI,CAAK,QAAI,CAAC,GAAG,QAAQ,GAAG,QAAQ,IAAI,aAAM,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,wBAAiB;IAC7C,CAAC;AACH,CAAC;SAEQ,kCAAY,CAAC,KAAgB,EAAE,IAAe,GAAG,YAAK,CAAC,uBAAgB,KAAK,CAAC;IACpF,EAAE,GAAG,KAAK,EACR,MAAM,CAAC,IAAI;IAGb,EAAE,EAAE,CAAK,QAAI,KAAK,EAChB,MAAM,CAAC,KAAK;IAGd,MAAM,CAAC,yBAAkB,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":"module.js.map"}
1
+ {"mappings":";;;;;;;;SEgBgB,yCAAS,CAAC,KAAgB,EAAE,QAAmB,EAAE,QAAmB,EAAE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tB,gBAAgB,EAAE,eAAe;QACjC,EAA8C,AAA9C,4CAA8C;QAC9C,cAAc,MAAQ,GAAG,CAAC,wBAAiB;IAC7C,CAAC;AACH,CAAC;SAEQ,kCAAY,CAAC,KAAgB,EAAE,IAAe,GAAG,YAAK,CAAC,uBAAgB,KAAK,CAAC;IACpF,EAAE,GAAG,KAAK,EACR,MAAM,CAAC,IAAI;IAGb,EAAE,EAAE,CAAK,QAAI,KAAK,EAChB,MAAM,CAAC,KAAK;IAGd,MAAM,CAAC,yBAAkB,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 showEra: value.calendar.identifier === 'gregory' && value.era === 'BC'\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 showEra?: boolean\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 if (options.showEra && startIdx === 0) {\n opts.era = '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 defaultFormatter = useMemo(() => new DateFormatter(locale), [locale]);\n let calendar = useMemo(() => createCalendar(defaultFormatter.resolvedOptions().calendar), [createCalendar, defaultFormatter]);\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 // 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 let val = calendarValue || placeholderDate;\n let showEra = calendar.identifier === 'gregory' && val.era === 'BC';\n let formatOpts = useMemo(() => ({\n granularity,\n maxGranularity: props.maxGranularity ?? 'year',\n timeZone: defaultTimeZone,\n hideTimeZone,\n hourCycle: props.hourCycle,\n showEra\n }), [props.maxGranularity, granularity, props.hourCycle, defaultTimeZone, hideTimeZone, showEra]);\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\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 // 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 // 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 showEra: (value.start.calendar.identifier === 'gregory' && value.start.era === 'BC') ||\n (value.end.calendar.identifier === 'gregory' && value.end.era === 'BC')\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":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;AAuBA,oBAA2B,IAAI,CAAC,KAAK,qBAAqB,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;ACFrH,uCAAw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C;IACzB,qHAAqH;IACrH,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,yHAAyH;IACzH,eAAe,EAAE,eAAe,CAAC;IACjC,0DAA0D;IAC1D,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAC;IACtF,yGAAyG;IACzG,kBAAkB,IAAI,IAAI,CAAA;CAC3B;AAED;;;;GAIG;AACH,wCAAwC,KAAK,EAAE,2BAA2B,GAAG,oBAAoB,CAgNhG;ACzQD,sCAAuC,SAAQ,gBAAgB,SAAS,CAAC;IACvE,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,kCAAkC,KAAK,EAAE,qBAAqB,GAAG,cAAc,CAsC9E","sources":["packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/utils.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useDatePickerState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useDateFieldState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useDateRangePickerState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useTimeFieldState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/index.ts","packages/@react-stately/datepicker/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,"/*\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"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AAuBA,oBAA2B,IAAI,CAAC,KAAK,qBAAqB,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;ACFrH,uCAAwC,SAAQ,gBAAgB,SAAS,CAAC;IACxE;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAA;CAChD;AAED;IACE,mCAAmC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB,0CAA0C;IAC1C,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB,0CAA0C;IAC1C,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACrC,wFAAwF;IACxF,WAAW,EAAE,WAAW,CAAC;IACzB,gHAAgH;IAChH,OAAO,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,yHAAyH;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datepicker/src/utils.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useDatePickerState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useDateFieldState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useDateRangePickerState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/useTimeFieldState.ts","packages/@react-stately/datepicker/src/packages/@react-stately/datepicker/src/index.ts","packages/@react-stately/datepicker/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,"/*\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"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/datepicker",
3
- "version": "3.0.0-rc.0",
3
+ "version": "3.0.0-rc.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@internationalized/date": "3.0.0-rc.0",
22
- "@react-stately/overlays": "^3.2.0",
23
- "@react-stately/utils": "^3.4.1",
24
- "@react-types/datepicker": "3.0.0-rc.0",
25
- "@react-types/shared": "^3.12.0"
21
+ "@internationalized/date": "3.0.0-rc.1",
22
+ "@react-stately/overlays": "^3.3.0",
23
+ "@react-stately/utils": "^3.5.0",
24
+ "@react-types/datepicker": "3.0.0-rc.1",
25
+ "@react-types/shared": "^3.13.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "react": "^16.8.0 || ^17.0.0-rc.1"
28
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "6a503b715e0dbbf92038cd7f08b1bcdde4c78e82"
33
+ "gitHead": "8f921ec5094e7c2b3c301bcb6133372e35a2052b"
34
34
  }
@@ -153,18 +153,39 @@ export function useDateFieldState(props: DateFieldStateOptions): DateFieldState
153
153
  throw new Error('Invalid granularity ' + granularity + ' for value ' + v.toString());
154
154
  }
155
155
 
156
+ let defaultFormatter = useMemo(() => new DateFormatter(locale), [locale]);
157
+ let calendar = useMemo(() => createCalendar(defaultFormatter.resolvedOptions().calendar), [createCalendar, defaultFormatter]);
158
+
159
+ let [value, setDate] = useControlledState<DateValue>(
160
+ props.value,
161
+ props.defaultValue,
162
+ props.onChange
163
+ );
164
+
165
+ let calendarValue = useMemo(() => convertValue(value, calendar), [value, calendar]);
166
+
167
+ // We keep track of the placeholder date separately in state so that onChange is not called
168
+ // until all segments are set. If the value === null (not undefined), then assume the component
169
+ // is controlled, so use the placeholder as the value until all segments are entered so it doesn't
170
+ // change from uncontrolled to controlled and emit a warning.
171
+ let [placeholderDate, setPlaceholderDate] = useState(
172
+ () => createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)
173
+ );
174
+
175
+ let val = calendarValue || placeholderDate;
176
+ let showEra = calendar.identifier === 'gregory' && val.era === 'BC';
156
177
  let formatOpts = useMemo(() => ({
157
178
  granularity,
158
179
  maxGranularity: props.maxGranularity ?? 'year',
159
180
  timeZone: defaultTimeZone,
160
181
  hideTimeZone,
161
- hourCycle: props.hourCycle
162
- }), [props.maxGranularity, granularity, props.hourCycle, defaultTimeZone, hideTimeZone]);
182
+ hourCycle: props.hourCycle,
183
+ showEra
184
+ }), [props.maxGranularity, granularity, props.hourCycle, defaultTimeZone, hideTimeZone, showEra]);
163
185
  let opts = useMemo(() => getFormatOptions({}, formatOpts), [formatOpts]);
164
186
 
165
187
  let dateFormatter = useMemo(() => new DateFormatter(locale, opts), [locale, opts]);
166
188
  let resolvedOptions = useMemo(() => dateFormatter.resolvedOptions(), [dateFormatter]);
167
- let calendar = useMemo(() => createCalendar(resolvedOptions.calendar), [createCalendar, resolvedOptions.calendar]);
168
189
 
169
190
  // Determine how many editable segments there are for validation purposes.
170
191
  // The result is cached for performance.
@@ -178,14 +199,6 @@ export function useDateFieldState(props: DateFieldStateOptions): DateFieldState
178
199
  () => props.value || props.defaultValue ? {...allSegments} : {}
179
200
  );
180
201
 
181
- // We keep track of the placeholder date separately in state so that onChange is not called
182
- // until all segments are set. If the value === null (not undefined), then assume the component
183
- // is controlled, so use the placeholder as the value until all segments are entered so it doesn't
184
- // change from uncontrolled to controlled and emit a warning.
185
- let [placeholderDate, setPlaceholderDate] = useState(
186
- () => createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)
187
- );
188
-
189
202
  // Reset placeholder when calendar changes
190
203
  let lastCalendarIdentifier = useRef(calendar.identifier);
191
204
  useEffect(() => {
@@ -199,14 +212,6 @@ export function useDateFieldState(props: DateFieldStateOptions): DateFieldState
199
212
  }
200
213
  }, [calendar, granularity, validSegments, defaultTimeZone, props.placeholderValue]);
201
214
 
202
- let [value, setDate] = useControlledState<DateValue>(
203
- props.value,
204
- props.defaultValue,
205
- props.onChange
206
- );
207
-
208
- let calendarValue = useMemo(() => convertValue(value, calendar), [value, calendar]);
209
-
210
215
  // If there is a value prop, and some segments were previously placeholders, mark them all as valid.
211
216
  if (value && Object.keys(validSegments).length < Object.keys(allSegments).length) {
212
217
  validSegments = {...allSegments};
@@ -153,7 +153,8 @@ export function useDatePickerState(props: DatePickerStateOptions): DatePickerSta
153
153
  granularity,
154
154
  timeZone: defaultTimeZone,
155
155
  hideTimeZone: props.hideTimeZone,
156
- hourCycle: props.hourCycle
156
+ hourCycle: props.hourCycle,
157
+ showEra: value.calendar.identifier === 'gregory' && value.era === 'BC'
157
158
  });
158
159
 
159
160
  let formatter = new DateFormatter(locale, formatOptions);
@@ -207,7 +207,9 @@ export function useDateRangePickerState(props: DateRangePickerStateOptions): Dat
207
207
  granularity: startGranularity,
208
208
  timeZone: startTimeZone,
209
209
  hideTimeZone: props.hideTimeZone,
210
- hourCycle: props.hourCycle
210
+ hourCycle: props.hourCycle,
211
+ showEra: (value.start.calendar.identifier === 'gregory' && value.start.era === 'BC') ||
212
+ (value.end.calendar.identifier === 'gregory' && value.end.era === 'BC')
211
213
  });
212
214
 
213
215
  let startDate = value.start.toDate(startTimeZone || 'UTC');
package/src/utils.ts CHANGED
@@ -27,7 +27,8 @@ interface FormatterOptions {
27
27
  hideTimeZone?: boolean,
28
28
  granularity?: DatePickerProps<any>['granularity'],
29
29
  maxGranularity?: 'year' | 'month' | DatePickerProps<any>['granularity'],
30
- hourCycle?: 12 | 24
30
+ hourCycle?: 12 | 24,
31
+ showEra?: boolean
31
32
  }
32
33
 
33
34
  const DEFAULT_FIELD_OPTIONS: FieldOptions = {
@@ -76,6 +77,10 @@ export function getFormatOptions(
76
77
  opts.timeZoneName = 'short';
77
78
  }
78
79
 
80
+ if (options.showEra && startIdx === 0) {
81
+ opts.era = 'short';
82
+ }
83
+
79
84
  return opts;
80
85
  }
81
86