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

1 lines
9.6 KiB

{"ast":null,"code":"import { placements } from '@popperjs/core';\nimport { CommonProps } from '../../cascader-panel/src/config.mjs';\nimport { tagProps } from '../../tag/src/tag.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { useSizeProp } from '../../../hooks/use-size/index.mjs';\nimport { useTooltipContentProps } from '../../tooltip/src/content.mjs';\nimport { useEmptyValuesProps } from '../../../hooks/use-empty-values/index.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';\nimport { isBoolean } from '../../../utils/types.mjs';\nconst cascaderProps = buildProps({\n ...CommonProps,\n size: useSizeProp,\n placeholder: String,\n disabled: Boolean,\n clearable: Boolean,\n filterable: Boolean,\n filterMethod: {\n type: definePropType(Function),\n default: (node, keyword) => node.text.includes(keyword)\n },\n separator: {\n type: String,\n default: \" / \"\n },\n showAllLevels: {\n type: Boolean,\n default: true\n },\n collapseTags: Boolean,\n maxCollapseTags: {\n type: Number,\n default: 1\n },\n collapseTagsTooltip: {\n type: Boolean,\n default: false\n },\n debounce: {\n type: Number,\n default: 300\n },\n beforeFilter: {\n type: definePropType(Function),\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\", \"bottom\", \"top-start\", \"top\", \"right\", \"left\"]\n },\n popperClass: {\n type: String,\n default: \"\"\n },\n teleported: useTooltipContentProps.teleported,\n tagType: {\n ...tagProps.type,\n default: \"info\"\n },\n tagEffect: {\n ...tagProps.effect,\n default: \"light\"\n },\n validateEvent: {\n type: Boolean,\n default: true\n },\n persistent: {\n type: Boolean,\n default: true\n },\n ...useEmptyValuesProps\n});\nconst cascaderEmits = {\n [UPDATE_MODEL_EVENT]: _ => true,\n [CHANGE_EVENT]: _ => true,\n focus: evt => evt instanceof FocusEvent,\n blur: evt => evt instanceof FocusEvent,\n clear: () => true,\n visibleChange: val => isBoolean(val),\n expandChange: val => !!val,\n removeTag: val => !!val\n};\nexport { cascaderEmits, cascaderProps };","map":{"version":3,"names":["cascaderProps","buildProps","CommonProps","size","useSizeProp","placeholder","String","disabled","Boolean","clearable","filterable","filterMethod","type","definePropType","Function","default","node","keyword","text","includes","separator","showAllLevels","collapseTags","maxCollapseTags","Number","collapseTagsTooltip","debounce","beforeFilter","placement","values","placements","fallbackPlacements","Array","popperClass","teleported","useTooltipContentProps","tagType","tagProps","tagEffect","effect","validateEvent","persistent","useEmptyValuesProps","cascaderEmits","UPDATE_MODEL_EVENT","_","CHANGE_EVENT","focus","evt","FocusEvent","blur","clear","visibleChange","val","isBoolean","expandChange","removeTag"],"sources":["../../../../../../packages/components/cascader/src/cascader.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { CommonProps } from '@element-plus/components/cascader-panel'\nimport { buildProps, definePropType, isBoolean } from '@element-plus/utils'\nimport { useEmptyValuesProps, useSizeProp } from '@element-plus/hooks'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { tagProps } from '@element-plus/components/tag'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type {\n CascaderNode,\n CascaderValue,\n} from '@element-plus/components/cascader-panel'\nimport type { Placement } from '@element-plus/components/popper'\n\nexport const cascaderProps = buildProps({\n ...CommonProps,\n /**\n * @description size of input\n */\n size: useSizeProp,\n /**\n * @description placeholder of input\n */\n placeholder: String,\n /**\n * @description whether Cascader is disabled\n */\n disabled: Boolean,\n /**\n * @description whether selected value can be cleared\n */\n clearable: Boolean,\n /**\n * @description whether the options can be searched\n */\n filterable: Boolean,\n /**\n * @description customize search logic, the first parameter is `node`, the second is `keyword`, and need return a boolean value indicating whether it hits.\n */\n filterMethod: {\n type: definePropType<(node: CascaderNode, keyword: string) => boolean>(\n Function\n ),\n default: (node: CascaderNode, keyword: string) =>\n node.text.includes(keyword),\n },\n /**\n * @description option label separator\n */\n separator: {\n type: String,\n default: ' / ',\n },\n /**\n * @description whether to display all levels of the selected value in the input\n */\n showAllLevels: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to collapse tags in multiple selection mode\n */\n collapseTags: 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 native input id\n */\n collapseTagsTooltip: {\n type: Boolean,\n default: false,\n },\n /**\n * @description debounce delay when typing filter keyword, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description hook function before filtering with the value to be filtered as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, filtering will be aborted\n */\n beforeFilter: {\n type: definePropType<(value: string) => boolean | Promise<any>>(Function),\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', 'bottom', 'top-start', 'top', 'right', 'left'],\n },\n /**\n * @description custom class name for Cascader's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description whether cascader popup is teleported\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description tag type\n */\n // eslint-disable-next-line vue/require-prop-types\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description when dropdown is inactive and `persistent` is `false`, dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n ...useEmptyValuesProps,\n})\n\nexport const cascaderEmits = {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n [UPDATE_MODEL_EVENT]: (_: CascaderValue) => true,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n [CHANGE_EVENT]: (_: CascaderValue) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n visibleChange: (val: boolean) => isBoolean(val),\n expandChange: (val: CascaderValue) => !!val,\n removeTag: (val: CascaderNode['valueByOption']) => !!val,\n}\n\n// Type name is taken(cascader-panel/src/node), needs discussion\n// export type CascaderProps = ExtractPropTypes<typeof cascaderProps>\n\nexport type CascaderEmits = typeof cascaderEmits\n"],"mappings":";;;;;;;;;AAOY,MAACA,aAAa,GAAGC,UAAU,CAAC;EACtC,GAAGC,WAAW;EACdC,IAAI,EAAEC,WAAW;EACjBC,WAAW,EAAEC,MAAM;EACnBC,QAAQ,EAAEC,OAAO;EACjBC,SAAS,EAAED,OAAO;EAClBE,UAAU,EAAEF,OAAO;EACnBG,YAAY,EAAE;IACZC,IAAI,EAAEC,cAAc,CAACC,QAAQ,CAAC;IAC9BC,OAAO,EAAEA,CAACC,IAAI,EAAEC,OAAO,KAAKD,IAAI,CAACE,IAAI,CAACC,QAAQ,CAACF,OAAO;EAC1D,CAAG;EACDG,SAAS,EAAE;IACTR,IAAI,EAAEN,MAAM;IACZS,OAAO,EAAE;EACb,CAAG;EACDM,aAAa,EAAE;IACbT,IAAI,EAAEJ,OAAO;IACbO,OAAO,EAAE;EACb,CAAG;EACDO,YAAY,EAAEd,OAAO;EACrBe,eAAe,EAAE;IACfX,IAAI,EAAEY,MAAM;IACZT,OAAO,EAAE;EACb,CAAG;EACDU,mBAAmB,EAAE;IACnBb,IAAI,EAAEJ,OAAO;IACbO,OAAO,EAAE;EACb,CAAG;EACDW,QAAQ,EAAE;IACRd,IAAI,EAAEY,MAAM;IACZT,OAAO,EAAE;EACb,CAAG;EACDY,YAAY,EAAE;IACZf,IAAI,EAAEC,cAAc,CAACC,QAAQ,CAAC;IAC9BC,OAAO,EAAEA,CAAA,KAAM;EACnB,CAAG;EACDa,SAAS,EAAE;IACThB,IAAI,EAAEC,cAAc,CAACP,MAA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