Files
chuanggao-website/client/node_modules/element-plus/es/components/message/src/message.mjs.map

1 line
8.3 KiB
Plaintext
Raw Normal View History

2026-05-12 16:53:18 +08:00
{"version":3,"file":"message.mjs","names":[],"sources":["../../../../../../packages/components/message/src/message.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isClient,\n mutable,\n} from '@element-plus/utils'\n\nimport type { AppContext, ExtractPublicPropTypes, VNode } from 'vue'\nimport type { IconPropType, Mutable } from '@element-plus/utils'\nimport type MessageConstructor from './message.vue'\n\nexport interface MessageProps {\n /**\n * @description custom class name for Message\n */\n customClass?: string\n /**\n * @description whether `message` is treated as HTML string\n */\n dangerouslyUseHTMLString?: boolean\n /**\n * @description display duration, millisecond. If set to 0, it will not turn off automatically\n */\n duration?: number\n /**\n * @description custom icon component, overrides `type`\n */\n icon?: IconPropType\n /**\n * @description message dom id\n */\n id?: string\n /**\n * @description message text\n */\n message?: string | VNode | (() => VNode)\n /**\n * @description callback function when closed with the message instance as the parameter\n */\n onClose?: () => void\n /**\n * @description whether to show a close button\n */\n showClose?: boolean\n /**\n * @description message type\n */\n type?: MessageType\n /**\n * @description whether message is plain\n */\n plain?: boolean\n /**\n * @description set the distance to the top of viewport\n */\n offset?: number\n /**\n * @description message placement position\n */\n placement?: MessagePlacement\n /**\n * @description message element zIndex value\n */\n zIndex?: number\n /**\n * @description merge messages with the same content, type of VNode message is not supported\n */\n grouping?: boolean\n /**\n * @description The number of repetitions, similar to badge, is used as the initial number when used with `grouping`\n */\n repeatNum?: number\n}\n\nexport const messageTypes = [\n 'primary',\n 'success',\n 'info',\n 'warning',\n 'error',\n] as const\n\nexport const messagePlacement = [\n 'top',\n 'top-left',\n 'top-right',\n 'bottom',\n 'bottom-left',\n 'bottom-right',\n] as const\n\nexport const MESSAGE_DEFAULT_PLACEMENT = 'top'\n\nexport type MessageType = (typeof messageTypes)[number]\nexport type MessagePlacement = (typeof messagePlacement)[number]\n/** @deprecated please use `MessageType` instead */\nexport type messageType = MessageType // will be removed in 3.0.0.\n\nexport interface MessageConfigContext {\n max?: number\n grouping?: boolean\n duration?: number\n offset?: number\n showClose?: boolean\n plain?: boolean\n placement?: string\n}\n\nexport const messageDefaults = mutable({\n customClass: '',\n dangerouslyUseHTMLString: false,\n duration: 3000,\n icon: undefined,\n id: '',\n message: '',\n onClose: undefined,\n showClose: false,\n type: 'info',\n plain: false,\n offset: 16,\n placement: undefined,\n zIndex: 0,\n grouping: false,\n repeatNum: 1,\n appendTo: isClient ? document.body : (undefined as never),\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `MessageProps` instead.\n */\nexport const messageProps = buildProps({\n /**\n * @description custom class name for Message\n */\n customClass: {\n type: String,\n default: messageDefaults.customClass,\n },\n /**\n * @description whether `message` is treated as HTML string\n */\n dangerouslyUseHTMLString: {\n type: Boolean,\n default: messageDefaults.dangerouslyUseHTMLString,\n },\n /**\n * @description display duration, millisecond. If set to 0, it will not turn off automatically\n */\n duration: {\n type: Number,\n default: messageDefaults.duration,\n },\n /**\n * @description custom icon component, overrides `type`\n */\n icon: {\n type: iconPropType,\n default: messageDefaults.icon,\n },\n /**\n * @description message dom id\n */\n id: {\n type: String,\n default: messageDefaults.id,\n },\n /**\n * @description message text\n */\n mes