plugin-ui-for-kzt 0.0.23 → 0.0.27

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.
Files changed (93) hide show
  1. package/dist/assets/0e28e37419c99ac65b12.png +0 -0
  2. package/dist/assets/264165b2b0e8a6840eb0.png +0 -0
  3. package/dist/components/BaseBadge/BaseBadge.vue.d.ts +2 -2
  4. package/dist/components/BaseButton/BaseButton.vue.d.ts +1 -1
  5. package/dist/components/BaseCalendar/BaseCalendar.vue.d.ts +10 -1
  6. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +2 -2
  7. package/dist/components/{DataTable/DataTable.vue.d.ts → BaseDefaultPages/BaseDefaultPages.vue.d.ts} +8 -6
  8. package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +1 -1
  9. package/dist/components/BaseInput/BaseInput.vue.d.ts +4 -4
  10. package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +11 -4
  11. package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +3 -3
  12. package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +2 -2
  13. package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +2 -2
  14. package/dist/components/{Tooltip/Tooltip.vue.d.ts → BasePageLoader/BasePageLoader.vue.d.ts} +24 -11
  15. package/dist/components/BasePagination/BasePagination.vue.d.ts +1 -1
  16. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +2 -2
  17. package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +1 -1
  18. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +2 -2
  19. package/dist/components/BaseTable/BaseTable.vue.d.ts +44 -0
  20. package/dist/components/BaseTag/BaseTag.vue.d.ts +1 -1
  21. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +2 -2
  22. package/dist/components/BaseToast/BaseToast.vue.d.ts +69 -0
  23. package/dist/components/BaseToggle/BaseToggle.vue.d.ts +2 -2
  24. package/dist/composables/useToast.d.ts +2 -0
  25. package/dist/index.d.ts +6 -5
  26. package/dist/index.js +1 -1
  27. package/dist/plugins/toastPlugin.d.ts +4 -0
  28. package/dist/sprite.svg +1 -1
  29. package/dist/store/toast.d.ts +8 -0
  30. package/example/App.vue +12 -38
  31. package/package.json +1 -1
  32. package/src/assets/404.png +0 -0
  33. package/src/assets/icons/arrow-down-stick.svg +4 -0
  34. package/src/assets/icons/edit-table.svg +5 -0
  35. package/src/assets/icons/ellipsis.svg +5 -0
  36. package/src/assets/icons/loading-page-default.svg +4 -0
  37. package/src/assets/icons/loading-page-error.svg +6 -0
  38. package/src/assets/icons/loading-page-success.svg +5 -0
  39. package/src/assets/icons/loading-page-warning.svg +6 -0
  40. package/src/assets/icons/more-dots.svg +5 -0
  41. package/src/assets/icons/time-table.svg +7 -0
  42. package/src/assets/icons/toast-error.svg +3 -0
  43. package/src/assets/icons/toast-info.svg +3 -0
  44. package/src/assets/icons/toast-success.svg +3 -0
  45. package/src/assets/icons/toast-warning.svg +3 -0
  46. package/src/assets/icons/trash-table.svg +7 -0
  47. package/src/assets/tech-work.png +0 -0
  48. package/src/components/BaseCalendar/BaseCalendar.vue +2 -0
  49. package/src/components/BaseChips/BaseChips.vue +3 -1
  50. package/src/components/BaseDefaultPages/BaseDefaultPages.vue +140 -0
  51. package/src/components/BaseDefaultPages/README.md +128 -0
  52. package/src/components/BaseOpenedListItem/BaseOpenedListItem.vue +3 -3
  53. package/src/components/BasePageLoader/BasePageLoader.vue +211 -0
  54. package/src/components/BasePageLoader/README.md +80 -0
  55. package/src/components/BaseSelect/BaseSelect.vue +8 -3
  56. package/src/components/BaseTable/BaseTable.vue +411 -0
  57. package/src/components/BaseTable/README.md +294 -0
  58. package/src/components/BaseToast/BaseToast.vue +200 -0
  59. package/src/components/BaseToast/README.md +103 -0
  60. package/src/components/BaseTooltip/BaseTooltip.vue +1 -0
  61. package/src/components/BaseUpload/BaseUpload.vue +1 -1
  62. package/src/composables/useToast.ts +10 -0
  63. package/src/index.ts +17 -13
  64. package/src/plugins/toastPlugin.ts +100 -0
  65. package/src/store/toast.ts +59 -0
  66. package/src/styles/root.scss +2 -0
  67. package/src/styles/toast.scss +36 -0
  68. package/src/types/calendar.d.ts +1 -0
  69. package/src/types/default-pages.d.ts +6 -0
  70. package/src/types/loading-page.d.ts +12 -0
  71. package/src/types/pagination.d.ts +1 -0
  72. package/src/types/table.d.ts +33 -0
  73. package/src/types/toast.d.ts +25 -0
  74. package/webpack.config.js +12 -0
  75. package/dist/components/Spinner/Spinner.vue.d.ts +0 -20
  76. package/dist/components/Toaster/Toaster.vue.d.ts +0 -80
  77. package/dist/components/Toaster/timer.d.ts +0 -12
  78. package/dist/plugins/toasterPlugin.d.ts +0 -26
  79. package/src/components/DataTable/DataTable.vue +0 -169
  80. package/src/components/DataTable/README.md +0 -57
  81. package/src/components/Spinner/README.md +0 -35
  82. package/src/components/Spinner/Spinner.vue +0 -60
  83. package/src/components/Toaster/README.md +0 -70
  84. package/src/components/Toaster/Toaster.vue +0 -235
  85. package/src/components/Toaster/timer.ts +0 -45
  86. package/src/components/Tooltip/README.md +0 -37
  87. package/src/components/Tooltip/Tooltip.vue +0 -96
  88. package/src/components/icons/CloseIcon.vue +0 -5
  89. package/src/components/icons/ErrorIcon.vue +0 -7
  90. package/src/components/icons/InfoIcon.vue +0 -7
  91. package/src/components/icons/SuccessIcon.vue +0 -6
  92. package/src/components/icons/WarningIcon.vue +0 -7
  93. package/src/plugins/toasterPlugin.ts +0 -179
