@element-plus/nightly 0.0.20260319 → 0.0.20260321
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.full.js +4 -4
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +4 -4
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/calendar/src/use-date-table.mjs +2 -1
- package/es/components/calendar/src/use-date-table.mjs.map +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.mjs.map +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +2 -1
- package/lib/components/calendar/src/use-date-table.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { ArrowDown, CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type SelectV2 from './select.vue'\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\n/**\n * @description Tag tooltip configuration interface\n */\nexport interface TagTooltipProps {\n appendTo?: string | HTMLElement\n placement?: Placement\n fallbackPlacements?: Placement[]\n effect?: PopperEffect\n popperClass?: string\n popperStyle?: string | CSSProperties\n transition?: string\n teleported?: boolean\n popperOptions?: Partial<Options>\n showAfter?: number\n hideAfter?: number\n autoClose?: number\n offset?: number\n}\n\nexport const selectV2Props = buildProps({\n /**\n * @description whether creating new items is allowed. To use this, `filterable` must be true\n */\n allowCreate: Boolean,\n /**\n * @description autocomplete of select input\n */\n autocomplete: {\n type: definePropType<'none' | 'both' | 'list' | 'inline'>(String),\n default: 'none',\n },\n /**\n * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n */\n automaticDropdown: Boolean,\n /**\n * @description whether select can be cleared\n */\n clearable: Boolean,\n /**\n * @description custom clear icon\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to collapse tags to a text when multiple selecting\n */\n collapseTags: Boolean,\n /**\n * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n */\n collapseTagsTooltip: Boolean,\n /**\n * @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true\n */\n tagTooltip: {\n type: definePropType<TagTooltipProps>(Object),\n default: () => ({}),\n },\n /**\n * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n */\n maxCollapseTags: {\n type: Number,\n default: 1,\n },\n /**\n * @description\n */\n defaultFirstOption: Boolean,\n /**\n * @description is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description whether Select is filterable\n */\n filterable: Boolean,\n /**\n * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true\n */\n filterMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description The height of the dropdown panel, 34px for each item\n */\n height: {\n type: Number,\n default: 274, // same as select dropdown menu\n },\n /**\n * @description The height of the dropdown item\n */\n itemHeight: {\n type: Number,\n default: 34,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description whether Select is loading data from server\n */\n loading: Boolean,\n /**\n * @description displayed text while loading data from server, default is 'Loading'\n */\n loadingText: String,\n /**\n * @description biding value\n */\n modelValue: {\n type: definePropType<\n any[] | string | number | boolean | Record<string, any> | any\n >([Array, String, Number, Boolean, Object]),\n default: undefined,\n },\n /**\n * @description is multiple\n */\n multiple: Boolean,\n /**\n * @description maximum number of options user can select when multiple is true. No limit when set to 0\n */\n multipleLimit: {\n type: Number,\n default: 0,\n },\n /**\n * @description the name attribute of select input\n */\n name: String,\n /**\n * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n */\n noDataText: String,\n /**\n * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n */\n noMatchText: String,\n /**\n * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n */\n remoteMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description whether reserve the keyword after select filtered option.\n */\n reserveKeyword: {\n type: Boolean,\n default: true,\n },\n /**\n * @description data of the options, the key of `value` and `label` can be customize by `props`\n */\n options: {\n type: definePropType<OptionType[]>(Array),\n required: true,\n },\n /**\n * @description placeholder, the default is 'Please select'\n */\n placeholder: {\n type: String,\n },\n /**\n * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom class name for Select's dropdown\n */\n popperClass: useTooltipContentProps.popperClass,\n /**\n * @description custom style for Select's dropdown\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}) as Partial<Options>,\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\n /**\n * @description debounce delay during remote search, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description configuration options, see the following table\n */\n props: {\n type: definePropType<Props>(Object),\n default: () => defaultProps,\n },\n /**\n * @description unique identity key name for value, required when value is an object\n */\n valueKey: {\n type: String,\n default: 'value',\n },\n /**\n * @description Controls whether the scrollbar is always displayed\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the dropdown\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description in remote search method show suffix icon\n */\n remoteShowSuffix: Boolean,\n /**\n * @description Determines whether the arrow is displayed\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType<Placement>(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom-start', 'top-start', 'right', 'left'],\n },\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description which element the select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description if it is `true`, the width of the dropdown panel is the same as the input box.\n * if it is `false`, the width is automatically calculated based on the value of `label`,\n * or it can be set to a number to make it a fixed width\n */\n fitInputWidth: {\n type: [Boolean, Number],\n default: true,\n validator(val) {\n return isBoolean(val) || isNumber(val)\n },\n },\n suffixIcon: {\n type: iconPropType,\n default: ArrowDown,\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const optionV2Props = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType<Option>(Object),\n required: true,\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n} as const)\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectV2Emits = {\n [UPDATE_MODEL_EVENT]: (val: SelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: SelectV2Props['modelValue']) => true,\n 'remove-tag': (val: unknown) => true,\n 'visible-change': (visible: boolean) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport const optionV2Emits = {\n hover: (index?: number) => isNumber(index),\n select: (val: Option, index?: number) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type SelectV2Props = ExtractPropTypes<typeof selectV2Props>\nexport type SelectV2PropsPublic = ExtractPublicPropTypes<typeof selectV2Props>\nexport type OptionV2Props = ExtractPropTypes<typeof optionV2Props>\nexport type OptionV2PropsPublic = ExtractPublicPropTypes<typeof optionV2Props>\nexport type SelectV2EmitFn = EmitFn<typeof selectV2Emits>\nexport type OptionV2EmitFn = EmitFn<typeof optionV2Emits>\n\nexport type SelectV2Instance = InstanceType<typeof SelectV2> & unknown\n"],"mappings":";;;;;;;;;;;;;;AAqDA,MAAa,gBAAgB,WAAW;CAItC,aAAa;CAIb,cAAc;EACZ,MAAM,eAAoD,OAAO;EACjE,SAAS;EACV;CAID,mBAAmB;CAInB,WAAW;CAIX,WAAW;EACT,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM,eAA6B,OAAO;EAC1C,SAAS;EACV;CAID,cAAc;CAId,qBAAqB;CAIrB,YAAY;EACV,MAAM,eAAgC,OAAO;EAC7C,gBAAgB,EAAE;EACnB;CAID,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CAID,oBAAoB;CAIpB,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,uBAAuB;EACrB,MAAM;EACN,SAAS;EACV;CAID,YAAY;CAIZ,cAAc,EACZ,MAAM,eAAwC,SAAS,EACxD;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EAC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,SAAS,OAAO;EACvB,SAAS;EACT,UAAU,KAAK;AACb,UAAO,UAAU,IAAI,IAAI,SAAS,IAAI;;EAEzC;CACD,YAAY;EACV,MAAM;EACN,SAAS;EACV;CACD,GAAG;CACH,GAAG,aAAa,CAAC,YAAY,CAAC;CAC/B,CAAU;AAEX,MAAa,gBAAgB,WAAW;CACtC,MAAM;CACN,UAAU;CACV,UAAU;CACV,MAAM;EACJ,MAAM,eAAuB,OAAO;EACpC,UAAU;EACX;CACD,OAAO;CACP,OAAO;CACP,UAAU;CACV,SAAS;CACV,CAAU;AAGX,MAAa,gBAAgB;EAC1B,sBAAsB,QAAqC;EAC3D,gBAAgB,QAAqC;CACtD,eAAe,QAAiB;CAChC,mBAAmB,YAAqB;CACxC,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,aAAa;CACd;AACD,MAAa,gBAAgB;CAC3B,QAAQ,UAAmB,SAAS,MAAM;CAC1C,SAAS,KAAa,UAAmB;CAC1C"}
|
|
1
|
+
{"version":3,"file":"defaults.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { ArrowDown, CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type SelectV2 from './select.vue'\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\n/**\n * @description Tag tooltip configuration interface\n */\nexport interface TagTooltipProps {\n appendTo?: string | HTMLElement\n placement?: Placement\n fallbackPlacements?: Placement[]\n effect?: PopperEffect\n popperClass?: string\n popperStyle?: string | CSSProperties\n transition?: string\n teleported?: boolean\n popperOptions?: Partial<Options>\n showAfter?: number\n hideAfter?: number\n autoClose?: number\n offset?: number\n}\n\nexport const selectV2Props = buildProps({\n /**\n * @description whether creating new items is allowed. To use this, `filterable` must be true\n */\n allowCreate: Boolean,\n /**\n * @description autocomplete of select input\n */\n autocomplete: {\n type: definePropType<'none' | 'both' | 'list' | 'inline'>(String),\n default: 'none',\n },\n /**\n * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n */\n automaticDropdown: Boolean,\n /**\n * @description whether select can be cleared\n */\n clearable: Boolean,\n /**\n * @description custom clear icon\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to collapse tags to a text when multiple selecting\n */\n collapseTags: Boolean,\n /**\n * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n */\n collapseTagsTooltip: Boolean,\n /**\n * @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true\n */\n tagTooltip: {\n type: definePropType<TagTooltipProps>(Object),\n default: () => ({}),\n },\n /**\n * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n */\n maxCollapseTags: {\n type: Number,\n default: 1,\n },\n /**\n * @description\n */\n defaultFirstOption: Boolean,\n /**\n * @description is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description Estimated item height for variable option sizes. Defaults to fixed `itemHeight` when omitted.\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description whether Select is filterable\n */\n filterable: Boolean,\n /**\n * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true\n */\n filterMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description The height of the dropdown panel, 34px for each item\n */\n height: {\n type: Number,\n default: 274, // same as select dropdown menu\n },\n /**\n * @description The height of the dropdown item\n */\n itemHeight: {\n type: Number,\n default: 34,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description whether Select is loading data from server\n */\n loading: Boolean,\n /**\n * @description displayed text while loading data from server, default is 'Loading'\n */\n loadingText: String,\n /**\n * @description biding value\n */\n modelValue: {\n type: definePropType<\n any[] | string | number | boolean | Record<string, any> | any\n >([Array, String, Number, Boolean, Object]),\n default: undefined,\n },\n /**\n * @description is multiple\n */\n multiple: Boolean,\n /**\n * @description maximum number of options user can select when multiple is true. No limit when set to 0\n */\n multipleLimit: {\n type: Number,\n default: 0,\n },\n /**\n * @description the name attribute of select input\n */\n name: String,\n /**\n * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n */\n noDataText: String,\n /**\n * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n */\n noMatchText: String,\n /**\n * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n */\n remoteMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description whether reserve the keyword after select filtered option.\n */\n reserveKeyword: {\n type: Boolean,\n default: true,\n },\n /**\n * @description data of the options, the key of `value` and `label` can be customize by `props`\n */\n options: {\n type: definePropType<OptionType[]>(Array),\n required: true,\n },\n /**\n * @description placeholder, the default is 'Please select'\n */\n placeholder: {\n type: String,\n },\n /**\n * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom class name for Select's dropdown\n */\n popperClass: useTooltipContentProps.popperClass,\n /**\n * @description custom style for Select's dropdown\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}) as Partial<Options>,\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\n /**\n * @description debounce delay during remote search, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description configuration options, see the following table\n */\n props: {\n type: definePropType<Props>(Object),\n default: () => defaultProps,\n },\n /**\n * @description unique identity key name for value, required when value is an object\n */\n valueKey: {\n type: String,\n default: 'value',\n },\n /**\n * @description Controls whether the scrollbar is always displayed\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the dropdown\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description in remote search method show suffix icon\n */\n remoteShowSuffix: Boolean,\n /**\n * @description Determines whether the arrow is displayed\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType<Placement>(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom-start', 'top-start', 'right', 'left'],\n },\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description which element the select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description if it is `true`, the width of the dropdown panel is the same as the input box.\n * if it is `false`, the width is automatically calculated based on the value of `label`,\n * or it can be set to a number to make it a fixed width\n */\n fitInputWidth: {\n type: [Boolean, Number],\n default: true,\n validator(val) {\n return isBoolean(val) || isNumber(val)\n },\n },\n suffixIcon: {\n type: iconPropType,\n default: ArrowDown,\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const optionV2Props = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType<Option>(Object),\n required: true,\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n} as const)\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectV2Emits = {\n [UPDATE_MODEL_EVENT]: (val: SelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: SelectV2Props['modelValue']) => true,\n 'remove-tag': (val: unknown) => true,\n 'visible-change': (visible: boolean) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport const optionV2Emits = {\n hover: (index?: number) => isNumber(index),\n select: (val: Option, index?: number) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type SelectV2Props = ExtractPropTypes<typeof selectV2Props>\nexport type SelectV2PropsPublic = ExtractPublicPropTypes<typeof selectV2Props>\nexport type OptionV2Props = ExtractPropTypes<typeof optionV2Props>\nexport type OptionV2PropsPublic = ExtractPublicPropTypes<typeof optionV2Props>\nexport type SelectV2EmitFn = EmitFn<typeof selectV2Emits>\nexport type OptionV2EmitFn = EmitFn<typeof optionV2Emits>\n\nexport type SelectV2Instance = InstanceType<typeof SelectV2> & unknown\n"],"mappings":";;;;;;;;;;;;;;AAqDA,MAAa,gBAAgB,WAAW;CAItC,aAAa;CAIb,cAAc;EACZ,MAAM,eAAoD,OAAO;EACjE,SAAS;EACV;CAID,mBAAmB;CAInB,WAAW;CAIX,WAAW;EACT,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM,eAA6B,OAAO;EAC1C,SAAS;EACV;CAID,cAAc;CAId,qBAAqB;CAIrB,YAAY;EACV,MAAM,eAAgC,OAAO;EAC7C,gBAAgB,EAAE;EACnB;CAID,iBAAiB;EACf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D;CAID,SAAS;EAAE,GAAG,SAAS;EAAM,SAAS;EAAQ;CAI9C,WAAW;EAAE,GAAG,SAAS;EAAQ,SAAS;EAAS;CAInD,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,UAAU,uBAAuB;CAMjC,eAAe;EACb,MAAM,CAAC,SAAS,OAAO;EACvB,SAAS;EACT,UAAU,KAAK;AACb,UAAO,UAAU,IAAI,IAAI,SAAS,IAAI;;EAEzC;CACD,YAAY;EACV,MAAM;EACN,SAAS;EACV;CACD,GAAG;CACH,GAAG,aAAa,CAAC,YAAY,CAAC;CAC/B,CAAU;AAEX,MAAa,gBAAgB,WAAW;CACtC,MAAM;CACN,UAAU;CACV,UAAU;CACV,MAAM;EACJ,MAAM,eAAuB,OAAO;EACpC,UAAU;EACX;CACD,OAAO;CACP,OAAO;CACP,UAAU;CACV,SAAS;CACV,CAAU;AAGX,MAAa,gBAAgB;EAC1B,sBAAsB,QAAqC;EAC3D,gBAAgB,QAAqC;CACtD,eAAe,QAAiB;CAChC,mBAAmB,YAAqB;CACxC,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,aAAa;CACd;AACD,MAAa,gBAAgB;CAC3B,QAAQ,UAAmB,SAAS,MAAM;CAC1C,SAAS,KAAa,UAAmB;CAC1C"}
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20260321'\n"],"mappings":";AAAA,MAAa,UAAU"}
|
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
|
|
3
3
|
const require_date = require('../../../constants/date.js');
|
|
4
4
|
const require_index = require('../../../hooks/use-locale/index.js');
|
|
5
|
+
const require_constants = require('../../time-picker/src/constants.js');
|
|
5
6
|
const require_utils = require('../../time-picker/src/utils.js');
|
|
6
7
|
const require_date_table = require('./date-table.js');
|
|
7
8
|
let vue = require("vue");
|
|
@@ -71,7 +72,7 @@ const useDateTable = (props, emit) => {
|
|
|
71
72
|
return {
|
|
72
73
|
isSelected: day.isSame(props.selectedDay),
|
|
73
74
|
type: `${type}-month`,
|
|
74
|
-
day: day.format(
|
|
75
|
+
day: day.format(require_constants.DEFAULT_FORMATS_DATE),
|
|
75
76
|
date: day.toDate()
|
|
76
77
|
};
|
|
77
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-date-table.js","names":["localeData","useLocale","rangeArr","getPrevMonthLastDays","getMonthDays","toNestedArr","WEEK_DAYS"],"sources":["../../../../../../packages/components/calendar/src/use-date-table.ts"],"sourcesContent":["import { computed } from 'vue'\nimport dayjs from 'dayjs'\nimport localeData from 'dayjs/plugin/localeData.js'\nimport { useLocale } from '@element-plus/hooks'\nimport {
|
|
1
|
+
{"version":3,"file":"use-date-table.js","names":["localeData","useLocale","rangeArr","getPrevMonthLastDays","getMonthDays","toNestedArr","WEEK_DAYS","DEFAULT_FORMATS_DATE"],"sources":["../../../../../../packages/components/calendar/src/use-date-table.ts"],"sourcesContent":["import { computed } from 'vue'\nimport dayjs from 'dayjs'\nimport localeData from 'dayjs/plugin/localeData.js'\nimport { useLocale } from '@element-plus/hooks'\nimport {\n DEFAULT_FORMATS_DATE,\n rangeArr,\n} from '@element-plus/components/time-picker'\nimport { WEEK_DAYS } from '@element-plus/constants'\nimport { getMonthDays, getPrevMonthLastDays, toNestedArr } from './date-table'\n\nimport type { SetupContext } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type {\n CalendarDateCell,\n CalendarDateCellType,\n DateTableEmits,\n DateTableProps,\n} from './date-table'\n\nexport const useDateTable = (\n props: DateTableProps,\n emit: SetupContext<DateTableEmits>['emit']\n) => {\n dayjs.extend(localeData)\n // https://day.js.org/docs/en/i18n/locale-data\n const firstDayOfWeek: number = dayjs.localeData().firstDayOfWeek()\n\n const { t, lang } = useLocale()\n const now = dayjs().locale(lang.value)\n\n const isInRange = computed(() => !!props.range && !!props.range.length)\n\n const rows = computed(() => {\n let days: CalendarDateCell[] = []\n if (isInRange.value) {\n const [start, end] = props.range!\n const currentMonthRange: CalendarDateCell[] = rangeArr(\n end.date() - start.date() + 1\n ).map((index) => ({\n text: start.date() + index,\n type: 'current',\n }))\n\n let remaining = currentMonthRange.length % 7\n remaining = remaining === 0 ? 0 : 7 - remaining\n const nextMonthRange: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = currentMonthRange.concat(nextMonthRange)\n } else {\n const firstDay = props.date.startOf('month').day()\n const prevMonthDays: CalendarDateCell[] = getPrevMonthLastDays(\n props.date,\n (firstDay - firstDayOfWeek + 7) % 7\n ).map((day) => ({\n text: day,\n type: 'prev',\n }))\n const currentMonthDays: CalendarDateCell[] = getMonthDays(props.date).map(\n (day) => ({\n text: day,\n type: 'current',\n })\n )\n days = [...prevMonthDays, ...currentMonthDays]\n const remaining = 7 - (days.length % 7 || 7)\n const nextMonthDays: CalendarDateCell[] = rangeArr(remaining).map(\n (_, index) => ({\n text: index + 1,\n type: 'next',\n })\n )\n days = days.concat(nextMonthDays)\n }\n return toNestedArr(days)\n })\n\n const weekDays = computed(() => {\n const start = firstDayOfWeek\n if (start === 0) {\n return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`))\n } else {\n return WEEK_DAYS.slice(start)\n .concat(WEEK_DAYS.slice(0, start))\n .map((_) => t(`el.datepicker.weeks.${_}`))\n }\n })\n\n const getFormattedDate = (day: number, type: CalendarDateCellType): Dayjs => {\n switch (type) {\n case 'prev':\n return props.date.startOf('month').subtract(1, 'month').date(day)\n case 'next':\n return props.date.startOf('month').add(1, 'month').date(day)\n case 'current':\n return props.date.date(day)\n }\n }\n\n const handlePickDay = ({ text, type }: CalendarDateCell) => {\n const date = getFormattedDate(text, type)\n emit('pick', date)\n }\n\n const getSlotData = ({ text, type }: CalendarDateCell) => {\n const day = getFormattedDate(text, type)\n return {\n isSelected: day.isSame(props.selectedDay),\n type: `${type}-month`,\n day: day.format(DEFAULT_FORMATS_DATE),\n date: day.toDate(),\n }\n }\n\n return {\n now,\n isInRange,\n rows,\n weekDays,\n getFormattedDate,\n handlePickDay,\n getSlotData,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,gBACX,OACA,SACG;AACH,eAAM,OAAOA,mCAAW;CAExB,MAAM,iBAAyB,cAAM,YAAY,CAAC,gBAAgB;CAElE,MAAM,EAAE,GAAG,SAASC,yBAAW;CAC/B,MAAM,0BAAa,CAAC,OAAO,KAAK,MAAM;CAEtC,MAAM,oCAA2B,CAAC,CAAC,MAAM,SAAS,CAAC,CAAC,MAAM,MAAM,OAAO;CAEvE,MAAM,+BAAsB;EAC1B,IAAI,OAA2B,EAAE;AACjC,MAAI,UAAU,OAAO;GACnB,MAAM,CAAC,OAAO,OAAO,MAAM;GAC3B,MAAM,oBAAwCC,uBAC5C,IAAI,MAAM,GAAG,MAAM,MAAM,GAAG,EAC7B,CAAC,KAAK,WAAW;IAChB,MAAM,MAAM,MAAM,GAAG;IACrB,MAAM;IACP,EAAE;GAEH,IAAI,YAAY,kBAAkB,SAAS;AAC3C,eAAY,cAAc,IAAI,IAAI,IAAI;GACtC,MAAM,iBAAqCA,uBAAS,UAAU,CAAC,KAC5D,GAAG,WAAW;IACb,MAAM,QAAQ;IACd,MAAM;IACP,EACF;AACD,UAAO,kBAAkB,OAAO,eAAe;SAC1C;GACL,MAAM,WAAW,MAAM,KAAK,QAAQ,QAAQ,CAAC,KAAK;GAClD,MAAM,gBAAoCC,wCACxC,MAAM,OACL,WAAW,iBAAiB,KAAK,EACnC,CAAC,KAAK,SA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A;EACA;EACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-date-pick.js","names":[],"sources":["../../../../../../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ppNs.b(),\n dpNs.b(),\n ppNs.is('border', border),\n ppNs.is('disabled', dateDisabled),\n {\n 'has-sidebar': $slots.sidebar || hasShortcuts,\n 'has-time': showTime,\n },\n ]\"\n >\n <div :class=\"ppNs.e('body-wrapper')\">\n <slot name=\"sidebar\" :class=\"ppNs.e('sidebar')\" />\n <div v-if=\"hasShortcuts\" :class=\"ppNs.e('sidebar')\">\n <button\n v-for=\"(shortcut, key) in shortcuts\"\n :key=\"key\"\n type=\"button\"\n :disabled=\"dateDisabled\"\n :class=\"ppNs.e('shortcut')\"\n @click=\"handleShortcutClick(shortcut)\"\n >\n {{ shortcut.text }}\n </button>\n </div>\n <div :class=\"ppNs.e('body')\">\n <div v-if=\"showTime\" :class=\"dpNs.e('time-header')\">\n <span :class=\"dpNs.e('editor-wrap')\">\n <el-input\n :placeholder=\"t('el.datepicker.selectDate')\"\n :model-value=\"visibleDate\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @input=\"(val) => (userInputDate = val)\"\n @change=\"handleVisibleDateChange\"\n />\n </span>\n <span\n v-click-outside=\"handleTimePickClose\"\n :class=\"dpNs.e('editor-wrap')\"\n >\n <el-input\n :placeholder=\"t('el.datepicker.selectTime')\"\n :model-value=\"visibleTime\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @focus=\"onTimePickerInputFocus\"\n @input=\"(val) => (userInputTime = val)\"\n @change=\"handleVisibleTimeChange\"\n />\n <time-pick-panel\n :visible=\"timePickerVisible\"\n :format=\"timeFormat\"\n :parsed-value=\"innerDate\"\n @pick=\"handleTimePick\"\n />\n </span>\n </div>\n <div\n v-show=\"currentView !== 'time'\"\n :class=\"[\n dpNs.e('header'),\n (currentView === 'year' || currentView === 'month') &&\n dpNs.em('header', 'bordered'),\n ]\"\n >\n <span :class=\"dpNs.e('prev-btn')\">\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevYear`)\"\n class=\"d-arrow-left\"\n :class=\"ppNs.e('icon-btn')\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(false)\"\n >\n <slot name=\"prev-year\">\n <el-icon><d-arrow-left /></el-icon>\n </slot>\n </button>\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-left\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(false)\"\n >\n <slot name=\"prev-month\">\n <el-icon><arrow-left /></el-icon>\n </slot>\n </button>\n </span>\n <span\n role=\"button\"\n :class=\"dpNs.e('header-label')\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n @keydown.enter=\"showPicker('year')\"\n @click=\"showPicker('year')\"\n >{{ yearLabel }}</span\n >\n <span\n v-show=\"currentView === 'date'\"\n role=\"button\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n :class=\"[\n dpNs.e('header-label'),\n { active: currentView === 'month' },\n ]\"\n @keydown.enter=\"showPicker('month')\"\n @click=\"showPicker('month')\"\n >{{ t(`el.datepicker.month${month + 1}`) }}</span\n >\n <span :class=\"dpNs.e('next-btn')\">\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(true)\"\n >\n <slot name=\"next-month\">\n <el-icon><arrow-right /></el-icon>\n </slot>\n </button>\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextYear`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"d-arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(true)\"\n >\n <slot name=\"next-year\">\n <el-icon><d-arrow-right /></el-icon>\n </slot>\n </button>\n </span>\n </div>\n <div :class=\"ppNs.e('content')\" @keydown=\"handleKeydownTable\">\n <date-table\n v-if=\"currentView === 'date'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n :show-week-number=\"showWeekNumber\"\n @pick=\"handleDatePick\"\n />\n <year-table\n v-if=\"currentView === 'year'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :parsed-value=\"parsedValue\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleYearPick\"\n />\n <month-table\n v-if=\"currentView === 'month'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleMonthPick\"\n />\n </div>\n </div>\n </div>\n <div\n v-if=\"showFooter && footerVisible && footerFilled\"\n :class=\"ppNs.e('footer')\"\n >\n <el-button\n v-show=\"!isMultipleType && showNow\"\n text\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledNow\"\n @click=\"changeToNow\"\n >\n {{ t('el.datepicker.now') }}\n </el-button>\n <el-button\n v-if=\"showConfirm\"\n plain\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledConfirm\"\n @click=\"onConfirm\"\n >\n {{ t('el.datepicker.confirm') }}\n </el-button>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n ref,\n toRef,\n useAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport dayjs from 'dayjs'\nimport ElButton from '@element-plus/components/button'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport {\n DEFAULT_FORMATS_DATE,\n DEFAULT_FORMATS_TIME,\n PICKER_BASE_INJECTION_KEY,\n TimePickPanel,\n extractDateFormat,\n extractTimeFormat,\n} from '@element-plus/components/time-picker'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n extractFirst,\n getEventCode,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ArrowLeft,\n ArrowRight,\n DArrowLeft,\n DArrowRight,\n} from '@element-plus/icons-vue'\nimport { panelDatePickProps } from '../props/panel-date-pick'\nimport {\n correctlyParseUserInput,\n getValidDateOfMonth,\n getValidDateOfYear,\n} from '../utils'\nimport { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY } from '../constants'\nimport DateTable from './basic-date-table.vue'\nimport MonthTable from './basic-month-table.vue'\nimport YearTable from './basic-year-table.vue'\nimport { useFormDisabled } from '@element-plus/components/form'\n\nimport type { SetupContext } from 'vue'\nimport type { ConfigType, Dayjs } from 'dayjs'\nimport type { PanelDatePickProps } from '../props/panel-date-pick'\nimport type {\n DateTableEmits,\n DatesPickerEmits,\n MonthsPickerEmits,\n WeekPickerEmits,\n YearsPickerEmits,\n} from '../props/basic-date-table'\n\ntype DatePickType = PanelDatePickProps['type']\n// todo\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst timeWithinRange = (_: ConfigType, __: any, ___: string) => true\nconst props = defineProps(panelDatePickProps)\nconst contextEmit = defineEmits(['pick', 'set-picker-option', 'panel-change'])\nconst ppNs = useNamespace('picker-panel')\nconst dpNs = useNamespace('date-picker')\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst { t, lang } = useLocale()\nconst pickerBase = inject(PICKER_BASE_INJECTION_KEY) as any\nconst isDefaultFormat = inject(\n ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,\n undefined\n) as any\nconst { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props\nconst defaultValue = toRef(pickerBase.props, 'defaultValue')\n\nconst currentViewRef = ref<{ focus: () => void }>()\n\nconst innerDate = ref(dayjs().locale(lang.value))\n\nconst isChangeToNow = ref(false)\n\nlet isShortcut = false\n\nconst defaultTimeD = computed(() => {\n return dayjs(defaultTime).locale(lang.value)\n})\n\nconst month = computed(() => {\n return innerDate.value.month()\n})\n\nconst year = computed(() => {\n return innerDate.value.year()\n})\n\nconst selectableRange = ref([])\nconst userInputDate = ref<string | null>(null)\nconst userInputTime = ref<string | null>(null)\n// todo update to disableHour\nconst checkDateWithinRange = (date: ConfigType) => {\n return selectableRange.value.length > 0\n ? timeWithinRange(date, selectableRange.value, props.format || 'HH:mm:ss')\n : true\n}\nconst formatEmit = (emitDayjs: Dayjs) => {\n if (\n defaultTime &&\n !visibleTime.value &&\n !isChangeToNow.value &&\n !isShortcut\n ) {\n return defaultTimeD.value\n .year(emitDayjs.year())\n .month(emitDayjs.month())\n .date(emitDayjs.date())\n }\n if (showTime.value) return emitDayjs.millisecond(0)\n return emitDayjs.startOf('day')\n}\nconst emit = (value: Dayjs | Dayjs[], ...args: any[]) => {\n if (!value) {\n contextEmit('pick', value, ...args)\n } else if (isArray(value)) {\n const dates = value.map(formatEmit)\n contextEmit('pick', dates, ...args)\n } else {\n contextEmit('pick', formatEmit(value), ...args)\n }\n userInputDate.value = null\n userInputTime.value = null\n isChangeToNow.value = false\n isShortcut = false\n}\nconst handleDatePick = async (value: DateTableEmits, keepOpen?: boolean) => {\n if (selectionMode.value === 'date' && dayjs.isDayjs(value)) {\n const parsedDateValue = extractFirst(props.parsedValue)\n let newDate = parsedDateValue\n ? parsedDateValue\n .year(value.year())\n .month(value.month())\n .date(value.date())\n : value\n // change default time while out of selectableRange\n if (!checkDateWithinRange(newDate)) {\n newDate = (selectableRange.value[0][0] as Dayjs)\n .year(value.year())\n .month(value.month())\n .date(value.date())\n }\n innerDate.value = newDate\n emit(newDate, showTime.value || keepOpen)\n } else if (selectionMode.value === 'week') {\n emit((value as WeekPickerEmits).date)\n } else if (selectionMode.value === 'dates') {\n emit(value as DatesPickerEmits, true) // set true to keep panel open\n }\n}\n\nconst moveByMonth = (forward: boolean) => {\n const action = forward ? 'add' : 'subtract'\n innerDate.value = innerDate.value[action](1, 'month')\n handlePanelChange('month')\n}\n\nconst moveByYear = (forward: boolean) => {\n const currentDate = innerDate.value\n const action = forward ? 'add' : 'subtract'\n\n innerDate.value =\n currentView.value === 'year'\n ? currentDate[action](10, 'year')\n : currentDate[action](1, 'year')\n\n handlePanelChange('year')\n}\n\nconst currentView = ref('date')\n\nconst yearLabel = computed(() => {\n const yearTranslation = t('el.datepicker.year')\n if (currentView.value === 'year') {\n const startYear = Math.floor(year.value / 10) * 10\n if (yearTranslation) {\n return `${startYear} ${yearTranslation} - ${\n startYear + 9\n } ${yearTranslation}`\n }\n return `${startYear} - ${startYear + 9}`\n }\n return `${year.value} ${yearTranslation}`\n})\n\ntype Shortcut = {\n value: (() => Dayjs) | Dayjs\n onClick?: (ctx: Omit<SetupContext, 'expose'>) => void\n}\n\nconst handleShortcutClick = (shortcut: Shortcut) => {\n const shortcutValue = isFunction(shortcut.value)\n ? shortcut.value()\n : shortcut.value\n if (shortcutValue) {\n isShortcut = true\n emit(dayjs(shortcutValue).locale(lang.value))\n return\n }\n if (shortcut.onClick) {\n shortcut.onClick({\n attrs,\n slots,\n emit: contextEmit as SetupContext['emit'],\n })\n }\n}\n\nconst selectionMode = computed<DatePickType>(() => {\n const { type } = props\n if (['week', 'month', 'months', 'year', 'years', 'dates'].includes(type))\n return type\n return 'date'\n})\n\nconst isMultipleType = computed(() => {\n return (\n selectionMode.value === 'dates' ||\n selectionMode.value === 'months' ||\n selectionMode.value === 'years'\n )\n})\n\nconst keyboardMode = computed<string>(() => {\n return selectionMode.value === 'date'\n ? currentView.value\n : selectionMode.value\n})\n\nconst hasShortcuts = computed(() => !!shortcuts.length)\n\nconst handleMonthPick = async (\n month: number | MonthsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'month') {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'months') {\n emit(month as MonthsPickerEmits, keepOpen ?? true)\n } else {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n currentView.value = 'date'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('month')\n}\n\nconst handleYearPick = async (\n year: number | YearsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'year') {\n const data = innerDate.value.startOf('year').year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'years') {\n emit(year as YearsPickerEmits, keepOpen ?? true)\n } else {\n const data = innerDate.value.year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n currentView.value = 'month'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('year')\n}\n\nconst dateDisabled = useFormDisabled()\n\nconst showPicker = async (view: 'month' | 'year') => {\n if (dateDisabled.value) return\n currentView.value = view\n await nextTick()\n handleFocusPicker()\n}\n\nconst showTime = computed(\n () => props.type === 'datetime' || props.type === 'datetimerange'\n)\n\nconst footerVisible = computed(() => {\n const showDateFooter = showTime.value || selectionMode.value === 'dates'\n const showYearFooter = selectionMode.value === 'years'\n const showMonthFooter = selectionMode.value === 'months'\n const isDateView = currentView.value === 'date'\n const isYearView = currentView.value === 'year'\n const isMonthView = currentView.value === 'month'\n return (\n (showDateFooter && isDateView) ||\n (showYearFooter && isYearView) ||\n (showMonthFooter && isMonthView)\n )\n})\n\nconst footerFilled = computed(\n () => (!isMultipleType.value && props.showNow) || props.showConfirm\n)\n\nconst disabledConfirm = computed(() => {\n if (!disabledDate) return false\n if (!props.parsedValue) return true\n if (isArray(props.parsedValue)) {\n return disabledDate(props.parsedValue[0].toDate())\n }\n return disabledDate(props.parsedValue.toDate())\n})\nconst onConfirm = () => {\n if (isMultipleType.value) {\n emit(props.parsedValue as Dayjs[])\n } else {\n // deal with the scenario where: user opens the date time picker, then confirm without doing anything\n let result = extractFirst(props.parsedValue)\n if (!result) {\n const defaultTimeD = dayjs(defaultTime).locale(lang.value)\n const defaultValueD = getDefaultValue()\n result = defaultTimeD\n .year(defaultValueD.year())\n .month(defaultValueD.month())\n .date(defaultValueD.date())\n }\n innerDate.value = result\n emit(result)\n }\n}\n\nconst disabledNow = computed(() => {\n if (!disabledDate) return false\n return disabledDate(dayjs().locale(lang.value).toDate())\n})\nconst changeToNow = () => {\n // NOTE: not a permanent solution\n // consider disable \"now\" button in the future\n const now = dayjs().locale(lang.value)\n const nowDate = now.toDate()\n isChangeToNow.value = true\n if (\n (!disabledDate || !disabledDate(nowDate)) &&\n checkDateWithinRange(nowDate)\n ) {\n innerDate.value = dayjs().locale(lang.value)\n emit(innerDate.value)\n }\n}\n\nconst timeFormat = computed(() => {\n return (\n props.timeFormat || extractTimeFormat(props.format) || DEFAULT_FORMATS_TIME\n )\n})\n\nconst dateFormat = computed(() => {\n return (\n props.dateFormat || extractDateFormat(props.format) || DEFAULT_FORMATS_DATE\n )\n})\n\nconst visibleTime = computed(() => {\n if (userInputTime.value) return userInputTime.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(timeFormat.value)\n})\n\nconst visibleDate = computed(() => {\n if (userInputDate.value) return userInputDate.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(dateFormat.value)\n})\n\nconst timePickerVisible = ref(false)\nconst onTimePickerInputFocus = () => {\n timePickerVisible.value = true\n}\nconst handleTimePickClose = () => {\n timePickerVisible.value = false\n}\n\nconst getUnits = (date: Dayjs) => {\n return {\n hour: date.hour(),\n minute: date.minute(),\n second: date.second(),\n year: date.year(),\n month: date.month(),\n date: date.date(),\n }\n}\n\nconst handleTimePick = (value: Dayjs, visible: boolean, first: boolean) => {\n const { hour, minute, second } = getUnits(value)\n const parsedDateValue = extractFirst(props.parsedValue)\n const newDate = parsedDateValue\n ? parsedDateValue.hour(hour).minute(minute).second(second)\n : value\n innerDate.value = newDate\n emit(innerDate.value, true)\n if (!first) {\n timePickerVisible.value = visible\n }\n}\n\nconst handleVisibleTimeChange = (value: string) => {\n const newDate = dayjs(value, timeFormat.value).locale(lang.value)\n if (newDate.isValid() && checkDateWithinRange(newDate)) {\n const { year, month, date } = getUnits(innerDate.value)\n innerDate.value = newDate.year(year).month(month).date(date)\n userInputTime.value = null\n timePickerVisible.value = false\n emit(innerDate.value, true)\n }\n}\n\nconst handleVisibleDateChange = (value: string) => {\n const newDate = correctlyParseUserInput(\n value,\n dateFormat.value,\n lang.value,\n isDefaultFormat\n ) as Dayjs\n if (newDate.isValid()) {\n if (disabledDate && disabledDate(newDate.toDate())) {\n return\n }\n const { hour, minute, second } = getUnits(innerDate.value)\n innerDate.value = newDate.hour(hour).minute(minute).second(second)\n userInputDate.value = null\n emit(innerDate.value, true)\n }\n}\n\nconst isValidValue = (date: unknown) => {\n return (\n dayjs.isDayjs(date) &&\n date.isValid() &&\n (disabledDate ? !disabledDate(date.toDate()) : true)\n )\n}\n\nconst parseUserInput = (value: Dayjs) => {\n return correctlyParseUserInput(\n value,\n props.format,\n lang.value,\n isDefaultFormat\n )\n}\n\nconst getDefaultValue = () => {\n const parseDate = dayjs(defaultValue.value).locale(lang.value)\n if (!defaultValue.value) {\n const defaultTimeDValue = defaultTimeD.value\n return dayjs()\n .hour(defaultTimeDValue.hour())\n .minute(defaultTimeDValue.minute())\n .second(defaultTimeDValue.second())\n .locale(lang.value)\n }\n return parseDate\n}\n\nconst handleFocusPicker = () => {\n if (['week', 'month', 'year', 'date'].includes(selectionMode.value)) {\n currentViewRef.value?.focus()\n }\n}\n\nconst _handleFocusPicker = () => {\n handleFocusPicker()\n // TODO: After focus the date input, the first time you use the ArrowDown keys, you cannot focus on the date cell\n if (selectionMode.value === 'week') {\n handleKeyControl(EVENT_CODE.down)\n }\n}\n\nconst handleKeydownTable = (event: KeyboardEvent) => {\n const code = getEventCode(event)\n\n const validCode = [\n EVENT_CODE.up,\n EVENT_CODE.down,\n EVENT_CODE.left,\n EVENT_CODE.right,\n EVENT_CODE.home,\n EVENT_CODE.end,\n EVENT_CODE.pageUp,\n EVENT_CODE.pageDown,\n ]\n if (validCode.includes(code)) {\n handleKeyControl(code)\n event.stopPropagation()\n event.preventDefault()\n }\n if (\n [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(\n code\n ) &&\n userInputDate.value === null &&\n userInputTime.value === null\n ) {\n event.preventDefault()\n emit(innerDate.value, false)\n }\n}\n\nconst handleKeyControl = (code: string) => {\n type KeyControlMappingCallableOffset = (date: Date, step?: number) => number\n type KeyControl = {\n [key: string]:\n | number\n | KeyControlMappingCallableOffset\n | ((date: Date, step: number) => any)\n offset: (date: Date, step: number) => any\n }\n interface KeyControlMapping {\n [key: string]: KeyControl\n }\n\n const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE\n const mapping: KeyControlMapping = {\n year: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setFullYear(date.getFullYear() + step),\n },\n month: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setMonth(date.getMonth() + step),\n },\n week: {\n [up]: -1,\n [down]: 1,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setDate(date.getDate() + step * 7),\n },\n date: {\n [up]: -7,\n [down]: 7,\n [left]: -1,\n [right]: 1,\n [home]: (date: Date) => -date.getDay(),\n [end]: (date: Date) => -date.getDay() + 6,\n [pageUp]: (date: Date) =>\n -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),\n [pageDown]: (date: Date) =>\n new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),\n offset: (date: Date, step: number) => date.setDate(date.getDate() + step),\n },\n }\n\n const newDate = innerDate.value.toDate()\n while (Math.abs(innerDate.value.diff(newDate, 'year', true)) < 1) {\n const map = mapping[keyboardMode.value]\n if (!map) return\n map.offset(\n newDate,\n isFunction(map[code])\n ? (map[code] as unknown as KeyControlMappingCallableOffset)(newDate)\n : ((map[code] as number) ?? 0)\n )\n if (disabledDate && disabledDate(newDate)) {\n break\n }\n const result = dayjs(newDate).locale(lang.value)\n innerDate.value = result\n contextEmit('pick', result, true)\n break\n }\n}\n\nconst handlePanelChange = (mode: 'month' | 'year') => {\n contextEmit('panel-change', innerDate.value.toDate(), mode, currentView.value)\n}\n\nwatch(\n () => selectionMode.value,\n (val) => {\n if (['month', 'year'].includes(val)) {\n currentView.value = val\n return\n } else if (val === 'years') {\n currentView.value = 'year'\n return\n } else if (val === 'months') {\n currentView.value = 'month'\n return\n }\n currentView.value = 'date'\n },\n { immediate: true }\n)\n\nwatch(\n () => defaultValue.value,\n (val) => {\n if (val) {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.parsedValue,\n (val) => {\n if (val) {\n if (isMultipleType.value) return\n if (isArray(val)) return\n innerDate.value = val\n } else {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\ncontextEmit('set-picker-option', ['isValidValue', isValidValue])\ncontextEmit('set-picker-option', ['parseUserInput', parseUserInput])\ncontextEmit('set-picker-option', ['handleFocusPicker', _handleFocusPicker])\n</script>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"panel-date-pick.js","names":[],"sources":["../../../../../../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ppNs.b(),\n dpNs.b(),\n ppNs.is('border', border),\n ppNs.is('disabled', dateDisabled),\n {\n 'has-sidebar': $slots.sidebar || hasShortcuts,\n 'has-time': showTime,\n },\n ]\"\n >\n <div :class=\"ppNs.e('body-wrapper')\">\n <slot name=\"sidebar\" :class=\"ppNs.e('sidebar')\" />\n <div v-if=\"hasShortcuts\" :class=\"ppNs.e('sidebar')\">\n <button\n v-for=\"(shortcut, key) in shortcuts\"\n :key=\"key\"\n type=\"button\"\n :disabled=\"dateDisabled\"\n :class=\"ppNs.e('shortcut')\"\n @click=\"handleShortcutClick(shortcut)\"\n >\n {{ shortcut.text }}\n </button>\n </div>\n <div :class=\"ppNs.e('body')\">\n <div v-if=\"showTime\" :class=\"dpNs.e('time-header')\">\n <span :class=\"dpNs.e('editor-wrap')\">\n <el-input\n :placeholder=\"t('el.datepicker.selectDate')\"\n :model-value=\"visibleDate\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @input=\"(val) => (userInputDate = val)\"\n @change=\"handleVisibleDateChange\"\n />\n </span>\n <span\n v-click-outside=\"handleTimePickClose\"\n :class=\"dpNs.e('editor-wrap')\"\n >\n <el-input\n :placeholder=\"t('el.datepicker.selectTime')\"\n :model-value=\"visibleTime\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @focus=\"onTimePickerInputFocus\"\n @input=\"(val) => (userInputTime = val)\"\n @change=\"handleVisibleTimeChange\"\n />\n <time-pick-panel\n :visible=\"timePickerVisible\"\n :format=\"timeFormat\"\n :parsed-value=\"innerDate\"\n @pick=\"handleTimePick\"\n />\n </span>\n </div>\n <div\n v-show=\"currentView !== 'time'\"\n :class=\"[\n dpNs.e('header'),\n (currentView === 'year' || currentView === 'month') &&\n dpNs.em('header', 'bordered'),\n ]\"\n >\n <span :class=\"dpNs.e('prev-btn')\">\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevYear`)\"\n class=\"d-arrow-left\"\n :class=\"ppNs.e('icon-btn')\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(false)\"\n >\n <slot name=\"prev-year\">\n <el-icon><d-arrow-left /></el-icon>\n </slot>\n </button>\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-left\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(false)\"\n >\n <slot name=\"prev-month\">\n <el-icon><arrow-left /></el-icon>\n </slot>\n </button>\n </span>\n <span\n role=\"button\"\n :class=\"dpNs.e('header-label')\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n @keydown.enter=\"showPicker('year')\"\n @click=\"showPicker('year')\"\n >{{ yearLabel }}</span\n >\n <span\n v-show=\"currentView === 'date'\"\n role=\"button\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n :class=\"[\n dpNs.e('header-label'),\n { active: currentView === 'month' },\n ]\"\n @keydown.enter=\"showPicker('month')\"\n @click=\"showPicker('month')\"\n >{{ t(`el.datepicker.month${month + 1}`) }}</span\n >\n <span :class=\"dpNs.e('next-btn')\">\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(true)\"\n >\n <slot name=\"next-month\">\n <el-icon><arrow-right /></el-icon>\n </slot>\n </button>\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextYear`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"d-arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(true)\"\n >\n <slot name=\"next-year\">\n <el-icon><d-arrow-right /></el-icon>\n </slot>\n </button>\n </span>\n </div>\n <div :class=\"ppNs.e('content')\" @keydown=\"handleKeydownTable\">\n <date-table\n v-if=\"currentView === 'date'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n :show-week-number=\"showWeekNumber\"\n @pick=\"handleDatePick\"\n />\n <year-table\n v-if=\"currentView === 'year'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :parsed-value=\"parsedValue\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleYearPick\"\n />\n <month-table\n v-if=\"currentView === 'month'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleMonthPick\"\n />\n </div>\n </div>\n </div>\n <div\n v-if=\"showFooter && footerVisible && footerFilled\"\n :class=\"ppNs.e('footer')\"\n >\n <el-button\n v-show=\"!isMultipleType && showNow\"\n text\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledNow\"\n @click=\"changeToNow\"\n >\n {{ t('el.datepicker.now') }}\n </el-button>\n <el-button\n v-if=\"showConfirm\"\n plain\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledConfirm\"\n @click=\"onConfirm\"\n >\n {{ t('el.datepicker.confirm') }}\n </el-button>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n ref,\n toRef,\n useAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport dayjs from 'dayjs'\nimport ElButton from '@element-plus/components/button'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport {\n DEFAULT_FORMATS_DATE,\n DEFAULT_FORMATS_TIME,\n PICKER_BASE_INJECTION_KEY,\n TimePickPanel,\n extractDateFormat,\n extractTimeFormat,\n} from '@element-plus/components/time-picker'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n extractFirst,\n getEventCode,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ArrowLeft,\n ArrowRight,\n DArrowLeft,\n DArrowRight,\n} from '@element-plus/icons-vue'\nimport { panelDatePickProps } from '../props/panel-date-pick'\nimport {\n correctlyParseUserInput,\n getValidDateOfMonth,\n getValidDateOfYear,\n} from '../utils'\nimport { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY } from '../constants'\nimport DateTable from './basic-date-table.vue'\nimport MonthTable from './basic-month-table.vue'\nimport YearTable from './basic-year-table.vue'\nimport { useFormDisabled } from '@element-plus/components/form'\n\nimport type { SetupContext } from 'vue'\nimport type { ConfigType, Dayjs } from 'dayjs'\nimport type { PanelDatePickProps } from '../props/panel-date-pick'\nimport type {\n DateTableEmits,\n DatesPickerEmits,\n MonthsPickerEmits,\n WeekPickerEmits,\n YearsPickerEmits,\n} from '../props/basic-date-table'\n\ntype DatePickType = PanelDatePickProps['type']\n// todo\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst timeWithinRange = (_: ConfigType, __: any, ___: string) => true\nconst props = defineProps(panelDatePickProps)\nconst contextEmit = defineEmits(['pick', 'set-picker-option', 'panel-change'])\nconst ppNs = useNamespace('picker-panel')\nconst dpNs = useNamespace('date-picker')\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst { t, lang } = useLocale()\nconst pickerBase = inject(PICKER_BASE_INJECTION_KEY) as any\nconst isDefaultFormat = inject(\n ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,\n undefined\n) as any\nconst { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props\nconst defaultValue = toRef(pickerBase.props, 'defaultValue')\n\nconst currentViewRef = ref<{ focus: () => void }>()\n\nconst innerDate = ref(dayjs().locale(lang.value))\n\nconst isChangeToNow = ref(false)\n\nlet isShortcut = false\n\nconst defaultTimeD = computed(() => {\n return dayjs(defaultTime).locale(lang.value)\n})\n\nconst month = computed(() => {\n return innerDate.value.month()\n})\n\nconst year = computed(() => {\n return innerDate.value.year()\n})\n\nconst selectableRange = ref([])\nconst userInputDate = ref<string | null>(null)\nconst userInputTime = ref<string | null>(null)\n// todo update to disableHour\nconst checkDateWithinRange = (date: ConfigType) => {\n return selectableRange.value.length > 0\n ? timeWithinRange(\n date,\n selectableRange.value,\n props.format || DEFAULT_FORMATS_TIME\n )\n : true\n}\nconst formatEmit = (emitDayjs: Dayjs) => {\n if (\n defaultTime &&\n !visibleTime.value &&\n !isChangeToNow.value &&\n !isShortcut\n ) {\n return defaultTimeD.value\n .year(emitDayjs.year())\n .month(emitDayjs.month())\n .date(emitDayjs.date())\n }\n if (showTime.value) return emitDayjs.millisecond(0)\n return emitDayjs.startOf('day')\n}\nconst emit = (value: Dayjs | Dayjs[], ...args: any[]) => {\n if (!value) {\n contextEmit('pick', value, ...args)\n } else if (isArray(value)) {\n const dates = value.map(formatEmit)\n contextEmit('pick', dates, ...args)\n } else {\n contextEmit('pick', formatEmit(value), ...args)\n }\n userInputDate.value = null\n userInputTime.value = null\n isChangeToNow.value = false\n isShortcut = false\n}\nconst handleDatePick = async (value: DateTableEmits, keepOpen?: boolean) => {\n if (selectionMode.value === 'date' && dayjs.isDayjs(value)) {\n const parsedDateValue = extractFirst(props.parsedValue)\n let newDate = parsedDateValue\n ? parsedDateValue\n .year(value.year())\n .month(value.month())\n .date(value.date())\n : value\n // change default time while out of selectableRange\n if (!checkDateWithinRange(newDate)) {\n newDate = (selectableRange.value[0][0] as Dayjs)\n .year(value.year())\n .month(value.month())\n .date(value.date())\n }\n innerDate.value = newDate\n emit(newDate, showTime.value || keepOpen)\n } else if (selectionMode.value === 'week') {\n emit((value as WeekPickerEmits).date)\n } else if (selectionMode.value === 'dates') {\n emit(value as DatesPickerEmits, true) // set true to keep panel open\n }\n}\n\nconst moveByMonth = (forward: boolean) => {\n const action = forward ? 'add' : 'subtract'\n innerDate.value = innerDate.value[action](1, 'month')\n handlePanelChange('month')\n}\n\nconst moveByYear = (forward: boolean) => {\n const currentDate = innerDate.value\n const action = forward ? 'add' : 'subtract'\n\n innerDate.value =\n currentView.value === 'year'\n ? currentDate[action](10, 'year')\n : currentDate[action](1, 'year')\n\n handlePanelChange('year')\n}\n\nconst currentView = ref('date')\n\nconst yearLabel = computed(() => {\n const yearTranslation = t('el.datepicker.year')\n if (currentView.value === 'year') {\n const startYear = Math.floor(year.value / 10) * 10\n if (yearTranslation) {\n return `${startYear} ${yearTranslation} - ${\n startYear + 9\n } ${yearTranslation}`\n }\n return `${startYear} - ${startYear + 9}`\n }\n return `${year.value} ${yearTranslation}`\n})\n\ntype Shortcut = {\n value: (() => Dayjs) | Dayjs\n onClick?: (ctx: Omit<SetupContext, 'expose'>) => void\n}\n\nconst handleShortcutClick = (shortcut: Shortcut) => {\n const shortcutValue = isFunction(shortcut.value)\n ? shortcut.value()\n : shortcut.value\n if (shortcutValue) {\n isShortcut = true\n emit(dayjs(shortcutValue).locale(lang.value))\n return\n }\n if (shortcut.onClick) {\n shortcut.onClick({\n attrs,\n slots,\n emit: contextEmit as SetupContext['emit'],\n })\n }\n}\n\nconst selectionMode = computed<DatePickType>(() => {\n const { type } = props\n if (['week', 'month', 'months', 'year', 'years', 'dates'].includes(type))\n return type\n return 'date'\n})\n\nconst isMultipleType = computed(() => {\n return (\n selectionMode.value === 'dates' ||\n selectionMode.value === 'months' ||\n selectionMode.value === 'years'\n )\n})\n\nconst keyboardMode = computed<string>(() => {\n return selectionMode.value === 'date'\n ? currentView.value\n : selectionMode.value\n})\n\nconst hasShortcuts = computed(() => !!shortcuts.length)\n\nconst handleMonthPick = async (\n month: number | MonthsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'month') {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'months') {\n emit(month as MonthsPickerEmits, keepOpen ?? true)\n } else {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n currentView.value = 'date'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('month')\n}\n\nconst handleYearPick = async (\n year: number | YearsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'year') {\n const data = innerDate.value.startOf('year').year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'years') {\n emit(year as YearsPickerEmits, keepOpen ?? true)\n } else {\n const data = innerDate.value.year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n currentView.value = 'month'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('year')\n}\n\nconst dateDisabled = useFormDisabled()\n\nconst showPicker = async (view: 'month' | 'year') => {\n if (dateDisabled.value) return\n currentView.value = view\n await nextTick()\n handleFocusPicker()\n}\n\nconst showTime = computed(\n () => props.type === 'datetime' || props.type === 'datetimerange'\n)\n\nconst footerVisible = computed(() => {\n const showDateFooter = showTime.value || selectionMode.value === 'dates'\n const showYearFooter = selectionMode.value === 'years'\n const showMonthFooter = selectionMode.value === 'months'\n const isDateView = currentView.value === 'date'\n const isYearView = currentView.value === 'year'\n const isMonthView = currentView.value === 'month'\n return (\n (showDateFooter && isDateView) ||\n (showYearFooter && isYearView) ||\n (showMonthFooter && isMonthView)\n )\n})\n\nconst footerFilled = computed(\n () => (!isMultipleType.value && props.showNow) || props.showConfirm\n)\n\nconst disabledConfirm = computed(() => {\n if (!disabledDate) return false\n if (!props.parsedValue) return true\n if (isArray(props.parsedValue)) {\n return disabledDate(props.parsedValue[0].toDate())\n }\n return disabledDate(props.parsedValue.toDate())\n})\nconst onConfirm = () => {\n if (isMultipleType.value) {\n emit(props.parsedValue as Dayjs[])\n } else {\n // deal with the scenario where: user opens the date time picker, then confirm without doing anything\n let result = extractFirst(props.parsedValue)\n if (!result) {\n const defaultTimeD = dayjs(defaultTime).locale(lang.value)\n const defaultValueD = getDefaultValue()\n result = defaultTimeD\n .year(defaultValueD.year())\n .month(defaultValueD.month())\n .date(defaultValueD.date())\n }\n innerDate.value = result\n emit(result)\n }\n}\n\nconst disabledNow = computed(() => {\n if (!disabledDate) return false\n return disabledDate(dayjs().locale(lang.value).toDate())\n})\nconst changeToNow = () => {\n // NOTE: not a permanent solution\n // consider disable \"now\" button in the future\n const now = dayjs().locale(lang.value)\n const nowDate = now.toDate()\n isChangeToNow.value = true\n if (\n (!disabledDate || !disabledDate(nowDate)) &&\n checkDateWithinRange(nowDate)\n ) {\n innerDate.value = dayjs().locale(lang.value)\n emit(innerDate.value)\n }\n}\n\nconst timeFormat = computed(() => {\n return (\n props.timeFormat || extractTimeFormat(props.format) || DEFAULT_FORMATS_TIME\n )\n})\n\nconst dateFormat = computed(() => {\n return (\n props.dateFormat || extractDateFormat(props.format) || DEFAULT_FORMATS_DATE\n )\n})\n\nconst visibleTime = computed(() => {\n if (userInputTime.value) return userInputTime.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(timeFormat.value)\n})\n\nconst visibleDate = computed(() => {\n if (userInputDate.value) return userInputDate.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(dateFormat.value)\n})\n\nconst timePickerVisible = ref(false)\nconst onTimePickerInputFocus = () => {\n timePickerVisible.value = true\n}\nconst handleTimePickClose = () => {\n timePickerVisible.value = false\n}\n\nconst getUnits = (date: Dayjs) => {\n return {\n hour: date.hour(),\n minute: date.minute(),\n second: date.second(),\n year: date.year(),\n month: date.month(),\n date: date.date(),\n }\n}\n\nconst handleTimePick = (value: Dayjs, visible: boolean, first: boolean) => {\n const { hour, minute, second } = getUnits(value)\n const parsedDateValue = extractFirst(props.parsedValue)\n const newDate = parsedDateValue\n ? parsedDateValue.hour(hour).minute(minute).second(second)\n : value\n innerDate.value = newDate\n emit(innerDate.value, true)\n if (!first) {\n timePickerVisible.value = visible\n }\n}\n\nconst handleVisibleTimeChange = (value: string) => {\n const newDate = dayjs(value, timeFormat.value).locale(lang.value)\n if (newDate.isValid() && checkDateWithinRange(newDate)) {\n const { year, month, date } = getUnits(innerDate.value)\n innerDate.value = newDate.year(year).month(month).date(date)\n userInputTime.value = null\n timePickerVisible.value = false\n emit(innerDate.value, true)\n }\n}\n\nconst handleVisibleDateChange = (value: string) => {\n const newDate = correctlyParseUserInput(\n value,\n dateFormat.value,\n lang.value,\n isDefaultFormat\n ) as Dayjs\n if (newDate.isValid()) {\n if (disabledDate && disabledDate(newDate.toDate())) {\n return\n }\n const { hour, minute, second } = getUnits(innerDate.value)\n innerDate.value = newDate.hour(hour).minute(minute).second(second)\n userInputDate.value = null\n emit(innerDate.value, true)\n }\n}\n\nconst isValidValue = (date: unknown) => {\n return (\n dayjs.isDayjs(date) &&\n date.isValid() &&\n (disabledDate ? !disabledDate(date.toDate()) : true)\n )\n}\n\nconst parseUserInput = (value: Dayjs) => {\n return correctlyParseUserInput(\n value,\n props.format,\n lang.value,\n isDefaultFormat\n )\n}\n\nconst getDefaultValue = () => {\n const parseDate = dayjs(defaultValue.value).locale(lang.value)\n if (!defaultValue.value) {\n const defaultTimeDValue = defaultTimeD.value\n return dayjs()\n .hour(defaultTimeDValue.hour())\n .minute(defaultTimeDValue.minute())\n .second(defaultTimeDValue.second())\n .locale(lang.value)\n }\n return parseDate\n}\n\nconst handleFocusPicker = () => {\n if (['week', 'month', 'year', 'date'].includes(selectionMode.value)) {\n currentViewRef.value?.focus()\n }\n}\n\nconst _handleFocusPicker = () => {\n handleFocusPicker()\n // TODO: After focus the date input, the first time you use the ArrowDown keys, you cannot focus on the date cell\n if (selectionMode.value === 'week') {\n handleKeyControl(EVENT_CODE.down)\n }\n}\n\nconst handleKeydownTable = (event: KeyboardEvent) => {\n const code = getEventCode(event)\n\n const validCode = [\n EVENT_CODE.up,\n EVENT_CODE.down,\n EVENT_CODE.left,\n EVENT_CODE.right,\n EVENT_CODE.home,\n EVENT_CODE.end,\n EVENT_CODE.pageUp,\n EVENT_CODE.pageDown,\n ]\n if (validCode.includes(code)) {\n handleKeyControl(code)\n event.stopPropagation()\n event.preventDefault()\n }\n if (\n [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(\n code\n ) &&\n userInputDate.value === null &&\n userInputTime.value === null\n ) {\n event.preventDefault()\n emit(innerDate.value, false)\n }\n}\n\nconst handleKeyControl = (code: string) => {\n type KeyControlMappingCallableOffset = (date: Date, step?: number) => number\n type KeyControl = {\n [key: string]:\n | number\n | KeyControlMappingCallableOffset\n | ((date: Date, step: number) => any)\n offset: (date: Date, step: number) => any\n }\n interface KeyControlMapping {\n [key: string]: KeyControl\n }\n\n const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE\n const mapping: KeyControlMapping = {\n year: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setFullYear(date.getFullYear() + step),\n },\n month: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setMonth(date.getMonth() + step),\n },\n week: {\n [up]: -1,\n [down]: 1,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setDate(date.getDate() + step * 7),\n },\n date: {\n [up]: -7,\n [down]: 7,\n [left]: -1,\n [right]: 1,\n [home]: (date: Date) => -date.getDay(),\n [end]: (date: Date) => -date.getDay() + 6,\n [pageUp]: (date: Date) =>\n -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),\n [pageDown]: (date: Date) =>\n new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),\n offset: (date: Date, step: number) => date.setDate(date.getDate() + step),\n },\n }\n\n const newDate = innerDate.value.toDate()\n while (Math.abs(innerDate.value.diff(newDate, 'year', true)) < 1) {\n const map = mapping[keyboardMode.value]\n if (!map) return\n map.offset(\n newDate,\n isFunction(map[code])\n ? (map[code] as unknown as KeyControlMappingCallableOffset)(newDate)\n : ((map[code] as number) ?? 0)\n )\n if (disabledDate && disabledDate(newDate)) {\n break\n }\n const result = dayjs(newDate).locale(lang.value)\n innerDate.value = result\n contextEmit('pick', result, true)\n break\n }\n}\n\nconst handlePanelChange = (mode: 'month' | 'year') => {\n contextEmit('panel-change', innerDate.value.toDate(), mode, currentView.value)\n}\n\nwatch(\n () => selectionMode.value,\n (val) => {\n if (['month', 'year'].includes(val)) {\n currentView.value = val\n return\n } else if (val === 'years') {\n currentView.value = 'year'\n return\n } else if (val === 'months') {\n currentView.value = 'month'\n return\n }\n currentView.value = 'date'\n },\n { immediate: true }\n)\n\nwatch(\n () => defaultValue.value,\n (val) => {\n if (val) {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.parsedValue,\n (val) => {\n if (val) {\n if (isMultipleType.value) return\n if (isArray(val)) return\n innerDate.value = val\n } else {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\ncontextEmit('set-picker-option', ['isValidValue', isValidValue])\ncontextEmit('set-picker-option', ['parseUserInput', parseUserInput])\ncontextEmit('set-picker-option', ['handleFocusPicker', _handleFocusPicker])\n</script>\n"],"mappings":""}
|
|
@@ -70,7 +70,7 @@ var panel_date_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
70
70
|
const userInputDate = (0, vue.ref)(null);
|
|
71
71
|
const userInputTime = (0, vue.ref)(null);
|
|
72
72
|
const checkDateWithinRange = (date) => {
|
|
73
|
-
return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format ||
|
|
73
|
+
return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format || require_constants.DEFAULT_FORMATS_TIME) : true;
|
|
74
74
|
};
|
|
75
75
|
const formatEmit = (emitDayjs) => {
|
|
76
76
|
if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-date-pick.vue_vue_type_script_setup_true_lang.js","names":["border","$slots","editable","disabled","parsedValue","showWeekNumber","showFooter","showNow","showConfirm"],"sources":["../../../../../../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ppNs.b(),\n dpNs.b(),\n ppNs.is('border', border),\n ppNs.is('disabled', dateDisabled),\n {\n 'has-sidebar': $slots.sidebar || hasShortcuts,\n 'has-time': showTime,\n },\n ]\"\n >\n <div :class=\"ppNs.e('body-wrapper')\">\n <slot name=\"sidebar\" :class=\"ppNs.e('sidebar')\" />\n <div v-if=\"hasShortcuts\" :class=\"ppNs.e('sidebar')\">\n <button\n v-for=\"(shortcut, key) in shortcuts\"\n :key=\"key\"\n type=\"button\"\n :disabled=\"dateDisabled\"\n :class=\"ppNs.e('shortcut')\"\n @click=\"handleShortcutClick(shortcut)\"\n >\n {{ shortcut.text }}\n </button>\n </div>\n <div :class=\"ppNs.e('body')\">\n <div v-if=\"showTime\" :class=\"dpNs.e('time-header')\">\n <span :class=\"dpNs.e('editor-wrap')\">\n <el-input\n :placeholder=\"t('el.datepicker.selectDate')\"\n :model-value=\"visibleDate\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @input=\"(val) => (userInputDate = val)\"\n @change=\"handleVisibleDateChange\"\n />\n </span>\n <span\n v-click-outside=\"handleTimePickClose\"\n :class=\"dpNs.e('editor-wrap')\"\n >\n <el-input\n :placeholder=\"t('el.datepicker.selectTime')\"\n :model-value=\"visibleTime\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @focus=\"onTimePickerInputFocus\"\n @input=\"(val) => (userInputTime = val)\"\n @change=\"handleVisibleTimeChange\"\n />\n <time-pick-panel\n :visible=\"timePickerVisible\"\n :format=\"timeFormat\"\n :parsed-value=\"innerDate\"\n @pick=\"handleTimePick\"\n />\n </span>\n </div>\n <div\n v-show=\"currentView !== 'time'\"\n :class=\"[\n dpNs.e('header'),\n (currentView === 'year' || currentView === 'month') &&\n dpNs.em('header', 'bordered'),\n ]\"\n >\n <span :class=\"dpNs.e('prev-btn')\">\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevYear`)\"\n class=\"d-arrow-left\"\n :class=\"ppNs.e('icon-btn')\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(false)\"\n >\n <slot name=\"prev-year\">\n <el-icon><d-arrow-left /></el-icon>\n </slot>\n </button>\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-left\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(false)\"\n >\n <slot name=\"prev-month\">\n <el-icon><arrow-left /></el-icon>\n </slot>\n </button>\n </span>\n <span\n role=\"button\"\n :class=\"dpNs.e('header-label')\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n @keydown.enter=\"showPicker('year')\"\n @click=\"showPicker('year')\"\n >{{ yearLabel }}</span\n >\n <span\n v-show=\"currentView === 'date'\"\n role=\"button\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n :class=\"[\n dpNs.e('header-label'),\n { active: currentView === 'month' },\n ]\"\n @keydown.enter=\"showPicker('month')\"\n @click=\"showPicker('month')\"\n >{{ t(`el.datepicker.month${month + 1}`) }}</span\n >\n <span :class=\"dpNs.e('next-btn')\">\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(true)\"\n >\n <slot name=\"next-month\">\n <el-icon><arrow-right /></el-icon>\n </slot>\n </button>\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextYear`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"d-arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(true)\"\n >\n <slot name=\"next-year\">\n <el-icon><d-arrow-right /></el-icon>\n </slot>\n </button>\n </span>\n </div>\n <div :class=\"ppNs.e('content')\" @keydown=\"handleKeydownTable\">\n <date-table\n v-if=\"currentView === 'date'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n :show-week-number=\"showWeekNumber\"\n @pick=\"handleDatePick\"\n />\n <year-table\n v-if=\"currentView === 'year'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :parsed-value=\"parsedValue\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleYearPick\"\n />\n <month-table\n v-if=\"currentView === 'month'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleMonthPick\"\n />\n </div>\n </div>\n </div>\n <div\n v-if=\"showFooter && footerVisible && footerFilled\"\n :class=\"ppNs.e('footer')\"\n >\n <el-button\n v-show=\"!isMultipleType && showNow\"\n text\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledNow\"\n @click=\"changeToNow\"\n >\n {{ t('el.datepicker.now') }}\n </el-button>\n <el-button\n v-if=\"showConfirm\"\n plain\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledConfirm\"\n @click=\"onConfirm\"\n >\n {{ t('el.datepicker.confirm') }}\n </el-button>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n ref,\n toRef,\n useAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport dayjs from 'dayjs'\nimport ElButton from '@element-plus/components/button'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport {\n DEFAULT_FORMATS_DATE,\n DEFAULT_FORMATS_TIME,\n PICKER_BASE_INJECTION_KEY,\n TimePickPanel,\n extractDateFormat,\n extractTimeFormat,\n} from '@element-plus/components/time-picker'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n extractFirst,\n getEventCode,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ArrowLeft,\n ArrowRight,\n DArrowLeft,\n DArrowRight,\n} from '@element-plus/icons-vue'\nimport { panelDatePickProps } from '../props/panel-date-pick'\nimport {\n correctlyParseUserInput,\n getValidDateOfMonth,\n getValidDateOfYear,\n} from '../utils'\nimport { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY } from '../constants'\nimport DateTable from './basic-date-table.vue'\nimport MonthTable from './basic-month-table.vue'\nimport YearTable from './basic-year-table.vue'\nimport { useFormDisabled } from '@element-plus/components/form'\n\nimport type { SetupContext } from 'vue'\nimport type { ConfigType, Dayjs } from 'dayjs'\nimport type { PanelDatePickProps } from '../props/panel-date-pick'\nimport type {\n DateTableEmits,\n DatesPickerEmits,\n MonthsPickerEmits,\n WeekPickerEmits,\n YearsPickerEmits,\n} from '../props/basic-date-table'\n\ntype DatePickType = PanelDatePickProps['type']\n// todo\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst timeWithinRange = (_: ConfigType, __: any, ___: string) => true\nconst props = defineProps(panelDatePickProps)\nconst contextEmit = defineEmits(['pick', 'set-picker-option', 'panel-change'])\nconst ppNs = useNamespace('picker-panel')\nconst dpNs = useNamespace('date-picker')\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst { t, lang } = useLocale()\nconst pickerBase = inject(PICKER_BASE_INJECTION_KEY) as any\nconst isDefaultFormat = inject(\n ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,\n undefined\n) as any\nconst { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props\nconst defaultValue = toRef(pickerBase.props, 'defaultValue')\n\nconst currentViewRef = ref<{ focus: () => void }>()\n\nconst innerDate = ref(dayjs().locale(lang.value))\n\nconst isChangeToNow = ref(false)\n\nlet isShortcut = false\n\nconst defaultTimeD = computed(() => {\n return dayjs(defaultTime).locale(lang.value)\n})\n\nconst month = computed(() => {\n return innerDate.value.month()\n})\n\nconst year = computed(() => {\n return innerDate.value.year()\n})\n\nconst selectableRange = ref([])\nconst userInputDate = ref<string | null>(null)\nconst userInputTime = ref<string | null>(null)\n// todo update to disableHour\nconst checkDateWithinRange = (date: ConfigType) => {\n return selectableRange.value.length > 0\n ? timeWithinRange(date, selectableRange.value, props.format || 'HH:mm:ss')\n : true\n}\nconst formatEmit = (emitDayjs: Dayjs) => {\n if (\n defaultTime &&\n !visibleTime.value &&\n !isChangeToNow.value &&\n !isShortcut\n ) {\n return defaultTimeD.value\n .year(emitDayjs.year())\n .month(emitDayjs.month())\n .date(emitDayjs.date())\n }\n if (showTime.value) return emitDayjs.millisecond(0)\n return emitDayjs.startOf('day')\n}\nconst emit = (value: Dayjs | Dayjs[], ...args: any[]) => {\n if (!value) {\n contextEmit('pick', value, ...args)\n } else if (isArray(value)) {\n const dates = value.map(formatEmit)\n contextEmit('pick', dates, ...args)\n } else {\n contextEmit('pick', formatEmit(value), ...args)\n }\n userInputDate.value = null\n userInputTime.value = null\n isChangeToNow.value = false\n isShortcut = false\n}\nconst handleDatePick = async (value: DateTableEmits, keepOpen?: boolean) => {\n if (selectionMode.value === 'date' && dayjs.isDayjs(value)) {\n const parsedDateValue = extractFirst(props.parsedValue)\n let newDate = parsedDateValue\n ? parsedDateValue\n .year(value.year())\n .month(value.month())\n .date(value.date())\n : value\n // change default time while out of selectableRange\n if (!checkDateWithinRange(newDate)) {\n newDate = (selectableRange.value[0][0] as Dayjs)\n .year(value.year())\n .month(value.month())\n .date(value.date())\n }\n innerDate.value = newDate\n emit(newDate, showTime.value || keepOpen)\n } else if (selectionMode.value === 'week') {\n emit((value as WeekPickerEmits).date)\n } else if (selectionMode.value === 'dates') {\n emit(value as DatesPickerEmits, true) // set true to keep panel open\n }\n}\n\nconst moveByMonth = (forward: boolean) => {\n const action = forward ? 'add' : 'subtract'\n innerDate.value = innerDate.value[action](1, 'month')\n handlePanelChange('month')\n}\n\nconst moveByYear = (forward: boolean) => {\n const currentDate = innerDate.value\n const action = forward ? 'add' : 'subtract'\n\n innerDate.value =\n currentView.value === 'year'\n ? currentDate[action](10, 'year')\n : currentDate[action](1, 'year')\n\n handlePanelChange('year')\n}\n\nconst currentView = ref('date')\n\nconst yearLabel = computed(() => {\n const yearTranslation = t('el.datepicker.year')\n if (currentView.value === 'year') {\n const startYear = Math.floor(year.value / 10) * 10\n if (yearTranslation) {\n return `${startYear} ${yearTranslation} - ${\n startYear + 9\n } ${yearTranslation}`\n }\n return `${startYear} - ${startYear + 9}`\n }\n return `${year.value} ${yearTranslation}`\n})\n\ntype Shortcut = {\n value: (() => Dayjs) | Dayjs\n onClick?: (ctx: Omit<SetupContext, 'expose'>) => void\n}\n\nconst handleShortcutClick = (shortcut: Shortcut) => {\n const shortcutValue = isFunction(shortcut.value)\n ? shortcut.value()\n : shortcut.value\n if (shortcutValue) {\n isShortcut = true\n emit(dayjs(shortcutValue).locale(lang.value))\n return\n }\n if (shortcut.onClick) {\n shortcut.onClick({\n attrs,\n slots,\n emit: contextEmit as SetupContext['emit'],\n })\n }\n}\n\nconst selectionMode = computed<DatePickType>(() => {\n const { type } = props\n if (['week', 'month', 'months', 'year', 'years', 'dates'].includes(type))\n return type\n return 'date'\n})\n\nconst isMultipleType = computed(() => {\n return (\n selectionMode.value === 'dates' ||\n selectionMode.value === 'months' ||\n selectionMode.value === 'years'\n )\n})\n\nconst keyboardMode = computed<string>(() => {\n return selectionMode.value === 'date'\n ? currentView.value\n : selectionMode.value\n})\n\nconst hasShortcuts = computed(() => !!shortcuts.length)\n\nconst handleMonthPick = async (\n month: number | MonthsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'month') {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'months') {\n emit(month as MonthsPickerEmits, keepOpen ?? true)\n } else {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n currentView.value = 'date'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('month')\n}\n\nconst handleYearPick = async (\n year: number | YearsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'year') {\n const data = innerDate.value.startOf('year').year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'years') {\n emit(year as YearsPickerEmits, keepOpen ?? true)\n } else {\n const data = innerDate.value.year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n currentView.value = 'month'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('year')\n}\n\nconst dateDisabled = useFormDisabled()\n\nconst showPicker = async (view: 'month' | 'year') => {\n if (dateDisabled.value) return\n currentView.value = view\n await nextTick()\n handleFocusPicker()\n}\n\nconst showTime = computed(\n () => props.type === 'datetime' || props.type === 'datetimerange'\n)\n\nconst footerVisible = computed(() => {\n const showDateFooter = showTime.value || selectionMode.value === 'dates'\n const showYearFooter = selectionMode.value === 'years'\n const showMonthFooter = selectionMode.value === 'months'\n const isDateView = currentView.value === 'date'\n const isYearView = currentView.value === 'year'\n const isMonthView = currentView.value === 'month'\n return (\n (showDateFooter && isDateView) ||\n (showYearFooter && isYearView) ||\n (showMonthFooter && isMonthView)\n )\n})\n\nconst footerFilled = computed(\n () => (!isMultipleType.value && props.showNow) || props.showConfirm\n)\n\nconst disabledConfirm = computed(() => {\n if (!disabledDate) return false\n if (!props.parsedValue) return true\n if (isArray(props.parsedValue)) {\n return disabledDate(props.parsedValue[0].toDate())\n }\n return disabledDate(props.parsedValue.toDate())\n})\nconst onConfirm = () => {\n if (isMultipleType.value) {\n emit(props.parsedValue as Dayjs[])\n } else {\n // deal with the scenario where: user opens the date time picker, then confirm without doing anything\n let result = extractFirst(props.parsedValue)\n if (!result) {\n const defaultTimeD = dayjs(defaultTime).locale(lang.value)\n const defaultValueD = getDefaultValue()\n result = defaultTimeD\n .year(defaultValueD.year())\n .month(defaultValueD.month())\n .date(defaultValueD.date())\n }\n innerDate.value = result\n emit(result)\n }\n}\n\nconst disabledNow = computed(() => {\n if (!disabledDate) return false\n return disabledDate(dayjs().locale(lang.value).toDate())\n})\nconst changeToNow = () => {\n // NOTE: not a permanent solution\n // consider disable \"now\" button in the future\n const now = dayjs().locale(lang.value)\n const nowDate = now.toDate()\n isChangeToNow.value = true\n if (\n (!disabledDate || !disabledDate(nowDate)) &&\n checkDateWithinRange(nowDate)\n ) {\n innerDate.value = dayjs().locale(lang.value)\n emit(innerDate.value)\n }\n}\n\nconst timeFormat = computed(() => {\n return (\n props.timeFormat || extractTimeFormat(props.format) || DEFAULT_FORMATS_TIME\n )\n})\n\nconst dateFormat = computed(() => {\n return (\n props.dateFormat || extractDateFormat(props.format) || DEFAULT_FORMATS_DATE\n )\n})\n\nconst visibleTime = computed(() => {\n if (userInputTime.value) return userInputTime.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(timeFormat.value)\n})\n\nconst visibleDate = computed(() => {\n if (userInputDate.value) return userInputDate.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(dateFormat.value)\n})\n\nconst timePickerVisible = ref(false)\nconst onTimePickerInputFocus = () => {\n timePickerVisible.value = true\n}\nconst handleTimePickClose = () => {\n timePickerVisible.value = false\n}\n\nconst getUnits = (date: Dayjs) => {\n return {\n hour: date.hour(),\n minute: date.minute(),\n second: date.second(),\n year: date.year(),\n month: date.month(),\n date: date.date(),\n }\n}\n\nconst handleTimePick = (value: Dayjs, visible: boolean, first: boolean) => {\n const { hour, minute, second } = getUnits(value)\n const parsedDateValue = extractFirst(props.parsedValue)\n const newDate = parsedDateValue\n ? parsedDateValue.hour(hour).minute(minute).second(second)\n : value\n innerDate.value = newDate\n emit(innerDate.value, true)\n if (!first) {\n timePickerVisible.value = visible\n }\n}\n\nconst handleVisibleTimeChange = (value: string) => {\n const newDate = dayjs(value, timeFormat.value).locale(lang.value)\n if (newDate.isValid() && checkDateWithinRange(newDate)) {\n const { year, month, date } = getUnits(innerDate.value)\n innerDate.value = newDate.year(year).month(month).date(date)\n userInputTime.value = null\n timePickerVisible.value = false\n emit(innerDate.value, true)\n }\n}\n\nconst handleVisibleDateChange = (value: string) => {\n const newDate = correctlyParseUserInput(\n value,\n dateFormat.value,\n lang.value,\n isDefaultFormat\n ) as Dayjs\n if (newDate.isValid()) {\n if (disabledDate && disabledDate(newDate.toDate())) {\n return\n }\n const { hour, minute, second } = getUnits(innerDate.value)\n innerDate.value = newDate.hour(hour).minute(minute).second(second)\n userInputDate.value = null\n emit(innerDate.value, true)\n }\n}\n\nconst isValidValue = (date: unknown) => {\n return (\n dayjs.isDayjs(date) &&\n date.isValid() &&\n (disabledDate ? !disabledDate(date.toDate()) : true)\n )\n}\n\nconst parseUserInput = (value: Dayjs) => {\n return correctlyParseUserInput(\n value,\n props.format,\n lang.value,\n isDefaultFormat\n )\n}\n\nconst getDefaultValue = () => {\n const parseDate = dayjs(defaultValue.value).locale(lang.value)\n if (!defaultValue.value) {\n const defaultTimeDValue = defaultTimeD.value\n return dayjs()\n .hour(defaultTimeDValue.hour())\n .minute(defaultTimeDValue.minute())\n .second(defaultTimeDValue.second())\n .locale(lang.value)\n }\n return parseDate\n}\n\nconst handleFocusPicker = () => {\n if (['week', 'month', 'year', 'date'].includes(selectionMode.value)) {\n currentViewRef.value?.focus()\n }\n}\n\nconst _handleFocusPicker = () => {\n handleFocusPicker()\n // TODO: After focus the date input, the first time you use the ArrowDown keys, you cannot focus on the date cell\n if (selectionMode.value === 'week') {\n handleKeyControl(EVENT_CODE.down)\n }\n}\n\nconst handleKeydownTable = (event: KeyboardEvent) => {\n const code = getEventCode(event)\n\n const validCode = [\n EVENT_CODE.up,\n EVENT_CODE.down,\n EVENT_CODE.left,\n EVENT_CODE.right,\n EVENT_CODE.home,\n EVENT_CODE.end,\n EVENT_CODE.pageUp,\n EVENT_CODE.pageDown,\n ]\n if (validCode.includes(code)) {\n handleKeyControl(code)\n event.stopPropagation()\n event.preventDefault()\n }\n if (\n [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(\n code\n ) &&\n userInputDate.value === null &&\n userInputTime.value === null\n ) {\n event.preventDefault()\n emit(innerDate.value, false)\n }\n}\n\nconst handleKeyControl = (code: string) => {\n type KeyControlMappingCallableOffset = (date: Date, step?: number) => number\n type KeyControl = {\n [key: string]:\n | number\n | KeyControlMappingCallableOffset\n | ((date: Date, step: number) => any)\n offset: (date: Date, step: number) => any\n }\n interface KeyControlMapping {\n [key: string]: KeyControl\n }\n\n const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE\n const mapping: KeyControlMapping = {\n year: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setFullYear(date.getFullYear() + step),\n },\n month: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setMonth(date.getMonth() + step),\n },\n week: {\n [up]: -1,\n [down]: 1,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setDate(date.getDate() + step * 7),\n },\n date: {\n [up]: -7,\n [down]: 7,\n [left]: -1,\n [right]: 1,\n [home]: (date: Date) => -date.getDay(),\n [end]: (date: Date) => -date.getDay() + 6,\n [pageUp]: (date: Date) =>\n -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),\n [pageDown]: (date: Date) =>\n new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),\n offset: (date: Date, step: number) => date.setDate(date.getDate() + step),\n },\n }\n\n const newDate = innerDate.value.toDate()\n while (Math.abs(innerDate.value.diff(newDate, 'year', true)) < 1) {\n const map = mapping[keyboardMode.value]\n if (!map) return\n map.offset(\n newDate,\n isFunction(map[code])\n ? (map[code] as unknown as KeyControlMappingCallableOffset)(newDate)\n : ((map[code] as number) ?? 0)\n )\n if (disabledDate && disabledDate(newDate)) {\n break\n }\n const result = dayjs(newDate).locale(lang.value)\n innerDate.value = result\n contextEmit('pick', result, true)\n break\n }\n}\n\nconst handlePanelChange = (mode: 'month' | 'year') => {\n contextEmit('panel-change', innerDate.value.toDate(), mode, currentView.value)\n}\n\nwatch(\n () => selectionMode.value,\n (val) => {\n if (['month', 'year'].includes(val)) {\n currentView.value = val\n return\n } else if (val === 'years') {\n currentView.value = 'year'\n return\n } else if (val === 'months') {\n currentView.value = 'month'\n return\n }\n currentView.value = 'date'\n },\n { immediate: true }\n)\n\nwatch(\n () => defaultValue.value,\n (val) => {\n if (val) {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.parsedValue,\n (val) => {\n if (val) {\n if (isMultipleType.value) return\n if (isArray(val)) return\n innerDate.value = val\n } else {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\ncontextEmit('set-picker-option', ['isValidValue', isValidValue])\ncontextEmit('set-picker-option', ['parseUserInput', parseUserInput])\ncontextEmit('set-picker-option', ['handleFocusPicker', _handleFocusPicker])\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyRA,MAAM,mBAAmB,GAAe,IAAS,QAAgB;EACjE,MAAM,QAAQ;EACd,MAAM,cAAc;EACpB,MAAM,OAAO,6BAAa,eAAc;EACxC,MAAM,OAAO,6BAAa,cAAa;EACvC,MAAM,2BAAiB;EACvB,MAAM,2BAAiB;EAEvB,MAAM,EAAE,GAAG,SAAS,yBAAU;EAC9B,MAAM,6BAAoB,4CAA0B;EACpD,MAAM,kCACJ,iEACA,OACD;EACD,MAAM,EAAE,WAAW,cAAc,eAAe,gBAAgB,WAAW;EAC3E,MAAM,8BAAqB,WAAW,OAAO,eAAc;EAE3D,MAAM,+BAA4C;EAElD,MAAM,6CAAuB,CAAC,OAAO,KAAK,MAAM,CAAA;EAEhD,MAAM,6BAAoB,MAAK;EAE/B,IAAI,aAAa;EAEjB,MAAM,uCAA8B;AAClC,6BAAa,YAAY,CAAC,OAAO,KAAK,MAA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BAAA,EAAA;;IAPV,OAAA;IACA,MAAK;IACJ,8CAAO,KAAI,CAAC,EAAC,WAAA,CAAA;IACb,UAAU,gBAAA;IACV,SAAO;;oCAEwB,kEAA7B,EAAC,CAAA,wBAAA,CAAA,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"panel-date-pick.vue_vue_type_script_setup_true_lang.js","names":["border","$slots","editable","disabled","parsedValue","showWeekNumber","showFooter","showNow","showConfirm"],"sources":["../../../../../../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ppNs.b(),\n dpNs.b(),\n ppNs.is('border', border),\n ppNs.is('disabled', dateDisabled),\n {\n 'has-sidebar': $slots.sidebar || hasShortcuts,\n 'has-time': showTime,\n },\n ]\"\n >\n <div :class=\"ppNs.e('body-wrapper')\">\n <slot name=\"sidebar\" :class=\"ppNs.e('sidebar')\" />\n <div v-if=\"hasShortcuts\" :class=\"ppNs.e('sidebar')\">\n <button\n v-for=\"(shortcut, key) in shortcuts\"\n :key=\"key\"\n type=\"button\"\n :disabled=\"dateDisabled\"\n :class=\"ppNs.e('shortcut')\"\n @click=\"handleShortcutClick(shortcut)\"\n >\n {{ shortcut.text }}\n </button>\n </div>\n <div :class=\"ppNs.e('body')\">\n <div v-if=\"showTime\" :class=\"dpNs.e('time-header')\">\n <span :class=\"dpNs.e('editor-wrap')\">\n <el-input\n :placeholder=\"t('el.datepicker.selectDate')\"\n :model-value=\"visibleDate\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @input=\"(val) => (userInputDate = val)\"\n @change=\"handleVisibleDateChange\"\n />\n </span>\n <span\n v-click-outside=\"handleTimePickClose\"\n :class=\"dpNs.e('editor-wrap')\"\n >\n <el-input\n :placeholder=\"t('el.datepicker.selectTime')\"\n :model-value=\"visibleTime\"\n size=\"small\"\n :validate-event=\"false\"\n :disabled=\"dateDisabled\"\n :readonly=\"!editable\"\n @focus=\"onTimePickerInputFocus\"\n @input=\"(val) => (userInputTime = val)\"\n @change=\"handleVisibleTimeChange\"\n />\n <time-pick-panel\n :visible=\"timePickerVisible\"\n :format=\"timeFormat\"\n :parsed-value=\"innerDate\"\n @pick=\"handleTimePick\"\n />\n </span>\n </div>\n <div\n v-show=\"currentView !== 'time'\"\n :class=\"[\n dpNs.e('header'),\n (currentView === 'year' || currentView === 'month') &&\n dpNs.em('header', 'bordered'),\n ]\"\n >\n <span :class=\"dpNs.e('prev-btn')\">\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevYear`)\"\n class=\"d-arrow-left\"\n :class=\"ppNs.e('icon-btn')\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(false)\"\n >\n <slot name=\"prev-year\">\n <el-icon><d-arrow-left /></el-icon>\n </slot>\n </button>\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.prevMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-left\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(false)\"\n >\n <slot name=\"prev-month\">\n <el-icon><arrow-left /></el-icon>\n </slot>\n </button>\n </span>\n <span\n role=\"button\"\n :class=\"dpNs.e('header-label')\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n @keydown.enter=\"showPicker('year')\"\n @click=\"showPicker('year')\"\n >{{ yearLabel }}</span\n >\n <span\n v-show=\"currentView === 'date'\"\n role=\"button\"\n aria-live=\"polite\"\n :tabindex=\"disabled ? undefined : 0\"\n :aria-disabled=\"disabled\"\n :class=\"[\n dpNs.e('header-label'),\n { active: currentView === 'month' },\n ]\"\n @keydown.enter=\"showPicker('month')\"\n @click=\"showPicker('month')\"\n >{{ t(`el.datepicker.month${month + 1}`) }}</span\n >\n <span :class=\"dpNs.e('next-btn')\">\n <button\n v-show=\"currentView === 'date'\"\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextMonth`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByMonth(true)\"\n >\n <slot name=\"next-month\">\n <el-icon><arrow-right /></el-icon>\n </slot>\n </button>\n <button\n type=\"button\"\n :aria-label=\"t(`el.datepicker.nextYear`)\"\n :class=\"ppNs.e('icon-btn')\"\n class=\"d-arrow-right\"\n :disabled=\"dateDisabled\"\n @click=\"moveByYear(true)\"\n >\n <slot name=\"next-year\">\n <el-icon><d-arrow-right /></el-icon>\n </slot>\n </button>\n </span>\n </div>\n <div :class=\"ppNs.e('content')\" @keydown=\"handleKeydownTable\">\n <date-table\n v-if=\"currentView === 'date'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n :show-week-number=\"showWeekNumber\"\n @pick=\"handleDatePick\"\n />\n <year-table\n v-if=\"currentView === 'year'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :parsed-value=\"parsedValue\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleYearPick\"\n />\n <month-table\n v-if=\"currentView === 'month'\"\n ref=\"currentViewRef\"\n :selection-mode=\"selectionMode\"\n :date=\"innerDate\"\n :parsed-value=\"parsedValue\"\n :disabled-date=\"disabledDate\"\n :disabled=\"dateDisabled\"\n :cell-class-name=\"cellClassName\"\n @pick=\"handleMonthPick\"\n />\n </div>\n </div>\n </div>\n <div\n v-if=\"showFooter && footerVisible && footerFilled\"\n :class=\"ppNs.e('footer')\"\n >\n <el-button\n v-show=\"!isMultipleType && showNow\"\n text\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledNow\"\n @click=\"changeToNow\"\n >\n {{ t('el.datepicker.now') }}\n </el-button>\n <el-button\n v-if=\"showConfirm\"\n plain\n size=\"small\"\n :class=\"ppNs.e('link-btn')\"\n :disabled=\"disabledConfirm\"\n @click=\"onConfirm\"\n >\n {{ t('el.datepicker.confirm') }}\n </el-button>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n ref,\n toRef,\n useAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport dayjs from 'dayjs'\nimport ElButton from '@element-plus/components/button'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport {\n DEFAULT_FORMATS_DATE,\n DEFAULT_FORMATS_TIME,\n PICKER_BASE_INJECTION_KEY,\n TimePickPanel,\n extractDateFormat,\n extractTimeFormat,\n} from '@element-plus/components/time-picker'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n extractFirst,\n getEventCode,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport {\n ArrowLeft,\n ArrowRight,\n DArrowLeft,\n DArrowRight,\n} from '@element-plus/icons-vue'\nimport { panelDatePickProps } from '../props/panel-date-pick'\nimport {\n correctlyParseUserInput,\n getValidDateOfMonth,\n getValidDateOfYear,\n} from '../utils'\nimport { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY } from '../constants'\nimport DateTable from './basic-date-table.vue'\nimport MonthTable from './basic-month-table.vue'\nimport YearTable from './basic-year-table.vue'\nimport { useFormDisabled } from '@element-plus/components/form'\n\nimport type { SetupContext } from 'vue'\nimport type { ConfigType, Dayjs } from 'dayjs'\nimport type { PanelDatePickProps } from '../props/panel-date-pick'\nimport type {\n DateTableEmits,\n DatesPickerEmits,\n MonthsPickerEmits,\n WeekPickerEmits,\n YearsPickerEmits,\n} from '../props/basic-date-table'\n\ntype DatePickType = PanelDatePickProps['type']\n// todo\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst timeWithinRange = (_: ConfigType, __: any, ___: string) => true\nconst props = defineProps(panelDatePickProps)\nconst contextEmit = defineEmits(['pick', 'set-picker-option', 'panel-change'])\nconst ppNs = useNamespace('picker-panel')\nconst dpNs = useNamespace('date-picker')\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst { t, lang } = useLocale()\nconst pickerBase = inject(PICKER_BASE_INJECTION_KEY) as any\nconst isDefaultFormat = inject(\n ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,\n undefined\n) as any\nconst { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props\nconst defaultValue = toRef(pickerBase.props, 'defaultValue')\n\nconst currentViewRef = ref<{ focus: () => void }>()\n\nconst innerDate = ref(dayjs().locale(lang.value))\n\nconst isChangeToNow = ref(false)\n\nlet isShortcut = false\n\nconst defaultTimeD = computed(() => {\n return dayjs(defaultTime).locale(lang.value)\n})\n\nconst month = computed(() => {\n return innerDate.value.month()\n})\n\nconst year = computed(() => {\n return innerDate.value.year()\n})\n\nconst selectableRange = ref([])\nconst userInputDate = ref<string | null>(null)\nconst userInputTime = ref<string | null>(null)\n// todo update to disableHour\nconst checkDateWithinRange = (date: ConfigType) => {\n return selectableRange.value.length > 0\n ? timeWithinRange(\n date,\n selectableRange.value,\n props.format || DEFAULT_FORMATS_TIME\n )\n : true\n}\nconst formatEmit = (emitDayjs: Dayjs) => {\n if (\n defaultTime &&\n !visibleTime.value &&\n !isChangeToNow.value &&\n !isShortcut\n ) {\n return defaultTimeD.value\n .year(emitDayjs.year())\n .month(emitDayjs.month())\n .date(emitDayjs.date())\n }\n if (showTime.value) return emitDayjs.millisecond(0)\n return emitDayjs.startOf('day')\n}\nconst emit = (value: Dayjs | Dayjs[], ...args: any[]) => {\n if (!value) {\n contextEmit('pick', value, ...args)\n } else if (isArray(value)) {\n const dates = value.map(formatEmit)\n contextEmit('pick', dates, ...args)\n } else {\n contextEmit('pick', formatEmit(value), ...args)\n }\n userInputDate.value = null\n userInputTime.value = null\n isChangeToNow.value = false\n isShortcut = false\n}\nconst handleDatePick = async (value: DateTableEmits, keepOpen?: boolean) => {\n if (selectionMode.value === 'date' && dayjs.isDayjs(value)) {\n const parsedDateValue = extractFirst(props.parsedValue)\n let newDate = parsedDateValue\n ? parsedDateValue\n .year(value.year())\n .month(value.month())\n .date(value.date())\n : value\n // change default time while out of selectableRange\n if (!checkDateWithinRange(newDate)) {\n newDate = (selectableRange.value[0][0] as Dayjs)\n .year(value.year())\n .month(value.month())\n .date(value.date())\n }\n innerDate.value = newDate\n emit(newDate, showTime.value || keepOpen)\n } else if (selectionMode.value === 'week') {\n emit((value as WeekPickerEmits).date)\n } else if (selectionMode.value === 'dates') {\n emit(value as DatesPickerEmits, true) // set true to keep panel open\n }\n}\n\nconst moveByMonth = (forward: boolean) => {\n const action = forward ? 'add' : 'subtract'\n innerDate.value = innerDate.value[action](1, 'month')\n handlePanelChange('month')\n}\n\nconst moveByYear = (forward: boolean) => {\n const currentDate = innerDate.value\n const action = forward ? 'add' : 'subtract'\n\n innerDate.value =\n currentView.value === 'year'\n ? currentDate[action](10, 'year')\n : currentDate[action](1, 'year')\n\n handlePanelChange('year')\n}\n\nconst currentView = ref('date')\n\nconst yearLabel = computed(() => {\n const yearTranslation = t('el.datepicker.year')\n if (currentView.value === 'year') {\n const startYear = Math.floor(year.value / 10) * 10\n if (yearTranslation) {\n return `${startYear} ${yearTranslation} - ${\n startYear + 9\n } ${yearTranslation}`\n }\n return `${startYear} - ${startYear + 9}`\n }\n return `${year.value} ${yearTranslation}`\n})\n\ntype Shortcut = {\n value: (() => Dayjs) | Dayjs\n onClick?: (ctx: Omit<SetupContext, 'expose'>) => void\n}\n\nconst handleShortcutClick = (shortcut: Shortcut) => {\n const shortcutValue = isFunction(shortcut.value)\n ? shortcut.value()\n : shortcut.value\n if (shortcutValue) {\n isShortcut = true\n emit(dayjs(shortcutValue).locale(lang.value))\n return\n }\n if (shortcut.onClick) {\n shortcut.onClick({\n attrs,\n slots,\n emit: contextEmit as SetupContext['emit'],\n })\n }\n}\n\nconst selectionMode = computed<DatePickType>(() => {\n const { type } = props\n if (['week', 'month', 'months', 'year', 'years', 'dates'].includes(type))\n return type\n return 'date'\n})\n\nconst isMultipleType = computed(() => {\n return (\n selectionMode.value === 'dates' ||\n selectionMode.value === 'months' ||\n selectionMode.value === 'years'\n )\n})\n\nconst keyboardMode = computed<string>(() => {\n return selectionMode.value === 'date'\n ? currentView.value\n : selectionMode.value\n})\n\nconst hasShortcuts = computed(() => !!shortcuts.length)\n\nconst handleMonthPick = async (\n month: number | MonthsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'month') {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'months') {\n emit(month as MonthsPickerEmits, keepOpen ?? true)\n } else {\n innerDate.value = getValidDateOfMonth(\n innerDate.value,\n innerDate.value.year(),\n month as number,\n lang.value,\n disabledDate\n )\n currentView.value = 'date'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('month')\n}\n\nconst handleYearPick = async (\n year: number | YearsPickerEmits,\n keepOpen?: boolean\n) => {\n if (selectionMode.value === 'year') {\n const data = innerDate.value.startOf('year').year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n emit(innerDate.value, false)\n } else if (selectionMode.value === 'years') {\n emit(year as YearsPickerEmits, keepOpen ?? true)\n } else {\n const data = innerDate.value.year(year as number)\n innerDate.value = getValidDateOfYear(data, lang.value, disabledDate)\n currentView.value = 'month'\n if (['month', 'year', 'date', 'week'].includes(selectionMode.value)) {\n emit(innerDate.value, true)\n await nextTick()\n handleFocusPicker()\n }\n }\n handlePanelChange('year')\n}\n\nconst dateDisabled = useFormDisabled()\n\nconst showPicker = async (view: 'month' | 'year') => {\n if (dateDisabled.value) return\n currentView.value = view\n await nextTick()\n handleFocusPicker()\n}\n\nconst showTime = computed(\n () => props.type === 'datetime' || props.type === 'datetimerange'\n)\n\nconst footerVisible = computed(() => {\n const showDateFooter = showTime.value || selectionMode.value === 'dates'\n const showYearFooter = selectionMode.value === 'years'\n const showMonthFooter = selectionMode.value === 'months'\n const isDateView = currentView.value === 'date'\n const isYearView = currentView.value === 'year'\n const isMonthView = currentView.value === 'month'\n return (\n (showDateFooter && isDateView) ||\n (showYearFooter && isYearView) ||\n (showMonthFooter && isMonthView)\n )\n})\n\nconst footerFilled = computed(\n () => (!isMultipleType.value && props.showNow) || props.showConfirm\n)\n\nconst disabledConfirm = computed(() => {\n if (!disabledDate) return false\n if (!props.parsedValue) return true\n if (isArray(props.parsedValue)) {\n return disabledDate(props.parsedValue[0].toDate())\n }\n return disabledDate(props.parsedValue.toDate())\n})\nconst onConfirm = () => {\n if (isMultipleType.value) {\n emit(props.parsedValue as Dayjs[])\n } else {\n // deal with the scenario where: user opens the date time picker, then confirm without doing anything\n let result = extractFirst(props.parsedValue)\n if (!result) {\n const defaultTimeD = dayjs(defaultTime).locale(lang.value)\n const defaultValueD = getDefaultValue()\n result = defaultTimeD\n .year(defaultValueD.year())\n .month(defaultValueD.month())\n .date(defaultValueD.date())\n }\n innerDate.value = result\n emit(result)\n }\n}\n\nconst disabledNow = computed(() => {\n if (!disabledDate) return false\n return disabledDate(dayjs().locale(lang.value).toDate())\n})\nconst changeToNow = () => {\n // NOTE: not a permanent solution\n // consider disable \"now\" button in the future\n const now = dayjs().locale(lang.value)\n const nowDate = now.toDate()\n isChangeToNow.value = true\n if (\n (!disabledDate || !disabledDate(nowDate)) &&\n checkDateWithinRange(nowDate)\n ) {\n innerDate.value = dayjs().locale(lang.value)\n emit(innerDate.value)\n }\n}\n\nconst timeFormat = computed(() => {\n return (\n props.timeFormat || extractTimeFormat(props.format) || DEFAULT_FORMATS_TIME\n )\n})\n\nconst dateFormat = computed(() => {\n return (\n props.dateFormat || extractDateFormat(props.format) || DEFAULT_FORMATS_DATE\n )\n})\n\nconst visibleTime = computed(() => {\n if (userInputTime.value) return userInputTime.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(timeFormat.value)\n})\n\nconst visibleDate = computed(() => {\n if (userInputDate.value) return userInputDate.value\n if (!props.parsedValue && !defaultValue.value) return\n const dateValue = extractFirst(props.parsedValue) || innerDate.value\n return dateValue.format(dateFormat.value)\n})\n\nconst timePickerVisible = ref(false)\nconst onTimePickerInputFocus = () => {\n timePickerVisible.value = true\n}\nconst handleTimePickClose = () => {\n timePickerVisible.value = false\n}\n\nconst getUnits = (date: Dayjs) => {\n return {\n hour: date.hour(),\n minute: date.minute(),\n second: date.second(),\n year: date.year(),\n month: date.month(),\n date: date.date(),\n }\n}\n\nconst handleTimePick = (value: Dayjs, visible: boolean, first: boolean) => {\n const { hour, minute, second } = getUnits(value)\n const parsedDateValue = extractFirst(props.parsedValue)\n const newDate = parsedDateValue\n ? parsedDateValue.hour(hour).minute(minute).second(second)\n : value\n innerDate.value = newDate\n emit(innerDate.value, true)\n if (!first) {\n timePickerVisible.value = visible\n }\n}\n\nconst handleVisibleTimeChange = (value: string) => {\n const newDate = dayjs(value, timeFormat.value).locale(lang.value)\n if (newDate.isValid() && checkDateWithinRange(newDate)) {\n const { year, month, date } = getUnits(innerDate.value)\n innerDate.value = newDate.year(year).month(month).date(date)\n userInputTime.value = null\n timePickerVisible.value = false\n emit(innerDate.value, true)\n }\n}\n\nconst handleVisibleDateChange = (value: string) => {\n const newDate = correctlyParseUserInput(\n value,\n dateFormat.value,\n lang.value,\n isDefaultFormat\n ) as Dayjs\n if (newDate.isValid()) {\n if (disabledDate && disabledDate(newDate.toDate())) {\n return\n }\n const { hour, minute, second } = getUnits(innerDate.value)\n innerDate.value = newDate.hour(hour).minute(minute).second(second)\n userInputDate.value = null\n emit(innerDate.value, true)\n }\n}\n\nconst isValidValue = (date: unknown) => {\n return (\n dayjs.isDayjs(date) &&\n date.isValid() &&\n (disabledDate ? !disabledDate(date.toDate()) : true)\n )\n}\n\nconst parseUserInput = (value: Dayjs) => {\n return correctlyParseUserInput(\n value,\n props.format,\n lang.value,\n isDefaultFormat\n )\n}\n\nconst getDefaultValue = () => {\n const parseDate = dayjs(defaultValue.value).locale(lang.value)\n if (!defaultValue.value) {\n const defaultTimeDValue = defaultTimeD.value\n return dayjs()\n .hour(defaultTimeDValue.hour())\n .minute(defaultTimeDValue.minute())\n .second(defaultTimeDValue.second())\n .locale(lang.value)\n }\n return parseDate\n}\n\nconst handleFocusPicker = () => {\n if (['week', 'month', 'year', 'date'].includes(selectionMode.value)) {\n currentViewRef.value?.focus()\n }\n}\n\nconst _handleFocusPicker = () => {\n handleFocusPicker()\n // TODO: After focus the date input, the first time you use the ArrowDown keys, you cannot focus on the date cell\n if (selectionMode.value === 'week') {\n handleKeyControl(EVENT_CODE.down)\n }\n}\n\nconst handleKeydownTable = (event: KeyboardEvent) => {\n const code = getEventCode(event)\n\n const validCode = [\n EVENT_CODE.up,\n EVENT_CODE.down,\n EVENT_CODE.left,\n EVENT_CODE.right,\n EVENT_CODE.home,\n EVENT_CODE.end,\n EVENT_CODE.pageUp,\n EVENT_CODE.pageDown,\n ]\n if (validCode.includes(code)) {\n handleKeyControl(code)\n event.stopPropagation()\n event.preventDefault()\n }\n if (\n [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(\n code\n ) &&\n userInputDate.value === null &&\n userInputTime.value === null\n ) {\n event.preventDefault()\n emit(innerDate.value, false)\n }\n}\n\nconst handleKeyControl = (code: string) => {\n type KeyControlMappingCallableOffset = (date: Date, step?: number) => number\n type KeyControl = {\n [key: string]:\n | number\n | KeyControlMappingCallableOffset\n | ((date: Date, step: number) => any)\n offset: (date: Date, step: number) => any\n }\n interface KeyControlMapping {\n [key: string]: KeyControl\n }\n\n const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE\n const mapping: KeyControlMapping = {\n year: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setFullYear(date.getFullYear() + step),\n },\n month: {\n [up]: -4,\n [down]: 4,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setMonth(date.getMonth() + step),\n },\n week: {\n [up]: -1,\n [down]: 1,\n [left]: -1,\n [right]: 1,\n offset: (date: Date, step: number) =>\n date.setDate(date.getDate() + step * 7),\n },\n date: {\n [up]: -7,\n [down]: 7,\n [left]: -1,\n [right]: 1,\n [home]: (date: Date) => -date.getDay(),\n [end]: (date: Date) => -date.getDay() + 6,\n [pageUp]: (date: Date) =>\n -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),\n [pageDown]: (date: Date) =>\n new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),\n offset: (date: Date, step: number) => date.setDate(date.getDate() + step),\n },\n }\n\n const newDate = innerDate.value.toDate()\n while (Math.abs(innerDate.value.diff(newDate, 'year', true)) < 1) {\n const map = mapping[keyboardMode.value]\n if (!map) return\n map.offset(\n newDate,\n isFunction(map[code])\n ? (map[code] as unknown as KeyControlMappingCallableOffset)(newDate)\n : ((map[code] as number) ?? 0)\n )\n if (disabledDate && disabledDate(newDate)) {\n break\n }\n const result = dayjs(newDate).locale(lang.value)\n innerDate.value = result\n contextEmit('pick', result, true)\n break\n }\n}\n\nconst handlePanelChange = (mode: 'month' | 'year') => {\n contextEmit('panel-change', innerDate.value.toDate(), mode, currentView.value)\n}\n\nwatch(\n () => selectionMode.value,\n (val) => {\n if (['month', 'year'].includes(val)) {\n currentView.value = val\n return\n } else if (val === 'years') {\n currentView.value = 'year'\n return\n } else if (val === 'months') {\n currentView.value = 'month'\n return\n }\n currentView.value = 'date'\n },\n { immediate: true }\n)\n\nwatch(\n () => defaultValue.value,\n (val) => {\n if (val) {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.parsedValue,\n (val) => {\n if (val) {\n if (isMultipleType.value) return\n if (isArray(val)) return\n innerDate.value = val\n } else {\n innerDate.value = getDefaultValue()\n }\n },\n { immediate: true }\n)\n\ncontextEmit('set-picker-option', ['isValidValue', isValidValue])\ncontextEmit('set-picker-option', ['parseUserInput', parseUserInput])\ncontextEmit('set-picker-option', ['handleFocusPicker', _handleFocusPicker])\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyRA,MAAM,mBAAmB,GAAe,IAAS,QAAgB;EACjE,MAAM,QAAQ;EACd,MAAM,cAAc;EACpB,MAAM,OAAO,6BAAa,eAAc;EACxC,MAAM,OAAO,6BAAa,cAAa;EACvC,MAAM,2BAAiB;EACvB,MAAM,2BAAiB;EAEvB,MAAM,EAAE,GAAG,SAAS,yBAAU;EAC9B,MAAM,6BAAoB,4CAA0B;EACpD,MAAM,kCACJ,iEACA,OACD;EACD,MAAM,EAAE,WAAW,cAAc,eAAe,gBAAgB,WAAW;EAC3E,MAAM,8BAAqB,WAAW,OAAO,eAAc;EAE3D,MAAM,+BAA4C;EAElD,MAAM,6CAAuB,CAAC,OAAO,KAAK,MAAM,CAAA;EAEhD,MAAM,6BAAoB,MAAK;EAE/B,IAAI,aAAa;EAEjB,MAAM,uCAA8B;AAClC,6BAAa,YAAY,CAAC,OAAO,KAAK,MAAK;IAC5C;EAED,MAAM,gCAAuB;AAC3B,UAAO,UAAU,MAAM,OAAM;IAC9B;EAED,MAAM,+BAAsB;AAC1B,UAAO,UAAU,MAAM,MAAK;IAC7B;EAED,MAAM,+BAAsB,EAAE,CAAA;EAC9B,MAAM,6BAAmC,KAAI;EAC7C,MAAM,6BAAmC,KAAI;EAE7C,MAAM,wBAAwB,SAAqB;AACjD,UAAO,gBAAgB,MAAM,SAAS,IAClC,gBACE,MACA,gBAAgB,OAChB,MAAM,UAAU,uCAClB,GACA;;EAEN,MAAM,cAAc,cAAqB;AACvC,OACE,eACA,CAAC,YA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AAA;OACN,gBAAcC,KAAAA;OACd,gCAAe,aAAY;OAC3B,yBAAU,aAAY;OACtB,kCAAiB,cAAa;OAC9B,oBAAkBC,KAAAA;OAClB,QAAM;;;;;;;;;;MAGD,YAAA,UAAW,qDASjB,kCAAA;;gBARI;OAAJ,KAAI;OACH,kBAAgB,cAAA;OAChB,MAAM,UAAA;OACN,gCAAe,aAAY;OAC3B,yBAAU,aAAY;OACtB,gBAAcD,KAAAA;OACd,kCAAiB,cAAa;OAC9B,QAAM;;;;;;;;;MAGD,YAAA,UAAW,sDASjB,mCAAA;;gBARI;OAAJ,KAAI;OACH,kBAAgB,cAAA;OAChB,MAAM,UAAA;OACN,gBAAcA,KAAAA;OACd,gCAAe,aAAY;OAC3B,yBAAU,aAAY;OACtB,kCAAiB,cAAa;OAC9B,QAAM;;;;;;;;;;;UAMPE,KAAAA,cAAc,cAAA,SAAiB,aAAA,2DAuBjC,OAAA;;IAtBH,8CAAO,KAAI,CAAC,EAAC,SAAA,CAAA;mEAWF,yBAAA,EAAA;IAPV,MAAA;IACA,MAAK;IACJ,8CAAO,KAAI,CAAC,EAAC,WAAA,CAAA;IACb,UAAU,YAAA;IACV,SAAO;;oCAEoB,kEAAzB,EAAC,CAAA,oBAAA,CAAA,EAAA,EAAA;;+CAPK,eAAA,SAAkBC,KAAAA,QAAO,IAU5BC,KAAAA,yEAQI,yBAAA,EAAA;;IAPV,OAAA;IACA,MAAK;IACJ,8CAAO,KAAI,CAAC,EAAC,WAAA,CAAA;IACb,UAAU,gBAAA;IACV,SAAO;;oCAEwB,kEAA7B,EAAC,CAAA,wBAAA,CAAA,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":["buildProps","definePropType","iconPropType","CircleClose","useTooltipContentProps","useSizeProp","defaultProps","placements","tagProps","isBoolean","isNumber","ArrowDown","useEmptyValuesProps","useAriaProps","UPDATE_MODEL_EVENT","CHANGE_EVENT"],"sources":["../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { ArrowDown, CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type SelectV2 from './select.vue'\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\n/**\n * @description Tag tooltip configuration interface\n */\nexport interface TagTooltipProps {\n appendTo?: string | HTMLElement\n placement?: Placement\n fallbackPlacements?: Placement[]\n effect?: PopperEffect\n popperClass?: string\n popperStyle?: string | CSSProperties\n transition?: string\n teleported?: boolean\n popperOptions?: Partial<Options>\n showAfter?: number\n hideAfter?: number\n autoClose?: number\n offset?: number\n}\n\nexport const selectV2Props = buildProps({\n /**\n * @description whether creating new items is allowed. To use this, `filterable` must be true\n */\n allowCreate: Boolean,\n /**\n * @description autocomplete of select input\n */\n autocomplete: {\n type: definePropType<'none' | 'both' | 'list' | 'inline'>(String),\n default: 'none',\n },\n /**\n * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n */\n automaticDropdown: Boolean,\n /**\n * @description whether select can be cleared\n */\n clearable: Boolean,\n /**\n * @description custom clear icon\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to collapse tags to a text when multiple selecting\n */\n collapseTags: Boolean,\n /**\n * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n */\n collapseTagsTooltip: Boolean,\n /**\n * @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true\n */\n tagTooltip: {\n type: definePropType<TagTooltipProps>(Object),\n default: () => ({}),\n },\n /**\n * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n */\n maxCollapseTags: {\n type: Number,\n default: 1,\n },\n /**\n * @description\n */\n defaultFirstOption: Boolean,\n /**\n * @description is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description whether Select is filterable\n */\n filterable: Boolean,\n /**\n * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true\n */\n filterMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description The height of the dropdown panel, 34px for each item\n */\n height: {\n type: Number,\n default: 274, // same as select dropdown menu\n },\n /**\n * @description The height of the dropdown item\n */\n itemHeight: {\n type: Number,\n default: 34,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description whether Select is loading data from server\n */\n loading: Boolean,\n /**\n * @description displayed text while loading data from server, default is 'Loading'\n */\n loadingText: String,\n /**\n * @description biding value\n */\n modelValue: {\n type: definePropType<\n any[] | string | number | boolean | Record<string, any> | any\n >([Array, String, Number, Boolean, Object]),\n default: undefined,\n },\n /**\n * @description is multiple\n */\n multiple: Boolean,\n /**\n * @description maximum number of options user can select when multiple is true. No limit when set to 0\n */\n multipleLimit: {\n type: Number,\n default: 0,\n },\n /**\n * @description the name attribute of select input\n */\n name: String,\n /**\n * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n */\n noDataText: String,\n /**\n * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n */\n noMatchText: String,\n /**\n * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n */\n remoteMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description whether reserve the keyword after select filtered option.\n */\n reserveKeyword: {\n type: Boolean,\n default: true,\n },\n /**\n * @description data of the options, the key of `value` and `label` can be customize by `props`\n */\n options: {\n type: definePropType<OptionType[]>(Array),\n required: true,\n },\n /**\n * @description placeholder, the default is 'Please select'\n */\n placeholder: {\n type: String,\n },\n /**\n * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom class name for Select's dropdown\n */\n popperClass: useTooltipContentProps.popperClass,\n /**\n * @description custom style for Select's dropdown\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}) as Partial<Options>,\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\n /**\n * @description debounce delay during remote search, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description configuration options, see the following table\n */\n props: {\n type: definePropType<Props>(Object),\n default: () => defaultProps,\n },\n /**\n * @description unique identity key name for value, required when value is an object\n */\n valueKey: {\n type: String,\n default: 'value',\n },\n /**\n * @description Controls whether the scrollbar is always displayed\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the dropdown\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description in remote search method show suffix icon\n */\n remoteShowSuffix: Boolean,\n /**\n * @description Determines whether the arrow is displayed\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType<Placement>(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom-start', 'top-start', 'right', 'left'],\n },\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description which element the select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description if it is `true`, the width of the dropdown panel is the same as the input box.\n * if it is `false`, the width is automatically calculated based on the value of `label`,\n * or it can be set to a number to make it a fixed width\n */\n fitInputWidth: {\n type: [Boolean, Number],\n default: true,\n validator(val) {\n return isBoolean(val) || isNumber(val)\n },\n },\n suffixIcon: {\n type: iconPropType,\n default: ArrowDown,\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const optionV2Props = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType<Option>(Object),\n required: true,\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n} as const)\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectV2Emits = {\n [UPDATE_MODEL_EVENT]: (val: SelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: SelectV2Props['modelValue']) => true,\n 'remove-tag': (val: unknown) => true,\n 'visible-change': (visible: boolean) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport const optionV2Emits = {\n hover: (index?: number) => isNumber(index),\n select: (val: Option, index?: number) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type SelectV2Props = ExtractPropTypes<typeof selectV2Props>\nexport type SelectV2PropsPublic = ExtractPublicPropTypes<typeof selectV2Props>\nexport type OptionV2Props = ExtractPropTypes<typeof optionV2Props>\nexport type OptionV2PropsPublic = ExtractPublicPropTypes<typeof optionV2Props>\nexport type SelectV2EmitFn = EmitFn<typeof selectV2Emits>\nexport type OptionV2EmitFn = EmitFn<typeof optionV2Emits>\n\nexport type SelectV2Instance = InstanceType<typeof SelectV2> & unknown\n"],"mappings":";;;;;;;;;;;;;;;;AAqDA,MAAa,gBAAgBA,6BAAW;CAItC,aAAa;CAIb,cAAc;EACZ,MAAMC,iCAAoD,OAAO;EACjE,SAAS;EACV;CAID,mBAAmB;CAInB,WAAW;CAIX,WAAW;EACT,MAAMC;EACN,SAASC;EACV;CAID,QAAQ;EACN,MAAMF,iCAA6B,OAAO;EAC1C,SAAS;EACV;CAID,cAAc;CAId,qBAAqB;CAIrB,YAAY;EACV,MAAMA,iCAAgC,OAAO;EAC7C,gBAAgB,EAAE;EACnB;CAID,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CAID,oBAAoB;CAIpB,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,uBAAuB;EACrB,MAAM;EACN,SAAS;EACV;CAID,YAAY;CAIZ,cAAc,EACZ,MAAMA,iCAAwC,SAAS,EACxD;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAM;EACN,SAAS;EACV;CAID,IAAI;CAIJ,SAAS;CAIT,aAAa;CAIb,YAAY;EACV,MAAMA,iCAEJ;GAAC;GAAO;GAAQ;GAAQ;GAAS;GAAO,CAAC;EAC3C,SAAS;EACV;CAID,UAAU;CAIV,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,MAAM;CAIN,YAAY;CAIZ,aAAa;CAIb,cAAc,EACZ,MAAMA,iCAAwC,SAAS,EACxD;CAID,gBAAgB;EACd,MAAM;EACN,SAAS;EACV;CAID,SAAS;EACP,MAAMA,iCAA6B,MAAM;EACzC,UAAU;EACX;CAID,aAAa,EACX,MAAM,QACP;CAID,YAAYG,uCAAuB;CAInC,YAAY;EACV,MAAM;EACN,SAAS;EACV;CAID,aAAaA,uCA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AAmB,YAAqB;CACxC,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,aAAa;CACd;AACD,MAAa,gBAAgB;CAC3B,QAAQ,UAAmBL,uBAAS,MAAM;CAC1C,SAAS,KAAa,UAAmB;CAC1C"}
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["buildProps","definePropType","iconPropType","CircleClose","useTooltipContentProps","useSizeProp","defaultProps","placements","tagProps","isBoolean","isNumber","ArrowDown","useEmptyValuesProps","useAriaProps","UPDATE_MODEL_EVENT","CHANGE_EVENT"],"sources":["../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { ArrowDown, CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type SelectV2 from './select.vue'\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\n/**\n * @description Tag tooltip configuration interface\n */\nexport interface TagTooltipProps {\n appendTo?: string | HTMLElement\n placement?: Placement\n fallbackPlacements?: Placement[]\n effect?: PopperEffect\n popperClass?: string\n popperStyle?: string | CSSProperties\n transition?: string\n teleported?: boolean\n popperOptions?: Partial<Options>\n showAfter?: number\n hideAfter?: number\n autoClose?: number\n offset?: number\n}\n\nexport const selectV2Props = buildProps({\n /**\n * @description whether creating new items is allowed. To use this, `filterable` must be true\n */\n allowCreate: Boolean,\n /**\n * @description autocomplete of select input\n */\n autocomplete: {\n type: definePropType<'none' | 'both' | 'list' | 'inline'>(String),\n default: 'none',\n },\n /**\n * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n */\n automaticDropdown: Boolean,\n /**\n * @description whether select can be cleared\n */\n clearable: Boolean,\n /**\n * @description custom clear icon\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to collapse tags to a text when multiple selecting\n */\n collapseTags: Boolean,\n /**\n * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n */\n collapseTagsTooltip: Boolean,\n /**\n * @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true\n */\n tagTooltip: {\n type: definePropType<TagTooltipProps>(Object),\n default: () => ({}),\n },\n /**\n * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n */\n maxCollapseTags: {\n type: Number,\n default: 1,\n },\n /**\n * @description\n */\n defaultFirstOption: Boolean,\n /**\n * @description is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description Estimated item height for variable option sizes. Defaults to fixed `itemHeight` when omitted.\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description whether Select is filterable\n */\n filterable: Boolean,\n /**\n * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true\n */\n filterMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description The height of the dropdown panel, 34px for each item\n */\n height: {\n type: Number,\n default: 274, // same as select dropdown menu\n },\n /**\n * @description The height of the dropdown item\n */\n itemHeight: {\n type: Number,\n default: 34,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description whether Select is loading data from server\n */\n loading: Boolean,\n /**\n * @description displayed text while loading data from server, default is 'Loading'\n */\n loadingText: String,\n /**\n * @description biding value\n */\n modelValue: {\n type: definePropType<\n any[] | string | number | boolean | Record<string, any> | any\n >([Array, String, Number, Boolean, Object]),\n default: undefined,\n },\n /**\n * @description is multiple\n */\n multiple: Boolean,\n /**\n * @description maximum number of options user can select when multiple is true. No limit when set to 0\n */\n multipleLimit: {\n type: Number,\n default: 0,\n },\n /**\n * @description the name attribute of select input\n */\n name: String,\n /**\n * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n */\n noDataText: String,\n /**\n * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n */\n noMatchText: String,\n /**\n * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n */\n remoteMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description whether reserve the keyword after select filtered option.\n */\n reserveKeyword: {\n type: Boolean,\n default: true,\n },\n /**\n * @description data of the options, the key of `value` and `label` can be customize by `props`\n */\n options: {\n type: definePropType<OptionType[]>(Array),\n required: true,\n },\n /**\n * @description placeholder, the default is 'Please select'\n */\n placeholder: {\n type: String,\n },\n /**\n * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom class name for Select's dropdown\n */\n popperClass: useTooltipContentProps.popperClass,\n /**\n * @description custom style for Select's dropdown\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}) as Partial<Options>,\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\n /**\n * @description debounce delay during remote search, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description configuration options, see the following table\n */\n props: {\n type: definePropType<Props>(Object),\n default: () => defaultProps,\n },\n /**\n * @description unique identity key name for value, required when value is an object\n */\n valueKey: {\n type: String,\n default: 'value',\n },\n /**\n * @description Controls whether the scrollbar is always displayed\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the dropdown\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description in remote search method show suffix icon\n */\n remoteShowSuffix: Boolean,\n /**\n * @description Determines whether the arrow is displayed\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType<Placement>(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom-start', 'top-start', 'right', 'left'],\n },\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description which element the select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description if it is `true`, the width of the dropdown panel is the same as the input box.\n * if it is `false`, the width is automatically calculated based on the value of `label`,\n * or it can be set to a number to make it a fixed width\n */\n fitInputWidth: {\n type: [Boolean, Number],\n default: true,\n validator(val) {\n return isBoolean(val) || isNumber(val)\n },\n },\n suffixIcon: {\n type: iconPropType,\n default: ArrowDown,\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const optionV2Props = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType<Option>(Object),\n required: true,\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n} as const)\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectV2Emits = {\n [UPDATE_MODEL_EVENT]: (val: SelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: SelectV2Props['modelValue']) => true,\n 'remove-tag': (val: unknown) => true,\n 'visible-change': (visible: boolean) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport const optionV2Emits = {\n hover: (index?: number) => isNumber(index),\n select: (val: Option, index?: number) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type SelectV2Props = ExtractPropTypes<typeof selectV2Props>\nexport type SelectV2PropsPublic = ExtractPublicPropTypes<typeof selectV2Props>\nexport type OptionV2Props = ExtractPropTypes<typeof optionV2Props>\nexport type OptionV2PropsPublic = ExtractPublicPropTypes<typeof optionV2Props>\nexport type SelectV2EmitFn = EmitFn<typeof selectV2Emits>\nexport type OptionV2EmitFn = EmitFn<typeof optionV2Emits>\n\nexport type SelectV2Instance = InstanceType<typeof SelectV2> & unknown\n"],"mappings":";;;;;;;;;;;;;;;;AAqDA,MAAa,gBAAgBA,6BAAW;CAItC,aAAa;CAIb,cAAc;EACZ,MAAMC,iCAAoD,OAAO;EACjE,SAAS;EACV;CAID,mBAAmB;CAInB,WAAW;CAIX,WAAW;EACT,MAAMC;EACN,SAASC;EACV;CAID,QAAQ;EACN,MAAMF,iCAA6B,OAAO;EAC1C,SAAS;EACV;CAID,cAAc;CAId,qBAAqB;CAIrB,YAAY;EACV,MAAMA,iCAAgC,OAAO;EAC7C,gBAAgB,EAAE;EACnB;CAID,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CAID,oBAAoB;CAIpB,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,uBAAuB;EACrB,MAAM;EACN,SAAS;EACV;CAID,YAAY;CAIZ,cAAc,EACZ,MAAMA,iCAAwC,SAAS,EACxD;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAM;EACN,SAAS;EACV;CAID,IAAI;CAIJ,SAAS;CAIT,aAAa;CAIb,YAA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BAAU,IAAI,IAAIC,uBAAS,IAAI;;EAEzC;CACD,YAAY;EACV,MAAMR;EACN,SAASS;EACV;CACD,GAAGC;CACH,GAAGC,6BAAa,CAAC,YAAY,CAAC;CAC/B,CAAU;AAEX,MAAa,gBAAgBb,6BAAW;CACtC,MAAM;CACN,UAAU;CACV,UAAU;CACV,MAAM;EACJ,MAAMC,iCAAuB,OAAO;EACpC,UAAU;EACX;CACD,OAAO;CACP,OAAO;CACP,UAAU;CACV,SAAS;CACV,CAAU;AAGX,MAAa,gBAAgB;EAC1Ba,oCAAsB,QAAqC;EAC3DC,8BAAgB,QAAqC;CACtD,eAAe,QAAiB;CAChC,mBAAmB,YAAqB;CACxC,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,aAAa;CACd;AACD,MAAa,gBAAgB;CAC3B,QAAQ,UAAmBL,uBAAS,MAAM;CAC1C,SAAS,KAAa,UAAmB;CAC1C"}
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20260321'\n"],"mappings":";;;AAAA,MAAa,UAAU"}
|