plugin-ui-for-kzt 0.0.4 → 0.0.5
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.
package/package.json
CHANGED
|
@@ -54,8 +54,8 @@ const getTypeModal = computed<{ img: any; nameClass: string }>(() => {
|
|
|
54
54
|
return { img: SuccessIcon, nameClass: "success" };
|
|
55
55
|
case "warning":
|
|
56
56
|
return { img: WarningIcon, nameClass: "warning" };
|
|
57
|
-
case "
|
|
58
|
-
return { img: InfoIcon, nameClass: "
|
|
57
|
+
case "infoModal":
|
|
58
|
+
return { img: InfoIcon, nameClass: "infoModal" };
|
|
59
59
|
default:
|
|
60
60
|
return {
|
|
61
61
|
img: SuccessIcon,
|
|
@@ -139,7 +139,7 @@ const getTypeModal = computed<{ img: any; nameClass: string }>(() => {
|
|
|
139
139
|
background: #15b853;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
.
|
|
142
|
+
.infoModal {
|
|
143
143
|
background: #f4a900;
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -2,7 +2,7 @@ import {createApp, h, getCurrentInstance} from "vue";
|
|
|
2
2
|
import {useModalStore} from "../store/modal";
|
|
3
3
|
import Modal from "../components/Modal/Modal.vue";
|
|
4
4
|
import {watch} from "vue";
|
|
5
|
-
import {IModalState} from "types";
|
|
5
|
+
import {IModalState, IModalType} from "types";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
install(app: any) {
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
|
|
11
11
|
// Добавление глобального метода $modal
|
|
12
12
|
app.config.globalProperties.$modal = {
|
|
13
|
-
open(name:
|
|
13
|
+
open(name: IModalType, options: IModalState) {
|
|
14
14
|
modalStore.openModal(name, options); // Открытие модалки через Pinia
|
|
15
15
|
console.log("Current modals:", modalStore.modals);
|
|
16
16
|
},
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
modalContainer.addEventListener("click", () => {
|
|
44
44
|
console.log("this click on background");
|
|
45
45
|
modalStore.closeModal(modal.id);
|
|
46
|
-
if (modalStore.modals.length ===
|
|
46
|
+
if (modalStore.modals.length === 0) modalContainer.classList.remove("modal")
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
const modalApp = createApp({
|
|
@@ -75,7 +75,7 @@ export function useModal() {
|
|
|
75
75
|
declare module "@vue/runtime-core" {
|
|
76
76
|
interface ComponentCustomProperties {
|
|
77
77
|
$modal: {
|
|
78
|
-
open: (name:
|
|
78
|
+
open: (name: IModalType, options?: IModalState) => void;
|
|
79
79
|
close: (id: number) => void;
|
|
80
80
|
};
|
|
81
81
|
}
|