From 573c04179e7b055977511c87bc71f7159f1d97e2 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Fri, 26 Jul 2024 12:23:04 +0300 Subject: [PATCH] Refactor #6075 --- .../src/confirmdialog/ConfirmDialog.vue | 31 +++------------- .../src/confirmpopup/ConfirmPopup.vue | 37 +++++-------------- 2 files changed, 15 insertions(+), 53 deletions(-) diff --git a/packages/primevue/src/confirmdialog/ConfirmDialog.vue b/packages/primevue/src/confirmdialog/ConfirmDialog.vue index d9d1d480f..fa9b152a4 100644 --- a/packages/primevue/src/confirmdialog/ConfirmDialog.vue +++ b/packages/primevue/src/confirmdialog/ConfirmDialog.vue @@ -122,9 +122,6 @@ export default { } this.visible = false; - }, - getCXOptions(icon, iconProps) { - return { contenxt: { icon, iconClass: iconProps.class } }; } }, computed: { @@ -141,35 +138,19 @@ export default { return this.confirmation ? this.confirmation.position : null; }, acceptLabel() { - if (!this.confirmation) { - return null; - } + if (this.confirmation) { + const confirmation = this.confirmation; - const confirmation = this.confirmation; - - if (confirmation.acceptLabel) { - return confirmation.acceptLabel; - } - - if (confirmation.acceptProps?.label) { - return confirmation.acceptProps.label; + return confirmation.acceptLabel || confirmation.acceptProps?.label || this.$primevue.config.locale.accept; } return this.$primevue.config.locale.accept; }, rejectLabel() { - if (!this.confirmation) { - return null; - } + if (this.confirmation) { + const confirmation = this.confirmation; - const confirmation = this.confirmation; - - if (confirmation.rejectLabel) { - return confirmation.rejectLabel; - } - - if (confirmation.rejectProps?.label) { - return confirmation.rejectProps.label; + return confirmation.rejectLabel || confirmation.rejectProps?.label || this.$primevue.config.locale.reject; } return this.$primevue.config.locale.reject; diff --git a/packages/primevue/src/confirmpopup/ConfirmPopup.vue b/packages/primevue/src/confirmpopup/ConfirmPopup.vue index 022c97685..42341d442 100644 --- a/packages/primevue/src/confirmpopup/ConfirmPopup.vue +++ b/packages/primevue/src/confirmpopup/ConfirmPopup.vue @@ -58,10 +58,10 @@