You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
13 KiB

{"ast":null,"code":"import { placements } from '@popperjs/core';\nimport { CircleClose } from '@element-plus/icons-vue';\nimport { disabledTimeListsProps } from '../props/shared.mjs';\nimport { buildProps, definePropType } from '../../../../utils/vue/props/runtime.mjs';\nimport { useSizeProp } from '../../../../hooks/use-size/index.mjs';\nimport { useEmptyValuesProps } from '../../../../hooks/use-empty-values/index.mjs';\nimport { useAriaProps } from '../../../../hooks/use-aria/index.mjs';\nconst timePickerDefaultProps = buildProps({\n id: {\n type: definePropType([Array, String])\n },\n name: {\n type: definePropType([Array, String])\n },\n popperClass: {\n type: String,\n default: \"\"\n },\n format: String,\n valueFormat: String,\n dateFormat: String,\n timeFormat: String,\n type: {\n type: String,\n default: \"\"\n },\n clearable: {\n type: Boolean,\n default: true\n },\n clearIcon: {\n type: definePropType([String, Object]),\n default: CircleClose\n },\n editable: {\n type: Boolean,\n default: true\n },\n prefixIcon: {\n type: definePropType([String, Object]),\n default: \"\"\n },\n size: useSizeProp,\n readonly: Boolean,\n disabled: Boolean,\n placeholder: {\n type: String,\n default: \"\"\n },\n popperOptions: {\n type: definePropType(Object),\n default: () => ({})\n },\n modelValue: {\n type: definePropType([Date, Array, String, Number]),\n default: \"\"\n },\n rangeSeparator: {\n type: String,\n default: \"-\"\n },\n startPlaceholder: String,\n endPlaceholder: String,\n defaultValue: {\n type: definePropType([Date, Array])\n },\n defaultTime: {\n type: definePropType([Date, Array])\n },\n isRange: Boolean,\n ...disabledTimeListsProps,\n disabledDate: {\n type: Function\n },\n cellClassName: {\n type: Function\n },\n shortcuts: {\n type: Array,\n default: () => []\n },\n arrowControl: Boolean,\n tabindex: {\n type: definePropType([String, Number]),\n default: 0\n },\n validateEvent: {\n type: Boolean,\n default: true\n },\n unlinkPanels: Boolean,\n placement: {\n type: definePropType(String),\n values: placements,\n default: \"bottom\"\n },\n fallbackPlacements: {\n type: definePropType(Array),\n default: [\"bottom\", \"top\", \"right\", \"left\"]\n },\n ...useEmptyValuesProps,\n ...useAriaProps([\"ariaLabel\"]),\n showNow: {\n type: Boolean,\n default: true\n }\n});\nconst timePickerRngeTriggerProps = buildProps({\n id: {\n type: definePropType(Array)\n },\n name: {\n type: definePropType(Array)\n },\n modelValue: {\n type: definePropType([Array, String])\n },\n startPlaceholder: String,\n endPlaceholder: String\n});\nexport { timePickerDefaultProps, timePickerRngeTriggerProps };","map":{"version":3,"names":["timePickerDefaultProps","buildProps","id","type","definePropType","Array","String","name","popperClass","default","format","valueFormat","dateFormat","timeFormat","clearable","Boolean","clearIcon","Object","CircleClose","editable","prefixIcon","size","useSizeProp","readonly","disabled","placeholder","popperOptions","modelValue","Date","Number","rangeSeparator","startPlaceholder","endPlaceholder","defaultValue","defaultTime","isRange","disabledTimeListsProps","disabledDate","Function","cellClassName","shortcuts","arrowControl","tabindex","validateEvent","unlinkPanels","placement","values","placements","fallbackPlacements","useEmptyValuesProps","useAriaProps","showNow","timePickerRngeTriggerProps"],"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, T]\nexport type DateModelType = number | string | Date\nexport type ModelValueType = SingleOrRange<DateModelType> | string[]\nexport type DayOrDays = SingleOrRange<Dayjs>\nexport type DateOrDates = SingleOrRange<Date>\nexport type UserInput = SingleOrRange<string | null>\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<SingleOrRange<string>>([Array, String]),\n },\n /**\n * @description same as `name` in native input\n */\n name: {\n type: definePropType<SingleOrRange<string>>([Array, String]),\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 | Component>([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 | Component>([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<Partial<Options>>(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<ModelValueType>([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<SingleOrRange<Date>>([Date, Array]),\n },\n /**\n * @description optional, the time value to use when selecting date range\n */\n defaultTime: {\n type: definePropType<SingleOrRange<Date>>([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>([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<Placement>(String),\n values: placements,\n default: 'bottom',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom', 'top', 'right', 'left'],\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n /**\n * @description whether to show the now button\n */\n showNow: {\n type: Boolean,\n default: true,\n },\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\nexport const timePickerRngeTriggerProps = buildProps({\n id: {\n type: definePropType<string[]>(Array),\n },\n name: {\n type: definePropType<string[]>(Array),\n },\n modelValue: {\n type: definePropType<UserInput>([Array, String]),\n },\n startPlaceholder: String,\n endPlaceholder: String,\n} as const)\n"],"mappings":";;;;;;;AASY,MAACA,sBAAsB,GAAGC,UAAU,CAAC;EAC/CC,EAAE,EAAE;IACFC,IAAI,EAAEC,cAAc,CAAC,CAACC,KAAK,EAAEC,MAAM,CAAC;EACxC,CAAG;EACDC,IAAI,EAAE;IACJJ,IAAI,EAAEC,cAAc,CAAC,CAACC,KAAK,EAAEC,MAAM,CAAC;EACxC,CAAG;EACDE,WAAW,EAAE;IACXL,IAAI,EAAEG,MAAM;IACZG,OAAO,EAAE;EACb,CAAG;EACDC,MAAM,EAAEJ,MAAM;EACdK,WAAW,EAAEL,MAAM;EACnBM,UAAU,EAAEN,MAAM;EAClBO,UAAU,EAAEP,MAAM;EAClBH,IAAI,EAAE;IACJA,IAAI,EAAEG,MAAM;IACZG,OAAO,EAAE;EACb,CAAG;EACDK,SAAS,EAAE;IACTX,IAAI,EAAEY,OAAO;IACbN,OAAO,EAAE;EACb,CAAG;EACDO,SAAS,EAAE;IACTb,IAAI,EAAEC,cAAc,CAAC,CAACE,MAAM,EAAEW,MAAM,CAAC,CAAC;IACtCR,OAAO,EAAES;EACb,CAAG;EACDC,QAAQ,EAAE;IACRhB,IAAI,EAAEY,OAAO;IACbN,OAAO,EAAE;EACb,CAAG;EACDW,UAAU,EAAE;IACVjB,IAAI,EAAEC,cAAc,CAAC,CAACE,MAAM,EAAEW,MAAM,CAAC,CAAC;IACtCR,OAAO,EAAE;EACb,CAAG;EACDY,IAAI,EAAEC,WAAW;EACjBC,QAAQ,EAAER,OAAO;EACjBS,QAAQ,EAAET,OAAO;EACjBU,WAAW,EAAE;IACXtB,IAAI,EAAEG,MAAM;IACZG,OAAO,EAAE;EACb,CAAG;EACDiB,aAAa,EAAE;IACbvB,IAAI,EAAEC,cAAc,CAACa,MAAM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