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
11 KiB
1 lines
11 KiB
{"ast":null,"code":"import { useTooltipTriggerProps } from '../../tooltip/src/trigger.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { EVENT_CODE } from '../../../constants/aria.mjs';\nimport { useTooltipContentProps } from '../../tooltip/src/content.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\nimport { createCollectionWithScope } from '../../collection/src/collection.mjs';\nconst dropdownProps = buildProps({\n trigger: useTooltipTriggerProps.trigger,\n triggerKeys: {\n type: definePropType(Array),\n default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space, EVENT_CODE.down]\n },\n effect: {\n ...useTooltipContentProps.effect,\n default: \"light\"\n },\n type: {\n type: definePropType(String)\n },\n placement: {\n type: definePropType(String),\n default: \"bottom\"\n },\n popperOptions: {\n type: definePropType(Object),\n default: () => ({})\n },\n id: String,\n size: {\n type: String,\n default: \"\"\n },\n splitButton: Boolean,\n hideOnClick: {\n type: Boolean,\n default: true\n },\n loop: {\n type: Boolean,\n default: true\n },\n showTimeout: {\n type: Number,\n default: 150\n },\n hideTimeout: {\n type: Number,\n default: 150\n },\n tabindex: {\n type: definePropType([Number, String]),\n default: 0\n },\n maxHeight: {\n type: definePropType([Number, String]),\n default: \"\"\n },\n popperClass: {\n type: String,\n default: \"\"\n },\n disabled: Boolean,\n role: {\n type: String,\n default: \"menu\"\n },\n buttonProps: {\n type: definePropType(Object)\n },\n teleported: useTooltipContentProps.teleported\n});\nconst dropdownItemProps = buildProps({\n command: {\n type: [Object, String, Number],\n default: () => ({})\n },\n disabled: Boolean,\n divided: Boolean,\n textValue: String,\n icon: {\n type: iconPropType\n }\n});\nconst dropdownMenuProps = buildProps({\n onKeydown: {\n type: definePropType(Function)\n }\n});\nconst FIRST_KEYS = [EVENT_CODE.down, EVENT_CODE.pageDown, EVENT_CODE.home];\nconst LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst {\n ElCollection,\n ElCollectionItem,\n COLLECTION_INJECTION_KEY,\n COLLECTION_ITEM_INJECTION_KEY\n} = createCollectionWithScope(\"Dropdown\");\nexport { COLLECTION_INJECTION_KEY as DROPDOWN_COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY as DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, ElCollection, ElCollectionItem, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, dropdownItemProps, dropdownMenuProps, dropdownProps };","map":{"version":3,"names":["dropdownProps","buildProps","trigger","useTooltipTriggerProps","triggerKeys","type","definePropType","Array","default","EVENT_CODE","enter","numpadEnter","space","down","effect","useTooltipContentProps","String","placement","popperOptions","Object","id","size","splitButton","Boolean","hideOnClick","loop","showTimeout","Number","hideTimeout","tabindex","maxHeight","popperClass","disabled","role","buttonProps","teleported","dropdownItemProps","command","divided","textValue","icon","iconPropType","dropdownMenuProps","onKeydown","Function","FIRST_KEYS","pageDown","home","LAST_KEYS","up","pageUp","end","FIRST_LAST_KEYS","ElCollection","ElCollectionItem","COLLECTION_INJECTION_KEY","COLLECTION_ITEM_INJECTION_KEY","createCollectionWithScope"],"sources":["../../../../../../packages/components/dropdown/src/dropdown.ts"],"sourcesContent":["// @ts-nocheck\nimport { buildProps, definePropType, iconPropType } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { createCollectionWithScope } from '@element-plus/components/collection'\nimport {\n useTooltipContentProps,\n useTooltipTriggerProps,\n} from '@element-plus/components/tooltip'\n\nimport type { Options } from '@popperjs/core'\nimport type { ButtonProps, ButtonType } from '@element-plus/components/button'\nimport type { Placement } from '@element-plus/components/popper'\nimport type { ComponentInternalInstance, ComputedRef } from 'vue'\nimport type { Nullable } from '@element-plus/utils'\n\nexport interface IElDropdownInstance {\n instance?: ComponentInternalInstance\n dropdownSize?: ComputedRef<string>\n handleClick?: () => void\n commandHandler?: (...arg) => void\n show?: () => void\n hide?: () => void\n trigger?: ComputedRef<string>\n hideOnClick?: ComputedRef<boolean>\n triggerElm?: ComputedRef<Nullable<HTMLButtonElement>>\n}\n\nexport const dropdownProps = buildProps({\n /**\n * @description how to trigger\n */\n trigger: useTooltipTriggerProps.trigger,\n triggerKeys: {\n type: definePropType<string[]>(Array),\n default: () => [\n EVENT_CODE.enter,\n EVENT_CODE.numpadEnter,\n EVENT_CODE.space,\n EVENT_CODE.down,\n ],\n },\n effect: {\n ...useTooltipContentProps.effect,\n default: 'light',\n },\n /**\n * @description menu button type, refer to `Button` Component, only works when `split-button` is true\n */\n type: {\n type: definePropType<ButtonType>(String),\n },\n /**\n * @description placement of pop menu\n */\n placement: {\n type: definePropType<Placement>(String),\n default: 'bottom',\n },\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}),\n },\n id: String,\n /**\n * @description menu size, also works on the split button\n */\n size: {\n type: String,\n default: '',\n },\n /**\n * @description whether a button group is displayed\n */\n splitButton: Boolean,\n /**\n * @description whether to hide menu after clicking menu-item\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n loop: {\n type: Boolean,\n default: true,\n },\n /**\n * @description delay time before show a dropdown (only works when trigger is `hover`)\n */\n showTimeout: {\n type: Number,\n default: 150,\n },\n /**\n * @description delay time before hide a dropdown (only works when trigger is `hover`)\n */\n hideTimeout: {\n type: Number,\n default: 150,\n },\n /**\n * @description [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of Dropdown\n */\n tabindex: {\n type: definePropType<number | string>([Number, String]),\n default: 0,\n },\n /**\n * @description the max height of menu\n */\n maxHeight: {\n type: definePropType<number | string>([Number, String]),\n default: '',\n },\n /**\n * @description custom class name for Dropdown's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description whether to disable\n */\n disabled: Boolean,\n /**\n * @description the ARIA role attribute for the dropdown menu. Depending on the use case, you may want to change this to 'navigation'\n */\n role: {\n type: String,\n default: 'menu',\n },\n buttonProps: {\n type: definePropType<ButtonProps>(Object),\n },\n /**\n * @description whether the dropdown popup is teleported to the body\n */\n teleported: useTooltipContentProps.teleported,\n} as const)\n\nexport const dropdownItemProps = buildProps({\n /**\n * @description a command to be dispatched to Dropdown's `command` callback\n */\n command: {\n type: [Object, String, Number],\n default: () => ({}),\n },\n /**\n * @description whether the item is disabled\n */\n disabled: Boolean,\n /**\n * @description whether a divider is displayed\n */\n divided: Boolean,\n textValue: String,\n /**\n * @description custom icon\n */\n icon: {\n type: iconPropType,\n },\n} as const)\n\nexport const dropdownMenuProps = buildProps({\n onKeydown: { type: definePropType<(e: KeyboardEvent) => void>(Function) },\n})\n\nexport const FIRST_KEYS = [\n EVENT_CODE.down,\n EVENT_CODE.pageDown,\n EVENT_CODE.home,\n]\n\nexport const LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end]\n\nexport const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]\n\nconst {\n ElCollection,\n ElCollectionItem,\n COLLECTION_INJECTION_KEY,\n COLLECTION_ITEM_INJECTION_KEY,\n} = createCollectionWithScope('Dropdown')\n\nexport {\n ElCollection,\n ElCollectionItem,\n COLLECTION_INJECTION_KEY as DROPDOWN_COLLECTION_INJECTION_KEY,\n COLLECTION_ITEM_INJECTION_KEY as DROPDOWN_COLLECTION_ITEM_INJECTION_KEY,\n}\n"],"mappings":";;;;;;AAOY,MAACA,aAAa,GAAGC,UAAU,CAAC;EACtCC,OAAO,EAAEC,sBAAsB,CAACD,OAAO;EACvCE,WAAW,EAAE;IACXC,IAAI,EAAEC,cAAc,CAACC,KAAK,CAAC;IAC3BC,OAAO,EAAEA,CAAA,KAAM,CACbC,UAAU,CAACC,KAAK,EAChBD,UAAU,CAACE,WAAW,EACtBF,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