From 916a9dfbc9c175c23865b9acbf6ab19e0a7ace4d Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Sat, 28 Oct 2023 16:02:42 +0300 Subject: [PATCH 1/5] Doc api table cosmetics --- assets/styles/layout/_doc.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/styles/layout/_doc.scss b/assets/styles/layout/_doc.scss index ece0ff892..ef076f39a 100644 --- a/assets/styles/layout/_doc.scss +++ b/assets/styles/layout/_doc.scss @@ -343,8 +343,8 @@ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, Liberation Mono, monospace; position: relative; scroll-margin-top: 6.5rem; - background-color: var(--highlight-bg); - color: var(--highlight-text-color); + background-color: var(--doc-highlight-text-bg); + color: var(--doc-highlight-text-color); border-radius: 6px; padding: 2px 6px; font-weight: 600; From b9c0574c5a6bd74d696406a75df0d8ffad6c8466 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Sat, 28 Oct 2023 16:59:59 +0300 Subject: [PATCH 2/5] Refactored ConfirmDialog demos --- .../lib/confirmdialog/ConfirmDialog.vue | 1 + doc/confirmdialog/AccessibilityDoc.vue | 3 +- doc/confirmdialog/BasicDoc.vue | 19 ++- doc/confirmdialog/ConfirmationServiceDoc.vue | 2 +- doc/confirmdialog/HeadlessDoc.vue | 156 ++++++++++++++++++ doc/confirmdialog/PositionDoc.vue | 56 +++---- doc/confirmdialog/TemplateDoc.vue | 63 +++---- pages/confirmdialog/index.vue | 8 +- 8 files changed, 239 insertions(+), 69 deletions(-) create mode 100644 doc/confirmdialog/HeadlessDoc.vue diff --git a/components/lib/confirmdialog/ConfirmDialog.vue b/components/lib/confirmdialog/ConfirmDialog.vue index 5347f9a1c..60e82c2bb 100644 --- a/components/lib/confirmdialog/ConfirmDialog.vue +++ b/components/lib/confirmdialog/ConfirmDialog.vue @@ -15,6 +15,7 @@ :unstyled="unstyled" > @@ -100,7 +101,8 @@ const confirm2 = () => { message: 'Do you want to delete this record?', header: 'Delete Confirmation', icon: 'pi pi-info-circle', - acceptClass: 'p-button-danger', + rejectClass: 'p-button-text p-button-text', + acceptClass: 'p-button-danger p-button-text', accept: () => { toast.add({ severity: 'info', summary: 'Confirmed', detail: 'Record deleted', life: 3000 }); }, @@ -133,7 +135,8 @@ const confirm2 = () => { message: 'Do you want to delete this record?', header: 'Delete Confirmation', icon: 'pi pi-info-circle', - acceptClass: 'p-button-danger', + rejectClass: 'p-button-text p-button-text', + acceptClass: 'p-button-danger p-button-text', accept: () => { this.$toast.add({ severity: 'info', summary: 'Confirmed', detail: 'Record deleted', life: 3000 }); }, diff --git a/doc/confirmdialog/ConfirmationServiceDoc.vue b/doc/confirmdialog/ConfirmationServiceDoc.vue index f5d29058f..e5a8935e2 100644 --- a/doc/confirmdialog/ConfirmationServiceDoc.vue +++ b/doc/confirmdialog/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/confirmdialog/HeadlessDoc.vue b/doc/confirmdialog/HeadlessDoc.vue new file mode 100644 index 000000000..6cb7d74af --- /dev/null +++ b/doc/confirmdialog/HeadlessDoc.vue @@ -0,0 +1,156 @@ + + + diff --git a/doc/confirmdialog/PositionDoc.vue b/doc/confirmdialog/PositionDoc.vue index adef71079..3688c8d54 100644 --- a/doc/confirmdialog/PositionDoc.vue +++ b/doc/confirmdialog/PositionDoc.vue @@ -1,14 +1,14 @@ @@ -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',