UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 4.75 kB
{"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/tooltip/src/content.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport {\n popperContentProps,\n popperContentPropsDefaults,\n} from '@element-plus/components/popper'\nimport {\n useAriaProps,\n useDelayedToggleProps,\n useDelayedTogglePropsDefaults,\n} from '@element-plus/hooks'\nimport { teleportProps } from '@element-plus/components/teleport'\n\nimport type { AriaProps, UseDelayedToggleProps } from '@element-plus/hooks'\nimport type { PopperContentProps } from '@element-plus/components/popper'\nimport type TooltipContent from './content.vue'\nimport type { ExtractPublicPropTypes } from 'vue'\n\nexport interface ElTooltipContentProps\n extends UseDelayedToggleProps, Omit<PopperContentProps, 'visible'> {\n /**\n * @description which element the tooltip CONTENT appends to\n */\n appendTo?: string | HTMLElement\n /**\n * @description display content, can be overridden by `slot#content`\n */\n content?: string\n /**\n * @description whether `content` is treated as HTML string\n */\n rawContent?: boolean\n /**\n * @description when tooltip inactive and `persistent` is `false` , popconfirm will be destroyed\n */\n persistent?: boolean\n // because model toggle prop is generated dynamically\n // so the typing cannot be evaluated by typescript as type:\n // [name]: { type: Boolean, default: null }\n // so we need to declare that again for type checking.\n /**\n * @description visibility of Tooltip\n */\n visible?: boolean | null\n /**\n * @description animation name\n */\n transition?: string\n /**\n * @description whether tooltip content is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported?: boolean\n /**\n * @description whether Tooltip is disabled\n */\n disabled?: boolean\n ariaLabel?: AriaProps['ariaLabel']\n}\n\nexport const useTooltipContentPropsDefaults = {\n ...useDelayedTogglePropsDefaults,\n ...popperContentPropsDefaults,\n content: '',\n visible: null,\n teleported: true,\n} as const\n\n/**\n * @deprecated Removed after 3.0.0, Use `ElTooltipContentProps` instead.\n */\nexport const useTooltipContentProps = buildProps({\n ...useDelayedToggleProps,\n ...popperContentProps,\n /**\n * @description which element the tooltip CONTENT appends to\n */\n appendTo: {\n type: teleportProps.to.type,\n },\n /**\n * @description display content, can be overridden by `slot#content`\n */\n content: {\n type: String,\n default: '',\n },\n /**\n * @description whether `content` is treated as HTML string\n */\n rawContent: Boolean,\n /**\n * @description when tooltip inactive and `persistent` is `false` , popconfirm will be destroyed\n */\n persistent: Boolean,\n // because model toggle prop is generated dynamically\n // so the typing cannot be evaluated by typescript as type:\n // [name]: { type: Boolean, default: null }\n // so we need to declare that again for type checking.\n /**\n * @description visibility of Tooltip\n */\n visible: {\n type: definePropType<boolean | null>(Boolean),\n default: null,\n },\n /**\n * @description animation name\n */\n transition: String,\n /**\n * @description whether tooltip content is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether Tooltip is disabled\n */\n disabled: Boolean,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `ElTooltipContentProps` instead.\n */\nexport type ElTooltipContentPropsPublic = ExtractPublicPropTypes<\n typeof useTooltipContentProps\n>\n\nexport type TooltipContentInstance = InstanceType<typeof TooltipContent> &\n unknown\n"],"names":[],"mappings":";;;;;;AA0DO,MAAM,8BAAA,GAAiC;AAAA,EAC5C,GAAG,6BAAA;AAAA,EACH,GAAG,0BAAA;AAAA,EACH,OAAA,EAAS,EAAA;AAAA,EACT,OAAA,EAAS,IAAA;AAAA,EACT,UAAA,EAAY;AACd;AAKO,MAAM,yBAAyB,UAAA,CAAW;AAAA,EAC/C,GAAG,qBAAA;AAAA,EACH,GAAG,kBAAA;AAAA;AAAA;AAAA;AAAA,EAIH,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,cAAc,EAAA,CAAG;AAAA,GACzB;AAAA;AAAA;AAAA;AAAA,EAIA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,UAAA,EAAY,OAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQZ,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,eAA+B,OAAO,CAAA;AAAA,IAC5C,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,UAAA,EAAY,MAAA;AAAA;AAAA;AAAA;AAAA,EAIZ,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAA,EAAU,OAAA;AAAA,EACV,GAAG,YAAA,CAAa,CAAC,WAAW,CAAC;AAC/B,CAAU;;;;"}