adminforth 2.26.0-next.8 → 2.26.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -80,12 +80,16 @@ const showConfirmationOnClose = ref(false);
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
async function open() {
|
|
83
|
-
|
|
83
|
+
if (props.beforeOpenFunction) {
|
|
84
|
+
await props.beforeOpenFunction?.();
|
|
85
|
+
}
|
|
84
86
|
isModalOpen.value = true;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
async function close() {
|
|
88
|
-
|
|
90
|
+
if (props.beforeCloseFunction) {
|
|
91
|
+
await props.beforeCloseFunction?.();
|
|
92
|
+
}
|
|
89
93
|
isModalOpen.value = false;
|
|
90
94
|
}
|
|
91
95
|
|
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
3
|
+
<Modal
|
|
4
|
+
ref="modalRef"
|
|
5
|
+
:beforeCloseFunction="()=>{modalStore.onAcceptFunction(false);modalStore.isOpened=false}"
|
|
6
|
+
>
|
|
7
|
+
<div class="relative p-4 w-full max-w-md max-h-full" >
|
|
8
|
+
<button type="button" @click="modalStore.togleModal()" class="absolute top-3 end-2.5 text-lightAcceptModalCloseIcon bg-transparent hover:bg-lightAcceptModalCloseIconHoverBackground hover:text-lightAcceptModalCloseIconHover rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:text-darkAcceptModalCloseIcon dark:hover:bg-darkAcceptModalCloseIconHoverBackground dark:hover:text-darkAcceptModalCloseIconHover" >
|
|
9
|
+
<svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
10
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
|
11
|
+
</svg>
|
|
12
|
+
<span class="sr-only">{{ $t('Close modal') }}</span>
|
|
13
|
+
</button>
|
|
14
|
+
<div class="p-4 md:p-5 text-center">
|
|
15
|
+
<svg class="mx-auto mb-4 text-lightAcceptModalWarningIcon w-12 h-12 dark:text-darkAcceptModalWarningIcon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
|
|
16
|
+
<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"/>
|
|
17
|
+
</svg>
|
|
18
|
+
<h3 class="afcl-confirmation-title mb-5 text-lg font-normal text-lightAcceptModalText dark:text-darkAcceptModalText">{{ modalStore?.modalContent?.content }}</h3>
|
|
19
|
+
<h3 class=" afcl-confirmation-title mb-5 text-lg font-normal text-lightAcceptModalText dark:text-darkAcceptModalText" v-html="modalStore?.modalContent?.contentHTML"></h3>
|
|
20
|
+
|
|
21
|
+
<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">
|
|
22
|
+
{{ modalStore?.modalContent?.acceptText }}
|
|
23
|
+
</button>
|
|
24
|
+
<button @click="()=>{modalStore.onAcceptFunction(false);modalStore.togleModal()}" type="button" class="afcl-confirmation-cancel-button py-2.5 px-5 ms-3 text-sm font-medium text-lightAcceptModalCancelButtonText focus:outline-none bg-lightAcceptModalCancelButtonBackground rounded-lg border border-lightAcceptModalCancelButtonBorder hover:bg-lightAcceptModalCancelButtonBackgroundHover hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-lightAcceptModalCancelButtonFocus dark:focus:ring-darkAcceptModalCancelButtonFocus dark:bg-darkAcceptModalCancelButtonBackground dark:text-darkAcceptModalCancelButtonText dark:border-darkAcceptModalCancelButtonBorder dark:hover:text-darkAcceptModalCancelButtonTextHover dark:hover:bg-darkAcceptModalCancelButtonBackgroundHover">{{ modalStore?.modalContent?.cancelText }}</button>
|
|
25
25
|
</div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</Teleport>
|
|
26
|
+
</div>
|
|
27
|
+
</Modal>
|
|
28
|
+
</Teleport>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
32
|
import { watch, onMounted, nextTick, ref } from 'vue';
|
|
33
33
|
import { useModalStore } from '@/stores/modal';
|
|
34
|
-
import { Modal } from '
|
|
34
|
+
import { Modal } from '@/afcl';
|
|
35
35
|
|
|
36
|
+
const modalRef = ref();
|
|
36
37
|
const modalStore = useModalStore();
|
|
37
|
-
const modalEl = ref(null);
|
|
38
|
-
const modal = ref(null);
|
|
39
38
|
|
|
40
39
|
watch( () => modalStore.isOpened, (newVal) => {
|
|
41
40
|
if (newVal) {
|
|
@@ -46,35 +45,14 @@ watch( () => modalStore.isOpened, (newVal) => {
|
|
|
46
45
|
}
|
|
47
46
|
);
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
await nextTick();
|
|
51
|
-
modal.value = new Modal(
|
|
52
|
-
modalEl.value,
|
|
53
|
-
{
|
|
54
|
-
closable: true,
|
|
55
|
-
backdrop: 'static',
|
|
56
|
-
backdropClasses: "bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-[100]"
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
})
|
|
48
|
+
|
|
60
49
|
|
|
61
50
|
function open() {
|
|
62
|
-
|
|
51
|
+
modalRef.value.open();
|
|
63
52
|
}
|
|
64
53
|
|
|
65
54
|
function close() {
|
|
66
|
-
|
|
55
|
+
modalRef.value.close();
|
|
67
56
|
}
|
|
68
57
|
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<style scoped>
|
|
72
|
-
.modal {
|
|
73
|
-
position: fixed;
|
|
74
|
-
z-index: 999;
|
|
75
|
-
top: 20%;
|
|
76
|
-
left: 50%;
|
|
77
|
-
width: 300px;
|
|
78
|
-
margin-left: -150px;
|
|
79
|
-
}
|
|
80
|
-
</style>
|
|
58
|
+
</script>
|