{"version":3,"file":"shared.js","sources":["../../../../../../../packages/components/date-picker/src/props/shared.ts"],"sourcesContent":["import { buildProps, definePropType, isArray } from '@element-plus/utils'\nimport { datePickTypes } from '@element-plus/constants'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type { DatePickType } from '@element-plus/constants'\n\nconst selectionModes = [\n 'date',\n 'dates',\n 'year',\n 'years',\n 'month',\n 'months',\n 'week',\n 'range',\n]\n\nexport type RangeState = {\n endDate: null | Dayjs\n selecting: boolean\n}\n\nexport type DisabledDateType = (date: Date) => boolean\n\nexport const datePickerSharedProps = buildProps({\n disabledDate: {\n type: definePropType(Function),\n },\n date: {\n type: definePropType(Object),\n required: true,\n },\n minDate: {\n type: definePropType(Object),\n },\n maxDate: {\n type: definePropType(Object),\n },\n parsedValue: {\n type: definePropType([Object, Array]),\n },\n rangeState: {\n type: definePropType(Object),\n default: () => ({\n endDate: null,\n selecting: false,\n }),\n },\n} as const)\n\nexport const panelSharedProps = buildProps({\n type: {\n type: definePropType(String),\n required: true,\n values: datePickTypes,\n },\n dateFormat: String,\n timeFormat: String,\n} as const)\n\nexport const panelRangeSharedProps = buildProps({\n unlinkPanels: Boolean,\n parsedValue: {\n type: definePropType(Array),\n },\n} as const)\n\nexport const selectionModeWithDefault = (\n mode: typeof selectionModes[number]\n) => {\n return {\n type: String,\n values: selectionModes,\n default: mode,\n }\n}\n\nexport const rangePickerSharedEmits = {\n pick: (range: [Dayjs, Dayjs]) => isArray(range),\n}\n\nexport type RangePickerSharedEmits = typeof rangePickerSharedEmits\nexport type PanelRangeSharedProps = ExtractPropTypes<\n typeof panelRangeSharedProps\n>\n"],"names":["buildProps","definePropType","datePickTypes","isArray"],"mappings":";;;;;;;;;;AAEA,MAAM,cAAc,GAAG;AACvB,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAE,MAAM;AACR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