diff --git a/api-generator/components/toast.js b/api-generator/components/toast.js index 1306aadb6..d9027d78b 100644 --- a/api-generator/components/toast.js +++ b/api-generator/components/toast.js @@ -60,6 +60,14 @@ const ToastSlots = [ { name: 'message', description: 'Custom content for the toast message' + }, + { + name: 'icon', + description: 'Custom icon template.' + }, + { + name: 'closeicon', + description: 'Custom close icon template.' } ]; diff --git a/components/lib/toast/Toast.d.ts b/components/lib/toast/Toast.d.ts index 66d5eaa8f..f948c87b0 100755 --- a/components/lib/toast/Toast.d.ts +++ b/components/lib/toast/Toast.d.ts @@ -95,29 +95,12 @@ export interface ToastProps { breakpoints?: ToastBreakpointsType; /** * Icon to display in the toast close button. - * @defaultValue pi pi-times */ closeIcon?: string | undefined; /** - * Icon to display in the toast with info severity. - * @defaultValue pi pi-info-circle + * Icon to display in the toast. */ - infoIcon?: string | undefined; - /** - * Icon to display in the toast with warn severity. - * @defaultValue pi pi-exclamation-triangle - */ - warnIcon?: string | undefined; - /** - * Icon to display in the toast with error severity. - * @defaultValue pi pi-times - */ - errorIcon?: string | undefined; - /** - * Icon to display in the toast with success severity. - * @defaultValue pi pi-check - */ - successIcon?: string | undefined; + icon?: string | undefined; /** * Uses to pass all properties of the HTMLButtonElement to the close button. */ @@ -138,6 +121,14 @@ export interface ToastSlots { */ message: any; }): VNode[]; + /** + * Custom icon template. + */ + icon(): VNode[]; + /** + * Custom close icon template. + */ + closeicon(): VNode[]; } /** diff --git a/components/lib/toast/Toast.vue b/components/lib/toast/Toast.vue index 61b798047..789388994 100755 --- a/components/lib/toast/Toast.vue +++ b/components/lib/toast/Toast.vue @@ -2,19 +2,14 @@
- + + + +
@@ -55,23 +50,11 @@ export default { }, closeIcon: { type: String, - default: 'pi pi-times' + default: undefined }, - infoIcon: { + icon: { type: String, - default: 'pi pi-info-circle' - }, - warnIcon: { - type: String, - default: 'pi pi-exclamation-triangle' - }, - errorIcon: { - type: String, - default: 'pi pi-times' - }, - successIcon: { - type: String, - default: 'pi pi-check' + default: undefined }, closeButtonProps: { type: null, diff --git a/components/lib/toast/ToastMessage.vue b/components/lib/toast/ToastMessage.vue index 246d5f616..b1b7f09a3 100755 --- a/components/lib/toast/ToastMessage.vue +++ b/components/lib/toast/ToastMessage.vue @@ -2,7 +2,9 @@