You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
16 KiB
1 line
16 KiB
{"ast":null,"code":"import { placements } from '@popperjs/core';\nimport '../../../hooks/index.mjs';\nimport '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport '../../tooltip/index.mjs';\nimport { CircleClose } from '@element-plus/icons-vue';\nimport '../../tag/index.mjs';\nimport { defaultProps } from './useProps.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\nimport { useTooltipContentProps } from '../../tooltip/src/content.mjs';\nimport { useSizeProp } from '../../../hooks/use-size/index.mjs';\nimport { tagProps } from '../../tag/src/tag.mjs';\nimport { useEmptyValuesProps } from '../../../hooks/use-empty-values/index.mjs';\nimport { useAriaProps } from '../../../hooks/use-aria/index.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';\nimport { isNumber } from '../../../utils/types.mjs';\nconst SelectProps = buildProps({\n allowCreate: Boolean,\n autocomplete: {\n type: definePropType(String),\n default: \"none\"\n },\n automaticDropdown: Boolean,\n clearable: Boolean,\n clearIcon: {\n type: iconPropType,\n default: CircleClose\n },\n effect: {\n type: definePropType(String),\n default: \"light\"\n },\n collapseTags: Boolean,\n collapseTagsTooltip: Boolean,\n maxCollapseTags: {\n type: Number,\n default: 1\n },\n defaultFirstOption: Boolean,\n disabled: Boolean,\n estimatedOptionHeight: {\n type: Number,\n default: void 0\n },\n filterable: Boolean,\n filterMethod: Function,\n height: {\n type: Number,\n default: 274\n },\n itemHeight: {\n type: Number,\n default: 34\n },\n id: String,\n loading: Boolean,\n loadingText: String,\n modelValue: {\n type: definePropType([Array, String, Number, Boolean, Object])\n },\n multiple: Boolean,\n multipleLimit: {\n type: Number,\n default: 0\n },\n name: String,\n noDataText: String,\n noMatchText: String,\n remoteMethod: Function,\n reserveKeyword: {\n type: Boolean,\n default: true\n },\n options: {\n type: definePropType(Array),\n required: true\n },\n placeholder: {\n type: String\n },\n teleported: useTooltipContentProps.teleported,\n persistent: {\n type: Boolean,\n default: true\n },\n popperClass: {\n type: String,\n default: \"\"\n },\n popperOptions: {\n type: definePropType(Object),\n default: () => ({})\n },\n remote: Boolean,\n size: useSizeProp,\n props: {\n type: definePropType(Object),\n default: () => defaultProps\n },\n valueKey: {\n type: String,\n default: \"value\"\n },\n scrollbarAlwaysOn: Boolean,\n validateEvent: {\n type: Boolean,\n default: true\n },\n placement: {\n type: definePropType(String),\n values: placements,\n default: \"bottom-start\"\n },\n fallbackPlacements: {\n type: definePropType(Array),\n default: [\"bottom-start\", \"top-start\", \"right\", \"left\"]\n },\n tagType: {\n ...tagProps.type,\n default: \"info\"\n },\n tagEffect: {\n ...tagProps.effect,\n default: \"light\"\n },\n ...useEmptyValuesProps,\n ...useAriaProps([\"ariaLabel\"])\n});\nconst OptionProps = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType(Object),\n required: true\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean\n});\nconst selectEmits = {\n [UPDATE_MODEL_EVENT]: val => true,\n [CHANGE_EVENT]: val => true,\n \"remove-tag\": val => true,\n \"visible-change\": visible => true,\n focus: evt => evt instanceof FocusEvent,\n blur: evt => evt instanceof FocusEvent,\n clear: () => true\n};\nconst optionEmits = {\n hover: index => isNumber(index),\n select: (val, index) => true\n};\nexport { OptionProps, SelectProps, optionEmits, selectEmits };","map":{"version":3,"names":["SelectProps","buildProps","allowCreate","Boolean","autocomplete","type","definePropType","String","default","automaticDropdown","clearable","clearIcon","iconPropType","CircleClose","effect","collapseTags","collapseTagsTooltip","maxCollapseTags","Number","defaultFirstOption","disabled","estimatedOptionHeight","filterable","filterMethod","Function","height","itemHeight","id","loading","loadingText","modelValue","Array","Object","multiple","multipleLimit","name","noDataText","noMatchText","remoteMethod","reserveKeyword","options","required","placeholder","teleported","useTooltipContentProps","persistent","popperClass","popperOptions","remote","size","useSizeProp","props","defaultProps","valueKey","scrollbarAlwaysOn","validateEvent","placement","values","placements","fallbackPlacements","tagType","tagProps","tagEffect","useEmptyValuesProps","useAriaProps","OptionProps","data","hovering","item","index","style","selected","created","selectEmits","UPDATE_MODEL_EVENT","val","CHANGE_EVENT","visible","focus","evt","FocusEvent","blur","clear","optionEmits","hover","isNumber","select"],"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 isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type { ExtractPropTypes } from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\nexport const SelectProps = 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>(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 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: Boolean,\n /**\n * @description\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description is filterable\n */\n filterable: Boolean,\n /**\n * @description\n */\n filterMethod: Function,\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\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 },\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: Function,\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 to the body\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: {\n type: String,\n default: '',\n },\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({} as Partial<Options>),\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\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 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 ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const OptionProps = 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 selectEmits = {\n [UPDATE_MODEL_EVENT]: (val: ISelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: ISelectV2Props['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 optionEmits = {\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 ISelectV2Props = ExtractPropTypes<typeof SelectProps>\nexport type IOptionV2Props = ExtractPropTypes<typeof OptionProps>\nexport type SelectEmitFn = EmitFn<typeof selectEmits>\nexport type OptionEmitFn = EmitFn<typeof optionEmits>\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBY,MAACA,WAAW,GAAGC,UAAU,CAAC;EACpCC,WAAW,EAAEC,OAAO;EACpBC,YAAY,EAAE;IACZC,IAAI,EAAEC,cAAc,CAACC,MAAM,CAAC;IAC5BC,OAAO,EAAE;EACb,CAAG;EACDC,iBAAiB,EAAEN,OAAO;EAC1BO,SAAS,EAAEP,OAAO;EAClBQ,SAAS,EAAE;IACTN,IAAI,EAAEO,YAAY;IAClBJ,OAAO,EAAEK;EACb,CAAG;EACDC,MAAM,EAAE;IACNT,IAAI,EAAEC,cAAc,CAACC,MAAM,CAAC;IAC5BC,OAAO,EAAE;EACb,CAAG;EACDO,YAAY,EAAEZ,OAAO;EACrBa,mBAAmB,EAAEb,OAAO;EAC5Bc,eAAe,EAAE;IACfZ,IAAI,EAAEa,MAAM;IACZV,OAAO,EAAE;EACb,CAAG;EACDW,kBAAkB,EAAEhB,OAAO;EAC3BiB,QAAQ,EAAEjB,OAAO;EACjBkB,qBAAqB,EAAE;IACrBhB,IAAI,EAAEa,MAAM;IACZV,OAAO,EAAE,KAAK;EAClB,CAAG;EACDc,UAAU,EAAEnB,OAAO;EACnBoB,YAAY,EAAEC,QAAQ;EACtBC,MAAM,EAAE;IACNpB,IAAI,EAAEa,MAAM;IACZV,OAAO,EAAE;EACb,CAAG;EACDkB,UAAU,EAAE;IACVrB,IAAI,EAAEa,MAAM;IACZV,OAAO,EAAE;EACb,CAAG;EACDmB,EAAE,EAAEp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