@@ -1,37 +0,0 @@
1
- # Документация компонента Tooltip
2
-
3
- ## Обзор
4
- Компонент `Tooltip` используется для отображения всплывающих подсказок при наведении курсора на элемент. Позволяет настраивать положение и ширину подсказки.
5
-
6
- ## Свойства (Props)
7
-
8
- - `content` (строка) – текст всплывающей подсказки. По умолчанию пустая строка.
9
- - `position` (строка, необязательно) – определяет расположение подсказки. Возможные значения: `top`, `bottom`, `left`, `right`. По умолчанию `top`.
10
- - `width` (строка, необязательно) – задаёт ширину подсказки. По умолчанию `200px`.
11
-
12
- ## Состояния (States)
13
-
14
- - `isVisible` (булево) – управляет отображением подсказки.
15
-
16
- ## Методы
17
-
18
- ### `showTooltip()`
19
- Активирует отображение подсказки при наведении курсора.
20
-
21
- ### `hideTooltip()`
22
- Скрывает подсказку при уходе курсора.
23
-
24
- ## Использование
25
-
26
- ```vue
27
- <Tooltip content="Подсказка" position="right" width="150px">
28
- <button>Наведи курсор</button>
29
- </Tooltip>
30
- ```
31
-
32
- ## Функциональность
33
-
34
- - Отображает подсказку при наведении и скрывает при уходе курсора.
35
- - Позволяет изменять положение подсказки.
36
- - Настраивает ширину содержимого всплывающего окна.
37
-
@@ -1,96 +0,0 @@
1
- <template>
2
- <div
3
- class="tooltip-container"
4
- @mouseenter="showTooltip"
5
- @mouseleave="hideTooltip"
6
- >
7
- <slot />
8
-
9
- <div v-if="isVisible" class="tooltip" :class="props.position">
10
- {{ props.content }}
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script setup lang="ts">
16
- import { ref } from "vue";
17
-
18
- interface TooltipProps {
19
- content: string;
20
- position?: "top" | "bottom" | "left" | "right";
21
- width?: string;
22
- }
23
-
24
- const props = withDefaults(defineProps<TooltipProps>(), {
25
- content: "",
26
- position: "top",
27
- width: "200px",
28
- });
29
-
30
- // states
31
- const isVisible = ref<boolean>(false);
32
-
33
- // functions
34
- const showTooltip = (): void => {
35
- isVisible.value = true;
36
- }
37
- const hideTooltip = (): void => {
38
- isVisible.value = false;
39
- }
40
- </script>
41
-
42
- <style scoped lang="scss">
43
- .tooltip-container {
44
- display: inline-block;
45
- position: relative;
46
- }
47
-
48
- .tooltip {
49
- position: absolute;
50
- padding: 8px 12px;
51
- background-color: #333;
52
- color: #fff;
53
- border-radius: 4px;
54
- font-size: 14px;
55
- line-height: 1.2;
56
- white-space: normal;
57
- z-index: 999;
58
- width: v-bind(width);
59
- opacity: 0;
60
- animation: fadeIn 0.2s forwards ease;
61
- }
62
-
63
- @keyframes fadeIn {
64
- to {
65
- opacity: 1;
66
- }
67
- }
68
-
69
- .tooltip.top {
70
- bottom: 100%;
71
- left: 50%;
72
- transform: translateX(-50%);
73
- margin-bottom: 8px;
74
- }
75
-
76
- .tooltip.bottom {
77
- top: 100%;
78
- left: 50%;
79
- transform: translateX(-50%);
80
- margin-top: 8px;
81
- }
82
-
83
- .tooltip.left {
84
- top: 50%;
85
- right: 100%;
86
- transform: translateY(-50%);
87
- margin-right: 8px;
88
- }
89
-
90
- .tooltip.right {
91
- top: 50%;
92
- left: 100%;
93
- transform: translateY(-50%);
94
- margin-left: 8px;
95
- }
96
- </style>
@@ -1,5 +0,0 @@
1
- <template>
2
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15.7592 1.51746C16.0803 1.17049 16.0803 0.607198 15.7592 0.260228C15.3311 -0.0867426 14.796 -0.0867426 14.4749 0.260228L7.94649 6.74237L1.52508 0.260228C1.09699 -0.0867426 0.561873 -0.0867426 0.240803 0.260228C-0.0802676 0.607198 -0.0802676 1.17049 0.240803 1.51746L6.76923 7.9996L0.240803 14.4828C-0.0802676 14.8298 -0.0802676 15.392 0.240803 15.739C0.561873 16.087 1.09699 16.087 1.52508 15.739L7.94649 9.25683L14.4749 15.739C14.796 16.087 15.3311 16.087 15.7592 15.739C16.0803 15.392 16.0803 14.8298 15.7592 14.4828L9.23077 7.9996L15.7592 1.51746Z" fill="white"/>
4
- </svg>
5
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg width="45" height="40" viewBox="0 0 45 40" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M42.8186 36.4103L23.3834 2.5641C22.9908 1.88034 22.0092 1.88034 21.6166 2.5641L2.1814 36.4103C1.78877 37.094 2.27955 37.9487 3.06481 37.9487H41.9352C42.7205 37.9487 43.2112 37.094 42.8186 36.4103ZM25.1503 1.53846C23.9724 -0.512819 21.0276 -0.512822 19.8498 1.53846L0.414562 35.3846C-0.763329 37.4359 0.709031 40 3.06481 40H41.9352C44.291 40 45.7633 37.4359 44.5854 35.3846L25.1503 1.53846Z" fill="white"/>
4
- <rect x="21.6213" y="10.2565" width="2.04017" height="17.4359" rx="1.02008" fill="white"/>
5
- <ellipse cx="22.712" cy="32.3076" rx="1.53012" ry="1.53846" fill="white"/>
6
- </svg>
7
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <circle cx="24" cy="24" r="22.5" stroke="white" stroke-width="3"/>
4
- <rect x="22" y="18" width="4" height="20" rx="2" fill="white"/>
5
- <circle cx="24" cy="12" r="2" fill="white"/>
6
- </svg>
7
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <circle cx="24" cy="24" r="22.5" stroke="white" stroke-width="3"/>
4
- <path d="M35.04 14.4L19.86 33.6L12.96 24.8728" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
5
- </svg>
6
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <circle cx="24" cy="24" r="22.5" stroke="white" stroke-width="3"/>
4
- <path d="M20.6759 13.9425C20.3227 11.8821 21.9096 10 24 10C26.0904 10 27.6773 11.8821 27.3241 13.9425L24.668 29.4368C24.6122 29.7622 24.3301 30 24 30C23.6699 30 23.3878 29.7622 23.332 29.4368L20.6759 13.9425Z" fill="white"/>
5
- <circle cx="24" cy="36" r="2" fill="white"/>
6
- </svg>
7
- </template>
@@ -1,179 +0,0 @@
1
- import { createApp, h, ref, getCurrentInstance } from "vue";
2
- import Toaster from "../components/Toaster/Toaster.vue";
3
-
4
- interface ToastOptions {
5
- position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
6
- duration?: number;
7
- dismissible?: boolean;
8
- pauseOnHover?: boolean;
9
- }
10
-
11
- interface Toast {
12
- id: number;
13
- type: "success" | "error" | "info" | "warning";
14
- message: string;
15
- position: "top-left" | "top-right" | "bottom-left" | "bottom-right";
16
- duration: number;
17
- dismissible: boolean;
18
- pauseOnHover: boolean;
19
- height?: number;
20
- }
21
-
22
- interface ToastPosition {
23
- toasts: Toast[];
24
- totalHeight: number;
25
- }
26
-
27
- export default {
28
- install(app: any) {
29
- app.config.globalProperties.$toast = {
30
- success: (message: string, options: ToastOptions = {}) =>
31
- addToast("success", message, options),
32
- error: (message: string, options: ToastOptions = {}) =>
33
- addToast("error", message, options),
34
- info: (message: string, options: ToastOptions = {}) =>
35
- addToast("info", message, options),
36
- warning: (message: string, options: ToastOptions = {}) =>
37
- addToast("warning", message, options),
38
- };
39
-
40
- const toasts = ref<Toast[]>([]);
41
- const toastPositions = ref<Record<string, ToastPosition>>({
42
- "top-right": { toasts: [], totalHeight: 0 },
43
- "top-left": { toasts: [], totalHeight: 0 },
44
- "bottom-right": { toasts: [], totalHeight: 0 },
45
- "bottom-left": { toasts: [], totalHeight: 0 },
46
- });
47
-
48
- const calculatePosition = (toast: Toast, index: number): number => {
49
- const position = toast.position;
50
- const positionData = toastPositions.value[position];
51
- const gap = 10;
52
- let offset = 20;
53
-
54
- for (let i = 0; i < index; i++) {
55
- const prevToast = positionData.toasts[i];
56
- offset += (prevToast.height || 0) + gap;
57
- }
58
-
59
- return offset;
60
- };
61
-
62
- const updateToastHeight = (id: number, height: number) => {
63
- const toast = toasts.value.find((t) => t.id === id);
64
- if (toast) {
65
- toast.height = height;
66
- const position = toast.position;
67
- const positionData = toastPositions.value[position];
68
- positionData.totalHeight = positionData.toasts.reduce(
69
- (total, t) => total + (t.height || 0) + 10,
70
- 20
71
- );
72
- }
73
- };
74
-
75
- const addToast = (
76
- type: "success" | "error" | "info" | "warning",
77
- message: string,
78
- options: ToastOptions = {}
79
- ) => {
80
- const id = Date.now();
81
- const position = options.position || "top-right";
82
- const duration = options.duration || 5000;
83
- const dismissible =
84
- options.dismissible !== undefined ? options.dismissible : true;
85
- const pauseOnHover =
86
- options.pauseOnHover !== undefined ? options.pauseOnHover : true;
87
-
88
- const toastData: Toast = {
89
- id,
90
- type,
91
- message,
92
- position,
93
- duration,
94
- dismissible,
95
- pauseOnHover,
96
- };
97
-
98
- toasts.value = [...toasts.value, toastData];
99
- toastPositions.value[position].toasts.push(toastData);
100
- };
101
-
102
- const removeToast = (id: number) => {
103
- const toast = toasts.value.find((t) => t.id === id);
104
- if (toast) {
105
- const position = toast.position;
106
- toastPositions.value[position].toasts = toastPositions.value[
107
- position
108
- ].toasts.filter((t) => t.id !== id);
109
-
110
- toastPositions.value[position].totalHeight = toastPositions.value[
111
- position
112
- ].toasts.reduce((total, t) => total + (t.height || 0) + 10, 20);
113
- }
114
- toasts.value = toasts.value.filter((t) => t.id !== id);
115
- };
116
-
117
- const createContainer = (position: string) => {
118
- const container = document.createElement("div");
119
- container.classList.add("toast-container", `toast--${position}`);
120
- document.body.appendChild(container);
121
- return container;
122
- };
123
-
124
- const topRightContainer = createContainer("top-right");
125
- const bottomRightContainer = createContainer("bottom-right");
126
- const topLeftContainer = createContainer("top-left");
127
- const bottomLeftContainer = createContainer("bottom-left");
128
-
129
- const createAppInstance = (position: string, container: HTMLElement) => {
130
- createApp({
131
- setup() {
132
- return { toasts, toastPositions };
133
- },
134
- render() {
135
- const positionToasts = toastPositions.value[position].toasts;
136
-
137
- return positionToasts.map((toast, index) => {
138
- const offset = calculatePosition(toast, index);
139
-
140
- return h(Toaster, {
141
- key: toast.id,
142
- ...toast,
143
- style: {
144
- position: "fixed",
145
- [position.includes("top") ? "top" : "bottom"]: `${offset}px`,
146
- [position.includes("right") ? "right" : "left"]: "20px",
147
- transition: "all 0.3s ease",
148
- },
149
- onDismiss: () => removeToast(toast.id),
150
- onHeightUpdate: (height: number) =>
151
- updateToastHeight(toast.id, height),
152
- });
153
- });
154
- },
155
- }).mount(container);
156
- };
157
-
158
- createAppInstance("top-right", topRightContainer);
159
- createAppInstance("bottom-right", bottomRightContainer);
160
- createAppInstance("top-left", topLeftContainer);
161
- createAppInstance("bottom-left", bottomLeftContainer);
162
- },
163
- };
164
-
165
- export function useToast() {
166
- const instance = getCurrentInstance();
167
- return instance?.appContext.config.globalProperties.$toast;
168
- }
169
-
170
- declare module "@vue/runtime-core" {
171
- interface ComponentCustomProperties {
172
- $toast: {
173
- success: (message: string, options?: ToastOptions) => void;
174
- error: (message: string, options?: ToastOptions) => void;
175
- info: (message: string, options?: ToastOptions) => void;
176
- warning: (message: string, options?: ToastOptions) => void;
177
- };
178
- }
179
- }