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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-ui-for-kzt",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "plugin-ui for kazaktelekom",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -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 "info":
58
- return { img: InfoIcon, nameClass: "info" };
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
- .info {
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: string, options: IModalState) {
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 === 1) modalContainer.classList.remove("modal")
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: string, options?: Record<string, any>) => void;
78
+ open: (name: IModalType, options?: IModalState) => void;
79
79
  close: (id: number) => void;
80
80
  };
81
81
  }
@@ -1,4 +1,7 @@
1
1
  export interface IModalState{
2
2
  title: string;
3
3
  message: string;
4
- }
4
+ }
5
+
6
+ export type IModalType= string | 'success' | 'error' | 'infoModal' | 'warning';
7
+