adminforth 2.4.0-next.242 → 2.4.0-next.243

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.
@@ -1,15 +1,9 @@
1
- <script setup lang="ts">
2
- import { useModalStore } from '@/stores/modal';
3
-
4
- const modalStore = useModalStore();
5
- </script>
6
-
7
1
  <template>
8
2
  <Teleport to="body">
9
- <div v-if="modalStore.isOpened" class="bg-gray-900/50 dark:bg-gray-900/80 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-[100] justify-center items-center w-full md:inset-0 h-full max-h-full">
10
- <div class="relative p-4 w-full max-w-md max-h-full top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 " >
3
+ <div ref="modalEl" tabindex="-1" aria-hidden="true" class="hidden fixed inset-0 z-50 w-full h-full overflow-y-auto overflow-x-hidden flex items-center justify-center">
4
+ <div class="relative p-4 w-full max-w-md max-h-full" >
11
5
  <div class="afcl-confirmation-container relative bg-lightAcceptModalBackground rounded-lg shadow dark:bg-darkAcceptModalBackground dark:shadow-black">
12
- <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" >
6
+ <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" >
13
7
  <svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
14
8
  <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"/>
15
9
  </svg>
@@ -32,6 +26,45 @@ const modalStore = useModalStore();
32
26
  </Teleport>
33
27
  </template>
34
28
 
29
+ <script setup lang="ts">
30
+ import { watch, onMounted, nextTick, ref } from 'vue';
31
+ import { useModalStore } from '@/stores/modal';
32
+ import { Modal } from 'flowbite';
33
+
34
+ const modalStore = useModalStore();
35
+ const modalEl = ref(null);
36
+ const modal = ref(null);
37
+
38
+ watch( () => modalStore.isOpened, (newVal) => {
39
+ if (newVal) {
40
+ open();
41
+ } else {
42
+ close();
43
+ }
44
+ }
45
+ );
46
+
47
+ onMounted(async () => {
48
+ await nextTick();
49
+ modal.value = new Modal(
50
+ modalEl.value,
51
+ {
52
+ closable: true,
53
+ backdrop: 'static',
54
+ }
55
+ );
56
+ })
57
+
58
+ function open() {
59
+ modal.value?.show();
60
+ }
61
+
62
+ function close() {
63
+ modal.value?.hide();
64
+ }
65
+
66
+ </script>
67
+
35
68
  <style scoped>
36
69
  .modal {
37
70
  position: fixed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.242",
3
+ "version": "2.4.0-next.243",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",