diff --git a/components/lib/confirmdialog/ConfirmDialog.vue b/components/lib/confirmdialog/ConfirmDialog.vue index 5347f9a1c..904e5f7d3 100644 --- a/components/lib/confirmdialog/ConfirmDialog.vue +++ b/components/lib/confirmdialog/ConfirmDialog.vue @@ -55,7 +55,6 @@ import BaseConfirmDialog from './BaseConfirmDialog.vue'; export default { name: 'ConfirmDialog', extends: BaseConfirmDialog, - confirmListener: null, closeListener: null, data() { diff --git a/components/lib/confirmpopup/style/ConfirmPopupStyle.js b/components/lib/confirmpopup/style/ConfirmPopupStyle.js index 362780089..7be86f603 100644 --- a/components/lib/confirmpopup/style/ConfirmPopupStyle.js +++ b/components/lib/confirmpopup/style/ConfirmPopupStyle.js @@ -86,8 +86,8 @@ const classes = { icon: ({ instance }) => ['p-confirm-popup-icon', instance.confirmation ? instance.confirmation.icon : null], message: 'p-confirm-popup-message', footer: 'p-confirm-popup-footer', - rejectButton: ({ instance }) => ['p-confirm-popup-reject', instance.confirmation && !instance.confirmation.rejectClass ? 'p-button-text' : null], - acceptButton: 'p-confirm-popup-accept' + rejectButton: ({ instance }) => ['p-confirm-popup-reject', instance.confirmation && !instance.confirmation.rejectClass ? 'p-button-sm p-button-text' : null], + acceptButton: ({ instance }) => ['p-confirm-popup-accept', instance.confirmation && !instance.confirmation.acceptClass ? 'p-button-sm' : null] }; export default BaseStyle.extend({ diff --git a/doc/confirmpopup/AccessibilityDoc.vue b/doc/confirmpopup/AccessibilityDoc.vue index 9b8821faa..0ded5e1ed 100644 --- a/doc/confirmpopup/AccessibilityDoc.vue +++ b/doc/confirmpopup/AccessibilityDoc.vue @@ -6,7 +6,7 @@ aria-modal is added since focus is kept within the popup.

- When require method of the $confirm instance is used and a trigger is passed as a parameter, ConfirmDialog adds aria-expanded state attribute and aria-controls to the trigger so that the relation between the + When require method of the $confirm instance is used and a trigger is passed as a parameter, ConfirmPopup adds aria-expanded state attribute and aria-controls to the trigger so that the relation between the trigger and the dialog is defined.

diff --git a/doc/confirmpopup/BasicDoc.vue b/doc/confirmpopup/BasicDoc.vue index 2bc1eb7bc..7b695081d 100644 --- a/doc/confirmpopup/BasicDoc.vue +++ b/doc/confirmpopup/BasicDoc.vue @@ -1,11 +1,11 @@ @@ -17,10 +17,8 @@ export default { code: { basic: ` -
- - -
+ + `, options: ` @@ -53,7 +51,7 @@ export default { target: event.currentTarget, message: 'Do you want to delete this record?', icon: 'pi pi-info-circle', - acceptClass: 'p-button-danger', + acceptClass: 'p-button-danger p-button-sm', accept: () => { this.$toast.add({ severity: 'info', summary: 'Confirmed', detail: 'Record deleted', life: 3000 }); }, @@ -72,7 +70,7 @@ export default {
- +
@@ -102,7 +100,7 @@ const confirm2 = (event) => { target: event.currentTarget, message: 'Do you want to delete this record?', icon: 'pi pi-info-circle', - acceptClass: 'p-button-danger', + acceptClass: 'p-button-danger p-button-sm', accept: () => { toast.add({ severity: 'info', summary: 'Confirmed', detail: 'Record deleted', life: 3000 }); }, @@ -135,7 +133,7 @@ const confirm2 = (event) => { target: event.currentTarget, message: 'Do you want to delete this record?', icon: 'pi pi-info-circle', - acceptClass: 'p-button-danger', + acceptClass: 'p-button-danger p-button-sm', accept: () => { this.$toast.add({ severity: 'info', summary: 'Confirmed', detail: 'Record deleted', life: 3000 }); }, diff --git a/doc/confirmpopup/ConfirmationServiceDoc.vue b/doc/confirmpopup/ConfirmationServiceDoc.vue index bb3499fa0..557dadcbc 100644 --- a/doc/confirmpopup/ConfirmationServiceDoc.vue +++ b/doc/confirmpopup/ConfirmationServiceDoc.vue @@ -4,7 +4,7 @@
-

$confirm is available as a property in the application instance for Options API. The service can be injected with the useConfirm function for Composition API.

+

The service is available with the useConfirm function for Composition API or using the $confirm property of the application for Options API.

diff --git a/doc/confirmpopup/HeadlessDoc.vue b/doc/confirmpopup/HeadlessDoc.vue new file mode 100644 index 000000000..3c244f3eb --- /dev/null +++ b/doc/confirmpopup/HeadlessDoc.vue @@ -0,0 +1,140 @@ + + + diff --git a/doc/confirmpopup/TemplateDoc.vue b/doc/confirmpopup/TemplateDoc.vue index 859b8f955..fee39f73b 100644 --- a/doc/confirmpopup/TemplateDoc.vue +++ b/doc/confirmpopup/TemplateDoc.vue @@ -1,17 +1,17 @@ @@ -22,31 +22,29 @@ export default { return { code: { basic: ` - + -
- -
+ `, options: ` @@ -56,11 +54,13 @@ export default { showTemplate(event) { this.$confirm.require({ target: event.currentTarget, - group: 'demo', - message: 'Do you accept that?', - icon: 'pi pi-question-circle', + group: 'templating', + message: 'Please confirm to proceed moving forward.', + icon: 'pi pi-exclamation-circle', acceptIcon: 'pi pi-check', rejectIcon: 'pi pi-times', + rejectClass: 'p-button-sm', + acceptClass: 'p-button-outlined p-button-sm', accept: () => { this.$toast.add({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted', life: 3000 }); }, @@ -76,16 +76,16 @@ export default { composition: ` @@ -99,11 +99,13 @@ const toast = useToast(); const showTemplate = (event) => { confirm.require({ target: event.currentTarget, - group: 'demo', - message: 'Do you accept that?', - icon: 'pi pi-question-circle', + group: 'templating', + message: 'Please confirm to proceed moving forward.', + icon: 'pi pi-exclamation-circle', acceptIcon: 'pi pi-check', rejectIcon: 'pi pi-times', + rejectClass: 'p-button-sm', + acceptClass: 'p-button-outlined p-button-sm', accept: () => { toast.add({severity:'info', summary:'Confirmed', detail:'You have accepted', life: 3000}); }, @@ -121,11 +123,13 @@ const showTemplate = (event) => { showTemplate(event) { this.$confirm.require({ target: event.currentTarget, - group: 'demo', - message: 'Do you accept that?', - icon: 'pi pi-question-circle', + group: 'templating', + message: 'Please confirm to proceed moving forward.', + icon: 'pi pi-exclamation-circle', acceptIcon: 'pi pi-check', rejectIcon: 'pi pi-times', + rejectClass: 'p-button-sm', + acceptClass: 'p-button-outlined p-button-sm', accept: () => { this.$toast.add({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted', life: 3000 }); }, diff --git a/pages/confirmpopup/index.vue b/pages/confirmpopup/index.vue index a152e9765..f4b2b2924 100644 --- a/pages/confirmpopup/index.vue +++ b/pages/confirmpopup/index.vue @@ -14,6 +14,7 @@ import AccessibilityDoc from '@/doc/confirmpopup/AccessibilityDoc.vue'; import BasicDoc from '@/doc/confirmpopup/BasicDoc.vue'; import ConfirmationServiceDoc from '@/doc/confirmpopup/ConfirmationServiceDoc.vue'; +import HeadlessDoc from '@/doc/confirmpopup/HeadlessDoc.vue'; import ImportDoc from '@/doc/confirmpopup/ImportDoc.vue'; import TemplateDoc from '@/doc/confirmpopup/TemplateDoc.vue'; import PTComponent from '@/doc/confirmpopup/pt/index.vue'; @@ -30,7 +31,7 @@ export default { }, { id: 'confirmation-service', - label: 'Confirmation Service', + label: 'Service', component: ConfirmationServiceDoc }, { @@ -43,6 +44,11 @@ export default { label: 'Template', component: TemplateDoc }, + { + id: 'headless', + label: 'Headless', + component: HeadlessDoc + }, { id: 'accessibility', label: 'Accessibility',