From a86f8faa39a6ebe087d21c161b4b63de459212ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 14 Apr 2023 15:03:58 +0300 Subject: [PATCH] Refactor #3832 Refactor #3833 - For Toast --- components/lib/toast/Toast.d.ts | 18 ++++++-- components/lib/toast/Toast.vue | 35 +++++++++++---- components/lib/toast/ToastMessage.vue | 62 +++++++++++++++++---------- 3 files changed, 81 insertions(+), 34 deletions(-) diff --git a/components/lib/toast/Toast.d.ts b/components/lib/toast/Toast.d.ts index f948c87b0..22da8f6ae 100755 --- a/components/lib/toast/Toast.d.ts +++ b/components/lib/toast/Toast.d.ts @@ -18,7 +18,7 @@ export interface ToastMessageOptions { * Severity level of the message. * @defaultValue info */ - severity?: 'success' | 'info' | 'warn' | 'error' | string | undefined; + severity?: 'success' | 'info' | 'warn' | 'error' | undefined; /** * Summary content of the message. */ @@ -98,9 +98,21 @@ export interface ToastProps { */ closeIcon?: string | undefined; /** - * Icon to display in the toast. + * Icon to display in the toast with info severity. */ - icon?: string | undefined; + infoIcon?: string | undefined; + /** + * Icon to display in the toast with warn severity. + */ + warnIcon?: string | undefined; + /** + * Icon to display in the toast with error severity. + */ + errorIcon?: string | undefined; + /** + * Icon to display in the toast with success severity. + */ + successIcon?: string | undefined; /** * Uses to pass all properties of the HTMLButtonElement to the close button. */ diff --git a/components/lib/toast/Toast.vue b/components/lib/toast/Toast.vue index 9e569b737..ccb9fe08d 100755 --- a/components/lib/toast/Toast.vue +++ b/components/lib/toast/Toast.vue @@ -2,14 +2,19 @@
- - - - +
@@ -52,7 +57,19 @@ export default { type: String, default: undefined }, - icon: { + infoIcon: { + type: String, + default: undefined + }, + warnIcon: { + type: String, + default: undefined + }, + errorIcon: { + type: String, + default: undefined + }, + successIcon: { type: String, default: undefined }, diff --git a/components/lib/toast/ToastMessage.vue b/components/lib/toast/ToastMessage.vue index 2d5e7a7fe..4455bca33 100755 --- a/components/lib/toast/ToastMessage.vue +++ b/components/lib/toast/ToastMessage.vue @@ -1,21 +1,17 @@