plugin-ui-for-kzt 0.0.5 → 0.0.7

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.5",
3
+ "version": "0.0.7",
4
4
  "description": "plugin-ui for kazaktelekom",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -7,6 +7,7 @@
7
7
  [getTypeModal.nameClass]: getTypeModal.nameClass !== '',
8
8
  }"
9
9
  >
10
+ {{getTypeModal.nameClass}}
10
11
  <div class="modal-container-header-title">
11
12
  <component :is="getTypeModal.img" />
12
13
  <div>{{ options.title }}</div>
@@ -27,26 +28,25 @@
27
28
  </template>
28
29
 
29
30
  <script setup lang="ts">
30
- import { ref, computed } from "vue";
31
+ import {ref, computed, Component} from "vue";
31
32
  import CloseIcon from "../icons/CloseIcon.vue";
32
33
  import ErrorIcon from "../icons/ErrorIcon.vue";
33
34
  import SuccessIcon from "../icons/SuccessIcon.vue";
34
35
  import WarningIcon from "../icons/WarningIcon.vue";
35
36
  import InfoIcon from "../icons/InfoIcon.vue";
37
+ import {IModalState, IModalType} from "../../types/index";
36
38
 
37
39
  interface IProps {
38
- options: {
39
- title: string;
40
- message: string;
41
- };
42
- name: string;
40
+ options:IModalState
41
+ name: IModalType;
43
42
  onClose: () => void;
44
43
  }
45
44
 
46
45
  const props = defineProps<IProps>();
47
46
  const showMore = ref<boolean>(false);
48
47
 
49
- const getTypeModal = computed<{ img: any; nameClass: string }>(() => {
48
+ const getTypeModal = computed<{ img: Component; nameClass: string }>(() => {
49
+ console.log(props.name);
50
50
  switch (props.name) {
51
51
  case "error":
52
52
  return { img: ErrorIcon, nameClass: "error" };
@@ -54,18 +54,18 @@ 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 "infoModal":
58
- return { img: InfoIcon, nameClass: "infoModal" };
57
+ case "info":
58
+ return { img: InfoIcon, nameClass: "info-modal" };
59
59
  default:
60
60
  return {
61
61
  img: SuccessIcon,
62
- nameClass: "",
62
+ nameClass: "info",
63
63
  };
64
64
  }
65
65
  });
66
66
  </script>
67
67
 
68
- <style lang="scss">
68
+ <style lang="scss" scoped>
69
69
  .modal {
70
70
  position: fixed;
71
71
  top: 0;
@@ -139,7 +139,7 @@ const getTypeModal = computed<{ img: any; nameClass: string }>(() => {
139
139
  background: #15b853;
140
140
  }
141
141
 
142
- .infoModal {
142
+ .info-modal {
143
143
  background: #f4a900;
144
144
  }
145
145
 
@@ -36,15 +36,12 @@ export default {
36
36
 
37
37
  modalContainer.addEventListener("click", (event) => {
38
38
  console.log(`Closing modal with id: ${modal.id}`);
39
+ console.log("this click on background", modalStore.modals);
40
+ if (modalStore.modals.length === 1) modalContainer.classList.remove("modal")
39
41
  modalStore.closeModal(modal.id);
40
42
  });
41
43
  modalContainer.setAttribute("name", modal.name);
42
44
  modalContainer.classList.add("modal");
43
- modalContainer.addEventListener("click", () => {
44
- console.log("this click on background");
45
- modalStore.closeModal(modal.id);
46
- if (modalStore.modals.length === 0) modalContainer.classList.remove("modal")
47
- });
48
45
 
49
46
  const modalApp = createApp({
50
47
  render() {
@@ -3,5 +3,5 @@ export interface IModalState{
3
3
  message: string;
4
4
  }
5
5
 
6
- export type IModalType= string | 'success' | 'error' | 'infoModal' | 'warning';
6
+ export type IModalType= string | 'success' | 'error' | 'info' | 'warning';
7
7