plugin-ui-for-kzt 0.0.22 → 0.0.25
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/dist/assets/0e28e37419c99ac65b12.png +0 -0
- package/dist/assets/264165b2b0e8a6840eb0.png +0 -0
- package/dist/components/BaseBadge/BaseBadge.vue.d.ts +1 -1
- package/dist/components/BaseButton/BaseButton.vue.d.ts +3 -3
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -4
- package/dist/components/{Spinner/Spinner.vue.d.ts → BaseDefaultPages/BaseDefaultPages.vue.d.ts} +9 -15
- package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +3 -3
- package/dist/components/BaseField/BaseField.vue.d.ts +2 -2
- package/dist/components/BaseInput/BaseInput.vue.d.ts +7 -7
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +5 -5
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +6 -6
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +5 -5
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +5 -5
- package/dist/components/BaseOpenedListItem/BaseOpenedListItem.vue.d.ts +3 -3
- package/dist/components/{Tooltip/Tooltip.vue.d.ts → BasePageLoader/BasePageLoader.vue.d.ts} +24 -11
- package/dist/components/BasePagination/BasePagination.vue.d.ts +1 -1
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -4
- package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +3 -3
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +4 -4
- package/dist/components/BaseTable/BaseTable.vue.d.ts +44 -0
- package/dist/components/BaseTabs/BaseTabs.vue.d.ts +25 -0
- package/dist/components/BaseTag/BaseTag.vue.d.ts +1 -1
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -5
- package/dist/components/BaseToast/BaseToast.vue.d.ts +69 -0
- package/dist/components/BaseToggle/BaseToggle.vue.d.ts +4 -4
- package/dist/components/BaseUpload/BaseUpload.vue.d.ts +11 -0
- package/dist/components/{DataTable/DataTable.vue.d.ts → BaseUpload/CropModal.vue.d.ts} +3 -6
- package/dist/composables/useToast.d.ts +2 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +15 -0
- package/dist/plugins/toastPlugin.d.ts +4 -0
- package/dist/sprite.svg +1 -1
- package/dist/store/toast.d.ts +8 -0
- package/example/App.vue +201 -28
- package/example/TestImage.vue +6 -0
- package/package.json +2 -1
- package/src/assets/404.png +0 -0
- package/src/assets/icons/arrow-down-stick.svg +4 -0
- package/src/assets/icons/edit-table.svg +5 -0
- package/src/assets/icons/ellipsis.svg +5 -0
- package/src/assets/icons/loading-page-default.svg +4 -0
- package/src/assets/icons/loading-page-error.svg +6 -0
- package/src/assets/icons/loading-page-success.svg +5 -0
- package/src/assets/icons/loading-page-warning.svg +6 -0
- package/src/assets/icons/more-dots.svg +5 -0
- package/src/assets/icons/time-table.svg +7 -0
- package/src/assets/icons/toast-error.svg +3 -0
- package/src/assets/icons/toast-info.svg +3 -0
- package/src/assets/icons/toast-success.svg +3 -0
- package/src/assets/icons/toast-warning.svg +3 -0
- package/src/assets/icons/trash-table.svg +7 -0
- package/src/assets/tech-work.png +0 -0
- package/src/components/BaseCheckbox/BaseCheckbox.vue +76 -46
- package/src/components/BaseChips/BaseChips.vue +3 -1
- package/src/components/BaseDefaultPages/BaseDefaultPages.vue +140 -0
- package/src/components/BaseDefaultPages/README.md +128 -0
- package/src/components/BaseOpenedListItem/BaseOpenedListItem.vue +3 -3
- package/src/components/BasePageLoader/BasePageLoader.vue +211 -0
- package/src/components/BasePageLoader/README.md +80 -0
- package/src/components/BaseRadio/BaseRadio.vue +266 -233
- package/src/components/BaseSelect/BaseSelect.vue +7 -3
- package/src/components/BaseTable/BaseTable.vue +411 -0
- package/src/components/BaseTable/README.md +294 -0
- package/src/components/BaseTabs/BaseTabs.vue +193 -0
- package/src/components/BaseToast/BaseToast.vue +200 -0
- package/src/components/BaseToast/README.md +103 -0
- package/src/components/BaseTooltip/BaseTooltip.vue +1 -0
- package/src/components/BaseUpload/BaseUpload.vue +36 -2
- package/src/components/BaseUpload/CropModal.vue +210 -0
- package/src/composables/useToast.ts +10 -0
- package/src/index.ts +20 -13
- package/src/plugins/toastPlugin.ts +100 -0
- package/src/store/toast.ts +59 -0
- package/src/styles/root.scss +2 -0
- package/src/styles/toast.scss +36 -0
- package/src/types/default-pages.d.ts +6 -0
- package/src/types/loading-page.d.ts +12 -0
- package/src/types/pagination.d.ts +1 -0
- package/src/types/tab.d.ts +17 -0
- package/src/types/table.d.ts +33 -0
- package/src/types/toast.d.ts +25 -0
- package/src/types/uploadedFile.d.ts +7 -0
- package/webpack.config.js +12 -0
- package/dist/components/Toaster/Toaster.vue.d.ts +0 -80
- package/dist/components/Toaster/timer.d.ts +0 -12
- package/dist/plugins/toasterPlugin.d.ts +0 -26
- package/src/components/DataTable/DataTable.vue +0 -169
- package/src/components/DataTable/README.md +0 -57
- package/src/components/Spinner/README.md +0 -35
- package/src/components/Spinner/Spinner.vue +0 -60
- package/src/components/Toaster/README.md +0 -70
- package/src/components/Toaster/Toaster.vue +0 -235
- package/src/components/Toaster/timer.ts +0 -45
- package/src/components/Tooltip/README.md +0 -37
- package/src/components/Tooltip/Tooltip.vue +0 -96
- package/src/components/icons/CloseIcon.vue +0 -5
- package/src/components/icons/ErrorIcon.vue +0 -7
- package/src/components/icons/InfoIcon.vue +0 -7
- package/src/components/icons/SuccessIcon.vue +0 -6
- package/src/components/icons/WarningIcon.vue +0 -7
- package/src/plugins/toasterPlugin.ts +0 -179
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base-page-loader" :class="classList" :aria-busy="loading">
|
|
3
|
+
<div class="base-page-loader__overlay" :class="{ 'base-page-loader__overlay--modal': modal }"></div>
|
|
4
|
+
<div class="base-page-loader__wrapper">
|
|
5
|
+
<div class="base-page-loader__icon-container">
|
|
6
|
+
<transition-group name="icon-fade" tag="div">
|
|
7
|
+
<base-icon
|
|
8
|
+
v-if="loading"
|
|
9
|
+
key="loading"
|
|
10
|
+
class="base-page-loader__icon base-page-loader__icon--animation"
|
|
11
|
+
size="custom"
|
|
12
|
+
name="loading-page-default"
|
|
13
|
+
/>
|
|
14
|
+
<base-icon
|
|
15
|
+
v-else-if="iconType"
|
|
16
|
+
key="status"
|
|
17
|
+
class="base-page-loader__icon base-page-loader__icon--after-loading"
|
|
18
|
+
size="custom"
|
|
19
|
+
:name="iconName"
|
|
20
|
+
/>
|
|
21
|
+
</transition-group>
|
|
22
|
+
</div>
|
|
23
|
+
<transition name="icon-fade">
|
|
24
|
+
<div v-if="message" class="base-page-loader__message">
|
|
25
|
+
{{ message }}
|
|
26
|
+
</div>
|
|
27
|
+
</transition>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import { computed } from 'vue';
|
|
34
|
+
import BaseIcon from '../BaseIcon/BaseIcon.vue';
|
|
35
|
+
import { useKitSize } from '../../composables/kit/size';
|
|
36
|
+
import type { TPageLoaderProps } from '../../types/loading-page';
|
|
37
|
+
|
|
38
|
+
const props = withDefaults(defineProps<TPageLoaderProps>(), {
|
|
39
|
+
size: 'medium',
|
|
40
|
+
loading: true,
|
|
41
|
+
message: '',
|
|
42
|
+
modal: false,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const { sizeClassList } = useKitSize(props);
|
|
46
|
+
|
|
47
|
+
const classList = computed(() => [
|
|
48
|
+
...sizeClassList.value,
|
|
49
|
+
'base-page-loader',
|
|
50
|
+
{ '--modal': props.modal },
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
const iconName = computed(() => {
|
|
54
|
+
switch (props.iconType) {
|
|
55
|
+
case 'success':
|
|
56
|
+
return 'loading-page-success';
|
|
57
|
+
case 'warning':
|
|
58
|
+
return 'loading-page-warning';
|
|
59
|
+
case 'error':
|
|
60
|
+
return 'loading-page-error';
|
|
61
|
+
default:
|
|
62
|
+
return 'loading-page-success';
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style scoped lang="scss">
|
|
68
|
+
@import '../../styles/variables';
|
|
69
|
+
@import '../../styles/root';
|
|
70
|
+
|
|
71
|
+
.base-page-loader {
|
|
72
|
+
$loader: &;
|
|
73
|
+
|
|
74
|
+
position: relative;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
z-index: 1000;
|
|
81
|
+
|
|
82
|
+
&__overlay {
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
background: rgba(0, 0, 0, 0.5);
|
|
89
|
+
z-index: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__wrapper {
|
|
93
|
+
position: relative;
|
|
94
|
+
z-index: 2;
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
gap: 12px;
|
|
100
|
+
width: auto;
|
|
101
|
+
min-width: 120px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&__icon-container {
|
|
105
|
+
position: relative;
|
|
106
|
+
width: 56px;
|
|
107
|
+
height: 56px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&__icon {
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
|
|
115
|
+
&--animation {
|
|
116
|
+
animation: loader-circle 1s linear infinite;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__message {
|
|
121
|
+
font: var(--typography-text-m-regular);
|
|
122
|
+
color: var(--primary-text-primary);
|
|
123
|
+
text-align: center;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.--small-size {
|
|
127
|
+
#{$loader}__icon-container {
|
|
128
|
+
width: 32px;
|
|
129
|
+
height: 32px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#{$loader}__icon {
|
|
133
|
+
width: 32px;
|
|
134
|
+
height: 32px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
#{$loader}__message {
|
|
138
|
+
font: var(--typography-text-s-regular);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.--medium-size {
|
|
143
|
+
#{$loader}__icon-container {
|
|
144
|
+
width: 48px;
|
|
145
|
+
height: 48px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#{$loader}__icon {
|
|
149
|
+
width: 48px;
|
|
150
|
+
height: 48px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#{$loader}__message {
|
|
154
|
+
font: var(--typography-text-m-regular);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.--large-size {
|
|
159
|
+
#{$loader}__icon-container {
|
|
160
|
+
width: 56px;
|
|
161
|
+
height: 56px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
#{$loader}__icon {
|
|
165
|
+
width: 56px;
|
|
166
|
+
height: 56px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
#{$loader}__message {
|
|
170
|
+
font: var(--typography-text-l-regular);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.--modal {
|
|
175
|
+
#{$loader}__overlay {
|
|
176
|
+
background: rgba(0, 0, 0, 0.7);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
#{$loader}__wrapper {
|
|
180
|
+
background: var(--bg-light);
|
|
181
|
+
border-radius: 20px;
|
|
182
|
+
padding: 48px 120px;
|
|
183
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@keyframes loader-circle {
|
|
189
|
+
0% {
|
|
190
|
+
transform: rotate(0deg);
|
|
191
|
+
}
|
|
192
|
+
100% {
|
|
193
|
+
transform: rotate(360deg);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.icon-fade-enter-active,
|
|
198
|
+
.icon-fade-leave-active {
|
|
199
|
+
transition: opacity 0.3s ease;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.icon-fade-enter-from,
|
|
203
|
+
.icon-fade-leave-to {
|
|
204
|
+
opacity: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.icon-fade-enter-to,
|
|
208
|
+
.icon-fade-leave-from {
|
|
209
|
+
opacity: 1;
|
|
210
|
+
}
|
|
211
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
BasePageLoader — это переиспользуемый Vue 3 компонент для отображения индикатора загрузки с опциональным оверлеем, текстом и иконками состояния. Компонент предназначен для показа процесса загрузки и результатов (успех, предупреждение, ошибка) с плавными анимациями.
|
|
2
|
+
|
|
3
|
+
Оверлей: Полупрозрачный фон, покрывающий всё пространство компонента, с возможностью настройки для модального режима.
|
|
4
|
+
Иконки: Показывает анимированную иконку загрузки во время loading: true и иконку состояния (success, warning, error) при loading: false.
|
|
5
|
+
Анимации: Плавное переключение иконок с использованием opacity для избежания "прыжков".
|
|
6
|
+
Сообщение: Опциональный текст, отображаемый под иконкой, с плавным появлением/исчезновением.
|
|
7
|
+
Модальный режим: Поддержка отображения контента в виде модального окна с белым фоном и тенью.
|
|
8
|
+
Размеры: Поддержка трех размеров (small, medium, large) для иконок.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Пропсы
|
|
12
|
+
|
|
13
|
+
size - string - medium
|
|
14
|
+
Размер компонента: small, medium, large. Влияет на размер иконки и текста.
|
|
15
|
+
|
|
16
|
+
loading - boolean - true
|
|
17
|
+
Показывает иконку загрузки, если true, или иконку состояния, если false.
|
|
18
|
+
|
|
19
|
+
iconType - TIconType ( success | error | warning ) - success
|
|
20
|
+
Тип иконки состояния, отображаемой после загрузки.
|
|
21
|
+
|
|
22
|
+
message - string - ''
|
|
23
|
+
Опциональный текст сообщения, отображаемый под иконкой.
|
|
24
|
+
|
|
25
|
+
modal - boolean - false
|
|
26
|
+
Включает модальный режим с белым фоном и тенью для контента.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
Использование
|
|
30
|
+
Базовый пример
|
|
31
|
+
<template>
|
|
32
|
+
<div style="width: 100%; height: 400px;">
|
|
33
|
+
<BasePageLoader
|
|
34
|
+
:loading="isLoading"
|
|
35
|
+
iconType="success"
|
|
36
|
+
message="Processing your request..."
|
|
37
|
+
size="large"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
import { ref } from 'vue';
|
|
44
|
+
import BasePageLoader from './BasePageLoader.vue';
|
|
45
|
+
|
|
46
|
+
const isLoading = ref(true);
|
|
47
|
+
|
|
48
|
+
// Симуляция завершения загрузки
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
isLoading.value = false;
|
|
51
|
+
}, 3000);
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
Модальный режим
|
|
55
|
+
<template>
|
|
56
|
+
<div style="width: 100%; height: 400px;">
|
|
57
|
+
<BasePageLoader
|
|
58
|
+
:loading="isLoading"
|
|
59
|
+
iconType="error"
|
|
60
|
+
message="An error occurred"
|
|
61
|
+
size="medium"
|
|
62
|
+
:modal="true"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script setup lang="ts">
|
|
68
|
+
import { ref } from 'vue';
|
|
69
|
+
import BasePageLoader from './BasePageLoader.vue';
|
|
70
|
+
|
|
71
|
+
const isLoading = ref(true);
|
|
72
|
+
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
isLoading.value = false;
|
|
75
|
+
}, 3000);
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
Модальный режим
|
|
80
|
+
В модальном режиме (modal: true):
|