plugin-ui-for-kzt 0.0.15 → 0.0.17
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/components/BaseButton/BaseButton.vue.d.ts +2 -2
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +3 -3
- package/dist/components/BaseChips/BaseChips.vue.d.ts +27 -0
- package/dist/components/BaseDropdown/BaseDropdown.vue.d.ts +2 -2
- package/dist/components/BaseInput/BaseInput.vue.d.ts +4 -4
- package/dist/components/BaseInputCalendar/BaseInputCalendar.vue.d.ts +4 -4
- package/dist/components/BaseInputCurrency/BaseInputCurrency.vue.d.ts +4 -4
- package/dist/components/BaseInputEmail/BaseInputEmail.vue.d.ts +4 -4
- package/dist/components/BaseInputPhone/BaseInputPhone.vue.d.ts +4 -4
- package/dist/components/BaseOpenedListItem/BaseOpenedListItem.vue.d.ts +2 -2
- package/dist/components/BasePagination/BasePagination.vue.d.ts +51 -0
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +3 -3
- package/dist/components/BaseSegmentedButtons/BaseSegmentedButtons.vue.d.ts +1 -1
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +2 -2
- package/dist/components/BaseSiteInput/BaseSiteInput.vue.d.ts +1 -1
- package/dist/components/BaseSwiper/BaseSwiper.vue.d.ts +57 -0
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +4 -4
- package/dist/components/BaseToggle/BaseToggle.vue.d.ts +3 -3
- package/dist/components/Toaster/Toaster.vue.d.ts +4 -4
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/dist/sprite.d.ts +4 -0
- package/dist/sprite.svg +1 -1
- package/example/App.vue +45 -23
- package/package.json +1 -1
- package/src/assets/icons/arrow-left-circle.svg +3 -0
- package/src/assets/icons/arrow-left.svg +4 -0
- package/src/assets/icons/arrow-right-circle.svg +3 -0
- package/src/assets/icons/arrow-right.svg +4 -0
- package/src/assets/icons/star.svg +3 -0
- package/src/components/BaseBreadCrumbs/BaseBreadCrumbs.vue +1 -2
- package/src/components/BaseButton/BaseButton.vue +29 -10
- package/src/components/BaseChips/BaseChips.vue +182 -0
- package/src/components/BaseChips/README.md +64 -0
- package/src/components/BaseInput/BaseInput.vue +1 -0
- package/src/components/BaseOpenedListItem/BaseOpenedListItem.vue +4 -4
- package/src/components/BasePagination/BasePagination.vue +405 -0
- package/src/components/BasePagination/README.md +156 -0
- package/src/components/BaseSiteInput/BaseSiteInput.vue +26 -9
- package/src/components/BaseSwiper/BaseSwiper.vue +229 -0
- package/src/components/BaseTextarea/BaseTextarea.vue +1 -0
- package/src/index.ts +42 -16
- package/src/sprite.ts +11 -0
- package/src/styles/root.scss +3 -0
- package/src/types/chips.d.ts +10 -0
- package/src/types/pagination.d.ts +13 -0
- package/src/types/swiper.d.ts +17 -0
- package/webpack.config.js +1 -1
- package/dist/icons/index.d.ts +0 -2
- package/src/icons/index.ts +0 -15
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Компонент BasePagination
|
|
2
|
+
|
|
3
|
+
Компонент `BasePagination` — это повторно используемый компонент Vue 3, предназначенный для навигации по страницам с различными стилями отображения. Он поддерживает числовую пагинацию с эллипсами для больших количеств страниц, а также альтернативные стили, такие как точки и тире, с или без цветного фона. Компонент легко настраивается через пропсы, слоты и переменные SCSS.
|
|
4
|
+
|
|
5
|
+
## Содержание
|
|
6
|
+
- [Обзор](#обзор)
|
|
7
|
+
- [Использование](#использование)
|
|
8
|
+
- [Базовое использование](#базовое-использование)
|
|
9
|
+
- [Кастомизация текста через слоты](#кастомизация-текста-через-слоты)
|
|
10
|
+
- [Использование разных типов](#использование-разных-типов)
|
|
11
|
+
- [Пропсы](#пропсы)
|
|
12
|
+
- [Слоты](#слоты)
|
|
13
|
+
- [События](#события)
|
|
14
|
+
- [Стилизация](#стилизация)
|
|
15
|
+
- [Зависимости](#зависимости)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Обзор
|
|
19
|
+
|
|
20
|
+
Компонент `BasePagination` предоставляет гибкий способ навигации по нескольким страницам. Поддерживаются пять типов пагинации:
|
|
21
|
+
- `numbers`: Отображает номера страниц с эллипсами для больших количеств страниц.
|
|
22
|
+
- `dots`: Отображает до 3 точек для представления страниц.
|
|
23
|
+
- `dotsWithBackground`: Отображает до 3 точек с цветным фоном.
|
|
24
|
+
- `dashes`: Отображает до 3 тире для представления страниц.
|
|
25
|
+
- `dashesWithBackground`: Отображает до 3 тире с цветным фоном.
|
|
26
|
+
|
|
27
|
+
Компонент включает кнопки навигации ("Назад" и "Вперёд") с возможностью кастомизации текста через слоты, а также поддерживает разные размеры и цветовые схемы.
|
|
28
|
+
|
|
29
|
+
## Использование
|
|
30
|
+
|
|
31
|
+
### Базовое использование
|
|
32
|
+
|
|
33
|
+
Для использования компонента `BasePagination` с настройками по умолчанию включите его в ваш шаблон и привяжите необходимые пропсы:
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<template>
|
|
37
|
+
<div>
|
|
38
|
+
<base-pagination
|
|
39
|
+
:current-page="currentPage"
|
|
40
|
+
:total-pages="10"
|
|
41
|
+
@update:current-page="currentPage = $event"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { ref } from 'vue';
|
|
48
|
+
import BasePagination from './components/BasePagination.vue';
|
|
49
|
+
|
|
50
|
+
const currentPage = ref(1);
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Результат**: Компонент отобразит числовую пагинацию с кнопками "Назад" и "Вперёд" по умолчанию.
|
|
55
|
+
|
|
56
|
+
### Кастомизация текста через слоты
|
|
57
|
+
|
|
58
|
+
Вы можете кастомизировать текст кнопок "Назад" и "Вперёд" с помощью слотов `previousTextButton` и `nextTextButton`:
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<template>
|
|
62
|
+
<div>
|
|
63
|
+
<base-pagination
|
|
64
|
+
:current-page="currentPage"
|
|
65
|
+
:total-pages="10"
|
|
66
|
+
@update:current-page="currentPage = $event"
|
|
67
|
+
>
|
|
68
|
+
<template #previousTextButton>Назад</template>
|
|
69
|
+
<template #nextTextButton>Вперёд</template>
|
|
70
|
+
</base-pagination>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Результат**: Кнопки будут отображать кастомный текст "Назад" и "Вперёд".
|
|
76
|
+
|
|
77
|
+
### Использование разных типов
|
|
78
|
+
|
|
79
|
+
Компонент поддерживает разные типы пагинации. Пример с типом `dotsWithBackground`:
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<template>
|
|
83
|
+
<div>
|
|
84
|
+
<base-pagination
|
|
85
|
+
type="dotsWithBackground"
|
|
86
|
+
:current-page="currentPage"
|
|
87
|
+
:total-pages="3"
|
|
88
|
+
color="primary"
|
|
89
|
+
@update:current-page="currentPage = $event"
|
|
90
|
+
>
|
|
91
|
+
<template #previousTextButton>Пред.</template>
|
|
92
|
+
<template #nextTextButton>След.</template>
|
|
93
|
+
</base-pagination>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Результат**: Отобразится пагинация с 3 точками на цветном фоне с кастомным текстом "Пред." и "След.".
|
|
99
|
+
|
|
100
|
+
## Пропсы
|
|
101
|
+
|
|
102
|
+
| Проп | Тип | По умолчанию | Описание |
|
|
103
|
+
|-------------------|----------------------|----------------|-----------------------------------------------|
|
|
104
|
+
| `type` | `PaginationType` | `'numbers'` | Тип пагинации (`numbers`, `dots`, `dotsWithBackground`, `dashes`, `dashesWithBackground`). |
|
|
105
|
+
| `currentPage` | `number` | `1` | Текущая страница. |
|
|
106
|
+
| `totalPages` | `number` | `1` | Общее количество страниц. |
|
|
107
|
+
| `maxDisplayedPages` | `number` | `5` | Максимальное количество отображаемых страниц (только для `numbers`). |
|
|
108
|
+
| `size` | `ICoreSize` | `'medium'` | Размер пагинации (`small`, `medium`, `large`). |
|
|
109
|
+
| `color` | `PaginationColor` | `'primary'` | Цветовая схема (`primary`, `secondary`, `white`, `black`). |
|
|
110
|
+
|
|
111
|
+
## Слоты
|
|
112
|
+
|
|
113
|
+
| Слот | По умолчанию | Описание |
|
|
114
|
+
|-------------------|----------------|-----------------------------------------------|
|
|
115
|
+
| `previousTextButton` | `'Назад'` | Слот для текста кнопки "Назад". |
|
|
116
|
+
| `nextTextButton` | `'Вперёд'` | Слот для текста кнопки "Вперёд". |
|
|
117
|
+
|
|
118
|
+
Пример использования слотов:
|
|
119
|
+
```vue
|
|
120
|
+
<base-pagination :current-page="currentPage" :total-pages="10" @update:current-page="currentPage = $event">
|
|
121
|
+
<template #previousTextButton>Пред.</template>
|
|
122
|
+
<template #nextTextButton>След.</template>
|
|
123
|
+
</base-pagination>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## События
|
|
127
|
+
|
|
128
|
+
| Событие | Описание | Параметры |
|
|
129
|
+
|--------------------|-----------------------------------------------|--------------------------|
|
|
130
|
+
| `update:currentPage` | Вызывается при изменении текущей страницы. | `page` (число) |
|
|
131
|
+
|
|
132
|
+
Пример обработки события:
|
|
133
|
+
```vue
|
|
134
|
+
<base-pagination
|
|
135
|
+
:current-page="currentPage"
|
|
136
|
+
:total-pages="10"
|
|
137
|
+
@update:current-page="currentPage = $event"
|
|
138
|
+
/>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Стилизация
|
|
142
|
+
|
|
143
|
+
Компонент использует SCSS для стилизации и поддерживает следующие особенности:
|
|
144
|
+
- **Размеры**: `small`, `medium`, `large` с соответствующими размерами для кнопок и элементов.
|
|
145
|
+
- **Цветовые схемы**: Четыре цветовых варианта (`primary`, `secondary`, `white`, `black`) для типов `dotsWithBackground` и `dashesWithBackground`.
|
|
146
|
+
- **Анимации**: Плавные переходы для активных элементов (масштабирование точек и тире).
|
|
147
|
+
- **Кастомные классы**:
|
|
148
|
+
- `base-pagination--${type}` для разных типов пагинации.
|
|
149
|
+
- `--color-${color}` для цветовых схем.
|
|
150
|
+
|
|
151
|
+
## Зависимости
|
|
152
|
+
|
|
153
|
+
- `vue` (Vue 3)
|
|
154
|
+
- `BaseButton` (компонент для кнопок)
|
|
155
|
+
- `BaseIcon` (компонент для иконок)
|
|
156
|
+
- `useKitSize` (композиция для управления размером)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="classList">
|
|
3
3
|
<div class="base-site-input__wrapper">
|
|
4
|
-
<div class="base-site-input__url">
|
|
5
|
-
|
|
4
|
+
<div class="base-site-input__url-wrapper">
|
|
5
|
+
<span class="base-site-input__url">
|
|
6
|
+
https://
|
|
7
|
+
</span>
|
|
6
8
|
</div>
|
|
7
9
|
<base-input
|
|
8
10
|
v-bind="{...$props, ...$attrs}"
|
|
@@ -90,22 +92,31 @@ watch(modelValue, (value) => {
|
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
&__url {
|
|
95
|
+
color: var(--primary-text-tertiary);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__url-wrapper {
|
|
99
|
+
background: var(--bg-light);
|
|
93
100
|
display: flex;
|
|
94
101
|
align-items: center;
|
|
95
102
|
justify-content: center;
|
|
103
|
+
border-top-left-radius: var(--corner-radius-s);
|
|
96
104
|
border-top: 1px solid var(--primary-black-300);
|
|
97
105
|
border-bottom: 1px solid var(--primary-black-300);
|
|
98
106
|
border-left: 1px solid var(--primary-black-300);
|
|
99
|
-
|
|
107
|
+
border-bottom-left-radius: var(--corner-radius-s);
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
&.--small-size {
|
|
103
111
|
#{$input} {
|
|
104
|
-
&__url
|
|
105
|
-
height:
|
|
112
|
+
&__url-wrapper{
|
|
113
|
+
height: 40px;
|
|
106
114
|
font: var(--typography-text-m-regular);
|
|
107
115
|
border-top-left-radius: var(--corner-radius-s);
|
|
108
116
|
border-bottom-left-radius: var(--corner-radius-s);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&__url {
|
|
109
120
|
padding: var(--spacing-s) var(--spacing-m) var(--spacing-s) var(--spacing-2l);
|
|
110
121
|
}
|
|
111
122
|
}
|
|
@@ -118,11 +129,14 @@ watch(modelValue, (value) => {
|
|
|
118
129
|
|
|
119
130
|
&.--medium-size {
|
|
120
131
|
#{$input} {
|
|
121
|
-
&__url
|
|
122
|
-
height:
|
|
132
|
+
&__url-wrapper{
|
|
133
|
+
height: 48px;
|
|
123
134
|
font: var(--typography-text-m-regular);
|
|
124
135
|
border-top-left-radius: var(--corner-radius-m);
|
|
125
136
|
border-bottom-left-radius: var(--corner-radius-m);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&__url {
|
|
126
140
|
padding: var(--spacing-m) var(--spacing-m) var(--spacing-m) var(--spacing-2l);
|
|
127
141
|
}
|
|
128
142
|
}
|
|
@@ -135,11 +149,14 @@ watch(modelValue, (value) => {
|
|
|
135
149
|
|
|
136
150
|
&.--large-size {
|
|
137
151
|
#{$input} {
|
|
138
|
-
&__url
|
|
139
|
-
height:
|
|
152
|
+
&__url-wrapper{
|
|
153
|
+
height: 56px;
|
|
140
154
|
font: var(--typography-text-l-regular);
|
|
141
155
|
border-top-left-radius: var(--corner-radius-m);
|
|
142
156
|
border-bottom-left-radius: var(--corner-radius-m);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&__url {
|
|
143
160
|
padding: var(--spacing-2l) var(--spacing-m) var(--spacing-2l) var(--spacing-l);
|
|
144
161
|
}
|
|
145
162
|
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base-swiper">
|
|
3
|
+
<!-- Кнопки навигации -->
|
|
4
|
+
<button
|
|
5
|
+
:class="buttonClassList"
|
|
6
|
+
class="base-swiper__nav base-swiper__nav--prev"
|
|
7
|
+
@click="prevSlide"
|
|
8
|
+
:disabled="currentSlide === 0"
|
|
9
|
+
>
|
|
10
|
+
<base-icon
|
|
11
|
+
name="arrow-left-circle"
|
|
12
|
+
size="medium"
|
|
13
|
+
/>
|
|
14
|
+
</button>
|
|
15
|
+
<div class="base-swiper__container" ref="swiperContainer">
|
|
16
|
+
<div class="base-swiper__slides">
|
|
17
|
+
<div
|
|
18
|
+
v-for="(image, index) in images"
|
|
19
|
+
:key="index"
|
|
20
|
+
class="base-swiper__slide"
|
|
21
|
+
:style="{ transform: `translateX(-${currentSlide * 100}%)` }"
|
|
22
|
+
>
|
|
23
|
+
<img :src="image" alt="Slide" class="base-swiper__image" />
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<button
|
|
28
|
+
:class="buttonClassList"
|
|
29
|
+
class="base-swiper__nav base-swiper__nav--next"
|
|
30
|
+
@click="nextSlide"
|
|
31
|
+
:disabled="currentSlide === images.length - 1"
|
|
32
|
+
>
|
|
33
|
+
<base-icon
|
|
34
|
+
name="arrow-right-circle"
|
|
35
|
+
size="medium"
|
|
36
|
+
/>
|
|
37
|
+
</button>
|
|
38
|
+
|
|
39
|
+
<!-- Пагинация -->
|
|
40
|
+
<div class="base-swiper__pagination">
|
|
41
|
+
<base-pagination
|
|
42
|
+
:type="paginationSettings.type"
|
|
43
|
+
v-model:current-page="currentPage"
|
|
44
|
+
:total-pages="images.length"
|
|
45
|
+
:color="paginationSettings.color"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import { ref, onMounted, onUnmounted, watch, computed } from 'vue';
|
|
53
|
+
import BaseIcon from '../BaseIcon/BaseIcon.vue';
|
|
54
|
+
import BasePagination from '../BasePagination/BasePagination.vue';
|
|
55
|
+
import type { ICoreSwiperProps } from '../../types/swiper';
|
|
56
|
+
|
|
57
|
+
const props = withDefaults(defineProps<ICoreSwiperProps>(), {
|
|
58
|
+
images: () => [],
|
|
59
|
+
autoplay: false,
|
|
60
|
+
autoplayInterval: 3000,
|
|
61
|
+
paginationSettings: {
|
|
62
|
+
type: 'dots',
|
|
63
|
+
color: 'primary',
|
|
64
|
+
},
|
|
65
|
+
buttonSize: 'medium',
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const emit = defineEmits<{
|
|
69
|
+
(e: 'update:currentSlide', value: number): void;
|
|
70
|
+
}>();
|
|
71
|
+
|
|
72
|
+
const swiperContainer = ref<HTMLElement | null>(null);
|
|
73
|
+
const currentSlide = ref(0);
|
|
74
|
+
const currentPage = ref(1);
|
|
75
|
+
|
|
76
|
+
const buttonClassList = computed(() => [
|
|
77
|
+
`--${props.buttonSize}-size`,
|
|
78
|
+
`--color-${props.paginationSettings.color}`,
|
|
79
|
+
]);
|
|
80
|
+
|
|
81
|
+
watch(currentSlide, (newSlide) => {
|
|
82
|
+
currentPage.value = newSlide + 1;
|
|
83
|
+
emit('update:currentSlide', newSlide);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
watch(currentPage, (newPage) => {
|
|
87
|
+
currentSlide.value = newPage - 1;
|
|
88
|
+
emit('update:currentSlide', currentSlide.value);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const prevSlide = () => {
|
|
92
|
+
if (currentSlide.value > 0) {
|
|
93
|
+
currentSlide.value -= 1;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const nextSlide = () => {
|
|
98
|
+
if (currentSlide.value < props.images.length - 1) {
|
|
99
|
+
currentSlide.value += 1;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
let autoplayIntervalId: ReturnType<typeof setInterval> | null = null;
|
|
104
|
+
|
|
105
|
+
const startAutoplay = () => {
|
|
106
|
+
if (props.autoplay && !autoplayIntervalId) {
|
|
107
|
+
autoplayIntervalId = setInterval(() => {
|
|
108
|
+
nextSlide();
|
|
109
|
+
if (currentSlide.value >= props.images.length - 1) {
|
|
110
|
+
currentSlide.value = 0; // Возвращаемся к первому слайду
|
|
111
|
+
}
|
|
112
|
+
}, props.autoplayInterval);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const stopAutoplay = () => {
|
|
117
|
+
if (autoplayIntervalId) {
|
|
118
|
+
clearInterval(autoplayIntervalId);
|
|
119
|
+
autoplayIntervalId = null;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
onMounted(() => {
|
|
124
|
+
startAutoplay();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
onUnmounted(() => {
|
|
128
|
+
stopAutoplay();
|
|
129
|
+
});
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style lang="scss" scoped>
|
|
133
|
+
@import '../../styles/variables';
|
|
134
|
+
@import '../../styles/root';
|
|
135
|
+
|
|
136
|
+
.base-swiper {
|
|
137
|
+
$swiper: &;
|
|
138
|
+
|
|
139
|
+
position: relative;
|
|
140
|
+
width: 100%;
|
|
141
|
+
max-width: 640px;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
|
|
144
|
+
&__container {
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
position: relative;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__slides {
|
|
150
|
+
display: flex;
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&__slide {
|
|
156
|
+
flex: 0 0 100%;
|
|
157
|
+
height: 100%;
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
align-items: center;
|
|
161
|
+
transition: all var(--transition);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&__image {
|
|
165
|
+
max-width: 100%;
|
|
166
|
+
max-height: 400px;
|
|
167
|
+
object-fit: contain;
|
|
168
|
+
border-radius: var(--corner-radius-m);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&__nav {
|
|
172
|
+
position: absolute;
|
|
173
|
+
top: 50%;
|
|
174
|
+
transform: translateY(-50%);
|
|
175
|
+
border: none;
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
border-radius: 50%;
|
|
178
|
+
z-index: 10;
|
|
179
|
+
|
|
180
|
+
&--prev {
|
|
181
|
+
left: var(--spacing-m);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&--next {
|
|
185
|
+
right: var(--spacing-m);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&:disabled {
|
|
189
|
+
opacity: 0.5;
|
|
190
|
+
cursor: not-allowed;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&__nav.--color-primary {
|
|
195
|
+
background: var(--primary-blue);
|
|
196
|
+
color: var(--primary-black-white);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&__nav.--color-secondary {
|
|
200
|
+
background: var(--primary-blue-50);
|
|
201
|
+
color: var(--primary-blue-800);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&__nav.--color-black {
|
|
205
|
+
background: #000;
|
|
206
|
+
color: var(--primary-black-white);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&__nav.--color-white {
|
|
210
|
+
background: var(--primary-black-white);
|
|
211
|
+
color: var(--primary-black-700);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&__nav.--medium-size {
|
|
215
|
+
padding: var(--spacing-s);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&__nav.--large-size {
|
|
219
|
+
padding: var(--spacing-2m);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&__pagination {
|
|
223
|
+
position: absolute;
|
|
224
|
+
bottom: 10px;
|
|
225
|
+
left: 50%;
|
|
226
|
+
transform: translateX(-50%);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
</style>
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import Tooltip from "./components/Tooltip/Tooltip.vue";
|
|
|
5
5
|
import Spinner from "./components/Spinner/Spinner.vue";
|
|
6
6
|
import ModalPlugin, { useModal } from "./plugins/modalPlugin";
|
|
7
7
|
import ToasterPlugin, { useToast } from "./plugins/toasterPlugin";
|
|
8
|
-
import "./
|
|
8
|
+
import "./sprite"; // Импортируем иконки для генерации спрайта
|
|
9
9
|
import "./styles/root.scss";
|
|
10
10
|
import BaseIcon from "./components/BaseIcon/BaseIcon.vue";
|
|
11
11
|
import BaseBreadCrumbs from "./components/BaseBreadCrumbs/BaseBreadCrumbs.vue";
|
|
@@ -23,10 +23,13 @@ import BaseInputCalendar from "./components/BaseInputCalendar/BaseInputCalendar.
|
|
|
23
23
|
import BaseOpenedListItem from "./components/BaseOpenedListItem/BaseOpenedListItem.vue";
|
|
24
24
|
import BaseDropdown from "./components/BaseDropdown/BaseDropdown.vue";
|
|
25
25
|
import BaseSelect from "./components/BaseSelect/BaseSelect.vue";
|
|
26
|
+
import BasePagination from "./components/BasePagination/BasePagination.vue";
|
|
26
27
|
import BaseSiteInput from "./components/BaseSiteInput/BaseSiteInput.vue";
|
|
27
28
|
import BaseInputPhone from "./components/BaseInputPhone/BaseInputPhone.vue";
|
|
28
29
|
import BaseInputCurrency from "./components/BaseInputCurrency/BaseInputCurrency.vue";
|
|
29
30
|
import BaseSegmentedButtons from "./components/BaseSegmentedButtons/BaseSegmentedButtons.vue";
|
|
31
|
+
import BaseChips from "./components/BaseChips/BaseChips.vue";
|
|
32
|
+
import BaseSwiper from "./components/BaseSwiper/BaseSwiper.vue";
|
|
30
33
|
|
|
31
34
|
const components = {
|
|
32
35
|
Modal,
|
|
@@ -52,22 +55,42 @@ const components = {
|
|
|
52
55
|
BaseSiteInput,
|
|
53
56
|
BaseInputPhone,
|
|
54
57
|
BaseInputCurrency,
|
|
55
|
-
|
|
58
|
+
BasePagination,
|
|
59
|
+
BaseSegmentedButtons,
|
|
60
|
+
BaseChips,
|
|
61
|
+
BaseSwiper
|
|
56
62
|
};
|
|
57
63
|
|
|
58
64
|
// Функция для загрузки sprite.svg
|
|
59
65
|
const loadSprite = () => {
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
const possiblePaths = [
|
|
67
|
+
"/sprite.svg",
|
|
68
|
+
"./sprite.svg",
|
|
69
|
+
"sprite.svg",
|
|
70
|
+
"/dist/sprite.svg"
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const tryLoadSprite = async (paths: string[]) => {
|
|
74
|
+
for (const path of paths) {
|
|
75
|
+
try {
|
|
76
|
+
const response = await fetch(path);
|
|
77
|
+
if (response.ok) {
|
|
78
|
+
const svg = await response.text();
|
|
79
|
+
const div = document.createElement("div");
|
|
80
|
+
div.style.display = "none";
|
|
81
|
+
div.innerHTML = svg;
|
|
82
|
+
document.body.appendChild(div);
|
|
83
|
+
console.log(`Спрайт загружен с пути: ${path}`);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.warn(`Не удалось загрузить спрайт с пути: ${path}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
console.error("Не удалось загрузить SVG-спрайт ни с одного из путей");
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
tryLoadSprite(possiblePaths);
|
|
71
94
|
};
|
|
72
95
|
|
|
73
96
|
export default {
|
|
@@ -81,10 +104,10 @@ export default {
|
|
|
81
104
|
app.component(name, component);
|
|
82
105
|
});
|
|
83
106
|
|
|
107
|
+
loadSprite();
|
|
108
|
+
|
|
84
109
|
app.use(ModalPlugin);
|
|
85
110
|
app.use(ToasterPlugin);
|
|
86
|
-
|
|
87
|
-
loadSprite();
|
|
88
111
|
},
|
|
89
112
|
};
|
|
90
113
|
|
|
@@ -114,5 +137,8 @@ export {
|
|
|
114
137
|
BaseSiteInput,
|
|
115
138
|
BaseInputPhone,
|
|
116
139
|
BaseInputCurrency,
|
|
117
|
-
|
|
140
|
+
BasePagination,
|
|
141
|
+
BaseSegmentedButtons,
|
|
142
|
+
BaseChips,
|
|
143
|
+
BaseSwiper
|
|
118
144
|
};
|
package/src/sprite.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Импортируем все иконки, чтобы они попали в спрайт
|
|
2
|
+
const requireIcons = require.context(
|
|
3
|
+
"@/assets/icons",
|
|
4
|
+
false,
|
|
5
|
+
/\.svg$/
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
// Автоматически добавляем спрайт в DOM при импорте
|
|
9
|
+
requireIcons.keys().forEach((fileName) => {
|
|
10
|
+
requireIcons(fileName);
|
|
11
|
+
});
|
package/src/styles/root.scss
CHANGED
|
@@ -142,11 +142,14 @@
|
|
|
142
142
|
--font-weight-medium: 500;
|
|
143
143
|
--font-weight-regular: 400;
|
|
144
144
|
--font-weight-semibold: 600;
|
|
145
|
+
--corner-radius-3xs: 3px;
|
|
145
146
|
--corner-radius-xxs: 4px;
|
|
146
147
|
--corner-radius-xs: 8px;
|
|
147
148
|
--corner-radius-s: 10px;
|
|
148
149
|
--corner-radius-m: 12px;
|
|
149
150
|
--corner-radius-l: 16px;
|
|
151
|
+
--corner-radius-xl: 24px;
|
|
152
|
+
--corner-radius-2xl: 32px;
|
|
150
153
|
--spacing-2xs: 2px;
|
|
151
154
|
--spacing-xs: 4px;
|
|
152
155
|
--spacing-2s: 6px;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ICoreSize } from './utils';
|
|
2
|
+
|
|
3
|
+
export type PaginationColor = 'primary' | 'secondary' | 'white' | 'black';
|
|
4
|
+
export type PaginationType = 'dots' | 'dotsWithBackground' | 'dashes' | 'dashesWithBackground' | 'numbers';
|
|
5
|
+
export interface IPaginationProps {
|
|
6
|
+
type?: PaginationType;
|
|
7
|
+
currentPage?: number;
|
|
8
|
+
totalPages?: number;
|
|
9
|
+
maxDisplayedPages?: number;
|
|
10
|
+
color?: PaginationColor;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type TPaginationProps = IPaginationProps & ICoreSize;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PaginationColor, PaginationType } from './pagination';
|
|
2
|
+
import type { ICoreSize } from './utils';
|
|
3
|
+
|
|
4
|
+
type TButtonSize = 'medium' | 'large';
|
|
5
|
+
|
|
6
|
+
export interface ICoreSwiperProps {
|
|
7
|
+
images: string[];
|
|
8
|
+
paginationSettings?: {
|
|
9
|
+
type?: PaginationType;
|
|
10
|
+
color?: PaginationColor;
|
|
11
|
+
size?: ICoreSize;
|
|
12
|
+
}
|
|
13
|
+
currentSlide?: number;
|
|
14
|
+
autoplay?: boolean;
|
|
15
|
+
autoplayInterval?: number;
|
|
16
|
+
buttonSize?: TButtonSize;
|
|
17
|
+
}
|
package/webpack.config.js
CHANGED
package/dist/icons/index.d.ts
DELETED
package/src/icons/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const requireIcons = require.context(
|
|
2
|
-
'@/assets/icons',
|
|
3
|
-
false,
|
|
4
|
-
/\.svg$/
|
|
5
|
-
);
|
|
6
|
-
|
|
7
|
-
const iconNames = requireIcons.keys().map((fileName: string) => {
|
|
8
|
-
return fileName.replace(/^\.\//, '').replace(/\.svg$/, '');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
requireIcons.keys().forEach((fileName: string) => {
|
|
12
|
-
requireIcons(fileName);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export default iconNames;
|