@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
1 lines • 20.5 kB
Source Map (JSON)
{"version":3,"file":"InlineDateTimePicker.mjs","names":["classes"],"sources":["../../../src/components/InlineDateTimePicker/InlineDateTimePicker.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useRef, useState } from 'react';\nimport {\n ActionIcon,\n ActionIconProps,\n Box,\n BoxProps,\n CheckIcon,\n ElementProps,\n Factory,\n genericFactory,\n MantineSize,\n StylesApiProps,\n Text,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDidUpdate, useMergedRef } from '@mantine/hooks';\nimport { useUncontrolledDates } from '../../hooks';\nimport { DatePickerType, DateStringValue, DateValue } from '../../types';\nimport { assignTime, clampDate, getDefaultClampedDate } from '../../utils';\nimport { pickCalendarProps } from '../Calendar';\nimport { DatePicker, DatePickerBaseProps, DatePickerStylesNames } from '../DatePicker';\nimport { useDatesContext } from '../DatesProvider';\nimport { getMaxTime, getMinTime } from '../DateTimePicker/get-min-max-time/get-min-max-time';\nimport { TimePicker, TimePickerProps } from '../TimePicker/TimePicker';\nimport classes from './InlineDateTimePicker.module.css';\n\nexport type InlineDateTimePickerStylesNames =\n | 'root'\n | 'timeWrapper'\n | 'timeInput'\n | 'submitButton'\n | 'rangeTimeWrapper'\n | 'rangeTimeInput'\n | 'rangeInfo'\n | DatePickerStylesNames;\n\nexport interface InlineDateTimePickerProps<Type extends DatePickerType = 'default'>\n extends\n BoxProps,\n DatePickerBaseProps<Type>,\n StylesApiProps<InlineDateTimePickerFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Default time value in `HH:mm` or `HH:mm:ss` format. Assigned to time when date is selected. */\n defaultTimeValue?: string;\n\n /** Props passed down to `TimePicker` component */\n timePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;\n\n /** Props passed down to the end time `TimePicker` component in range mode */\n endTimePickerProps?: Omit<TimePickerProps, 'defaultValue' | 'value'>;\n\n /** Props passed down to the submit button */\n submitButtonProps?: ActionIconProps & React.ComponentProps<'button'>;\n\n /** Determines whether the seconds input should be displayed @default false */\n withSeconds?: boolean;\n\n /** Called when the submit button is clicked */\n onSubmit?: () => void;\n\n /** `dayjs` format for range display, or a function that receives the value as a `YYYY-MM-DD HH:mm:ss` string and returns the formatted value @default \"DD/MM/YYYY HH:mm\" */\n valueFormat?: string | ((date: DateStringValue) => string);\n\n /** Separator between range values */\n labelSeparator?: string;\n\n /** Component size @default 'sm' */\n size?: MantineSize;\n\n /** Min date */\n minDate?: DateStringValue | Date;\n\n /** Max date */\n maxDate?: DateStringValue | Date;\n\n /** @internal Adds data-mantine-stop-propagation to interactive elements */\n __stopPropagation?: boolean;\n\n /** @internal Overrides the static selector used for class names */\n __staticSelector?: string;\n\n /** @internal Called when Enter is pressed in a time input */\n __onEnter?: () => void;\n\n /** @internal Forwarded to DatePicker for preset handling */\n __onPresetSelect?: (val: any) => void;\n}\n\nexport type InlineDateTimePickerFactory = Factory<{\n props: InlineDateTimePickerProps;\n ref: HTMLDivElement;\n stylesNames: InlineDateTimePickerStylesNames;\n signature: <Type extends DatePickerType = 'default'>(\n props: InlineDateTimePickerProps<Type> & { ref?: React.Ref<HTMLDivElement> }\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n type: 'default',\n size: 'sm',\n} satisfies Partial<InlineDateTimePickerProps>;\n\nexport const InlineDateTimePicker = genericFactory<InlineDateTimePickerFactory>((_props) => {\n const props = useProps('InlineDateTimePicker', defaultProps as any, _props);\n const {\n value,\n defaultValue,\n onChange,\n valueFormat,\n locale,\n classNames,\n styles,\n unstyled,\n timePickerProps,\n endTimePickerProps,\n submitButtonProps,\n withSeconds,\n level,\n defaultLevel,\n size,\n variant,\n vars,\n minDate,\n maxDate,\n defaultDate,\n defaultTimeValue,\n presets,\n attributes,\n onSubmit,\n labelSeparator,\n type,\n className,\n style,\n __stopPropagation,\n __staticSelector,\n __onEnter,\n __onPresetSelect,\n fullWidth,\n ...rest\n } = props;\n\n const _staticSelector = __staticSelector || 'InlineDateTimePicker';\n\n const getStyles = useStyles<InlineDateTimePickerFactory>({\n name: _staticSelector,\n classes,\n props: props as InlineDateTimePickerProps,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<InlineDateTimePickerFactory>({\n classNames,\n styles,\n props: props as InlineDateTimePickerProps,\n });\n\n const ctx = useDatesContext();\n const _valueFormat = valueFormat || (withSeconds ? 'DD/MM/YYYY HH:mm:ss' : 'DD/MM/YYYY HH:mm');\n const _labelSeparator = ctx.getLabelSeparator(labelSeparator);\n const isRange = (type as string) === 'range';\n\n const startTimePickerRef = useRef<HTMLInputElement>(null);\n const startTimePickerRefMerged = useMergedRef(startTimePickerRef, timePickerProps?.hoursRef);\n const endTimePickerRef = useRef<HTMLInputElement>(null);\n const endTimePickerRefMerged = useMergedRef(endTimePickerRef, endTimePickerProps?.hoursRef);\n\n const {\n calendarProps: { allowSingleDateInRange, ...calendarProps },\n others,\n } = pickCalendarProps(rest);\n\n const [_value, setValue] = useUncontrolledDates({\n type: type as any,\n value,\n defaultValue,\n onChange: onChange as any,\n withTime: true,\n });\n\n const formatTime = (dateValue: DateStringValue | null) =>\n dateValue ? dayjs(dateValue).format(withSeconds ? 'HH:mm:ss' : 'HH:mm') : '';\n\n const getInitialStartTime = () => {\n if (defaultTimeValue) {\n return defaultTimeValue;\n }\n if (isRange) {\n return Array.isArray(_value) ? formatTime(_value[0]) : '';\n }\n return formatTime(_value as DateStringValue | null);\n };\n\n const getInitialEndTime = () => {\n if (defaultTimeValue) {\n return defaultTimeValue;\n }\n return isRange && Array.isArray(_value) ? formatTime(_value[1]) : '';\n };\n\n const [startTimeValue, setStartTimeValue] = useState(getInitialStartTime);\n const [endTimeValue, setEndTimeValue] = useState(getInitialEndTime);\n const [currentLevel, setCurrentLevel] = useState(level || defaultLevel || 'month');\n\n const _defaultDate = isRange\n ? (Array.isArray(_value) ? _value[0] : null) || defaultDate\n : (_value as DateStringValue | null) || defaultDate;\n\n const handleDefaultDateChange = (date: DateValue) => {\n if (date) {\n setValue(\n assignTime(clampDate(minDate, maxDate, date), startTimeValue || defaultTimeValue || '')\n );\n }\n startTimePickerRef.current?.focus();\n };\n\n const handleRangeDateChange = (dates: any) => {\n const [start, end] = dates;\n const newStart = start\n ? assignTime(clampDate(minDate, maxDate, start), startTimeValue || defaultTimeValue || '')\n : null;\n const newEnd = end\n ? assignTime(clampDate(minDate, maxDate, end), endTimeValue || defaultTimeValue || '')\n : null;\n setValue([newStart, newEnd] as any);\n\n if (start && end) {\n startTimePickerRef.current?.focus();\n }\n };\n\n const handleDateChange = (date: any) => {\n if (isRange) {\n handleRangeDateChange(date);\n } else {\n handleDefaultDateChange(date);\n }\n };\n\n const handleStartTimeChange = (timeString: string) => {\n timePickerProps?.onChange?.(timeString);\n setStartTimeValue(timeString);\n\n if (timeString) {\n if (isRange && Array.isArray(_value)) {\n if (_value[0]) {\n const newStart = assignTime(_value[0], timeString);\n setValue([newStart, _value[1]] as any);\n }\n } else {\n setValue(assignTime(_value as DateStringValue | null, timeString));\n }\n }\n };\n\n const handleEndTimeChange = (timeString: string) => {\n endTimePickerProps?.onChange?.(timeString);\n setEndTimeValue(timeString);\n\n if (timeString && isRange && Array.isArray(_value) && _value[1]) {\n const newEnd = assignTime(_value[1], timeString);\n setValue([_value[0], newEnd] as any);\n }\n };\n\n const handleTimeInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n __onEnter?.();\n }\n };\n\n const getFormattedRange = () => {\n if (!isRange || !Array.isArray(_value)) {\n return '';\n }\n\n const formatDate = (v: DateStringValue | null) => {\n if (!v) {\n return '';\n }\n if (typeof _valueFormat === 'function') {\n return _valueFormat(v);\n }\n return dayjs(v).locale(ctx.getLocale(locale)).format(_valueFormat);\n };\n\n const start = formatDate(_value[0]);\n const end = formatDate(_value[1]);\n\n if (start && end) {\n return `${start} ${_labelSeparator} ${end}`;\n }\n\n if (start) {\n return `${start} ${_labelSeparator} ...`;\n }\n\n return '';\n };\n\n useDidUpdate(() => {\n if (isRange && Array.isArray(_value)) {\n setStartTimeValue(formatTime(_value[0]));\n setEndTimeValue(formatTime(_value[1]));\n } else {\n setStartTimeValue(formatTime(_value as DateStringValue | null));\n }\n }, [_value]);\n\n const startMinTime = isRange\n ? getMinTime({ minDate, value: Array.isArray(_value) ? _value[0] : null })\n : getMinTime({ minDate, value: _value as DateStringValue | null });\n\n const startMaxTime = isRange\n ? getMaxTime({ maxDate, value: Array.isArray(_value) ? _value[0] : null })\n : getMaxTime({ maxDate, value: _value as DateStringValue | null });\n\n const endMinTime = isRange\n ? getMinTime({ minDate, value: Array.isArray(_value) ? _value[1] : null })\n : undefined;\n\n const endMaxTime = isRange\n ? getMaxTime({ maxDate, value: Array.isArray(_value) ? _value[1] : null })\n : undefined;\n\n return (\n <Box {...getStyles('root', { className, style })} {...others} ref={props.ref as any}>\n <DatePicker\n fullWidth={fullWidth ?? true}\n {...calendarProps}\n maxDate={maxDate}\n minDate={minDate}\n size={size}\n variant={variant}\n type={type as any}\n value={_value as any}\n defaultDate={_defaultDate || getDefaultClampedDate({ maxDate, minDate })}\n onChange={handleDateChange}\n locale={locale}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector={_staticSelector}\n __stopPropagation={__stopPropagation}\n level={level}\n defaultLevel={defaultLevel}\n onLevelChange={(_level) => {\n setCurrentLevel(_level);\n calendarProps.onLevelChange?.(_level);\n }}\n presets={presets}\n allowSingleDateInRange={allowSingleDateInRange}\n __onPresetSelect={__onPresetSelect}\n attributes={attributes}\n />\n\n {currentLevel === 'month' && !isRange && (\n <div {...getStyles('timeWrapper')}>\n <TimePicker\n value={startTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={startMinTime}\n max={startMaxTime}\n {...timePickerProps}\n {...getStyles('timeInput', {\n className: timePickerProps?.className,\n style: timePickerProps?.style,\n })}\n onChange={handleStartTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={startTimePickerRefMerged}\n />\n\n <ActionIcon\n variant=\"default\"\n size={`input-${size || 'sm'}`}\n {...getStyles('submitButton', {\n className: submitButtonProps?.className,\n style: submitButtonProps?.style,\n })}\n unstyled={unstyled}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n // eslint-disable-next-line react/no-children-prop\n children={<CheckIcon size=\"30%\" />}\n {...submitButtonProps}\n onClick={(event) => {\n submitButtonProps?.onClick?.(event);\n onSubmit?.();\n }}\n />\n </div>\n )}\n\n {currentLevel === 'month' && isRange && (\n <>\n <Text {...getStyles('rangeInfo')}>{getFormattedRange()}</Text>\n\n <div {...getStyles('rangeTimeWrapper')}>\n <TimePicker\n value={startTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={startMinTime}\n max={startMaxTime}\n {...timePickerProps}\n {...getStyles('rangeTimeInput', {\n className: timePickerProps?.className,\n style: timePickerProps?.style,\n })}\n onChange={handleStartTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={startTimePickerRefMerged}\n />\n\n <TimePicker\n value={endTimeValue}\n withSeconds={withSeconds}\n unstyled={unstyled}\n min={endMinTime}\n max={endMaxTime}\n {...endTimePickerProps}\n {...getStyles('rangeTimeInput', {\n className: endTimePickerProps?.className,\n style: endTimePickerProps?.style,\n })}\n onChange={handleEndTimeChange}\n onKeyDown={handleTimeInputKeyDown}\n size={size}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n hoursRef={endTimePickerRefMerged}\n />\n\n <ActionIcon\n variant=\"default\"\n size={`input-${size || 'sm'}`}\n {...getStyles('submitButton', {\n className: submitButtonProps?.className,\n style: submitButtonProps?.style,\n })}\n unstyled={unstyled}\n data-mantine-stop-propagation={__stopPropagation || undefined}\n // eslint-disable-next-line react/no-children-prop\n children={<CheckIcon size=\"30%\" />}\n {...submitButtonProps}\n onClick={(event) => {\n submitButtonProps?.onClick?.(event);\n onSubmit?.();\n }}\n />\n </div>\n </>\n )}\n </Box>\n );\n});\n\nInlineDateTimePicker.classes = { ...classes, ...DatePicker.classes };\nInlineDateTimePicker.displayName = '@mantine/dates/InlineDateTimePicker';\n"],"mappings":";;;;;;;;;;;;;;;;;AAoGA,MAAM,eAAe;CACnB,MAAM;CACN,MAAM;AACR;AAEA,MAAa,uBAAuB,gBAA6C,WAAW;CAC1F,MAAM,QAAQ,SAAS,wBAAwB,cAAqB,MAAM;CAC1E,MAAM,EACJ,OACA,cACA,UACA,aACA,QACA,YACA,QACA,UACA,iBACA,oBACA,mBACA,aACA,OACA,cACA,MACA,SACA,MACA,SACA,SACA,aACA,kBACA,SACA,YACA,UACA,gBACA,MACA,WACA,OACA,mBACA,kBACA,WACA,kBACA,WACA,GAAG,SACD;CAEJ,MAAM,kBAAkB,oBAAoB;CAE5C,MAAM,YAAY,UAAuC;EACvD,MAAM;EACN,SAAA;EACO;EACP;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,EAAE,oBAAoB,mBAAmB,qBAAkD;EAC/F;EACA;EACO;CACT,CAAC;CAED,MAAM,MAAM,gBAAgB;CAC5B,MAAM,eAAe,gBAAgB,cAAc,wBAAwB;CAC3E,MAAM,kBAAkB,IAAI,kBAAkB,cAAc;CAC5D,MAAM,UAAW,SAAoB;CAErC,MAAM,qBAAqB,OAAyB,IAAI;CACxD,MAAM,2BAA2B,aAAa,oBAAoB,iBAAiB,QAAQ;CAE3F,MAAM,yBAAyB,aADN,OAAyB,IACS,GAAG,oBAAoB,QAAQ;CAE1F,MAAM,EACJ,eAAe,EAAE,wBAAwB,GAAG,iBAC5C,WACE,kBAAkB,IAAI;CAE1B,MAAM,CAAC,QAAQ,YAAY,qBAAqB;EACxC;EACN;EACA;EACU;EACV,UAAU;CACZ,CAAC;CAED,MAAM,cA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