From 67320fb0d8df35bd8847d6c98c646f9b8b7b7a32 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, 26 Aug 2022 09:31:31 +0300 Subject: [PATCH] message slot added --- api-generator/components/confirmdialog.js | 10 +++++++++- src/components/confirmdialog/ConfirmDialog.d.ts | 9 +++++++++ src/views/confirmdialog/ConfirmDialogDoc.vue | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/api-generator/components/confirmdialog.js b/api-generator/components/confirmdialog.js index 310d06ab7..2d1c38d98 100644 --- a/api-generator/components/confirmdialog.js +++ b/api-generator/components/confirmdialog.js @@ -13,10 +13,18 @@ const ConfirmDialogProps = [ } ]; +const ConfirmDialogSlots = [ + { + name: "message", + description: "Custom content for the component." + } +]; + module.exports = { confirmdialog: { name: "ConfirmDialog", description: "ConfirmDialog uses a Dialog UI that is integrated with the Confirmation API.", - props: ConfirmDialogProps + props: ConfirmDialogProps, + slots: ConfirmDialogSlots } }; diff --git a/src/components/confirmdialog/ConfirmDialog.d.ts b/src/components/confirmdialog/ConfirmDialog.d.ts index 391217e49..f2131a330 100644 --- a/src/components/confirmdialog/ConfirmDialog.d.ts +++ b/src/components/confirmdialog/ConfirmDialog.d.ts @@ -1,4 +1,6 @@ +import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +import { ConfirmationOptions } from '../confirmationoptions'; export interface ConfirmDialogBreakpoints { /** @@ -32,6 +34,13 @@ export interface ConfirmDialogProps { } export interface ConfirmDialogSlots { + /** + * Custom message template. + * @param {Object} scope - message slot's params. + */ + message: (scope: { + message: ConfirmationOptions; + }) => VNode[]; } export declare type ConfirmDialogEmits = { diff --git a/src/views/confirmdialog/ConfirmDialogDoc.vue b/src/views/confirmdialog/ConfirmDialogDoc.vue index 03b68c9e5..e7651994a 100644 --- a/src/views/confirmdialog/ConfirmDialogDoc.vue +++ b/src/views/confirmdialog/ConfirmDialogDoc.vue @@ -278,7 +278,7 @@ export default { -
Slots
+
Slots