diff --git a/package.json b/package.json index 91674bd..4c0c9fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bytetrade/ui", - "version": "0.1.16", + "version": "0.1.17", "private": false, "scripts": { "serve": "vue-cli-service serve", diff --git a/packages/notify/index.ts b/packages/notify/index.ts index d7a16ca..54db201 100644 --- a/packages/notify/index.ts +++ b/packages/notify/index.ts @@ -1,13 +1,13 @@ -import { Notify, QSpinner } from "quasar"; -import { NotifyDefinedType, BtNotifyProps } from "./type"; +import { Notify, QSpinner } from 'quasar'; +import { NotifyDefinedType, BtNotifyProps } from './type'; const BtNotify: BtNotifyProps = { alwaysShow: null, - notify: Notify, + notify: Notify, async show(props: any): Promise { - if (!this.notify) { - this.init(Notify) - } + if (!this.notify) { + this.init(Notify); + } if (props.closeTimeout) { this.alwaysShow = this.notify?.create({ ...props @@ -25,79 +25,89 @@ const BtNotify: BtNotifyProps = { }, async init(notify?: Notify): Promise { - if (!notify) { - return - } - this.notify = notify; - notify.registerType(NotifyDefinedType.LOGIN_NOTIFY, { - position: "bottom", - html: true, - timeout: 0, - color: "transparent", - textColor: "warning", - classes: "login-notification-add", - icon: "sym_r_cancel" - }); + if (!notify) { + return; + } + this.notify = notify; + notify.registerType(NotifyDefinedType.LOGIN_NOTIFY, { + position: 'bottom', + html: true, + timeout: 0, + color: 'transparent', + textColor: 'warning', + classes: 'login-notification-add', + icon: 'sym_r_cancel' + }); + + notify.registerType(NotifyDefinedType.SUCCESS, { + position: 'bottom', + html: true, + timeout: 0, + color: 'white', + textColor: 'positive', + classes: 'success-notify-class', + icon: 'sym_r_check_circle', + group: false + }); - notify.registerType(NotifyDefinedType.SUCCESS, { - position: "bottom", - html: true, - timeout: 0, - color: "white", - textColor: "positive", - classes: "success-notify-class", - icon: "sym_r_check_circle", - group: false - }); + notify.registerType(NotifyDefinedType.FAILED, { + position: 'bottom', + html: true, + timeout: 0, + color: 'white', + textColor: 'negative', + classes: 'failed-notify-class', + icon: 'sym_r_cancel', + group: false + }); - notify.registerType(NotifyDefinedType.FAILED, { - position: "bottom", - html: true, - timeout: 0, - color: "white", - textColor: "negative", - classes: "failed-notify-class", - icon: "sym_r_cancel", - group: false - }); + notify.registerType(NotifyDefinedType.WARNING, { + position: 'bottom', + html: true, + timeout: 0, + color: 'white', + textColor: 'warning', + classes: 'warning-notify-class', + icon: 'sym_r_error', + group: false + }); - notify.registerType(NotifyDefinedType.WARNING, { - position: "bottom", - html: true, - timeout: 0, - color: "white", - textColor: "warning", - classes: "warning-notify-class", - icon: "sym_r_error", - group: false - }); + notify.registerType(NotifyDefinedType.LOADING, { + position: 'bottom', + html: true, + timeout: 0, + color: 'white', + textColor: 'grey-8', + classes: 'loading-notify-class', + spinner: QSpinner, + spinnerSize: 'xs', + spinnerColor: 'grey-8', + group: false + }); - notify.registerType(NotifyDefinedType.LOADING, { - position: "bottom", - html: true, - timeout: 0, - color: "white", - textColor: "grey-8", - classes: "loading-notify-class", - spinner: QSpinner, - spinnerSize: "xs", - spinnerColor: "grey-8", - group: false - }); + notify.registerType(NotifyDefinedType.PROGRESS, { + position: 'bottom', + html: true, + timeout: 0, + color: 'white', + textColor: 'info', + classes: 'progress-notify-class', + spinner: QSpinner, + spinnerSize: 'sm', + spinnerColor: 'info', + group: false + }); - notify.registerType(NotifyDefinedType.PROGRESS, { - position: "bottom", - html: true, - timeout: 0, - color: "white", - textColor: "info", - classes: "progress-notify-class", - spinner: QSpinner, - spinnerSize: "sm", - spinnerColor: "info", - group: false - }); + notify.registerType(NotifyDefinedType.MESSAGE, { + position: 'bottom', + html: true, + timeout: 0, + color: 'white', + textColor: 'grey-8', + classes: 'loading-notify-class', + group: false + }); } }; -export default BtNotify; \ No newline at end of file +export default BtNotify; diff --git a/packages/notify/type.ts b/packages/notify/type.ts index f666106..4da8565 100644 --- a/packages/notify/type.ts +++ b/packages/notify/type.ts @@ -1,19 +1,19 @@ export enum NotifyDefinedType { - DEFAULT = "bt-default", - LOGIN_NOTIFY = "bt-login", - POSITIVE = "bt-positive", - SUCCESS = "bt-success", - FAILED = "bt-failed", - WARNING = "bt-warning", - LOADING = "bt-loading", - PROGRESS = "bt-progress" + DEFAULT = 'bt-default', + LOGIN_NOTIFY = 'bt-login', + POSITIVE = 'bt-positive', + SUCCESS = 'bt-success', + FAILED = 'bt-failed', + WARNING = 'bt-warning', + LOADING = 'bt-loading', + PROGRESS = 'bt-progress', + MESSAGE = 'bt-message' } - export interface BtNotifyProps { alwaysShow: any; show: any; hide: any; - init(notify: any): void; - notify: any; + init(notify: any): void; + notify: any; }