{"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(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 | 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(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>(Object),\n default: () => ({} as Partial),\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(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(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType(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