{"version":3,"file":"props.js","sources":["../../../../../../../packages/components/time-picker/src/common/props.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, definePropType } from '@element-plus/utils'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport { CircleClose } from '@element-plus/icons-vue'\nimport { disabledTimeListsProps } from '../props/shared'\n\nimport type { Component, ExtractPropTypes } from 'vue'\nimport type { Options } from '@popperjs/core'\nimport type { Dayjs } from 'dayjs'\nimport type { Placement } from '@element-plus/components/popper'\n\nexport type SingleOrRange = T | [T, T]\nexport type DateModelType = number | string | Date\nexport type ModelValueType = SingleOrRange | string[]\nexport type DayOrDays = SingleOrRange\nexport type DateOrDates = SingleOrRange\nexport type UserInput = SingleOrRange\nexport type GetDisabledHours = (role: string, comparingDate?: Dayjs) => number[]\nexport type GetDisabledMinutes = (\n hour: number,\n role: string,\n comparingDate?: Dayjs\n) => number[]\nexport type GetDisabledSeconds = (\n hour: number,\n minute: number,\n role: string,\n comparingDate?: Dayjs\n) => number[]\n\nexport const timePickerDefaultProps = buildProps({\n /**\n * @description same as `id` in native input\n */\n id: {\n type: definePropType>([Array, String]),\n },\n /**\n * @description same as `name` in native input\n */\n name: {\n type: definePropType>([Array, String]),\n default: '',\n },\n /**\n * @description custom class name for TimePicker's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description format of the displayed value in the input box\n */\n format: String,\n /**\n * @description optional, format of binding value. If not specified, the binding value will be a Date object\n */\n valueFormat: String,\n /**\n * @description optional, format of the date displayed value in TimePicker's dropdown\n */\n dateFormat: String,\n /**\n * @description optional, format of the time displayed value in TimePicker's dropdown\n */\n timeFormat: String,\n /**\n * @description type of the picker\n */\n type: {\n type: String,\n default: '',\n },\n /**\n * @description whether to show clear button\n */\n clearable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Custom clear icon component\n */\n clearIcon: {\n type: definePropType([String, Object]),\n default: CircleClose,\n },\n /**\n * @description whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description Custom prefix icon component\n */\n prefixIcon: {\n type: definePropType([String, Object]),\n default: '',\n },\n /**\n * @description size of Input\n */\n size: useSizeProp,\n /**\n * @description whether TimePicker is read only\n */\n readonly: Boolean,\n /**\n * @description whether TimePicker is disabled\n */\n disabled: Boolean,\n /**\n * @description placeholder in non-range mode\n */\n placeholder: {\n type: String,\n default: '',\n },\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType>(Object),\n default: () => ({}),\n },\n /**\n * @description binding value, if it is an array, the length should be 2\n */\n modelValue: {\n type: definePropType([Date, Array, String, Number]),\n default: '',\n },\n /**\n * @description range separator\n */\n rangeSeparator: {\n type: String,\n default: '-',\n },\n /**\n * @description placeholder for the start date in range mode\n */\n startPlaceholder: String,\n /**\n * @description placeholder for the end date in range mode\n */\n endPlaceholder: String,\n /**\n * @description optional, default date of the calendar\n */\n defaultValue: {\n type: definePropType>([Date, Array]),\n },\n /**\n * @description optional, the time value to use when selecting date range\n */\n defaultTime: {\n type: definePropType>([Date, Array]),\n },\n /**\n * @description whether to pick a time range\n */\n isRange: Boolean,\n ...disabledTimeListsProps,\n /**\n * @description a function determining if a date is disabled with that date as its parameter. Should return a Boolean\n */\n disabledDate: {\n type: Function,\n },\n /**\n * @description set custom className\n */\n cellClassName: {\n type: Function,\n },\n /**\n * @description an object array to set shortcut options\n */\n shortcuts: {\n type: Array,\n default: () => [],\n },\n /**\n * @description whether to pick time using arrow buttons\n */\n arrowControl: Boolean,\n /**\n * @description input tabindex\n */\n tabindex: {\n type: definePropType([String, Number]),\n default: 0,\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description unlink two date-panels in range-picker\n */\n unlinkPanels: Boolean,\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType(String),\n values: placements,\n default: 'bottom',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType(Array),\n default: ['bottom', 'top', 'right', 'left'],\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport type TimePickerDefaultProps = ExtractPropTypes<\n typeof timePickerDefaultProps\n>\n\nexport interface PickerOptions {\n isValidValue: (date: DayOrDays) => boolean\n handleKeydownInput: (event: KeyboardEvent) => void\n parseUserInput: (value: UserInput) => DayOrDays\n formatToString: (value: DayOrDays) => UserInput\n getRangeAvailableTime: (date: DayOrDays) => DayOrDays\n getDefaultValue: () => DayOrDays\n panelReady: boolean\n handleClear: () => void\n handleFocusPicker?: () => void\n}\n"],"names":["buildProps","definePropType","CircleClose","useSizeProp","disabledTimeListsProps","placements","useEmptyValuesProps","useAriaProps"],"mappings":";;;;;;;;;;;;;;AASY,MAAC,sBAAsB,GAAGA,kBAAU,CAAC;AACjD,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEA,sBAAc,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EA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