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 line
6.5 KiB

{"ast":null,"code":"import '../../../utils/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\nconst notificationTypes = [\"success\", \"info\", \"warning\", \"error\"];\nconst notificationProps = buildProps({\n customClass: {\n type: String,\n default: \"\"\n },\n dangerouslyUseHTMLString: Boolean,\n duration: {\n type: Number,\n default: 4500\n },\n icon: {\n type: iconPropType\n },\n id: {\n type: String,\n default: \"\"\n },\n message: {\n type: definePropType([String, Object]),\n default: \"\"\n },\n offset: {\n type: Number,\n default: 0\n },\n onClick: {\n type: definePropType(Function),\n default: () => void 0\n },\n onClose: {\n type: definePropType(Function),\n required: true\n },\n position: {\n type: String,\n values: [\"top-right\", \"top-left\", \"bottom-right\", \"bottom-left\"],\n default: \"top-right\"\n },\n showClose: {\n type: Boolean,\n default: true\n },\n title: {\n type: String,\n default: \"\"\n },\n type: {\n type: String,\n values: [...notificationTypes, \"\"],\n default: \"\"\n },\n zIndex: Number\n});\nconst notificationEmits = {\n destroy: () => true\n};\nexport { notificationEmits, notificationProps, notificationTypes };","map":{"version":3,"names":["notificationTypes","notificationProps","buildProps","customClass","type","String","default","dangerouslyUseHTMLString","Boolean","duration","Number","icon","iconPropType","id","message","definePropType","Object","offset","onClick","Function","onClose","required","position","values","showClose","title","zIndex","notificationEmits","destroy"],"sources":["../../../../../../packages/components/notification/src/notification.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, VNode } from 'vue'\nimport type Notification from './notification.vue'\n\nexport const notificationTypes = [\n 'success',\n 'info',\n 'warning',\n 'error',\n] as const\n\nexport const notificationProps = buildProps({\n /**\n * @description custom class name for Notification\n */\n customClass: {\n type: String,\n default: '',\n },\n /**\n * @description whether `message` is treated as HTML string\n */\n dangerouslyUseHTMLString: Boolean,\n /**\n * @description duration before close. It will not automatically close if set 0\n */\n duration: {\n type: Number,\n default: 4500,\n },\n /**\n * @description custom icon component. It will be overridden by `type`\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description notification dom id\n */\n id: {\n type: String,\n default: '',\n },\n /**\n * @description description text\n */\n message: {\n type: definePropType<string | VNode>([String, Object]),\n default: '',\n },\n /**\n * @description offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset\n */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description callback function when notification clicked\n */\n onClick: {\n type: definePropType<() => void>(Function),\n default: () => undefined,\n },\n /**\n * @description callback function when closed\n */\n onClose: {\n type: definePropType<() => void>(Function),\n required: true,\n },\n /**\n * @description custom position\n */\n position: {\n type: String,\n values: ['top-right', 'top-left', 'bottom-right', 'bottom-left'],\n default: 'top-right',\n },\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description title\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description notification type\n */\n type: {\n type: String,\n values: [...notificationTypes, ''],\n default: '',\n },\n /**\n * @description initial zIndex\n */\n zIndex: Number,\n} as const)\nexport type NotificationProps = ExtractPropTypes<typeof notificationProps>\n\nexport const notificationEmits = {\n destroy: () => true,\n}\nexport type NotificationEmits = typeof notificationEmits\n\nexport type NotificationInstance = InstanceType<typeof Notification>\n\nexport type NotificationOptions = Omit<NotificationProps, 'id'> & {\n /**\n * @description set the root element for the notification, default to `document.body`\n */\n appendTo?: HTMLElement | string\n}\nexport type NotificationOptionsTyped = Omit<NotificationOptions, 'type'>\n\nexport interface NotificationHandle {\n close: () => void\n}\n\nexport type NotificationParams = Partial<NotificationOptions> | string | VNode\nexport type NotificationParamsTyped =\n | Partial<NotificationOptionsTyped>\n | string\n | VNode\n\nexport type NotifyFn = ((\n options?: NotificationParams\n) => NotificationHandle) & { closeAll: () => void }\n\nexport type NotifyTypedFn = (\n options?: NotificationParamsTyped\n) => NotificationHandle\n\nexport interface Notify extends NotifyFn {\n success: NotifyTypedFn\n warning: NotifyTypedFn\n error: NotifyTypedFn\n info: NotifyTypedFn\n}\n\nexport interface NotificationQueueItem {\n vm: VNode\n}\n\nexport type NotificationQueue = NotificationQueueItem[]\n"],"mappings":";;;AACY,MAACA,iBAAiB,GAAG,CAC/B,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACT;AACY,MAACC,iBAAiB,GAAGC,UAAU,CAAC;EAC1CC,WAAW,EAAE;IACXC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACb,CAAG;EACDC,wBAAwB,EAAEC,OAAO;EACjCC,QAAQ,EAAE;IACRL,IAAI,EAAEM,MAAM;IACZJ,OAAO,EAAE;EACb,CAAG;EACDK,IAAI,EAAE;IACJP,IAAI,EAAEQ;EACV,CAAG;EACDC,EAAE,EAAE;IACFT,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACb,CAAG;EACDQ,OAAO,EAAE;IACPV,IAAI,EAAEW,cAAc,CAAC,CAACV,MAAM,EAAEW,MAAM,CAAC,CAAC;IACtCV,OAAO,EAAE;EACb,CAAG;EACDW,MAAM,EAAE;IACNb,IAAI,EAAEM,MAAM;IACZJ,OAAO,EAAE;EACb,CAAG;EACDY,OAAO,EAAE;IACPd,IAAI,EAAEW,cAAc,CAACI,QAAQ,CAAC;IAC9Bb,OAAO,EAAEA,CAAA,KAAM,KAAK;EACxB,CAAG;EACDc,OAAO,EAAE;IACPhB,IAAI,EAAEW,cAAc,CAACI,QAAQ,CAAC;IAC9BE,QAAQ,EAAE;EACd,CAAG;EACDC,QAAQ,EAAE;IACRlB,IAAI,EAAEC,MAAM;IACZkB,MAAM,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,CAAC;IAChEjB,OAAO,EAAE;EACb,CAAG;EACDkB,SAAS,EAAE;IACTpB,IAAI,EAAEI,OAAO;IACbF,OAAO,EAAE;EACb,CAAG;EACDmB,KAAK,EAAE;IACLrB,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACb,CAAG;EACDF,IAAI,EAAE;IACJA,IAAI,EAAEC,MAAM;IACZkB,MAAM,EAAE,CAAC,GAAGvB,iBAAiB,EAAE,EAAE,CAAC;IAClCM,OAAO,EAAE;EACb,CAAG;EACDoB,MAAM,EAAEhB;AACV,CAAC;AACW,MAACiB,iBAAiB,GAAG;EAC/BC,OAAO,EAAEA,CAAA,KAAM;AACjB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}