{"version":3,"file":"notification2.mjs","sources":["../../../../../../packages/components/notification/src/notification.ts"],"sourcesContent":["import { buildProps, definePropType } from '@sgui-plus/utils/props'\r\n\r\nimport type { VNode, ExtractPropTypes } from 'vue'\r\n\r\nexport const notificationTypes = [\r\n  'primary',\r\n  'success',\r\n  'info',\r\n  'warning',\r\n  'error',\r\n] as const\r\n\r\nexport const notificationProps = buildProps({\r\n  customClass: {\r\n    type: String,\r\n    default: '',\r\n  },\r\n  duration: {\r\n    type: Number,\r\n    default: 4500,\r\n  },\r\n  icon: {\r\n    type: definePropType<string | Comment>([String, Object]),\r\n    default: '',\r\n  },\r\n  id: {\r\n    type: String,\r\n    default: '',\r\n  },\r\n  description: {\r\n    type: definePropType<string | VNode>([String, Object]),\r\n    default: '',\r\n  },\r\n  offset: {\r\n    type: Number,\r\n    default: 0,\r\n  },\r\n  onClick: {\r\n    type: definePropType<() => void>(Function),\r\n    default: () => undefined,\r\n  },\r\n  onClose: {\r\n    type: definePropType<() => void>(Function),\r\n    required: true,\r\n  },\r\n  position: {\r\n    type: String,\r\n    values: ['top-right', 'top-left', 'bottom-right', 'bottom-left'],\r\n    default: 'top-right',\r\n  },\r\n  closable: {\r\n    type: Boolean,\r\n    default: true,\r\n  },\r\n  title: {\r\n    type: String,\r\n    default: '',\r\n  },\r\n  type: {\r\n    type: String,\r\n    values: [...notificationTypes, ''],\r\n    default: '',\r\n  },\r\n  zIndex: {\r\n    type: Number,\r\n    default: 0,\r\n  },\r\n  grouping: {\r\n    type: Boolean,\r\n    default: false,\r\n  },\r\n  repeatNum: {\r\n    type: Number,\r\n    default: 1,\r\n  },\r\n} as const)\r\nexport type NotificationProps = ExtractPropTypes<typeof notificationProps>\r\n\r\nexport const notificationEmits = {\r\n  destroy: () => true,\r\n}\r\nexport type NotificationEmits = typeof notificationEmits\r\n\r\nexport type NotificationOptions = Omit<NotificationProps, 'id'>\r\nexport type NotificationOptionsTyped = Omit<NotificationOptions, 'type'>\r\n\r\nexport interface NotificationHandle {\r\n  close: () => void\r\n}\r\n\r\nexport type NotificationParams = Partial<NotificationOptions> | string | VNode\r\nexport type NotificationParamsTyped =\r\n  | Partial<NotificationOptionsTyped>\r\n  | string\r\n  | VNode\r\n\r\nexport type NotifyFn = ((\r\n  options?: NotificationParams\r\n) => NotificationHandle) & { closeAll: () => void }\r\n\r\nexport type NotifyTypedFn = (\r\n  options?: NotificationParamsTyped\r\n) => NotificationHandle\r\n\r\nexport interface Notify extends NotifyFn {\r\n  success: NotifyTypedFn\r\n  warning: NotifyTypedFn\r\n  error: NotifyTypedFn\r\n  info: NotifyTypedFn\r\n}\r\n\r\nexport interface NotificationQueueItem {\r\n  vm: VNode\r\n}\r\n\r\nexport type NotificationQueue = NotificationQueueItem[]\r\n"],"names":[],"mappings":";;AACY,MAAC,iBAAiB,GAAG;AACjC,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,SAAS;AACX,EAAE,OAAO;AACT,EAAE;AACU,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,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