From 962ddb13530e4a109971dc02012317a6a6da68c3 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: Tue, 19 Sep 2023 12:36:33 +0300 Subject: [PATCH] Fixed #4470 - Dialog/Toast: new container template --- api-generator/components/dialog.js | 4 ++ api-generator/components/toast.js | 4 ++ components/lib/dialog/Dialog.d.ts | 15 +++++ components/lib/dialog/Dialog.vue | 91 ++++++++++++++------------- components/lib/toast/Toast.d.ts | 14 +++++ components/lib/toast/ToastMessage.vue | 3 +- 6 files changed, 86 insertions(+), 45 deletions(-) diff --git a/api-generator/components/dialog.js b/api-generator/components/dialog.js index 96efd0501..268c457e4 100644 --- a/api-generator/components/dialog.js +++ b/api-generator/components/dialog.js @@ -215,6 +215,10 @@ const DialogSlots = [ { name: 'maximizeicon', description: 'Custom maximizeicon icon template of dialog.' + }, + { + name: 'container', + description: 'Custom container template.' } ]; diff --git a/api-generator/components/toast.js b/api-generator/components/toast.js index 055a5a200..679266540 100644 --- a/api-generator/components/toast.js +++ b/api-generator/components/toast.js @@ -80,6 +80,10 @@ const ToastSlots = [ { name: 'closeicon', description: 'Custom close icon template.' + }, + { + name: 'container', + description: 'Custom container template.' } ]; diff --git a/components/lib/dialog/Dialog.d.ts b/components/lib/dialog/Dialog.d.ts index 98190f8aa..2a553f8e9 100755 --- a/components/lib/dialog/Dialog.d.ts +++ b/components/lib/dialog/Dialog.d.ts @@ -332,6 +332,21 @@ export interface DialogSlots { */ class: any; }): VNode[]; + /** + * Custom container slot. + * @param {Object} scope - container slot's params. + */ + container(scope: { + /** + * Close dialog function. + */ + onClose: () => void; + /** + * Maximize/minimize dialog function. + * @param {Event} event - Browser event + */ + onMaximize: (event: Event) => void; + }): VNode[]; } /** diff --git a/components/lib/dialog/Dialog.vue b/components/lib/dialog/Dialog.vue index 4885f3646..fcb1e826d 100755 --- a/components/lib/dialog/Dialog.vue +++ b/components/lib/dialog/Dialog.vue @@ -3,51 +3,54 @@
-
- - {{ header }} - -
- - + +
diff --git a/components/lib/toast/Toast.d.ts b/components/lib/toast/Toast.d.ts index 0a1124d0b..e040ed875 100755 --- a/components/lib/toast/Toast.d.ts +++ b/components/lib/toast/Toast.d.ts @@ -289,6 +289,20 @@ export interface ToastSlots { */ class: any; }): VNode[]; + /** + * Custom container slot. + * @param {Object} scope - container slot's params. + */ + container(scope: { + /** + * Message of the component + */ + message: any; + /** + * Close toast function + */ + onClose: () => void; + }): VNode[]; } /** diff --git a/components/lib/toast/ToastMessage.vue b/components/lib/toast/ToastMessage.vue index 00a298cb8..b47de3f9b 100755 --- a/components/lib/toast/ToastMessage.vue +++ b/components/lib/toast/ToastMessage.vue @@ -1,6 +1,7 @@