@soroka282/migrant.ui-kit 0.0.68 → 0.0.70
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/README.md +147 -147
- package/dist/List-DkipCs8x.js +94 -0
- package/dist/{index-CP315OU8.js → index-BvOE31Fh.js} +3542 -3437
- package/dist/migrant.ui-kit.es.js +33 -32
- package/dist/migrant.ui-kit.umd.js +13 -13
- package/dist/src/components/UI-kit/button/UIButton.vue.d.ts +1 -1
- package/dist/src/components/UI-kit/inputs/UIInput.stories.d.ts +2 -0
- package/dist/src/components/UI-kit/inputs/UIInput.vue.d.ts +2 -0
- package/dist/src/components/UI-kit/radioButton/UIRadioButton.stories.d.ts +4 -0
- package/dist/src/components/UI-kit/radioButton/UIRadioButton.vue.d.ts +1 -0
- package/dist/src/components/UI-kit/select/UISelect.stories.d.ts +3 -0
- package/dist/src/components/UI-kit/select/UISelect.vue.d.ts +2 -1
- package/dist/src/components/UI-kit/select/components/List.vue.d.ts +21 -1
- package/dist/src/types/UI/ui-input.type.d.ts +4 -0
- package/dist/src/types/UI/ui-radio-button.type.d.ts +1 -0
- package/dist/src/types/UI/ui-select.type.d.ts +1 -0
- package/dist/src/types/global.d.ts +13 -13
- package/package.json +118 -118
- package/scripts/postinstall.js +55 -55
- package/scripts/verify-commit.js +35 -35
- package/src/App.vue +7 -7
- package/src/assets/scss/common/swiper.scss +19 -19
- package/src/assets/scss/common/variables.scss +24 -24
- package/src/assets/scss/index.scss +8 -8
- package/src/assets/scss/mixins/flex.minix.scss +6 -6
- package/src/assets/scss/mixins/identation.mixin.scss +20 -20
- package/src/assets/scss/mixins/index.mixin.scss +2 -2
- package/src/assets/scss/mixins/typograph.mixin.scss +4 -4
- package/src/components/UI-blocks/components/BlockElement/BlockElement.stories.ts +224 -224
- package/src/components/UI-blocks/components/BlockElement/BlockElement.vue +146 -145
- package/src/components/UI-kit/button/UIButton.stories.ts +137 -137
- package/src/components/UI-kit/button/UIButton.vue +129 -129
- package/src/components/UI-kit/card/UICard.stories.ts +57 -57
- package/src/components/UI-kit/card/UICard.vue +52 -52
- package/src/components/UI-kit/checkbox/UICheckBox.stories.ts +197 -197
- package/src/components/UI-kit/checkbox/UICheckBox.vue +89 -89
- package/src/components/UI-kit/description/UIDescription.stories.ts +37 -37
- package/src/components/UI-kit/description/UIDescription.vue +34 -34
- package/src/components/UI-kit/inputs/BaseMaskedInput.vue +100 -100
- package/src/components/UI-kit/inputs/UIInput.stories.ts +151 -92
- package/src/components/UI-kit/inputs/UIInput.vue +244 -203
- package/src/components/UI-kit/loader/UILoader.stories.ts +31 -31
- package/src/components/UI-kit/loader/UILoader.vue +69 -69
- package/src/components/UI-kit/modal/UIModal.stories.ts +41 -41
- package/src/components/UI-kit/modal/UIModal.vue +307 -307
- package/src/components/UI-kit/modal/UIModalContainer.vue +20 -20
- package/src/components/UI-kit/radioButton/UIRadioButton.stories.ts +435 -240
- package/src/components/UI-kit/radioButton/UIRadioButton.vue +147 -61
- package/src/components/UI-kit/select/UISelect.stories.ts +325 -180
- package/src/components/UI-kit/select/UISelect.vue +204 -182
- package/src/components/UI-kit/select/components/List.stories.ts +76 -76
- package/src/components/UI-kit/select/components/List.vue +204 -159
- package/src/components/UI-kit/svg-icon/UISvgIcon.stories.ts +34 -34
- package/src/components/UI-kit/svg-icon/UISvgIcon.vue +21 -21
- package/src/components/UI-kit/swiper/UISwiper.stories.ts +33 -33
- package/src/components/UI-kit/swiper/UISwiper.vue +47 -47
- package/src/components/UI-kit/title/UITitle.stories.ts +35 -35
- package/src/components/UI-kit/title/UITitle.vue +37 -37
- package/src/components/UI-kit/toaster/UIToastNotification.stories.ts +146 -146
- package/src/components/UI-kit/toaster/UIToaster.ts +57 -57
- package/src/components/icons/email.svg +10 -10
- package/src/components/icons/person.svg +4 -4
- package/src/components/modules/auth/assets/styles/index.scss +3 -3
- package/src/components/modules/auth/assets/styles/seven-zero-two-themes.scss +96 -96
- package/src/components/modules/auth/assets/styles/student-themes.scss +176 -176
- package/src/components/modules/auth/auth-test/AuthTest.vue +63 -63
- package/src/components/modules/auth/auth-test/AuthTestWrapper.vue +43 -43
- package/src/components/modules/auth/components/AccountStep.vue +158 -158
- package/src/components/modules/auth/components/ConfirmationStep.vue +163 -163
- package/src/components/modules/auth/components/LinkMailStep.vue +199 -199
- package/src/components/modules/auth/composables/useMailRedirect.ts +49 -49
- package/src/components/modules/auth/config/themes-module-auth.config.ts +94 -94
- package/src/components/modules/auth/constants/EStep.enum.ts +5 -5
- package/src/components/modules/auth/constants/default-locale-auth-module.ts +21 -21
- package/src/components/modules/auth/constants/validation/validate-email.ts +17 -17
- package/src/components/modules/auth/index.ts +2 -2
- package/src/components/modules/auth/store/authModuleStore.ts +44 -44
- package/src/components/modules/auth/types/auth-ui-schema.type.ts +36 -36
- package/src/components/modules/auth/types/step.types.ts +1 -1
- package/src/components/modules/documents/ModuleDocuments.vue +88 -88
- package/src/components/modules/documents/components/composables/useDefaultFields.ts +302 -302
- package/src/components/modules/documents/components/composables/useDocumentImage.ts +39 -39
- package/src/components/modules/documents/components/constants/default-locale-document-module.ts +57 -57
- package/src/components/modules/documents/components/constants/validation/common.validation.ts +42 -42
- package/src/components/modules/documents/components/constants/validation/driver-license.validation.ts +25 -25
- package/src/components/modules/documents/components/constants/validation/inn.validation.ts +15 -15
- package/src/components/modules/documents/components/constants/validation/license-plate.validation.ts +37 -37
- package/src/components/modules/documents/components/constants/validation/passport.validation.ts +48 -48
- package/src/components/modules/documents/components/constants/validation.ts +5 -5
- package/src/components/modules/documents/components/index.ts +5 -5
- package/src/components/modules/documents/config/themes-module-document.config.ts +24 -24
- package/src/components/modules/documents/index.ts +2 -2
- package/src/components/modules/documents/store/module-document.store.ts +5 -5
- package/src/components/modules/documents/type/DocumentsType.ts +30 -30
- package/src/components/modules/documents/type/document-ui-schema.type.ts +10 -10
- package/src/components/modules/documents/type/index.ts +2 -2
- package/src/components/modules/form/ModuleForm.vue +44 -44
- package/src/components/modules/form/ModulesForm.stories.ts +188 -188
- package/src/components/modules/form/components/Field.vue +136 -136
- package/src/components/modules/form/types/inputType.ts +26 -26
- package/src/composables/index.ts +2 -2
- package/src/composables/useIframeHandlers.ts +52 -52
- package/src/composables/useRequestHandler.ts +49 -49
- package/src/configs/i18n.config.ts +8 -8
- package/src/configs/index.ts +1 -1
- package/src/constants/default-locale.ts +30 -30
- package/src/constants/index.ts +2 -2
- package/src/constants/ui-color.constant.ts +25 -25
- package/src/index.ts +31 -31
- package/src/main.ts +22 -22
- package/src/plugins/formatter.ts +136 -136
- package/src/plugins/index.ts +3 -3
- package/src/plugins/plural-endings.ts +19 -19
- package/src/plugins/ui-kit-install.ts +36 -36
- package/src/store/config-module.store.ts +66 -66
- package/src/store/index.ts +3 -3
- package/src/store/language.store.ts +28 -28
- package/src/store/modal.store.ts +101 -101
- package/src/types/UI/ui-button.type.ts +31 -31
- package/src/types/UI/ui-checkbox.type.ts +18 -18
- package/src/types/UI/ui-color.type.ts +28 -28
- package/src/types/UI/ui-input.type.ts +74 -65
- package/src/types/UI/ui-modal.type.ts +7 -7
- package/src/types/UI/ui-radio-button.type.ts +1 -0
- package/src/types/UI/ui-select.type.ts +28 -27
- package/src/types/UI/ui-size.type.ts +7 -7
- package/src/types/common.type.ts +2 -2
- package/src/types/global.d.ts +13 -13
- package/src/types/index.ts +11 -11
- package/src/types/language.type.ts +7 -7
- package/src/types/plugin.type.ts +6 -6
- package/src/types/project-name.type.ts +5 -5
- package/src/utils/buildYupChain.util.ts +12 -12
- package/src/utils/debounce.util.ts +7 -7
- package/src/utils/getGlobalLocale.util.ts +5 -5
- package/src/utils/index.ts +5 -5
- package/src/utils/scrollIntoView.util.ts +8 -8
- package/src/utils/scrollToElement.util.ts +9 -9
- package/dist/List-BBKMFaT9.js +0 -70
package/README.md
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
# 📖 Migrant UI Kit
|
|
2
|
-
|
|
3
|
-
Библиотека переиспользуемых компонентов для проектов Migrant. Построена на [Vue 3](https://vuejs.org/) с поддержкой TypeScript и scoped-стилей.
|
|
4
|
-
|
|
5
|
-
## 📦 Установка и использование библиотеки
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @soroka282/migrant.ui-kit
|
|
9
|
-
```
|
|
10
|
-
или
|
|
11
|
-
```bash
|
|
12
|
-
yarn add @soroka282/migrant.ui-kit
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### 🛠️ Использование компонентов
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import {
|
|
20
|
-
UIButton,
|
|
21
|
-
UIColor,
|
|
22
|
-
UIColorName,
|
|
23
|
-
UISize,
|
|
24
|
-
} from '@soroka282/migrant.ui-kit';
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<UIButton
|
|
29
|
-
is-box-shadow
|
|
30
|
-
:size="UISize.S"
|
|
31
|
-
:color="UIColor[UIColorName.White]"
|
|
32
|
-
:bg-color="UIColor[UIColorName.PurpleMain]"
|
|
33
|
-
>
|
|
34
|
-
Кнопка
|
|
35
|
-
</UIButton>
|
|
36
|
-
</template>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### ⚙️ TypeScript автодополнение
|
|
40
|
-
|
|
41
|
-
Убедитесь, что `tsconfig.json` содержит:
|
|
42
|
-
|
|
43
|
-
```json
|
|
44
|
-
{
|
|
45
|
-
"compilerOptions": {
|
|
46
|
-
"moduleResolution": "bundler",
|
|
47
|
-
"paths": {
|
|
48
|
-
"@soroka282/migrant.ui-kit": ["node_modules/@soroka282/migrant.ui-kit"]
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 💻 Разработка
|
|
55
|
-
|
|
56
|
-
#### Установка зависимостей
|
|
57
|
-
```bash
|
|
58
|
-
npm i
|
|
59
|
-
```
|
|
60
|
-
Проверить, что установился .husky и commit-msg (.husky/commit-msg) имеет:
|
|
61
|
-
```
|
|
62
|
-
node scripts/verify-commit.js
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
#### Запуск локального проекта:
|
|
66
|
-
```bash
|
|
67
|
-
npm run dev
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
#### Запуск локального сторибука
|
|
71
|
-
```bash
|
|
72
|
-
npm run storybook
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## 🧪 Коммиты
|
|
76
|
-
|
|
77
|
-
Формат коммитов:
|
|
78
|
-
```
|
|
79
|
-
<номер задачи>/<тип>(<scope>): <описание>
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Если задача в трекере отсутствует:
|
|
83
|
-
```
|
|
84
|
-
<тип>(<scope>): <описание>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### Типы коммитов:
|
|
88
|
-
|
|
89
|
-
- `feat` — добавление нового функционала
|
|
90
|
-
- `fix` — исправление ошибок
|
|
91
|
-
- `docs` — изменение документации
|
|
92
|
-
- `build` — сборка и настройка инфраструктуры (vite, tsconfig и т.п.)
|
|
93
|
-
|
|
94
|
-
#### Примеры:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
EVOLVE-1/feat(useIframeHandler): добавлен новый composable метод
|
|
98
|
-
EVOLVE-2/fix(UIInput): обработка событий при потере фокуса
|
|
99
|
-
EVOLVE-3/build(vite.config): релиз библиотеки
|
|
100
|
-
|
|
101
|
-
feat(useIframeHandler): добавлен новый composable метод
|
|
102
|
-
build(vite.config): релиз библиотеки
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## 🛠️ Сборка библиотеки
|
|
106
|
-
|
|
107
|
-
Билд библиотеки:
|
|
108
|
-
```bash
|
|
109
|
-
npm run build
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Генерация .d.ts:
|
|
113
|
-
```bash
|
|
114
|
-
npm run ts
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Публикация пакета в npm
|
|
118
|
-
|
|
119
|
-
- Поднять version в package.json
|
|
120
|
-
- Опубликовать:
|
|
121
|
-
```bash
|
|
122
|
-
npm run publish:npm
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## 📖 Storybook
|
|
126
|
-
|
|
127
|
-
Сборка:
|
|
128
|
-
```bash
|
|
129
|
-
npm run build:storybook
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## 🥉 Используемые зависимости
|
|
133
|
-
|
|
134
|
-
- [Vue 3](https://vuejs.org/) — основной фреймворк
|
|
135
|
-
- [Pinia](https://pinia.vuejs.org/) — управление состоянием
|
|
136
|
-
- [Maska](https://beholdr.github.io/maska/) — маски ввода
|
|
137
|
-
- [Swiper](https://swiperjs.com/) — свайпер/карусель
|
|
138
|
-
- [Vue-toastification](https://vue-toastification.maronato.dev/) — уведомления (тосты)
|
|
139
|
-
|
|
140
|
-
## 🎨 Глобальные стили (optional)
|
|
141
|
-
|
|
142
|
-
В `main.ts`:
|
|
143
|
-
|
|
144
|
-
```ts
|
|
145
|
-
import '@soroka282/migrant.ui-kit/dist/style.css';
|
|
146
|
-
```
|
|
147
|
-
|
|
1
|
+
# 📖 Migrant UI Kit
|
|
2
|
+
|
|
3
|
+
Библиотека переиспользуемых компонентов для проектов Migrant. Построена на [Vue 3](https://vuejs.org/) с поддержкой TypeScript и scoped-стилей.
|
|
4
|
+
|
|
5
|
+
## 📦 Установка и использование библиотеки
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @soroka282/migrant.ui-kit
|
|
9
|
+
```
|
|
10
|
+
или
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @soroka282/migrant.ui-kit
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 🛠️ Использование компонентов
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import {
|
|
20
|
+
UIButton,
|
|
21
|
+
UIColor,
|
|
22
|
+
UIColorName,
|
|
23
|
+
UISize,
|
|
24
|
+
} from '@soroka282/migrant.ui-kit';
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<UIButton
|
|
29
|
+
is-box-shadow
|
|
30
|
+
:size="UISize.S"
|
|
31
|
+
:color="UIColor[UIColorName.White]"
|
|
32
|
+
:bg-color="UIColor[UIColorName.PurpleMain]"
|
|
33
|
+
>
|
|
34
|
+
Кнопка
|
|
35
|
+
</UIButton>
|
|
36
|
+
</template>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### ⚙️ TypeScript автодополнение
|
|
40
|
+
|
|
41
|
+
Убедитесь, что `tsconfig.json` содержит:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"compilerOptions": {
|
|
46
|
+
"moduleResolution": "bundler",
|
|
47
|
+
"paths": {
|
|
48
|
+
"@soroka282/migrant.ui-kit": ["node_modules/@soroka282/migrant.ui-kit"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 💻 Разработка
|
|
55
|
+
|
|
56
|
+
#### Установка зависимостей
|
|
57
|
+
```bash
|
|
58
|
+
npm i
|
|
59
|
+
```
|
|
60
|
+
Проверить, что установился .husky и commit-msg (.husky/commit-msg) имеет:
|
|
61
|
+
```
|
|
62
|
+
node scripts/verify-commit.js
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Запуск локального проекта:
|
|
66
|
+
```bash
|
|
67
|
+
npm run dev
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Запуск локального сторибука
|
|
71
|
+
```bash
|
|
72
|
+
npm run storybook
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 🧪 Коммиты
|
|
76
|
+
|
|
77
|
+
Формат коммитов:
|
|
78
|
+
```
|
|
79
|
+
<номер задачи>/<тип>(<scope>): <описание>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Если задача в трекере отсутствует:
|
|
83
|
+
```
|
|
84
|
+
<тип>(<scope>): <описание>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Типы коммитов:
|
|
88
|
+
|
|
89
|
+
- `feat` — добавление нового функционала
|
|
90
|
+
- `fix` — исправление ошибок
|
|
91
|
+
- `docs` — изменение документации
|
|
92
|
+
- `build` — сборка и настройка инфраструктуры (vite, tsconfig и т.п.)
|
|
93
|
+
|
|
94
|
+
#### Примеры:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
EVOLVE-1/feat(useIframeHandler): добавлен новый composable метод
|
|
98
|
+
EVOLVE-2/fix(UIInput): обработка событий при потере фокуса
|
|
99
|
+
EVOLVE-3/build(vite.config): релиз библиотеки
|
|
100
|
+
|
|
101
|
+
feat(useIframeHandler): добавлен новый composable метод
|
|
102
|
+
build(vite.config): релиз библиотеки
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 🛠️ Сборка библиотеки
|
|
106
|
+
|
|
107
|
+
Билд библиотеки:
|
|
108
|
+
```bash
|
|
109
|
+
npm run build
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Генерация .d.ts:
|
|
113
|
+
```bash
|
|
114
|
+
npm run ts
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Публикация пакета в npm
|
|
118
|
+
|
|
119
|
+
- Поднять version в package.json
|
|
120
|
+
- Опубликовать:
|
|
121
|
+
```bash
|
|
122
|
+
npm run publish:npm
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 📖 Storybook
|
|
126
|
+
|
|
127
|
+
Сборка:
|
|
128
|
+
```bash
|
|
129
|
+
npm run build:storybook
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 🥉 Используемые зависимости
|
|
133
|
+
|
|
134
|
+
- [Vue 3](https://vuejs.org/) — основной фреймворк
|
|
135
|
+
- [Pinia](https://pinia.vuejs.org/) — управление состоянием
|
|
136
|
+
- [Maska](https://beholdr.github.io/maska/) — маски ввода
|
|
137
|
+
- [Swiper](https://swiperjs.com/) — свайпер/карусель
|
|
138
|
+
- [Vue-toastification](https://vue-toastification.maronato.dev/) — уведомления (тосты)
|
|
139
|
+
|
|
140
|
+
## 🎨 Глобальные стили (optional)
|
|
141
|
+
|
|
142
|
+
В `main.ts`:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import '@soroka282/migrant.ui-kit/dist/style.css';
|
|
146
|
+
```
|
|
147
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineComponent as b, ref as p, computed as w, createElementBlock as s, openBlock as o, createCommentVNode as a, createElementVNode as d, createVNode as I, renderSlot as V, createBlock as B, resolveDynamicComponent as L, Fragment as g, renderList as _, normalizeStyle as m, normalizeClass as N, createTextVNode as F, toDisplayString as f } from "vue";
|
|
2
|
+
import { u as T, U, _ as $ } from "./index-BvOE31Fh.js";
|
|
3
|
+
const z = { class: "select-list" }, A = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "search-wrapper"
|
|
6
|
+
}, D = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "infoblock-wrapper"
|
|
9
|
+
}, E = ["onClick"], M = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "option-item-icon",
|
|
12
|
+
width: "20",
|
|
13
|
+
height: "20",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
17
|
+
}, R = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "confirm-button-wrapper"
|
|
20
|
+
}, Z = /* @__PURE__ */ b({
|
|
21
|
+
__name: "List",
|
|
22
|
+
props: {
|
|
23
|
+
showSearchInput: { type: Boolean, default: !0 },
|
|
24
|
+
placeholderSearchInput: { default: "Поиск..." },
|
|
25
|
+
options: {},
|
|
26
|
+
multiple: { type: Boolean, default: !1 },
|
|
27
|
+
selectedValues: { default: () => [] },
|
|
28
|
+
selectedColor: { default: "#7c3aed" },
|
|
29
|
+
infoblockSlot: {},
|
|
30
|
+
multipleButtonConfirmText: { default: "Подтвердить" }
|
|
31
|
+
},
|
|
32
|
+
emits: ["select", "close"],
|
|
33
|
+
setup(C, { emit: h }) {
|
|
34
|
+
const u = h, n = C, [v] = T(), c = p(""), r = p([...n.selectedValues]), k = w(() => {
|
|
35
|
+
if (!c.value) return n.options;
|
|
36
|
+
const e = c.value.toLowerCase();
|
|
37
|
+
return n.options.filter((l) => l.label.toLowerCase().includes(e));
|
|
38
|
+
}), i = (e) => r.value.some((l) => l.value === e.value), y = (e) => {
|
|
39
|
+
if (n.multiple) {
|
|
40
|
+
const l = r.value.findIndex((t) => t.value === e.value);
|
|
41
|
+
l === -1 ? r.value.push(e) : r.value.splice(l, 1), u("select", [...r.value]);
|
|
42
|
+
} else
|
|
43
|
+
u("select", e), u("close");
|
|
44
|
+
}, S = () => {
|
|
45
|
+
u("close");
|
|
46
|
+
};
|
|
47
|
+
return (e, l) => (o(), s("div", z, [
|
|
48
|
+
e.showSearchInput ? (o(), s("div", A, [
|
|
49
|
+
I(U, {
|
|
50
|
+
modelValue: c.value,
|
|
51
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => c.value = t),
|
|
52
|
+
placeholder: e.placeholderSearchInput,
|
|
53
|
+
showSearchIcon: !0,
|
|
54
|
+
"color-scheme": e.selectedColor === "#3C6BFF" ? "WIR" : "SIR"
|
|
55
|
+
}, null, 8, ["modelValue", "placeholder", "color-scheme"])
|
|
56
|
+
])) : a("", !0),
|
|
57
|
+
e.$slots.infoblock || e.infoblockSlot ? (o(), s("div", D, [
|
|
58
|
+
V(e.$slots, "infoblock", {}, () => [
|
|
59
|
+
e.infoblockSlot ? (o(), B(L(e.infoblockSlot), { key: 0 })) : a("", !0)
|
|
60
|
+
], !0)
|
|
61
|
+
])) : a("", !0),
|
|
62
|
+
d("ul", {
|
|
63
|
+
ref_key: "list",
|
|
64
|
+
ref: v,
|
|
65
|
+
class: "options-list"
|
|
66
|
+
}, [
|
|
67
|
+
(o(!0), s(g, null, _(k.value, (t) => (o(), s("li", {
|
|
68
|
+
key: t.value,
|
|
69
|
+
class: N(["option-item", { "--selected": e.multiple && i(t) }]),
|
|
70
|
+
style: m(e.multiple && i(t) ? { color: n.selectedColor } : {}),
|
|
71
|
+
onClick: (q) => y(t)
|
|
72
|
+
}, [
|
|
73
|
+
F(f(t.label) + " ", 1),
|
|
74
|
+
e.multiple && i(t) ? (o(), s("svg", M, l[1] || (l[1] = [
|
|
75
|
+
d("path", {
|
|
76
|
+
d: "M10 20C4.47656 20 0 15.5234 0 10C0 4.47656 4.47656 0 10 0C15.5234 0 20 4.47656 20 10C20 15.5234 15.5234 20 10 20ZM14.6094 5.69141C14.1914 5.38672 13.6055 5.48047 13.3008 5.89844L8.63672 12.3125L6.60156 10.2773C6.23438 9.91016 5.64063 9.91016 5.27734 10.2773C4.91406 10.6445 4.91016 11.2383 5.27734 11.6016L8.08984 14.4141C8.28516 14.6094 8.55078 14.707 8.82422 14.6875C9.09766 14.668 9.34766 14.5273 9.50781 14.3047L14.8164 7C15.1211 6.58203 15.0273 5.99609 14.6094 5.69141Z",
|
|
77
|
+
fill: "currentColor"
|
|
78
|
+
}, null, -1)
|
|
79
|
+
]))) : a("", !0)
|
|
80
|
+
], 14, E))), 128))
|
|
81
|
+
], 512),
|
|
82
|
+
e.multiple ? (o(), s("div", R, [
|
|
83
|
+
d("button", {
|
|
84
|
+
class: "confirm-button",
|
|
85
|
+
style: m({ background: e.selectedColor }),
|
|
86
|
+
onClick: S
|
|
87
|
+
}, f(e.multipleButtonConfirmText), 5)
|
|
88
|
+
])) : a("", !0)
|
|
89
|
+
]));
|
|
90
|
+
}
|
|
91
|
+
}), W = /* @__PURE__ */ $(Z, [["__scopeId", "data-v-247ea40b"]]);
|
|
92
|
+
export {
|
|
93
|
+
W as default
|
|
94
|
+
};
|