Skip to content

Commit

Permalink
Refactor #3832 Refactor #3833 - For ConfirmPopup & ConfirmDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Apr 19, 2023
1 parent 3339f1f commit c7f2bf5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
14 changes: 12 additions & 2 deletions components/lib/confirmdialog/ConfirmDialog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,21 @@ export interface ConfirmDialogSlots {
* Custom message template.
* @param {Object} scope - message slot's params.
*/
message(scope: { message: ConfirmationOptions }): VNode[];
message(scope: {
/**
* Message of the component
*/
message: ConfirmationOptions;
}): VNode[];
/**
* Custom icon template.
*/
icon(): VNode[];
icon(scope: {
/**
* Style class of the icon template
*/
class: any;
}): VNode[];
/**
* Custom icon template.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/confirmdialog/ConfirmDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@update:visible="onHide"
>
<template v-if="!$slots.message">
<slot name="icon">
<slot name="icon" class="p-confirm-dialog-icon">
<component v-if="$slots.icon" :is="$slots.icon" class="p-confirm-dialog-icon" />
<span v-else-if="confirmation.icon" :class="iconClass" />
</slot>
Expand Down
14 changes: 12 additions & 2 deletions components/lib/confirmpopup/ConfirmPopup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@ export interface ConfirmPopupSlots {
* Custom message template.
* @param {Object} scope - message slot's params.
*/
message(scope: { message: ConfirmationOptions }): VNode[];
message(scope: {
/**
* Message of the component
*/
message: ConfirmationOptions;
}): VNode[];
/**
* Custom icon template.
*/
icon(): VNode[];
icon(scope: {
/**
* Style class of the icon template
*/
class: any;
}): VNode[];
/**
* Custom icon template.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/confirmpopup/ConfirmPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div v-if="visible" :ref="containerRef" v-focustrap role="alertdialog" :class="containerClass" :aria-modal="visible" @click="onOverlayClick" @keydown="onOverlayKeydown" v-bind="$attrs">
<template v-if="!$slots.message">
<div class="p-confirm-popup-content">
<slot name="icon">
<slot name="icon" class="p-confirm-popup-icon">
<component v-if="$slots.icon" :is="$slots.icon" class="p-confirm-popup-icon" />
<span v-else-if="confirmation.icon" :class="iconClass" />
</slot>
Expand Down

0 comments on commit c7f2bf5

Please sign in to comment.