{"version":3,"file":"TimePicker.cjs","names":["getParsedTime","useTimePicker","getTimeString","clampTime","TimePickerProvider","Popover","InputBase","CloseButton","SpinInput","padTime","AmPmInput","TimePresets","TimeControlsList","AmPmControlsList","classes"],"sources":["../../../src/components/TimePicker/TimePicker.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport {\n  __BaseInputProps,\n  __InputStylesNames,\n  BoxProps,\n  ClearSectionMode,\n  CloseButton,\n  CloseButtonProps,\n  createVarsResolver,\n  DataAttributes,\n  ElementProps,\n  factory,\n  Factory,\n  getFontSize,\n  InputBase,\n  InputVariant,\n  Popover,\n  PopoverProps,\n  ScrollAreaProps,\n  StylesApiProps,\n  useProps,\n  useResolvedStylesApi,\n  useStyles,\n} from '@mantine/core';\nimport { useId, useMergedRef } from '@mantine/hooks';\nimport { SpinInput } from '../SpinInput';\nimport { AmPmInput } from './AmPmInput/AmPmInput';\nimport { AmPmControlsList } from './TimeControlsList/AmPmControlsList';\nimport { TimeControlsList } from './TimeControlsList/TimeControlsList';\nimport { TimePickerProvider } from './TimePicker.context';\nimport {\n  TimePickerAmPmLabels,\n  TimePickerFormat,\n  TimePickerPasteSplit,\n  TimePickerPresets,\n  TimePickerType,\n} from './TimePicker.types';\nimport { TimePresets } from './TimePresets/TimePresets';\nimport { useTimePicker } from './use-time-picker';\nimport { clampTime } from './utils/clamp-time/clamp-time';\nimport { getParsedTime } from './utils/get-parsed-time/get-parsed-time';\nimport { getTimeString } from './utils/get-time-string/get-time-string';\nimport { padTime } from './utils/pad-time/pad-time';\nimport classes from './TimePicker.module.css';\n\nexport type TimePickerStylesNames =\n  | 'fieldsRoot'\n  | 'fieldsGroup'\n  | 'field'\n  | 'controlsList'\n  | 'controlsListGroup'\n  | 'control'\n  | 'dropdown'\n  | 'presetsRoot'\n  | 'presetsGroup'\n  | 'presetsGroupLabel'\n  | 'presetControl'\n  | 'scrollarea'\n  | __InputStylesNames;\n\nexport type TimePickerCssVariables = {\n  dropdown: '--control-font-size';\n};\n\nexport interface TimePickerProps\n  extends\n    BoxProps,\n    __BaseInputProps,\n    StylesApiProps<TimePickerFactory>,\n    ElementProps<'div', 'onChange' | 'defaultValue'> {\n  /** TimePicker type, `'time'` for regular time input, `'duration'` for duration input that allows values greater than 24 hours @default 'time' */\n  type?: TimePickerType;\n\n  /** Controlled component value */\n  value?: string;\n\n  /** Uncontrolled component default value */\n  defaultValue?: string;\n\n  /** Called when the value changes */\n  onChange?: (value: string) => void;\n\n  /** Determines whether the clear button should be displayed @default false */\n  clearable?: boolean;\n\n  /** Determines how the clear button and rightSection are rendered @default 'both' */\n  clearSectionMode?: ClearSectionMode;\n\n  /** `name` prop passed down to the hidden input */\n  name?: string;\n\n  /** `form` prop passed down to the hidden input */\n  form?: string;\n\n  /** Min possible time value in `hh:mm:ss` format */\n  min?: string;\n\n  /** Max possible time value in `hh:mm:ss` format */\n  max?: string;\n\n  /** Time format, `'24h'` by default */\n  format?: TimePickerFormat;\n\n  /** Number by which hours are incremented/decremented @default 1 */\n  hoursStep?: number;\n\n  /** Number by which minutes are incremented/decremented @default 1 */\n  minutesStep?: number;\n\n  /** Number by which seconds are incremented/decremented @default 1 */\n  secondsStep?: number;\n\n  /** Determines whether the seconds input should be displayed @default false */\n  withSeconds?: boolean;\n\n  /** `aria-label` of hours input */\n  hoursInputLabel?: string;\n\n  /** `aria-label` of minutes input */\n  minutesInputLabel?: string;\n\n  /** `aria-label` of seconds input */\n  secondsInputLabel?: string;\n\n  /** `aria-label` of am/pm input */\n  amPmInputLabel?: string;\n\n  /** Labels used for am/pm values @default { am: 'AM', pm: 'PM' } */\n  amPmLabels?: TimePickerAmPmLabels;\n\n  /** Determines whether the dropdown with time controls list should be visible when the input has focus @default false */\n  withDropdown?: boolean;\n\n  /** Props passed down to `Popover` component */\n  popoverProps?: PopoverProps;\n\n  /** Called once when one of the inputs is focused, not called when focused is shifted between hours, minutes, seconds and am/pm inputs */\n  onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\n  /** Called once when the focus is no longer on any of the inputs */\n  onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;\n\n  /** Props passed down to clear button */\n  clearButtonProps?: CloseButtonProps & ElementProps<'button'> & DataAttributes;\n\n  /** Props passed down to hours input */\n  hoursInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n  /** Props passed down to minutes input */\n  minutesInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n  /** Props passed down to seconds input */\n  secondsInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n  /** Props passed down to am/pm select */\n  amPmSelectProps?: React.ComponentProps<'select'> & DataAttributes;\n\n  /** If set, the value cannot be updated */\n  readOnly?: boolean;\n\n  /** If set, the component becomes disabled */\n  disabled?: boolean;\n\n  /** Props passed down to the hidden input */\n  hiddenInputProps?: React.ComponentProps<'input'> & DataAttributes;\n\n  /** A function to transform paste values, by default time in 24h format can be parsed on paste for example `23:34:22` */\n  pasteSplit?: TimePickerPasteSplit;\n\n  /** A ref object to get node reference of the hours input */\n  hoursRef?: React.Ref<HTMLInputElement>;\n\n  /** A ref object to get node reference of the minutes input */\n  minutesRef?: React.Ref<HTMLInputElement>;\n\n  /** A ref object to get node reference of the seconds input */\n  secondsRef?: React.Ref<HTMLInputElement>;\n\n  /** A ref object to get node reference of the am/pm select */\n  amPmRef?: React.Ref<HTMLSelectElement>;\n\n  /** Time presets to display in the dropdown */\n  presets?: TimePickerPresets;\n\n  /** If set, the dropdown is closed when a value is selected from the presets list @default false */\n  closeDropdownOnPresetSelect?: boolean;\n\n  /** Maximum height of the content displayed in the dropdown in px @default 200 */\n  maxDropdownContentHeight?: number;\n\n  /** Props passed down to all underlying `ScrollArea` components */\n  scrollAreaProps?: ScrollAreaProps;\n\n  /** If set, the time controls list are reversed, @default false */\n  reverseTimeControlsList?: boolean;\n\n  /** Hours input placeholder, @default -- */\n  hoursPlaceholder?: string;\n\n  /** Minutes input placeholder, @default -- */\n  minutesPlaceholder?: string;\n\n  /** Seconds input placeholder, @default -- */\n  secondsPlaceholder?: string;\n\n  /** Minimum number of digits displayed in the hours input, applicable only when `type=\"duration\"` is set @default 2 */\n  minHoursDigits?: number;\n}\n\nexport type TimePickerFactory = Factory<{\n  props: TimePickerProps;\n  ref: HTMLDivElement;\n  stylesNames: TimePickerStylesNames;\n  vars: TimePickerCssVariables;\n  variant: InputVariant;\n}>;\n\nconst defaultProps = {\n  type: 'time',\n  hoursStep: 1,\n  minutesStep: 1,\n  secondsStep: 1,\n  format: '24h',\n  amPmLabels: { am: 'AM', pm: 'PM' },\n  pasteSplit: getParsedTime,\n  maxDropdownContentHeight: 200,\n  hoursPlaceholder: '--',\n  minutesPlaceholder: '--',\n  secondsPlaceholder: '--',\n  minHoursDigits: 2,\n} satisfies Partial<TimePickerProps>;\n\nconst varsResolver = createVarsResolver<TimePickerFactory>((_theme, { size }) => ({\n  dropdown: {\n    '--control-font-size': getFontSize(size),\n  },\n}));\n\nconst DURATION_HOURS_MAX = Infinity;\n\nexport const TimePicker = factory<TimePickerFactory>((_props) => {\n  const props = useProps(['Input', 'InputWrapper', 'TimePicker'], defaultProps, _props);\n  const {\n    classNames,\n    className,\n    style,\n    styles,\n    unstyled,\n    vars,\n    onClick,\n    type,\n    format: _format,\n    value,\n    defaultValue,\n    onChange,\n    hoursStep,\n    minutesStep,\n    secondsStep,\n    withSeconds,\n    hoursInputLabel,\n    minutesInputLabel,\n    secondsInputLabel,\n    amPmInputLabel,\n    amPmLabels,\n    clearable,\n    clearSectionMode,\n    onMouseDown,\n    onFocusCapture,\n    onBlurCapture,\n    min,\n    max,\n    popoverProps,\n    withDropdown,\n    rightSection,\n    onFocus,\n    onBlur,\n    clearButtonProps,\n    hoursInputProps,\n    minutesInputProps,\n    secondsInputProps,\n    amPmSelectProps,\n    readOnly,\n    disabled,\n    size,\n    name,\n    form,\n    hiddenInputProps,\n    labelProps,\n    pasteSplit,\n    hoursRef,\n    minutesRef,\n    secondsRef,\n    amPmRef,\n    presets,\n    closeDropdownOnPresetSelect,\n    maxDropdownContentHeight,\n    scrollAreaProps,\n    attributes,\n    reverseTimeControlsList,\n    hoursPlaceholder,\n    minutesPlaceholder,\n    secondsPlaceholder,\n    minHoursDigits,\n    ...others\n  } = props;\n\n  const isDuration = type === 'duration';\n  const format = isDuration ? '24h' : _format!;\n  const resolvedHoursPlaceholder =\n    isDuration && hoursPlaceholder === '--' ? '-'.repeat(minHoursDigits!) : hoursPlaceholder;\n\n  const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<TimePickerFactory>({\n    classNames,\n    styles,\n    props,\n  });\n\n  const getStyles = useStyles<TimePickerFactory>({\n    name: 'TimePicker',\n    classes,\n    props,\n    className,\n    style,\n    classNames,\n    styles,\n    unstyled,\n    attributes,\n    vars,\n    varsResolver,\n  });\n\n  const controller = useTimePicker({\n    value,\n    defaultValue,\n    onChange,\n    format,\n    amPmLabels,\n    withSeconds,\n    min,\n    max,\n    clearable,\n    disabled,\n    readOnly,\n    pasteSplit,\n    type: type!,\n  });\n\n  const _hoursRef = useMergedRef(controller.refs.hours, hoursRef);\n  const _minutesRef = useMergedRef(controller.refs.minutes, minutesRef);\n  const _secondsRef = useMergedRef(controller.refs.seconds, secondsRef);\n  const _amPmRef = useMergedRef(controller.refs.amPm, amPmRef);\n\n  const hoursInputId = useId();\n  const hasFocusRef = useRef(false);\n  const [dropdownOpened, setDropdownOpened] = useState(false);\n\n  const handleFocus = (event: React.FocusEvent<any>) => {\n    if (!hasFocusRef.current) {\n      hasFocusRef.current = true;\n      onFocus?.(event);\n    }\n  };\n\n  const handlePresetSelect = (timeString: string) => {\n    controller.setTimeString(timeString);\n\n    if (closeDropdownOnPresetSelect) {\n      setDropdownOpened(false);\n      popoverProps?.onChange?.(false);\n    }\n  };\n\n  const handleBlur = (event: React.FocusEvent<HTMLDivElement>) => {\n    if (!event.currentTarget.contains(event.relatedTarget)) {\n      const computedValue = controller.values;\n      const timeString = getTimeString({\n        ...computedValue,\n        format,\n        amPmLabels,\n        withSeconds: !!withSeconds,\n      });\n\n      if (timeString.valid && (min || max)) {\n        const clamped = clampTime(timeString.value, min, max);\n\n        if (clamped.timeString !== timeString.value) {\n          controller.setTimeString(clamped.timeString);\n        }\n      }\n      hasFocusRef.current = false;\n      onBlur?.(event);\n    }\n  };\n\n  return (\n    <TimePickerProvider value={{ getStyles, scrollAreaProps, maxDropdownContentHeight }}>\n      <Popover\n        opened={dropdownOpened}\n        transitionProps={{ duration: 0 }}\n        position=\"bottom-start\"\n        withRoles={false}\n        disabled={disabled || readOnly || !withDropdown || isDuration}\n        {...popoverProps}\n      >\n        <Popover.Target>\n          <InputBase\n            component=\"div\"\n            size={size}\n            disabled={disabled}\n            onClick={(event) => {\n              onClick?.(event);\n              controller.focus('hours');\n              if (!disabled) {\n                setDropdownOpened(true);\n              }\n            }}\n            onMouseDown={(event) => {\n              event.preventDefault();\n              onMouseDown?.(event);\n            }}\n            onFocusCapture={(event) => {\n              setDropdownOpened(true);\n              onFocusCapture?.(event);\n            }}\n            onBlurCapture={(event) => {\n              setDropdownOpened(false);\n              onBlurCapture?.(event);\n            }}\n            rightSection={rightSection}\n            __clearSection={\n              <CloseButton\n                {...clearButtonProps}\n                size={size}\n                onClick={(event) => {\n                  controller.clear();\n                  clearButtonProps?.onClick?.(event);\n                }}\n                onMouseDown={(event) => {\n                  event.preventDefault();\n                  clearButtonProps?.onMouseDown?.(event);\n                }}\n              />\n            }\n            __clearable={controller.isClearable}\n            __clearSectionMode={clearSectionMode}\n            labelProps={{ htmlFor: hoursInputId, ...labelProps }}\n            style={style}\n            className={className}\n            classNames={resolvedClassNames}\n            styles={resolvedStyles}\n            attributes={attributes}\n            __staticSelector=\"TimePicker\"\n            {...others}\n          >\n            <div {...getStyles('fieldsRoot')} dir=\"ltr\">\n              <div {...getStyles('fieldsGroup')} onBlur={handleBlur}>\n                <SpinInput\n                  id={hoursInputId}\n                  {...hoursInputProps}\n                  {...getStyles('field', {\n                    className: hoursInputProps?.className,\n                    style: isDuration\n                      ? {\n                          width: `calc(${Math.max(minHoursDigits!, padTime(controller.values.hours ?? 0).length)}ch + 0.3em)`,\n                          ...hoursInputProps?.style,\n                        }\n                      : hoursInputProps?.style,\n                  })}\n                  value={controller.values.hours}\n                  onChange={controller.setHours}\n                  onNextInput={() => controller.focus('minutes')}\n                  min={format === '12h' ? 1 : 0}\n                  max={isDuration ? DURATION_HOURS_MAX : format === '12h' ? 12 : 23}\n                  allowTemporaryZero={format === '12h'}\n                  disableAutoAdvance={isDuration}\n                  focusable\n                  step={hoursStep}\n                  ref={_hoursRef}\n                  aria-label={hoursInputLabel}\n                  readOnly={readOnly}\n                  disabled={disabled}\n                  onPaste={controller.onPaste}\n                  onFocus={(event) => {\n                    handleFocus(event);\n                    hoursInputProps?.onFocus?.(event);\n                  }}\n                  onBlur={(event) => {\n                    const actualInputValue = event.currentTarget.value;\n                    const numericValue = actualInputValue ? parseInt(actualInputValue, 10) : null;\n\n                    if (format === '12h' && numericValue === 0) {\n                      controller.setHours(12);\n                    }\n                    hoursInputProps?.onBlur?.(event);\n                  }}\n                  placeholder={resolvedHoursPlaceholder}\n                />\n                <span>:</span>\n                <SpinInput\n                  {...minutesInputProps}\n                  {...getStyles('field', {\n                    className: minutesInputProps?.className,\n                    style: minutesInputProps?.style,\n                  })}\n                  value={controller.values.minutes}\n                  onChange={controller.setMinutes}\n                  min={0}\n                  max={59}\n                  focusable\n                  step={minutesStep}\n                  ref={_minutesRef}\n                  onPreviousInput={() => controller.focus('hours')}\n                  onNextInput={() =>\n                    withSeconds ? controller.focus('seconds') : controller.focus('amPm')\n                  }\n                  aria-label={minutesInputLabel}\n                  tabIndex={-1}\n                  readOnly={readOnly}\n                  disabled={disabled}\n                  onPaste={controller.onPaste}\n                  onFocus={(event) => {\n                    handleFocus(event);\n                    minutesInputProps?.onFocus?.(event);\n                  }}\n                  placeholder={minutesPlaceholder}\n                />\n\n                {withSeconds && (\n                  <>\n                    <span>:</span>\n                    <SpinInput\n                      {...secondsInputProps}\n                      {...getStyles('field', {\n                        className: secondsInputProps?.className,\n                        style: secondsInputProps?.style,\n                      })}\n                      value={controller.values.seconds}\n                      onChange={controller.setSeconds}\n                      min={0}\n                      max={59}\n                      focusable\n                      step={secondsStep}\n                      ref={_secondsRef}\n                      onPreviousInput={() => controller.focus('minutes')}\n                      onNextInput={() => controller.focus('amPm')}\n                      aria-label={secondsInputLabel}\n                      tabIndex={-1}\n                      readOnly={readOnly}\n                      disabled={disabled}\n                      onPaste={controller.onPaste}\n                      onFocus={(event) => {\n                        handleFocus(event);\n                        secondsInputProps?.onFocus?.(event);\n                      }}\n                      placeholder={secondsPlaceholder}\n                    />\n                  </>\n                )}\n\n                {format === '12h' && !isDuration && (\n                  <AmPmInput\n                    {...amPmSelectProps}\n                    inputType={withDropdown ? 'input' : 'select'}\n                    labels={amPmLabels}\n                    value={controller.values.amPm}\n                    onChange={controller.setAmPm}\n                    ref={_amPmRef}\n                    aria-label={amPmInputLabel}\n                    onPreviousInput={() =>\n                      withSeconds ? controller.focus('seconds') : controller.focus('minutes')\n                    }\n                    readOnly={readOnly}\n                    disabled={disabled}\n                    tabIndex={-1}\n                    onPaste={controller.onPaste}\n                    onFocus={(event) => {\n                      handleFocus(event);\n                      amPmSelectProps?.onFocus?.(event);\n                    }}\n                  />\n                )}\n              </div>\n            </div>\n\n            <input\n              type=\"hidden\"\n              name={name}\n              form={form}\n              value={controller.hiddenInputValue}\n              {...hiddenInputProps}\n            />\n          </InputBase>\n        </Popover.Target>\n        <Popover.Dropdown\n          {...getStyles('dropdown')}\n          onMouseDown={(event) => event.preventDefault()}\n        >\n          {presets ? (\n            <TimePresets\n              value={controller.hiddenInputValue}\n              onChange={handlePresetSelect}\n              format={format}\n              presets={presets}\n              amPmLabels={amPmLabels}\n              withSeconds={withSeconds || false}\n            />\n          ) : (\n            <div {...getStyles('controlsListGroup')}>\n              <TimeControlsList\n                min={format === '12h' ? 1 : 0}\n                max={format === '12h' ? 12 : 23}\n                step={hoursStep}\n                value={controller.values.hours}\n                onSelect={controller.setHours}\n                reversed={reverseTimeControlsList}\n              />\n              <TimeControlsList\n                min={0}\n                max={59}\n                step={minutesStep}\n                value={controller.values.minutes}\n                onSelect={controller.setMinutes}\n                reversed={reverseTimeControlsList}\n              />\n              {withSeconds && (\n                <TimeControlsList\n                  min={0}\n                  max={59}\n                  step={secondsStep}\n                  value={controller.values.seconds}\n                  onSelect={controller.setSeconds}\n                  reversed={reverseTimeControlsList}\n                />\n              )}\n              {format === '12h' && (\n                <AmPmControlsList\n                  labels={amPmLabels}\n                  value={controller.values.amPm}\n                  onSelect={controller.setAmPm}\n                />\n              )}\n            </div>\n          )}\n        </Popover.Dropdown>\n      </Popover>\n    </TimePickerProvider>\n  );\n});\n\nTimePicker.displayName = '@mantine/dates/TimePicker';\nTimePicker.classes = classes;\nTimePicker.varsResolver = varsResolver;\n\nexport namespace TimePicker {\n  export type Props = TimePickerProps;\n  export type StylesNames = TimePickerStylesNames;\n  export type Factory = TimePickerFactory;\n  export type CssVariables = TimePickerCssVariables;\n  export type Format = TimePickerFormat;\n  export type AmPmLabels = TimePickerAmPmLabels;\n  export type PasteSplit = TimePickerPasteSplit;\n  export type Presets = TimePickerPresets;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyNA,MAAM,eAAe;CACnB,MAAM;CACN,WAAW;CACX,aAAa;CACb,aAAa;CACb,QAAQ;CACR,YAAY;EAAE,IAAI;EAAM,IAAI;CAAK;CACjC,YAAYA,wBAAAA;CACZ,0BAA0B;CAC1B,kBAAkB;CAClB,oBAAoB;CACpB,oBAAoB;CACpB,gBAAgB;AAClB;AAEA,MAAM,gBAAA,GAAA,cAAA,mBAAA,EAAsD,QAAQ,EAAE,YAAY,EAChF,UAAU,EACR,wBAAA,GAAA,cAAA,YAAA,CAAmC,IAAI,EACzC,EACF,EAAE;AAEF,MAAM,qBAAqB;AAE3B,MAAa,cAAA,GAAA,cAAA,QAAA,EAAyC,WAAW;CAC/D,MAAM,SAAA,GAAA,cAAA,SAAA,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