@fluentui/react-datepicker-compat 0.1.3 → 0.1.5
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/CHANGELOG.json +133 -1
- package/CHANGELOG.md +37 -2
- package/lib/Calendar.js +0 -1
- package/lib/Calendar.js.map +1 -1
- package/lib/CalendarDay.js +0 -1
- package/lib/CalendarDay.js.map +1 -1
- package/lib/CalendarDayGrid.js +0 -1
- package/lib/CalendarDayGrid.js.map +1 -1
- package/lib/CalendarMonth.js +0 -1
- package/lib/CalendarMonth.js.map +1 -1
- package/lib/CalendarPicker.js +0 -1
- package/lib/CalendarPicker.js.map +1 -1
- package/lib/CalendarYear.js +0 -1
- package/lib/CalendarYear.js.map +1 -1
- package/lib/DatePicker.js +0 -1
- package/lib/DatePicker.js.map +1 -1
- package/lib/components/Calendar/Calendar.js +278 -300
- package/lib/components/Calendar/Calendar.js.map +1 -1
- package/lib/components/Calendar/Calendar.types.js +7 -12
- package/lib/components/Calendar/Calendar.types.js.map +1 -1
- package/lib/components/Calendar/defaults.js +0 -1
- package/lib/components/Calendar/defaults.js.map +1 -1
- package/lib/components/Calendar/index.js +0 -1
- package/lib/components/Calendar/index.js.map +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.js +100 -128
- package/lib/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.types.js +0 -1
- package/lib/components/CalendarDay/CalendarDay.types.js.map +1 -1
- package/lib/components/CalendarDay/index.js +0 -1
- package/lib/components/CalendarDay/index.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js +146 -159
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js +0 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js +150 -179
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridRow.js +20 -34
- package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js +29 -39
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/index.js +0 -1
- package/lib/components/CalendarDayGrid/index.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeekCornerStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeeks.js +34 -36
- package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js +238 -258
- package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.types.js +0 -1
- package/lib/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
- package/lib/components/CalendarMonth/index.js +0 -1
- package/lib/components/CalendarMonth/index.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.js +2 -4
- package/lib/components/CalendarMonth/useCalendarMonthStyles.js.map +1 -1
- package/lib/components/CalendarPicker/CalendarPicker.types.js +1 -2
- package/lib/components/CalendarPicker/CalendarPicker.types.js.map +1 -1
- package/lib/components/CalendarPicker/index.js +0 -1
- package/lib/components/CalendarPicker/index.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.js +260 -312
- package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.types.js +0 -1
- package/lib/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib/components/CalendarYear/index.js +0 -1
- package/lib/components/CalendarYear/index.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib/components/DatePicker/DatePicker.js +4 -5
- package/lib/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/components/DatePicker/DatePicker.types.js +0 -1
- package/lib/components/DatePicker/DatePicker.types.js.map +1 -1
- package/lib/components/DatePicker/defaults.js +9 -10
- package/lib/components/DatePicker/defaults.js.map +1 -1
- package/lib/components/DatePicker/index.js +0 -1
- package/lib/components/DatePicker/index.js.map +1 -1
- package/lib/components/DatePicker/renderDatePicker.js +5 -12
- package/lib/components/DatePicker/renderDatePicker.js.map +1 -1
- package/lib/components/DatePicker/useDatePicker.js +401 -353
- package/lib/components/DatePicker/useDatePicker.js.map +1 -1
- package/lib/components/DatePicker/useDatePickerStyles.styles.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/animations.js +72 -73
- package/lib/utils/animations.js.map +1 -1
- package/lib/utils/constants.js +50 -52
- package/lib/utils/constants.js.map +1 -1
- package/lib/utils/dateFormatting/dateFormatting.defaults.js +71 -34
- package/lib/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
- package/lib/utils/dateFormatting/dateFormatting.types.js +1 -2
- package/lib/utils/dateFormatting/dateFormatting.types.js.map +1 -1
- package/lib/utils/dateFormatting/index.js +0 -1
- package/lib/utils/dateFormatting/index.js.map +1 -1
- package/lib/utils/dateGrid/dateGrid.types.js +1 -2
- package/lib/utils/dateGrid/dateGrid.types.js.map +1 -1
- package/lib/utils/dateGrid/findAvailableDate.js +14 -21
- package/lib/utils/dateGrid/findAvailableDate.js.map +1 -1
- package/lib/utils/dateGrid/getBoundedDateRange.js +11 -11
- package/lib/utils/dateGrid/getBoundedDateRange.js.map +1 -1
- package/lib/utils/dateGrid/getDateRangeTypeToUse.js +6 -8
- package/lib/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
- package/lib/utils/dateGrid/getDayGrid.js +59 -73
- package/lib/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib/utils/dateGrid/index.js +0 -1
- package/lib/utils/dateGrid/index.js.map +1 -1
- package/lib/utils/dateGrid/isAfterMaxDate.js +3 -7
- package/lib/utils/dateGrid/isAfterMaxDate.js.map +1 -1
- package/lib/utils/dateGrid/isBeforeMinDate.js +3 -7
- package/lib/utils/dateGrid/isBeforeMinDate.js.map +1 -1
- package/lib/utils/dateGrid/isContiguous.js +11 -12
- package/lib/utils/dateGrid/isContiguous.js.map +1 -1
- package/lib/utils/dateGrid/isRestrictedDate.js +7 -13
- package/lib/utils/dateGrid/isRestrictedDate.js.map +1 -1
- package/lib/utils/dateMath/dateMath.js +179 -198
- package/lib/utils/dateMath/dateMath.js.map +1 -1
- package/lib/utils/dateMath/index.js +0 -1
- package/lib/utils/dateMath/index.js.map +1 -1
- package/lib/utils/dom.js +5 -6
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/focus.js +17 -19
- package/lib/utils/focus.js.map +1 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/usePopupPositioning.js +12 -16
- package/lib/utils/usePopupPositioning.js.map +1 -1
- package/lib-commonjs/Calendar.js +0 -3
- package/lib-commonjs/Calendar.js.map +1 -1
- package/lib-commonjs/CalendarDay.js +0 -3
- package/lib-commonjs/CalendarDay.js.map +1 -1
- package/lib-commonjs/CalendarDayGrid.js +0 -3
- package/lib-commonjs/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/CalendarMonth.js +0 -3
- package/lib-commonjs/CalendarMonth.js.map +1 -1
- package/lib-commonjs/CalendarPicker.js +0 -3
- package/lib-commonjs/CalendarPicker.js.map +1 -1
- package/lib-commonjs/CalendarYear.js +0 -3
- package/lib-commonjs/CalendarYear.js.map +1 -1
- package/lib-commonjs/DatePicker.js +0 -3
- package/lib-commonjs/DatePicker.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.js +1 -3
- package/lib-commonjs/components/Calendar/Calendar.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.types.js +5 -7
- package/lib-commonjs/components/Calendar/Calendar.types.js.map +1 -1
- package/lib-commonjs/components/Calendar/defaults.js +1 -3
- package/lib-commonjs/components/Calendar/defaults.js.map +1 -1
- package/lib-commonjs/components/Calendar/index.js +0 -3
- package/lib-commonjs/components/Calendar/index.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js +0 -2
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js +1 -3
- package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.types.js +0 -3
- package/lib-commonjs/components/CalendarDay/CalendarDay.types.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/index.js +0 -3
- package/lib-commonjs/components/CalendarDay/index.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js +0 -2
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js +7 -9
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js +0 -3
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js +1 -3
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js +1 -3
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js +1 -3
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/index.js +0 -3
- package/lib-commonjs/components/CalendarDayGrid/index.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +0 -2
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js +0 -2
- package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js +9 -11
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js +1 -3
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js +0 -3
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/index.js +0 -3
- package/lib-commonjs/components/CalendarMonth/index.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js +1 -3
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js +0 -3
- package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/index.js +0 -3
- package/lib-commonjs/components/CalendarPicker/index.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js +0 -2
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.js +1 -3
- package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.types.js +0 -3
- package/lib-commonjs/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/index.js +0 -3
- package/lib-commonjs/components/CalendarYear/index.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js +0 -2
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DatePicker/DatePicker.js +1 -3
- package/lib-commonjs/components/DatePicker/DatePicker.js.map +1 -1
- package/lib-commonjs/components/DatePicker/DatePicker.types.js +0 -3
- package/lib-commonjs/components/DatePicker/DatePicker.types.js.map +1 -1
- package/lib-commonjs/components/DatePicker/defaults.js +1 -3
- package/lib-commonjs/components/DatePicker/defaults.js.map +1 -1
- package/lib-commonjs/components/DatePicker/index.js +0 -3
- package/lib-commonjs/components/DatePicker/index.js.map +1 -1
- package/lib-commonjs/components/DatePicker/renderDatePicker.js +1 -3
- package/lib-commonjs/components/DatePicker/renderDatePicker.js.map +1 -1
- package/lib-commonjs/components/DatePicker/useDatePicker.js +8 -11
- package/lib-commonjs/components/DatePicker/useDatePicker.js.map +1 -1
- package/lib-commonjs/components/DatePicker/useDatePickerStyles.styles.js +0 -2
- package/lib-commonjs/components/DatePicker/useDatePickerStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/animations.js +4 -6
- package/lib-commonjs/utils/animations.js.map +1 -1
- package/lib-commonjs/utils/constants.js +7 -9
- package/lib-commonjs/utils/constants.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js +1 -3
- package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/dateFormatting.types.js +0 -3
- package/lib-commonjs/utils/dateFormatting/dateFormatting.types.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/index.js +0 -3
- package/lib-commonjs/utils/dateFormatting/index.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/dateGrid.types.js +0 -3
- package/lib-commonjs/utils/dateGrid/dateGrid.types.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/findAvailableDate.js +1 -3
- package/lib-commonjs/utils/dateGrid/findAvailableDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js +1 -3
- package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js +1 -3
- package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDayGrid.js +1 -3
- package/lib-commonjs/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/index.js +0 -3
- package/lib-commonjs/utils/dateGrid/index.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js +1 -3
- package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js +1 -3
- package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isContiguous.js +1 -3
- package/lib-commonjs/utils/dateGrid/isContiguous.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isRestrictedDate.js +1 -3
- package/lib-commonjs/utils/dateGrid/isRestrictedDate.js.map +1 -1
- package/lib-commonjs/utils/dateMath/dateMath.js +1 -3
- package/lib-commonjs/utils/dateMath/dateMath.js.map +1 -1
- package/lib-commonjs/utils/dateMath/index.js +0 -3
- package/lib-commonjs/utils/dateMath/index.js.map +1 -1
- package/lib-commonjs/utils/dom.js +1 -3
- package/lib-commonjs/utils/dom.js.map +1 -1
- package/lib-commonjs/utils/focus.js +1 -3
- package/lib-commonjs/utils/focus.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -3
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/usePopupPositioning.js +1 -3
- package/lib-commonjs/utils/usePopupPositioning.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/DatePicker/useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport { mergeCallbacks, resolveShorthand, useControllableState, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nfunction isDateOutOfBounds(date, minDate, maxDate) {\n return !!minDate && compareDatePart(minDate, date) > 0 || !!maxDate && compareDatePart(maxDate, date) < 0;\n}\nfunction useFocusLogic() {\n const inputRef = React.useRef(null);\n const preventFocusOpeningPicker = React.useRef(false);\n const focus = () => {\n var _inputRef_current, _inputRef_current_focus;\n (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);\n };\n const preventNextFocusOpeningPicker = () => {\n preventFocusOpeningPicker.current = true;\n };\n return [focus, inputRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker];\n}\nfunction usePopupVisibility(props) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open\n });\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n if (isMounted.current && !open) {\n var\n // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n _props_onOpenChange;\n (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, false);\n }\n isMounted.current = true;\n },\n // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.allowTextInput, open]);\n return [open, setOpen];\n}\nfunction useSelectedDate({\n formatDate,\n onSelectDate,\n value\n}) {\n const [selectedDate, setSelectedDateState] = useControllableState({\n initialState: undefined,\n state: value\n });\n const [formattedDate, setFormattedDate] = React.useState(() => value && formatDate ? formatDate(value) : '');\n const setSelectedDate = newDate => {\n if (selectedDate === undefined && newDate !== undefined || selectedDate !== undefined && newDate === undefined || newDate && selectedDate && (newDate > selectedDate || newDate < selectedDate)) {\n onSelectDate === null || onSelectDate === void 0 ? void 0 : onSelectDate(newDate);\n }\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n React.useEffect(() => {\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [formatDate, value]);\n return [selectedDate, formattedDate, setSelectedDate, setFormattedDate];\n}\nconst defaultFormatDate = date => date ? date.toDateString() : '';\nconst defaultParseDateFromString = dateStr => {\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */\nexport const useDatePicker_unstable = (props, ref) => {\n const {\n allowTextInput = false,\n allFocusable = false,\n borderless = false,\n dateTimeFormatter,\n defaultOpen = false,\n disableAutoFocus = true,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n formatDate = defaultFormatDate,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n initialPickerDate = new Date(),\n inlinePopup = false,\n isMonthPickerVisible = true,\n maxDate,\n minDate,\n onOpenChange,\n onSelectDate: onUserSelectDate,\n openOnClick = true,\n onValidationResult,\n parseDateFromString = defaultParseDateFromString,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay = false,\n showWeekNumbers = false,\n strings = defaultDatePickerStrings,\n today,\n underlined = false,\n value,\n ...restOfProps\n } = props;\n const calendar = React.useRef(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n var _fieldContext_required;\n const required = (_fieldContext_required = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n const validateTextInput = React.useCallback((date = null) => {\n let error;\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date !== null && date !== void 0 ? date : selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString(formattedDate);\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n onUserSelectDate === null || onUserSelectDate === void 0 ? void 0 : onUserSelectDate(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n onValidationResult === null || onValidationResult === void 0 ? void 0 : onValidationResult({\n error\n });\n }, [allowTextInput, formatDate, formattedDate, maxDate, minDate, onUserSelectDate, onValidationResult, parseDateFromString, required, selectedDate, setSelectedDate]);\n const setOpen = React.useCallback(newState => {\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);\n setOpenState(newState);\n }, [onOpenChange, setOpenState]);\n const dismissDatePickerPopup = React.useCallback(newlySelectedDate => {\n if (open) {\n setOpen(false);\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n }, [allowTextInput, open, setOpen, setSelectedDate, validateTextInput]);\n const showDatePickerPopup = React.useCallback(() => {\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [open, preventNextFocusOpeningPicker, setOpen]);\n /**\n * Callback for closing the calendar callout\n */\n const calendarDismissed = React.useCallback(newlySelectedDate => {\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n }, [dismissDatePickerPopup, preventNextFocusOpeningPicker]);\n const onInputChange = React.useCallback((ev, data) => {\n const {\n value: newValue\n } = data;\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n setFormattedDate(newValue);\n }\n }, [allowTextInput, dismissDatePickerPopup, open, setFormattedDate]);\n const onInputBlur = React.useCallback(() => {\n validateTextInput();\n }, [validateTextInput]);\n const onInputKeyDown = React.useCallback(ev => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n case ArrowDown:\n ev.preventDefault();\n if (ev.altKey && !open) {\n showDatePickerPopup();\n }\n break;\n default:\n break;\n }\n }, [calendarDismissed, dismissDatePickerPopup, open, props.allowTextInput, showDatePickerPopup, validateTextInput]);\n const onInputFocus = React.useCallback(() => {\n if (disableAutoFocus) {\n return;\n }\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [allowTextInput, disableAutoFocus, preventFocusOpeningPicker, showDatePickerPopup]);\n const onInputClick = React.useCallback(() => {\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [allowTextInput, dismissDatePickerPopup, open, props.disabled, props.disableAutoFocus, props.openOnClick, showDatePickerPopup]);\n const onIconClick = ev => {\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const rootShorthand = resolveShorthand(restOfProps, {\n required: true,\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: /*#__PURE__*/React.createElement(CalendarMonthRegular, {\n onClick: onIconClick\n }),\n readOnly: !allowTextInput,\n role: 'combobox',\n root: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: useMergedRefs(triggerWrapperRef, ref)\n },\n input: {\n ref: rootRef\n }\n }\n });\n rootShorthand.onChange = mergeCallbacks(rootShorthand.onChange, onInputChange);\n rootShorthand.onBlur = mergeCallbacks(rootShorthand.onBlur, onInputBlur);\n rootShorthand.onKeyDown = mergeCallbacks(rootShorthand.onKeyDown, onInputKeyDown);\n rootShorthand.onFocus = mergeCallbacks(rootShorthand.onFocus, onInputFocus);\n rootShorthand.onClick = mergeCallbacks(rootShorthand.onClick, onInputClick);\n const {\n modalAttributes\n } = useModalAttributes({\n trapFocus: true,\n alwaysFocusable: true,\n legacyTrapFocus: false\n });\n const popupSurfaceShorthand = open ? resolveShorthand(props.popupSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes\n }\n }) : undefined;\n const {\n targetDocument\n } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open\n });\n // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(() => {\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [disableAutoFocus, open, props.disabled]);\n // When the popup is closed, focus should go back to the input.\n React.useEffect(() => {\n if (!open && !props.disabled) {\n focus();\n }\n }, [open, props.disabled, focus]);\n const calendarShorthand = resolveShorthand(props.calendar, {\n required: true,\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate\n }\n });\n calendarShorthand.onDismiss = mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed);\n calendarShorthand.onSelectDate = mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed);\n React.useImperativeHandle(props.componentRef, () => ({\n focus,\n reset() {\n setOpen(false);\n setSelectedDate(undefined);\n },\n showDatePickerPopup\n }), [focus, setOpen, setSelectedDate, showDatePickerPopup]);\n const state = {\n disabled: !!props.disabled,\n inlinePopup,\n components: {\n root: Input,\n calendar: Calendar,\n popupSurface: 'div'\n },\n calendar: calendarShorthand,\n root: rootShorthand,\n popupSurface: popupSurfaceShorthand\n };\n state.root.value = formattedDate;\n return state;\n};\n//# sourceMappingURL=useDatePicker.js.map"],"names":["useDatePicker_unstable","isDateOutOfBounds","date","minDate","maxDate","compareDatePart","useFocusLogic","inputRef","React","useRef","preventFocusOpeningPicker","focus","_inputRef_current","_inputRef_current_focus","current","call","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","useControllableState","initialState","defaultState","defaultOpen","state","isMounted","useEffect","_props_onOpenChange","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","undefined","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","popupSurfaceId","useId","validateTextInput","useCallback","error","isNaN","getTime","newState","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","altKey","onInputFocus","onInputClick","disabled","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","rootShorthand","resolveShorthand","defaultProps","appearance","contentAfter","createElement","CalendarMonthRegular","onClick","readOnly","role","root","useMergedRefs","input","onChange","mergeCallbacks","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurfaceShorthand","popupSurface","id","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","calendarShorthand","componentRef","onDismiss","useImperativeHandle","reset","components","Input","Calendar"],"mappings":";;;;+BAoFaA;;aAAAA;;;6DApFU;8BACkB;0BAChB;4BACY;uBACuB;0BACnB;4BACnB;gCAC8G;4BACxE;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAE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AAU,CAAC,CAAC9F,MAAM8F,QAAQ;QAC1BjD;QACA6F,YAAY;YACV5B,MAAM6B,iBAAK;YACX/E,UAAUgF,kBAAQ;YAClBhB,cAAc;QAChB;QACAhE,UAAUyE;QACVvB,MAAMV;QACNwB,cAAcD;IAChB;IACApH,MAAMuG,IAAI,CAAC9F,KAAK,GAAGI;IACnB,OAAOb;AACT,GACA,yCAAyC"}
|
|
1
|
+
{"version":3,"sources":["useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport { mergeCallbacks, resolveShorthand, useControllableState, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nfunction isDateOutOfBounds(date, minDate, maxDate) {\n return !!minDate && compareDatePart(minDate, date) > 0 || !!maxDate && compareDatePart(maxDate, date) < 0;\n}\nfunction useFocusLogic() {\n const inputRef = React.useRef(null);\n const preventFocusOpeningPicker = React.useRef(false);\n const focus = ()=>{\n var _inputRef_current, _inputRef_current_focus;\n (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);\n };\n const preventNextFocusOpeningPicker = ()=>{\n preventFocusOpeningPicker.current = true;\n };\n return [\n focus,\n inputRef,\n preventFocusOpeningPicker,\n preventNextFocusOpeningPicker\n ];\n}\nfunction usePopupVisibility(props) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open\n });\n const isMounted = React.useRef(false);\n React.useEffect(()=>{\n if (isMounted.current && !open) {\n var // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n _props_onOpenChange;\n (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, false);\n }\n isMounted.current = true;\n }, // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n props.allowTextInput,\n open\n ]);\n return [\n open,\n setOpen\n ];\n}\nfunction useSelectedDate({ formatDate , onSelectDate , value }) {\n const [selectedDate, setSelectedDateState] = useControllableState({\n initialState: undefined,\n state: value\n });\n const [formattedDate, setFormattedDate] = React.useState(()=>value && formatDate ? formatDate(value) : '');\n const setSelectedDate = (newDate)=>{\n if (selectedDate === undefined && newDate !== undefined || selectedDate !== undefined && newDate === undefined || newDate && selectedDate && (newDate > selectedDate || newDate < selectedDate)) {\n onSelectDate === null || onSelectDate === void 0 ? void 0 : onSelectDate(newDate);\n }\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n React.useEffect(()=>{\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [\n formatDate,\n value\n ]);\n return [\n selectedDate,\n formattedDate,\n setSelectedDate,\n setFormattedDate\n ];\n}\nconst defaultFormatDate = (date)=>date ? date.toDateString() : '';\nconst defaultParseDateFromString = (dateStr)=>{\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */ export const useDatePicker_unstable = (props, ref)=>{\n const { allowTextInput =false , allFocusable =false , borderless =false , dateTimeFormatter , defaultOpen =false , disableAutoFocus =true , firstDayOfWeek =DayOfWeek.Sunday , firstWeekOfYear =FirstWeekOfYear.FirstDay , formatDate =defaultFormatDate , highlightCurrentMonth =false , highlightSelectedMonth =false , initialPickerDate =new Date() , inlinePopup =false , isMonthPickerVisible =true , maxDate , minDate , onOpenChange , onSelectDate: onUserSelectDate , openOnClick =true , onValidationResult , parseDateFromString =defaultParseDateFromString , showCloseButton =false , showGoToToday =true , showMonthPickerAsOverlay =false , showWeekNumbers =false , strings =defaultDatePickerStrings , today , underlined =false , value , ...restOfProps } = props;\n const calendar = React.useRef(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n var _fieldContext_required;\n const required = (_fieldContext_required = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n const validateTextInput = React.useCallback((date = null)=>{\n let error;\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date !== null && date !== void 0 ? date : selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString(formattedDate);\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n onUserSelectDate === null || onUserSelectDate === void 0 ? void 0 : onUserSelectDate(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n onValidationResult === null || onValidationResult === void 0 ? void 0 : onValidationResult({\n error\n });\n }, [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate\n ]);\n const setOpen = React.useCallback((newState)=>{\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);\n setOpenState(newState);\n }, [\n onOpenChange,\n setOpenState\n ]);\n const dismissDatePickerPopup = React.useCallback((newlySelectedDate)=>{\n if (open) {\n setOpen(false);\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n }, [\n allowTextInput,\n open,\n setOpen,\n setSelectedDate,\n validateTextInput\n ]);\n const showDatePickerPopup = React.useCallback(()=>{\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [\n open,\n preventNextFocusOpeningPicker,\n setOpen\n ]);\n /**\n * Callback for closing the calendar callout\n */ const calendarDismissed = React.useCallback((newlySelectedDate)=>{\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n }, [\n dismissDatePickerPopup,\n preventNextFocusOpeningPicker\n ]);\n const onInputChange = React.useCallback((ev, data)=>{\n const { value: newValue } = data;\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n setFormattedDate(newValue);\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n setFormattedDate\n ]);\n const onInputBlur = React.useCallback(()=>{\n validateTextInput();\n }, [\n validateTextInput\n ]);\n const onInputKeyDown = React.useCallback((ev)=>{\n switch(ev.key){\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n case ArrowDown:\n ev.preventDefault();\n if (ev.altKey && !open) {\n showDatePickerPopup();\n }\n break;\n default:\n break;\n }\n }, [\n calendarDismissed,\n dismissDatePickerPopup,\n open,\n props.allowTextInput,\n showDatePickerPopup,\n validateTextInput\n ]);\n const onInputFocus = React.useCallback(()=>{\n if (disableAutoFocus) {\n return;\n }\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [\n allowTextInput,\n disableAutoFocus,\n preventFocusOpeningPicker,\n showDatePickerPopup\n ]);\n const onInputClick = React.useCallback(()=>{\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup\n ]);\n const onIconClick = (ev)=>{\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const rootShorthand = resolveShorthand(restOfProps, {\n required: true,\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: /*#__PURE__*/ React.createElement(CalendarMonthRegular, {\n onClick: onIconClick\n }),\n readOnly: !allowTextInput,\n role: 'combobox',\n root: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: useMergedRefs(triggerWrapperRef, ref)\n },\n input: {\n ref: rootRef\n }\n }\n });\n rootShorthand.onChange = mergeCallbacks(rootShorthand.onChange, onInputChange);\n rootShorthand.onBlur = mergeCallbacks(rootShorthand.onBlur, onInputBlur);\n rootShorthand.onKeyDown = mergeCallbacks(rootShorthand.onKeyDown, onInputKeyDown);\n rootShorthand.onFocus = mergeCallbacks(rootShorthand.onFocus, onInputFocus);\n rootShorthand.onClick = mergeCallbacks(rootShorthand.onClick, onInputClick);\n const { modalAttributes } = useModalAttributes({\n trapFocus: true,\n alwaysFocusable: true,\n legacyTrapFocus: false\n });\n const popupSurfaceShorthand = open ? resolveShorthand(props.popupSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes\n }\n }) : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(()=>{\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [\n disableAutoFocus,\n open,\n props.disabled\n ]);\n // When the popup is closed, focus should go back to the input.\n React.useEffect(()=>{\n if (!open && !props.disabled) {\n focus();\n }\n // Focus function keeps changing, so we need to skip it in the deps\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open,\n props.disabled\n ]);\n const calendarShorthand = resolveShorthand(props.calendar, {\n required: true,\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate\n }\n });\n calendarShorthand.onDismiss = mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed);\n calendarShorthand.onSelectDate = mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed);\n React.useImperativeHandle(props.componentRef, ()=>({\n focus,\n reset () {\n setOpen(false);\n setSelectedDate(undefined);\n },\n showDatePickerPopup\n }), [\n focus,\n setOpen,\n setSelectedDate,\n showDatePickerPopup\n ]);\n const state = {\n disabled: !!props.disabled,\n inlinePopup,\n components: {\n root: Input,\n calendar: Calendar,\n popupSurface: 'div'\n },\n calendar: calendarShorthand,\n root: rootShorthand,\n popupSurface: popupSurfaceShorthand\n };\n state.root.value = formattedDate;\n return state;\n};\n"],"names":["useDatePicker_unstable","isDateOutOfBounds","date","minDate","maxDate","compareDatePart","useFocusLogic","inputRef","React","useRef","preventFocusOpeningPicker","focus","_inputRef_current","_inputRef_current_focus","current","call","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","useControllableState","initialState","defaultState","defaultOpen","state","isMounted","useEffect","_props_onOpenChange","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","undefined","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","popupSurfaceId","useId","validateTextInput","useCallback","error","isNaN","getTime","newState","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","altKey","onInputFocus","onInputClick","disabled","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","rootShorthand","resolveShorthand","defaultProps","appearance","contentAfter","createElement","CalendarMonthRegular","onClick","readOnly","role","root","useMergedRefs","input","onChange","mergeCallbacks","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurfaceShorthand","popupSurface","id","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","calendarShorthand","componentRef","onDismiss","useImperativeHandle","reset","components","Input","Calendar"],"mappings":";;;;+BAgGiBA;;aAAAA;;;6DAhGM;8BACkB;0BAChB;4BACY;uBACuB;0BACnB;4BACnB;gCAC8G;4BACxE;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAE;IAC/C,OAAO,CAAC,CAACD,WAAWE,IAAAA,sBAAe,EAACF,SAASD,QAAQ,KAAK,CAAC,CAACE,WAAWC,IAAAA,sBAAe,EAACD,SAASF,QAAQ;AAC5G;AACA,SAASI,gBAAgB;IACrB,MAAMC,WAAWC,OAAMC,MAAM,CAAC,IAAI;IAClC,MAAMC,4BAA4BF,OAAMC,MAAM,CAAC,KAAK;IACpD,MAAME,QAAQ,IAAI;QACd,IAAIC,mBAAmBC;QACtBD,CAAAA,oBAAoBL,SAASO,OAAO,AAAD,MAAO,IAAI,IAAIF,sBAAsB,KAAK,IAAI,KAAK,IAAI,AAACC,CAAAA,0BAA0BD,kBAAkBD,KAAK,AAAD,MAAO,IAAI,IAAIE,4BAA4B,KAAK,IAAI,KAAK,IAAIA,wBAAwBE,IAAI,CAACH,kBAAkB;IAC5P;IACA,MAAMI,gCAAgC,IAAI;QACtCN,0BAA0BI,OAAO,GAAG,IAAI;IAC5C;IACA,OAAO;QACHH;QACAJ;QACAG;QACAM;KACH;AACL;AACA,SAASC,mBAAmBC,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;YACAzC,OAAOC,gBAAgB2B;QAC3B;IACJ;IACAyF,kBAAkBE,SAAS,GAAGrB,IAAAA,8BAAc,EAACmB,kBAAkBE,SAAS,EAAEzD;IAC1EuD,kBAAkBtH,YAAY,GAAGmG,IAAAA,8BAAc,EAACmB,kBAAkBtH,YAAY,EAAE+D;IAChFxF,OAAMkJ,mBAAmB,CAACxI,MAAMsI,YAAY,EAAE,IAAK,CAAA;YAC3C7I;YACAgJ,SAAS;gBACLvI,QAAQ,KAAK;gBACbqB,gBAAgBJ;YACpB;YACA0D;QACJ,CAAA,GAAI;QACJpF;QACAS;QACAqB;QACAsD;KACH;IACD,MAAMtE,QAAQ;QACVuF,UAAU,CAAC,CAAC9F,MAAM8F,QAAQ;QAC1BjD;QACA6F,YAAY;YACR5B,MAAM6B,iBAAK;YACX/E,UAAUgF,kBAAQ;YAClBhB,cAAc;QAClB;QACAhE,UAAUyE;QACVvB,MAAMV;QACNwB,cAAcD;IAClB;IACApH,MAAMuG,IAAI,CAAC9F,KAAK,GAAGI;IACnB,OAAOb;AACX"}
|
|
@@ -51,5 +51,3 @@ const useDatePickerStyles_unstable = (state)=>{
|
|
|
51
51
|
state.calendar.className = (0, _react.mergeClasses)(datePickerClassNames.calendar, state.calendar.className);
|
|
52
52
|
return state;
|
|
53
53
|
}; //# sourceMappingURL=useDatePickerStyles.styles.js.map
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=useDatePickerStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useDatePickerStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const datePickerClassNames = {\n root: 'fui-DatePicker',\n calendar: 'fui-DatePicker__calendar',\n popupSurface: 'fui-DatePicker__popupSurface'\n};\nconst useStyles = /*#__PURE__*/__styles({\n base: {\n qhf8xq: \"f10pi13n\",\n Bceei9c: \"f1k6fduh\",\n xfaavh: \"faxec97\"\n },\n disabled: {\n Bceei9c: \"f158kwzp\",\n xfaavh: \"f19qwlmg\"\n }\n}, {\n d: [\".f10pi13n{position:relative;}\", \".f1k6fduh{cursor:pointer;}\", \".faxec97 input{cursor:pointer;}\", \".f158kwzp{cursor:default;}\", \".f19qwlmg input{cursor:default;}\"]\n});\nconst usePopupSurfaceClassName = /*#__PURE__*/__resetStyles(\"r1ytv1z8\", null, [\".r1ytv1z8{background-color:var(--colorNeutralBackground1);box-shadow:var(--shadow16);border-radius:var(--borderRadiusMedium);border-width:1px;border-style:solid;border-color:var(--colorTransparentStroke);display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;color:var(--colorNeutralForeground1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}\"]);\n/**\n * Apply styling to the DatePicker slots based on the state\n */\nexport const useDatePickerStyles_unstable = state => {\n const styles = useStyles();\n const popupSurfaceClassName = usePopupSurfaceClassName();\n const {\n disabled\n } = state;\n state.root.className = mergeClasses(datePickerClassNames.root, styles.base, disabled && styles.disabled, state.root.className);\n if (state.popupSurface) {\n state.popupSurface.className = mergeClasses(datePickerClassNames.popupSurface, popupSurfaceClassName, state.popupSurface.className);\n }\n state.calendar.className = mergeClasses(datePickerClassNames.calendar, state.calendar.className);\n return state;\n};\n//# sourceMappingURL=useDatePickerStyles.styles.js.map"],"names":["datePickerClassNames","useDatePickerStyles_unstable","root","calendar","popupSurface","useStyles","__styles","base","qhf8xq","Bceei9c","xfaavh","disabled","d","usePopupSurfaceClassName","__resetStyles","state","styles","popupSurfaceClassName","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB,MAApBA;IAsBAC,4BAA4B,MAA5BA;;uBAxByC;AAE/C,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,UAAU;IACVC,cAAc;AAChB;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCC,MAAM;QACJC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;IACAC,UAAU;QACRF,SAAS;QACTC,QAAQ;IACV;AACF,GAAG;IACDE,GAAG;QAAC;QAAiC;QAA8B;QAAmC;QAA8B;KAAmC;AACzK;AACA,MAAMC,2BAA2B,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,IAAI,EAAE;IAAC;CAAwe;AAIhjB,MAAMb,+BAA+Bc,CAAAA,QAAS;IACnD,MAAMC,SAASX;IACf,MAAMY,wBAAwBJ;IAC9B,MAAM,EACJF,SAAQ,EACT,GAAGI;IACJA,MAAMb,IAAI,CAACgB,SAAS,GAAGC,IAAAA,mBAAY,EAACnB,qBAAqBE,IAAI,EAAEc,OAAOT,IAAI,EAAEI,YAAYK,OAAOL,QAAQ,EAAEI,MAAMb,IAAI,CAACgB,SAAS;IAC7H,IAAIH,MAAMX,YAAY,EAAE;QACtBW,MAAMX,YAAY,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAACnB,qBAAqBI,YAAY,EAAEa,uBAAuBF,MAAMX,YAAY,CAACc,SAAS;IACpI,CAAC;IACDH,MAAMZ,QAAQ,CAACe,SAAS,GAAGC,IAAAA,mBAAY,EAACnB,qBAAqBG,QAAQ,EAAEY,MAAMZ,QAAQ,CAACe,SAAS;IAC/F,OAAOH;AACT,GACA,sDAAsD"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { AnimationDirection } from './Calendar';\nexport { DatePicker, datePickerClassNames, defaultDatePickerErrorStrings, defaultDatePickerStrings, renderDatePicker_unstable, useDatePicker_unstable, useDatePickerStyles_unstable } from './DatePicker';\nexport { DAYS_IN_WEEK, DateRangeType, DayOfWeek, FirstWeekOfYear, MonthOfYear, TimeConstants, addDays, addMonths, addWeeks, addYears, compareDatePart, compareDates, getDatePartHashValue, getDateRangeArray, getEndDateOfWeek, getMonthEnd, getMonthStart, getStartDateOfWeek, getWeekNumber, getWeekNumbersInMonth, getYearEnd, getYearStart, isInDateRangeArray, setMonth } from './utils';\n"],"names":["AnimationDirection","DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable","DAYS_IN_WEEK","DateRangeType","DayOfWeek","FirstWeekOfYear","MonthOfYear","TimeConstants","addDays","addMonths","addWeeks","addYears","compareDatePart","compareDates","getDatePartHashValue","getDateRangeArray","getEndDateOfWeek","getMonthEnd","getMonthStart","getStartDateOfWeek","getWeekNumber","getWeekNumbersInMonth","getYearEnd","getYearStart","isInDateRangeArray","setMonth"],"mappings":";;;;;;;;;;;IAASA,kBAAkB,MAAlBA,4BAAkB;IAClBC,UAAU,MAAVA,sBAAU;IAAEC,oBAAoB,MAApBA,gCAAoB;IAAEC,6BAA6B,MAA7BA,yCAA6B;IAAEC,wBAAwB,MAAxBA,oCAAwB;IAAEC,yBAAyB,MAAzBA,qCAAyB;IAAEC,sBAAsB,MAAtBA,kCAAsB;IAAEC,4BAA4B,MAA5BA,wCAA4B;IAC1KC,YAAY,MAAZA,mBAAY;IAAEC,aAAa,MAAbA,oBAAa;IAAEC,SAAS,MAATA,gBAAS;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,WAAW,MAAXA,kBAAW;IAAEC,aAAa,MAAbA,oBAAa;IAAEC,OAAO,MAAPA,cAAO;IAAEC,SAAS,MAATA,gBAAS;IAAEC,QAAQ,MAARA,eAAQ;IAAEC,QAAQ,MAARA,eAAQ;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,YAAY,MAAZA,mBAAY;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IAAEC,gBAAgB,MAAhBA,uBAAgB;IAAEC,WAAW,MAAXA,kBAAW;IAAEC,aAAa,MAAbA,oBAAa;IAAEC,kBAAkB,MAAlBA,yBAAkB;IAAEC,aAAa,MAAbA,oBAAa;IAAEC,qBAAqB,MAArBA,4BAAqB;IAAEC,UAAU,MAAVA,iBAAU;IAAEC,YAAY,MAAZA,mBAAY;IAAEC,kBAAkB,MAAlBA,yBAAkB;IAAEC,QAAQ,MAARA,eAAQ;;0BAFzU;4BACwJ;uBACyL"}
|
|
@@ -108,19 +108,17 @@ const SLIDE_UP_OUT20 = {
|
|
|
108
108
|
const TRANSITION_ROW_DISAPPEARANCE = {
|
|
109
109
|
'100%': {
|
|
110
110
|
height: '0px',
|
|
111
|
-
|
|
111
|
+
..._react.shorthands.overflow('hidden'),
|
|
112
112
|
width: '0px'
|
|
113
113
|
},
|
|
114
114
|
'99.9%': {
|
|
115
115
|
height: '28px',
|
|
116
|
-
|
|
116
|
+
..._react.shorthands.overflow('visible'),
|
|
117
117
|
width: '100%'
|
|
118
118
|
},
|
|
119
119
|
'0%': {
|
|
120
120
|
height: '28px',
|
|
121
|
-
|
|
121
|
+
..._react.shorthands.overflow('visible'),
|
|
122
122
|
width: '100%'
|
|
123
123
|
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
//# sourceMappingURL=animations.js.map
|
|
124
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["animations.js"],"sourcesContent":["import { shorthands } from '@griffel/react';\nexport const EASING_FUNCTION_1 = 'cubic-bezier(.1,.9,.2,1)';\nexport const EASING_FUNCTION_2 = 'cubic-bezier(.1,.25,.75,.9)';\nexport const DURATION_1 = '0.167s';\nexport const DURATION_2 = '0.267s';\nexport const DURATION_3 = '0.367s';\nexport const DURATION_4 = '0.467s';\nexport const FADE_IN = {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n};\nexport const FADE_OUT = {\n from: {\n opacity: 1\n },\n to: {\n opacity: 0,\n visibility: 'hidden'\n }\n};\nexport const SLIDE_DOWN_IN20 = {\n from: {\n pointerEvents: 'none',\n transform: 'translate3d(0, -20px, 0)'\n },\n to: {\n pointerEvents: 'auto',\n transform: 'translate3d(0, 0, 0)'\n }\n};\nexport const SLIDE_LEFT_IN20 = {\n from: {\n pointerEvents: 'none',\n transform: 'translate3d(20px, 0, 0)'\n },\n to: {\n pointerEvents: 'auto',\n transform: 'translate3d(0, 0, 0)'\n }\n};\nexport const SLIDE_RIGHT_IN20 = {\n from: {\n pointerEvents: 'none',\n transform: 'translate3d(-20px, 0, 0)'\n },\n to: {\n pointerEvents: 'auto',\n transform: 'translate3d(0, 0, 0)'\n }\n};\nexport const SLIDE_UP_IN20 = {\n from: {\n pointerEvents: 'none',\n transform: 'translate3d(0, 20px, 0)'\n },\n to: {\n pointerEvents: 'auto',\n transform: 'translate3d(0, 0, 0)'\n }\n};\nexport const SLIDE_DOWN_OUT20 = {\n from: {\n transform: 'translate3d(0, 0, 0)'\n },\n to: {\n transform: 'translate3d(0, 20px, 0)'\n }\n};\nexport const SLIDE_UP_OUT20 = {\n from: {\n transform: 'translate3d(0, 0, 0)'\n },\n to: {\n transform: 'translate3d(0, -20px, 0)'\n }\n};\nexport const TRANSITION_ROW_DISAPPEARANCE = {\n '100%': {\n height: '0px',\n ...shorthands.overflow('hidden'),\n width: '0px'\n },\n '99.9%': {\n height: '28px',\n ...shorthands.overflow('visible'),\n width: '100%'\n },\n '0%': {\n height: '28px',\n ...shorthands.overflow('visible'),\n width: '100%'\n }\n};\n"],"names":["EASING_FUNCTION_1","EASING_FUNCTION_2","DURATION_1","DURATION_2","DURATION_3","DURATION_4","FADE_IN","FADE_OUT","SLIDE_DOWN_IN20","SLIDE_LEFT_IN20","SLIDE_RIGHT_IN20","SLIDE_UP_IN20","SLIDE_DOWN_OUT20","SLIDE_UP_OUT20","TRANSITION_ROW_DISAPPEARANCE","from","opacity","to","visibility","pointerEvents","transform","height","shorthands","overflow","width"],"mappings":";;;;;;;;;;;IACaA,iBAAiB,MAAjBA;IACAC,iBAAiB,MAAjBA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;QACJO,QAAQ;QACR,GAAGC,iBAAU,CAACC,QAAQ,CAAC,SAAS;QAChCC,OAAO;IACX;IACA,SAAS;QACLH,QAAQ;QACR,GAAGC,iBAAU,CAACC,QAAQ,CAAC,UAAU;QACjCC,OAAO;IACX;IACA,MAAM;QACFH,QAAQ;QACR,GAAGC,iBAAU,CAACC,QAAQ,CAAC,UAAU;QACjCC,OAAO;IACX;AACJ"}
|
|
@@ -71,12 +71,10 @@ const TimeConstants = {
|
|
|
71
71
|
SecondsInOneMinute: 60,
|
|
72
72
|
OffsetTo24HourFormat: 12,
|
|
73
73
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
//# sourceMappingURL=constants.js.map
|
|
74
|
+
* Matches a time string. Groups:
|
|
75
|
+
* 1. hours (with or without leading 0)
|
|
76
|
+
* 2. minutes
|
|
77
|
+
* 3. seconds (optional)
|
|
78
|
+
* 4. meridiem (am/pm, case-insensitive, optional)
|
|
79
|
+
*/ TimeFormatRegex: /^(\d\d?):(\d\d):?(\d\d)? ?([ap]m)?/i
|
|
80
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["constants.js"],"sourcesContent":["/**\n * The days of the week\n */ export var DayOfWeek;\n(function(DayOfWeek) {\n DayOfWeek[DayOfWeek[\"Sunday\"] = 0] = \"Sunday\";\n DayOfWeek[DayOfWeek[\"Monday\"] = 1] = \"Monday\";\n DayOfWeek[DayOfWeek[\"Tuesday\"] = 2] = \"Tuesday\";\n DayOfWeek[DayOfWeek[\"Wednesday\"] = 3] = \"Wednesday\";\n DayOfWeek[DayOfWeek[\"Thursday\"] = 4] = \"Thursday\";\n DayOfWeek[DayOfWeek[\"Friday\"] = 5] = \"Friday\";\n DayOfWeek[DayOfWeek[\"Saturday\"] = 6] = \"Saturday\";\n})(DayOfWeek || (DayOfWeek = {}));\nexport var MonthOfYear;\n(function(MonthOfYear) {\n MonthOfYear[MonthOfYear[\"January\"] = 0] = \"January\";\n MonthOfYear[MonthOfYear[\"February\"] = 1] = \"February\";\n MonthOfYear[MonthOfYear[\"March\"] = 2] = \"March\";\n MonthOfYear[MonthOfYear[\"April\"] = 3] = \"April\";\n MonthOfYear[MonthOfYear[\"May\"] = 4] = \"May\";\n MonthOfYear[MonthOfYear[\"June\"] = 5] = \"June\";\n MonthOfYear[MonthOfYear[\"July\"] = 6] = \"July\";\n MonthOfYear[MonthOfYear[\"August\"] = 7] = \"August\";\n MonthOfYear[MonthOfYear[\"September\"] = 8] = \"September\";\n MonthOfYear[MonthOfYear[\"October\"] = 9] = \"October\";\n MonthOfYear[MonthOfYear[\"November\"] = 10] = \"November\";\n MonthOfYear[MonthOfYear[\"December\"] = 11] = \"December\";\n})(MonthOfYear || (MonthOfYear = {}));\nexport var FirstWeekOfYear;\n(function(FirstWeekOfYear) {\n FirstWeekOfYear[FirstWeekOfYear[\"FirstDay\"] = 0] = \"FirstDay\";\n FirstWeekOfYear[FirstWeekOfYear[\"FirstFullWeek\"] = 1] = \"FirstFullWeek\";\n FirstWeekOfYear[FirstWeekOfYear[\"FirstFourDayWeek\"] = 2] = \"FirstFourDayWeek\";\n})(FirstWeekOfYear || (FirstWeekOfYear = {}));\nexport var DateRangeType;\n(function(DateRangeType) {\n DateRangeType[DateRangeType[\"Day\"] = 0] = \"Day\";\n DateRangeType[DateRangeType[\"Week\"] = 1] = \"Week\";\n DateRangeType[DateRangeType[\"Month\"] = 2] = \"Month\";\n DateRangeType[DateRangeType[\"WorkWeek\"] = 3] = \"WorkWeek\";\n})(DateRangeType || (DateRangeType = {}));\nexport const DAYS_IN_WEEK = 7;\nexport const TimeConstants = {\n MillisecondsInOneDay: 86400000,\n MillisecondsIn1Sec: 1000,\n MillisecondsIn1Min: 60000,\n MillisecondsIn30Mins: 1800000,\n MillisecondsIn1Hour: 3600000,\n MinutesInOneDay: 1440,\n MinutesInOneHour: 60,\n DaysInOneWeek: 7,\n MonthInOneYear: 12,\n HoursInOneDay: 24,\n SecondsInOneMinute: 60,\n OffsetTo24HourFormat: 12,\n /**\n * Matches a time string. Groups:\n * 1. hours (with or without leading 0)\n * 2. minutes\n * 3. seconds (optional)\n * 4. meridiem (am/pm, case-insensitive, optional)\n */ TimeFormatRegex: /^(\\d\\d?):(\\d\\d):?(\\d\\d)? ?([ap]m)?/i\n};\n"],"names":["DayOfWeek","MonthOfYear","FirstWeekOfYear","DateRangeType","DAYS_IN_WEEK","TimeConstants","MillisecondsInOneDay","MillisecondsIn1Sec","MillisecondsIn1Min","MillisecondsIn30Mins","MillisecondsIn1Hour","MinutesInOneDay","MinutesInOneHour","DaysInOneWeek","MonthInOneYear","HoursInOneDay","SecondsInOneMinute","OffsetTo24HourFormat","TimeFormatRegex"],"mappings":"AAAA;;CAEC;;;;;;;;;;;IAAcA,SAAS,MAATA;IAUJC,WAAW,MAAXA;IAeAC,eAAe,MAAfA;IAMAC,aAAa,MAAbA;IAOEC,YAAY,MAAZA;IACAC,aAAa,MAAbA;;AAvCF,IAAIL;AACd,CAAA,SAASA,SAAS,EAAE;IACjBA,SAAS,CAACA,SAAS,CAAC,SAAS,GAAG,EAAE,GAAG;IACrCA,SAAS,CAACA,SAAS,CAAC,SAAS,GAAG,EAAE,GAAG;IACrCA,SAAS,CAACA,SAAS,CAAC,UAAU,GAAG,EAAE,GAAG;IACtCA,SAAS,CAACA,SAAS,CAAC,YAAY,GAAG,EAAE,GAAG;IACxCA,SAAS,CAACA,SAAS,CAAC,WAAW,GAAG,EAAE,GAAG;IACvCA,SAAS,CAACA,SAAS,CAAC,SAAS,GAAG,EAAE,GAAG;IACrCA,SAAS,CAACA,SAAS,CAAC,WAAW,GAAG,EAAE,GAAG;AAC3C,CAAA,EAAGA,aAAcA,CAAAA,YAAY,CAAC,CAAA;AACvB,IAAIC;AACV,CAAA,SAASA,WAAW,EAAE;IACnBA,WAAW,CAAC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AAG,EAAE,GAAG;AACnD,CAAA,EAAGA,iBAAkBA,CAAAA,gBAAgB,CAAC,CAAA;AAC/B,MAAMC,eAAe;AACrB,MAAMC,gBAAgB;IACzBC,sBAAsB;IACtBC,oBAAoB;IACpBC,oBAAoB;IACpBC,sBAAsB;IACtBC,qBAAqB;IACrBC,iBAAiB;IACjBC,kBAAkB;IAClBC,eAAe;IACfC,gBAAgB;IAChBC,eAAe;IACfC,oBAAoB;IACpBC,sBAAsB;IACtB;;;;;;GAMD,GAAGC,iBAAiB;AACvB"}
|
|
@@ -97,6 +97,4 @@ const DEFAULT_CALENDAR_STRINGS = {
|
|
|
97
97
|
monthPickerHeaderAriaLabel: '{0}, change year',
|
|
98
98
|
yearPickerHeaderAriaLabel: '{0}, change month',
|
|
99
99
|
dayMarkedAriaLabel: 'marked'
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
//# sourceMappingURL=dateFormatting.defaults.js.map
|
|
100
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["dateFormatting.defaults.js"],"sourcesContent":["/**\n * Format date to a day string representation\n * @param date - input date to format\n */ export const formatDay = (date)=>date.getDate().toString();\n/**\n * Format date to a month-day-year string\n * @param date - input date to format\n * @param strings - localized strings\n */ export const formatMonthDayYear = (date, strings)=>strings.months[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear();\n/**\n * Format date to a month-year string\n * @param date - input date to format\n * @param strings - localized strings\n */ export const formatMonthYear = (date, strings)=>strings.months[date.getMonth()] + ' ' + date.getFullYear();\n/**\n * Format date to a month string\n * @param date - input date to format\n * @param strings - localized strings\n */ export const formatMonth = (date, strings)=>strings.months[date.getMonth()];\n/**\n * Format date to a year string representation\n * @param date - input date to format\n */ export const formatYear = (date)=>date.getFullYear().toString();\nexport const DEFAULT_DATE_GRID_STRINGS = {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ],\n shortMonths: [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ],\n days: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n ],\n shortDays: [\n 'S',\n 'M',\n 'T',\n 'W',\n 'T',\n 'F',\n 'S'\n ]\n};\nexport const DEFAULT_DATE_FORMATTING = {\n formatDay,\n formatMonth,\n formatYear,\n formatMonthDayYear,\n formatMonthYear\n};\nexport const DEFAULT_CALENDAR_STRINGS = {\n ...DEFAULT_DATE_GRID_STRINGS,\n goToToday: 'Go to today',\n weekNumberFormatString: 'Week number {0}',\n prevMonthAriaLabel: 'Previous month',\n nextMonthAriaLabel: 'Next month',\n prevYearAriaLabel: 'Previous year',\n nextYearAriaLabel: 'Next year',\n prevYearRangeAriaLabel: 'Previous year range',\n nextYearRangeAriaLabel: 'Next year range',\n closeButtonAriaLabel: 'Close',\n selectedDateFormatString: 'Selected date {0}',\n todayDateFormatString: \"Today's date {0}\",\n monthPickerHeaderAriaLabel: '{0}, change year',\n yearPickerHeaderAriaLabel: '{0}, change month',\n dayMarkedAriaLabel: 'marked'\n};\n"],"names":["formatDay","formatMonthDayYear","formatMonthYear","formatMonth","formatYear","DEFAULT_DATE_GRID_STRINGS","DEFAULT_DATE_FORMATTING","DEFAULT_CALENDAR_STRINGS","date","getDate","toString","strings","months","getMonth","getFullYear","shortMonths","days","shortDays","goToToday","weekNumberFormatString","prevMonthAriaLabel","nextMonthAriaLabel","prevYearAriaLabel","nextYearAriaLabel","prevYearRangeAriaLabel","nextYearRangeAriaLabel","closeButtonAriaLabel","selectedDateFormatString","todayDateFormatString","monthPickerHeaderAriaLabel","yearPickerHeaderAriaLabel","dayMarkedAriaLabel"],"mappings":"AAAA;;;CAGC;;;;;;;;;;;IAAgB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B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -5,6 +5,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./dateFormatting.defaults"), exports);
|
|
7
7
|
_exportStar(require("./dateFormatting.types"), exports);
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './dateFormatting.defaults';\nexport * from './dateFormatting.types';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["findAvailableDate.js"],"sourcesContent":["import { isRestrictedDate } from './isRestrictedDate';\nimport { isAfterMaxDate } from './isAfterMaxDate';\nimport { isBeforeMinDate } from './isBeforeMinDate';\nimport { compareDatePart, addDays } from '../dateMath/dateMath';\n/**\n * Returns closest available date given the restriction `options`, or undefined otherwise\n * @param options - list of search options\n */ export const findAvailableDate = (options)=>{\n const { targetDate , initialDate , direction , ...restrictedDateOptions } = options;\n let availableDate = targetDate;\n // if the target date is available, return it immediately\n if (!isRestrictedDate(targetDate, restrictedDateOptions)) {\n return targetDate;\n }\n while(compareDatePart(initialDate, availableDate) !== 0 && isRestrictedDate(availableDate, restrictedDateOptions) && !isAfterMaxDate(availableDate, restrictedDateOptions) && !isBeforeMinDate(availableDate, restrictedDateOptions)){\n availableDate = addDays(availableDate, direction);\n }\n if (compareDatePart(initialDate, availableDate) !== 0 && !isRestrictedDate(availableDate, restrictedDateOptions)) {\n return availableDate;\n }\n return undefined;\n};\n"],"names":["findAvailableDate","options","targetDate","initialDate","direction","restrictedDateOptions","availableDate","isRestrictedDate","compareDatePart","isAfterMaxDate","isBeforeMinDate","addDays","undefined"],"mappings":";;;;+BAOiBA;;aAAAA;;kCAPgB;gCACF;iCACC;0BACS;AAI9B,MAAMA,oBAAoB,CAACC,UAAU;IAC5C,MAAM,EAAEC,WAAU,EAAGC,YAAW,EAAGC,UAAS,EAAG,GAAGC,uBAAuB,GAAGJ;IAC5E,IAAIK,gBAAgBJ;IACpB,yDAAyD;IACzD,IAAI,CAACK,IAAAA,kCAAgB,EAACL,YAAYG,wBAAwB;QACtD,OAAOH;IACX,CAAC;IACD,MAAMM,IAAAA,yBAAe,EAACL,aAAaG,mBAAmB,KAAKC,IAAAA,kCAAgB,EAACD,eAAeD,0BAA0B,CAACI,IAAAA,8BAAc,EAACH,eAAeD,0BAA0B,CAACK,IAAAA,gCAAe,EAACJ,eAAeD,uBAAuB;QACjOC,gBAAgBK,IAAAA,iBAAO,EAACL,eAAeF;IAC3C;IACA,IAAII,IAAAA,yBAAe,EAACL,aAAaG,mBAAmB,KAAK,CAACC,IAAAA,kCAAgB,EAACD,eAAeD,wBAAwB;QAC9G,OAAOC;IACX,CAAC;IACD,OAAOM;AACX"}
|
|
@@ -18,6 +18,4 @@ const getBoundedDateRange = (dateRange, minDate, maxDate)=>{
|
|
|
18
18
|
boundedDateRange = boundedDateRange.filter((date)=>(0, _dateMath.compareDatePart)(date, maxDate) <= 0);
|
|
19
19
|
}
|
|
20
20
|
return boundedDateRange;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=getBoundedDateRange.js.map
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["getBoundedDateRange.js"],"sourcesContent":["import { compareDatePart } from '../dateMath/dateMath';\n/**\n * Generates a list of dates, bounded by min and max dates\n * @param dateRange - input date range\n * @param minDate - min date to limit the range\n * @param maxDate - max date to limit the range\n */ export const getBoundedDateRange = (dateRange, minDate, maxDate)=>{\n let boundedDateRange = [\n ...dateRange\n ];\n if (minDate) {\n boundedDateRange = boundedDateRange.filter((date)=>compareDatePart(date, minDate) >= 0);\n }\n if (maxDate) {\n boundedDateRange = boundedDateRange.filter((date)=>compareDatePart(date, maxDate) <= 0);\n }\n return boundedDateRange;\n};\n"],"names":["getBoundedDateRange","dateRange","minDate","maxDate","boundedDateRange","filter","date","compareDatePart"],"mappings":";;;;+BAMiBA;;aAAAA;;0BANe;AAMrB,MAAMA,sBAAsB,CAACC,WAAWC,SAASC,UAAU;IAClE,IAAIC,mBAAmB;WAChBH;KACN;IACD,IAAIC,SAAS;QACTE,mBAAmBA,iBAAiBC,MAAM,CAAC,CAACC,OAAOC,IAAAA,yBAAe,EAACD,MAAMJ,YAAY;IACzF,CAAC;IACD,IAAIC,SAAS;QACTC,mBAAmBA,iBAAiBC,MAAM,CAAC,CAACC,OAAOC,IAAAA,yBAAe,EAACD,MAAMH,YAAY;IACzF,CAAC;IACD,OAAOC;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["getDateRangeTypeToUse.js"],"sourcesContent":["import { DateRangeType } from '../constants';\nimport { isContiguous } from './isContiguous';\n/**\n * Return corrected date range type, given `dateRangeType` and list of working days.\n * For non-contiguous working days and working week range type, returns general week range type.\n * For other cases returns input date range type.\n * @param dateRangeType - input type of range\n * @param workWeekDays - list of working days in a week\n */ export const getDateRangeTypeToUse = (dateRangeType, workWeekDays, firstDayOfWeek)=>{\n if (workWeekDays && dateRangeType === DateRangeType.WorkWeek) {\n if (!isContiguous(workWeekDays, true, firstDayOfWeek) || workWeekDays.length === 0) {\n return DateRangeType.Week;\n }\n }\n return dateRangeType;\n};\n"],"names":["getDateRangeTypeToUse","dateRangeType","workWeekDays","firstDayOfWeek","DateRangeType","WorkWeek","isContiguous","length","Week"],"mappings":";;;;+BAQiBA;;aAAAA;;2BARa;8BACD;AAOlB,MAAMA,wBAAwB,CAACC,eAAeC,cAAcC,iBAAiB;IACpF,IAAID,gBAAgBD,kBAAkBG,wBAAa,CAACC,QAAQ,EAAE;QAC1D,IAAI,CAACC,IAAAA,0BAAY,EAACJ,cAAc,IAAI,EAAEC,mBAAmBD,aAAaK,MAAM,KAAK,GAAG;YAChF,OAAOH,wBAAa,CAACI,IAAI;QAC7B,CAAC;IACL,CAAC;IACD,OAAOP;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["getDayGrid.js"],"sourcesContent":["import { addDays, compareDates, getDateRangeArray, isInDateRangeArray } from '../dateMath/dateMath';\nimport { DAYS_IN_WEEK } from '../constants';\nimport { getDateRangeTypeToUse } from './getDateRangeTypeToUse';\nimport { getBoundedDateRange } from './getBoundedDateRange';\nimport { isRestrictedDate } from './isRestrictedDate';\n/**\n * Generates a grid of days, given the `options`.\n * Returns one additional week at the begining from the previous range\n * and one at the end from the future range\n * @param options - parameters to specify date related restrictions for the resulting grid\n */ export const getDayGrid = (options)=>{\n const { selectedDate , dateRangeType , firstDayOfWeek , today , minDate , maxDate , weeksToShow , workWeekDays , daysToSelectInDayView , restrictedDates , markedDays } = options;\n const restrictedDateOptions = {\n minDate,\n maxDate,\n restrictedDates\n };\n const todaysDate = today || new Date();\n const navigatedDate = options.navigatedDate ? options.navigatedDate : todaysDate;\n let date;\n if (weeksToShow && weeksToShow <= 4) {\n // if showing less than a full month, just use date == navigatedDate\n date = new Date(navigatedDate.getFullYear(), navigatedDate.getMonth(), navigatedDate.getDate());\n } else {\n date = new Date(navigatedDate.getFullYear(), navigatedDate.getMonth(), 1);\n }\n const weeks = [];\n // Cycle the date backwards to get to the first day of the week.\n while(date.getDay() !== firstDayOfWeek){\n date.setDate(date.getDate() - 1);\n }\n // add the transition week as last week of previous range\n date = addDays(date, -DAYS_IN_WEEK);\n // a flag to indicate whether all days of the week are outside the month\n let isAllDaysOfWeekOutOfMonth = false;\n // in work week view if the days aren't contiguous we use week view instead\n const selectedDateRangeType = getDateRangeTypeToUse(dateRangeType, workWeekDays, firstDayOfWeek);\n let selectedDates = [];\n if (selectedDate) {\n selectedDates = getDateRangeArray(selectedDate, selectedDateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView);\n selectedDates = getBoundedDateRange(selectedDates, minDate, maxDate);\n }\n let shouldGetWeeks = true;\n for(let weekIndex = 0; shouldGetWeeks; weekIndex++){\n const week = [];\n isAllDaysOfWeekOutOfMonth = true;\n for(let dayIndex = 0; dayIndex < DAYS_IN_WEEK; dayIndex++){\n const originalDate = new Date(date.getTime());\n const dayInfo = {\n key: date.toString(),\n date: date.getDate().toString(),\n originalDate,\n isInMonth: date.getMonth() === navigatedDate.getMonth(),\n isToday: compareDates(todaysDate, date),\n isSelected: isInDateRangeArray(date, selectedDates),\n isInBounds: !isRestrictedDate(date, restrictedDateOptions),\n isMarked: (markedDays === null || markedDays === void 0 ? void 0 : markedDays.some((markedDay)=>compareDates(originalDate, markedDay))) || false\n };\n week.push(dayInfo);\n if (dayInfo.isInMonth) {\n isAllDaysOfWeekOutOfMonth = false;\n }\n date.setDate(date.getDate() + 1);\n }\n // We append the condition of the loop depending upon the showSixWeeksByDefault prop.\n shouldGetWeeks = weeksToShow ? weekIndex < weeksToShow + 1 : !isAllDaysOfWeekOutOfMonth || weekIndex === 0;\n // we don't check shouldGetWeeks before pushing because we want to add one extra week for transition state\n weeks.push(week);\n }\n return weeks;\n};\n"],"names":["getDayGrid","options","selectedDate","dateRangeType","firstDayOfWeek","today","minDate","maxDate","weeksToShow","workWeekDays","daysToSelectInDayView","restrictedDates","markedDays","restrictedDateOptions","todaysDate","Date","navigatedDate","date","getFullYear","getMonth","getDate","weeks","getDay","setDate","addDays","DAYS_IN_WEEK","isAllDaysOfWeekOutOfMonth","selectedDateRangeType","getDateRangeTypeToUse","selectedDates","getDateRangeArray","getBoundedDateRange","shouldGetWeeks","weekIndex","week","dayIndex","originalDate","getTime","dayInfo","key","toString","isInMonth","isToday","compareDates","isSelected","isInDateRangeArray","isInBounds","isRestrictedDate","isMarked","some","markedDay","push"],"mappings":";;;;+BAUiBA;;aAAAA;;0BAV4D;2BAChD;uCACS;qCACF;kCACH;AAMtB,MAAMA,aAAa,CAACC,UAAU;IACrC,MAAM,EAAEC,aAAY,EAAGC,cAAa,EAAGC,eAAc,EAAGC,MAAK,EAAGC,QAAO,EAAGC,QAAO,EAAGC,YAAW,EAAGC,aAAY,EAAGC,sBAAqB,EAAGC,gBAAe,EAAGC,WAAU,EAAG,GAAGX;IAC3K,MAAMY,wBAAwB;QAC1BP;QACAC;QACAI;IACJ;IACA,MAAMG,aAAaT,SAAS,IAAIU;IAChC,MAAMC,gBAAgBf,QAAQe,aAAa,GAAGf,QAAQe,aAAa,GAAGF,UAAU;IAChF,IAAIG;IACJ,IAAIT,eAAeA,eAAe,GAAG;QACjC,oEAAoE;QACpES,OAAO,IAAIF,KAAKC,cAAcE,WAAW,IAAIF,cAAcG,QAAQ,IAAIH,cAAcI,OAAO;IAChG,OAAO;QACHH,OAAO,IAAIF,KAAKC,cAAcE,WAAW,IAAIF,cAAcG,QAAQ,IAAI;IAC3E,CAAC;IACD,MAAME,QAAQ,EAAE;IAChB,gEAAgE;IAChE,MAAMJ,KAAKK,MAAM,OAAOlB,eAAe;QACnCa,KAAKM,OAAO,CAACN,KAAKG,OAAO,KAAK;IAClC;IACA,yDAAyD;IACzDH,OAAOO,IAAAA,iBAAO,EAACP,MAAM,CAACQ,uBAAY;IAClC,wEAAwE;IACxE,IAAIC,4BAA4B,KAAK;IACrC,2EAA2E;IAC3E,MAAMC,wBAAwBC,IAAAA,4CAAqB,EAACzB,eAAeM,cAAcL;IACjF,IAAIyB,gBAAgB,EAAE;IACtB,IAAI3B,cAAc;QACd2B,gBAAgBC,IAAAA,2BAAiB,EAAC5B,cAAcyB,uBAAuBvB,gBAAgBK,cAAcC;QACrGmB,gBAAgBE,IAAAA,wCAAmB,EAACF,eAAevB,SAASC;IAChE,CAAC;IACD,IAAIyB,iBAAiB,IAAI;IACzB,IAAI,IAAIC,YAAY,GAAGD,gBAAgBC,YAAY;QAC/C,MAAMC,OAAO,EAAE;QACfR,4BAA4B,IAAI;QAChC,IAAI,IAAIS,WAAW,GAAGA,WAAWV,uBAAY,EAAEU,WAAW;YACtD,MAAMC,eAAe,IAAIrB,KAAKE,KAAKoB,OAAO;YAC1C,MAAMC,UAAU;gBACZC,KAAKtB,KAAKuB,QAAQ;gBAClBvB,MAAMA,KAAKG,OAAO,GAAGoB,QAAQ;gBAC7BJ;gBACAK,WAAWxB,KAAKE,QAAQ,OAAOH,cAAcG,QAAQ;gBACrDuB,SAASC,IAAAA,sBAAY,EAAC7B,YAAYG;gBAClC2B,YAAYC,IAAAA,4BAAkB,EAAC5B,MAAMY;gBACrCiB,YAAY,CAACC,IAAAA,kCAAgB,EAAC9B,MAAMJ;gBACpCmC,UAAU,AAACpC,CAAAA,eAAe,IAAI,IAAIA,eAAe,KAAK,IAAI,KAAK,IAAIA,WAAWqC,IAAI,CAAC,CAACC,YAAYP,IAAAA,sBAAY,EAACP,cAAcc,WAAW,AAAD,KAAM,KAAK;YACpJ;YACAhB,KAAKiB,IAAI,CAACb;YACV,IAAIA,QAAQG,SAAS,EAAE;gBACnBf,4BAA4B,KAAK;YACrC,CAAC;YACDT,KAAKM,OAAO,CAACN,KAAKG,OAAO,KAAK;QAClC;QACA,qFAAqF;QACrFY,iBAAiBxB,cAAcyB,YAAYzB,cAAc,IAAI,CAACkB,6BAA6BO,cAAc,CAAC;QAC1G,0GAA0G;QAC1GZ,MAAM8B,IAAI,CAACjB;IACf;IACA,OAAOb;AACX"}
|
|
@@ -8,6 +8,3 @@ _exportStar(require("./findAvailableDate"), exports);
|
|
|
8
8
|
_exportStar(require("./getBoundedDateRange"), exports);
|
|
9
9
|
_exportStar(require("./getDayGrid"), exports);
|
|
10
10
|
_exportStar(require("./isRestrictedDate"), exports);
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './dateGrid.types';\nexport * from './findAvailableDate';\nexport * from './getBoundedDateRange';\nexport * from './getDayGrid';\nexport * from './isRestrictedDate';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -10,6 +10,4 @@ const _dateMath = require("../dateMath/dateMath");
|
|
|
10
10
|
const isAfterMaxDate = (date, options)=>{
|
|
11
11
|
const { maxDate } = options;
|
|
12
12
|
return maxDate ? (0, _dateMath.compareDatePart)(date, maxDate) >= 1 : false;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=isAfterMaxDate.js.map
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["isAfterMaxDate.js"],"sourcesContent":["import { compareDatePart } from '../dateMath/dateMath';\n/**\n * Checks if `date` happens later than max date\n * @param date - date to check\n * @param options - object with max date to check against\n */ export const isAfterMaxDate = (date, options)=>{\n const { maxDate } = options;\n return maxDate ? compareDatePart(date, maxDate) >= 1 : false;\n};\n"],"names":["isAfterMaxDate","date","options","maxDate","compareDatePart"],"mappings":";;;;+BAKiBA;;aAAAA;;0BALe;AAKrB,MAAMA,iBAAiB,CAACC,MAAMC,UAAU;IAC/C,MAAM,EAAEC,QAAO,EAAG,GAAGD;IACrB,OAAOC,UAAUC,IAAAA,yBAAe,EAACH,MAAME,YAAY,IAAI,KAAK;AAChE"}
|
|
@@ -10,6 +10,4 @@ const _dateMath = require("../dateMath/dateMath");
|
|
|
10
10
|
const isBeforeMinDate = (date, options)=>{
|
|
11
11
|
const { minDate } = options;
|
|
12
12
|
return minDate ? (0, _dateMath.compareDatePart)(minDate, date) >= 1 : false;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=isBeforeMinDate.js.map
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["isBeforeMinDate.js"],"sourcesContent":["import { compareDatePart } from '../dateMath/dateMath';\n/**\n * Checks if `date` happens earlier than min date\n * @param date - date to check\n * @param options - object with min date to check against\n */ export const isBeforeMinDate = (date, options)=>{\n const { minDate } = options;\n return minDate ? compareDatePart(minDate, date) >= 1 : false;\n};\n"],"names":["isBeforeMinDate","date","options","minDate","compareDatePart"],"mappings":";;;;+BAKiBA;;aAAAA;;0BALe;AAKrB,MAAMA,kBAAkB,CAACC,MAAMC,UAAU;IAChD,MAAM,EAAEC,QAAO,EAAG,GAAGD;IACrB,OAAOC,UAAUC,IAAAA,yBAAe,EAACD,SAASF,SAAS,IAAI,KAAK;AAChE"}
|
|
@@ -23,6 +23,4 @@ const isContiguous = (days, isSingleWeek, firstDayOfWeek)=>{
|
|
|
23
23
|
// In case the full week is provided, then each day has a neighbor
|
|
24
24
|
//, otherwise the last day does not have a neighbor.
|
|
25
25
|
return amountOfNoNeighbors < 2;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=isContiguous.js.map
|
|
26
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["isContiguous.js"],"sourcesContent":["/**\n * Returns whether provided week days are contiguous.\n * @param days - list of days in a week\n * @param isSingleWeek - decides whether the contiguous logic applies across week boundaries or not\n * @param firstDayOfWeek - decides which day of week is the first one in the order.\n */ export const isContiguous = (days, isSingleWeek, firstDayOfWeek)=>{\n const daySet = new Set(days);\n let amountOfNoNeighbors = 0;\n for (const day of days){\n const nextDay = (day + 1) % 7;\n if (!(daySet.has(nextDay) && (!isSingleWeek || firstDayOfWeek !== nextDay))) {\n amountOfNoNeighbors++;\n }\n }\n // In case the full week is provided, then each day has a neighbor\n //, otherwise the last day does not have a neighbor.\n return amountOfNoNeighbors < 2;\n};\n"],"names":["isContiguous","days","isSingleWeek","firstDayOfWeek","daySet","Set","amountOfNoNeighbors","day","nextDay","has"],"mappings":"AAAA;;;;;CAKC;;;;+BAAgBA;;aAAAA;;AAAN,MAAMA,eAAe,CAACC,MAAMC,cAAcC,iBAAiB;IAClE,MAAMC,SAAS,IAAIC,IAAIJ;IACvB,IAAIK,sBAAsB;IAC1B,KAAK,MAAMC,OAAON,KAAK;QACnB,MAAMO,UAAU,AAACD,CAAAA,MAAM,CAAA,IAAK;QAC5B,IAAI,CAAEH,CAAAA,OAAOK,GAAG,CAACD,YAAa,CAAA,CAACN,gBAAgBC,mBAAmBK,OAAM,CAAC,GAAI;YACzEF;QACJ,CAAC;IACL;IACA,kEAAkE;IAClE,oDAAoD;IACpD,OAAOA,sBAAsB;AACjC"}
|
|
@@ -16,6 +16,4 @@ const isRestrictedDate = (date, options)=>{
|
|
|
16
16
|
}
|
|
17
17
|
const inRestrictedDates = restrictedDates && restrictedDates.some((rd)=>(0, _dateMath.compareDates)(rd, date));
|
|
18
18
|
return inRestrictedDates || (0, _isBeforeMinDate.isBeforeMinDate)(date, options) || (0, _isAfterMaxDate.isAfterMaxDate)(date, options);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=isRestrictedDate.js.map
|
|
19
|
+
};
|