UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 5.83 kB
{"version":3,"file":"popover.mjs","sources":["../../../../../../packages/components/popover/src/popover.ts"],"sourcesContent":["import { buildProps, isBoolean } from '@element-plus/utils'\nimport {\n useTooltipContentProps,\n useTooltipTriggerProps,\n} from '@element-plus/components/tooltip'\nimport { dropdownProps } from '@element-plus/components/dropdown'\n\nimport type { ExtractPropTypes, ExtractPublicPropTypes, PropType } from 'vue'\nimport type Popover from './popover.vue'\n\nexport const popoverProps = buildProps({\n /**\n * @description how the popover is triggered, not valid in controlled mode\n */\n trigger: useTooltipTriggerProps.trigger,\n /**\n * @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of popover through the keyboard, not valid in controlled mode\n */\n triggerKeys: useTooltipTriggerProps.triggerKeys,\n /**\n * @description popover placement\n */\n placement: dropdownProps.placement,\n /**\n * @description whether Popover is disabled\n */\n disabled: useTooltipTriggerProps.disabled,\n /**\n * @description whether popover is visible\n */\n visible: useTooltipContentProps.visible,\n /**\n * @description popover transition animation\n */\n transition: useTooltipContentProps.transition,\n /**\n * @description parameters for [popper.js](https://popper.js.org/docs/v2/)\n */\n popperOptions: dropdownProps.popperOptions,\n /**\n * @description [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of Popover\n */\n tabindex: dropdownProps.tabindex,\n /**\n * @description popover content, can be replaced with a default `slot`\n */\n content: useTooltipContentProps.content,\n /**\n * @description custom style for popover\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description custom class name for popover\n */\n popperClass: useTooltipContentProps.popperClass,\n enterable: {\n ...useTooltipContentProps.enterable,\n default: true,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n ...useTooltipContentProps.effect,\n default: 'light',\n },\n /**\n * @description whether popover dropdown is teleported to the body\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description which select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description popover title\n */\n title: String,\n /**\n * @description popover width\n */\n width: {\n type: [String, Number],\n default: 150,\n },\n /**\n * @description popover offset\n */\n offset: {\n type: Number,\n default: undefined,\n },\n /**\n * @description delay of appearance, in millisecond, not valid in controlled mode\n */\n showAfter: {\n type: Number,\n default: 0,\n },\n /**\n * @description delay of disappear, in millisecond, not valid in controlled mode\n */\n hideAfter: {\n type: Number,\n default: 200,\n },\n /**\n * @description timeout in milliseconds to hide tooltip, not valid in controlled mode\n */\n autoClose: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether a tooltip arrow is displayed or not. For more info, please refer to [ElPopper](https://github.com/element-plus/element-plus/tree/dev/packages/components/popper)\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description when popover inactive and `persistent` is `false` , popover will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n 'onUpdate:visible': {\n type: Function as PropType<(visible: boolean) => void>,\n },\n} as const)\nexport type PopoverProps = ExtractPropTypes<typeof popoverProps>\nexport type PopoverPropsPublic = ExtractPublicPropTypes<typeof popoverProps>\n\nexport const popoverEmits = {\n 'update:visible': (value: boolean) => isBoolean(value),\n 'before-enter': () => true,\n 'before-leave': () => true,\n 'after-enter': () => true,\n 'after-leave': () => true,\n}\nexport type PopoverEmits = typeof popoverEmits\n\nexport type PopoverInstance = InstanceType<typeof Popover> & unknown\n"],"names":[],"mappings":";;;;;;AAUO,MAAM,eAAe,UAAW,CAAA;AAAA,EAIrC,SAAS,sBAAuB,CAAA,OAAA;AAAA,EAIhC,aAAa,sBAAuB,CAAA,WAAA;AAAA,EAIpC,WAAW,aAAc,CAAA,SAAA;AAAA,EAIzB,UAAU,sBAAuB,CAAA,QAAA;AAAA,EAIjC,SAAS,sBAAuB,CAAA,OAAA;AAAA,EAIhC,YAAY,sBAAuB,CAAA,UAAA;AAAA,EAInC,eAAe,aAAc,CAAA,aAAA;AAAA,EAI7B,UAAU,aAAc,CAAA,QAAA;AAAA,EAIxB,SAAS,sBAAuB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