Skip to content

Commit b783a04

Browse files
committed
1 parent 1f07dc2 commit b783a04

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

adminforth/spa/src/adminforth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class FrontendAPI implements FrontendAPIInterface {
132132
return new Promise((resolve, reject) => {
133133
this.modalStore.setModalContent({
134134
content: params.message,
135+
contentHTML: params.messageHtml,
135136
acceptText: params.yes || 'Yes',
136137
cancelText: params.no || 'Cancel'
137138
})

adminforth/spa/src/components/AcceptModal.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
1515
</svg>
1616
<h3 class="afcl-confirmation-title mb-5 text-lg font-normal text-lightAcceptModalText dark:text-darkAcceptModalText">{{ modalStore?.modalContent?.content }}</h3>
17+
<h3 class="prose afcl-confirmation-title mb-5 text-lg font-normal text-lightAcceptModalText dark:text-darkAcceptModalText" v-html="modalStore?.modalContent?.contentHTML"></h3>
18+
1719
<button @click="()=>{ modalStore.onAcceptFunction(true);modalStore.togleModal()}" type="button" class="afcl-confirmation-accept-button text-lightAcceptModalConfirmButtonText bg-lightAcceptModalConfirmButtonBackground hover:bg-lightAcceptModalConfirmButtonBackgroundHover focus:ring-4 focus:outline-none focus:ring-lightAcceptModalConfirmButtonFocus font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center dark:text-darkAcceptModalConfirmButtonText dark:bg-darkAcceptModalConfirmButtonBackground dark:hover:bg-darkAcceptModalConfirmButtonBackgroundHover dark:focus:ring-darkAcceptModalConfirmButtonFocus">
1820
{{ modalStore?.modalContent?.acceptText }}
1921
</button>

adminforth/spa/src/stores/modal.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { defineStore } from 'pinia'
44
type ModalContentType = {
55
title?: string;
66
content?: string;
7+
contentHTML?: string;
78
acceptText?: string;
89
cancelText?: string;
910
}
@@ -12,7 +13,8 @@ import { defineStore } from 'pinia'
1213
export const useModalStore = defineStore('modal', () => {
1314
const modalContent = ref({
1415
title: 'title',
15-
content: 'content',
16+
content: '',
17+
contentHTML: '',
1618
acceptText: 'acceptText',
1719
cancelText: 'cancelText',
1820
});
@@ -31,7 +33,8 @@ export const useModalStore = defineStore('modal', () => {
3133
function setModalContent(content: ModalContentType) {
3234
modalContent.value = {
3335
title: content.title || 'title',
34-
content: content.content || 'content',
36+
content: content.content || '',
37+
contentHTML: content.contentHTML || '',
3538
acceptText: content.acceptText || 'acceptText',
3639
cancelText: content.cancelText || 'cancelText',
3740
};
@@ -41,6 +44,7 @@ export const useModalStore = defineStore('modal', () => {
4144
modalContent.value = {
4245
title: 'title',
4346
content: 'content',
47+
contentHTML: '',
4448
acceptText: 'acceptText',
4549
cancelText: 'cancelText',
4650
};

adminforth/types/FrontendAPI.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ export type ConfirmParams = {
159159
* The message to display in the dialog
160160
*/
161161
message?: string;
162+
/**
163+
* Message to display in the dialog as HTML (can be used instead of message)
164+
*/
165+
messageHtml?: string;
162166
/**
163167
* The text to display in the "accept" button
164168
*/

0 commit comments

Comments
 (0)