@alfalab/core-components-select 15.2.2 → 15.3.0
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/Component.desktop.d.ts +1 -2
- package/Component.mobile.js +1 -1
- package/Component.modal.mobile.d.ts +202 -4
- package/Component.modal.mobile.js +1 -1
- package/Component.responsive.js +1 -1
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +4 -4
- package/components/base-option/Component.js +1 -1
- package/components/base-option/index.css +13 -13
- package/components/base-select/Component.js +1 -1
- package/components/base-select/index.css +11 -11
- package/components/base-select-mobile/Component.d.ts +4 -3
- package/components/base-select-mobile/Component.js +3 -3
- package/components/base-select-mobile/footer/Component.js +1 -1
- package/components/base-select-mobile/footer/index.css +5 -5
- package/components/base-select-mobile/index.css +16 -16
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +10 -10
- package/components/checkmark-mobile/Component.js +1 -1
- package/components/checkmark-mobile/index.css +6 -6
- package/components/field/Component.js +1 -1
- package/components/field/index.css +12 -12
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +1 -1
- package/components/option/index.css +20 -20
- package/components/options-list/Component.js +1 -1
- package/components/options-list/index.css +9 -9
- package/components/search/Component.js +1 -1
- package/components/search/index.css +2 -2
- package/components/virtual-options-list/Component.js +9 -5
- package/components/virtual-options-list/index.css +15 -15
- package/cssm/Component.desktop.d.ts +1 -2
- package/cssm/Component.modal.mobile.d.ts +202 -4
- package/cssm/components/base-select-mobile/Component.d.ts +4 -3
- package/cssm/components/base-select-mobile/Component.js +2 -2
- package/cssm/components/virtual-options-list/Component.js +8 -4
- package/cssm/desktop/index.d.ts +2 -0
- package/cssm/desktop/index.js +48 -0
- package/cssm/mobile/index.d.ts +5 -0
- package/cssm/mobile/index.js +62 -0
- package/cssm/shared/index.d.ts +5 -0
- package/cssm/shared/index.js +85 -0
- package/desktop/index.d.ts +2 -0
- package/{desktop.js → desktop/index.js} +13 -13
- package/desktop/package.json +3 -0
- package/esm/Component.desktop.d.ts +1 -2
- package/esm/Component.mobile.js +1 -1
- package/esm/Component.modal.mobile.d.ts +202 -4
- package/esm/Component.modal.mobile.js +1 -1
- package/esm/Component.responsive.js +1 -1
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-checkmark/Component.js +1 -1
- package/esm/components/base-checkmark/index.css +4 -4
- package/esm/components/base-option/Component.js +1 -1
- package/esm/components/base-option/index.css +13 -13
- package/esm/components/base-select/Component.js +1 -1
- package/esm/components/base-select/index.css +11 -11
- package/esm/components/base-select-mobile/Component.d.ts +4 -3
- package/esm/components/base-select-mobile/Component.js +3 -3
- package/esm/components/base-select-mobile/footer/Component.js +1 -1
- package/esm/components/base-select-mobile/footer/index.css +5 -5
- package/esm/components/base-select-mobile/index.css +16 -16
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +10 -10
- package/esm/components/checkmark-mobile/Component.js +1 -1
- package/esm/components/checkmark-mobile/index.css +6 -6
- package/esm/components/field/Component.js +1 -1
- package/esm/components/field/index.css +12 -12
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +1 -1
- package/esm/components/option/index.css +20 -20
- package/esm/components/options-list/Component.js +1 -1
- package/esm/components/options-list/index.css +9 -9
- package/esm/components/search/Component.js +1 -1
- package/esm/components/search/index.css +2 -2
- package/esm/components/virtual-options-list/Component.js +9 -5
- package/esm/components/virtual-options-list/index.css +15 -15
- package/esm/desktop/index.d.ts +2 -0
- package/esm/{desktop.js → desktop/index.js} +13 -13
- package/esm/index.js +1 -1
- package/esm/mobile/index.d.ts +5 -0
- package/esm/mobile/index.js +40 -0
- package/esm/presets/index.js +1 -1
- package/esm/presets/useSelectWithApply/hook.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/shared/index.d.ts +5 -0
- package/esm/shared/index.js +41 -0
- package/index.js +1 -1
- package/mobile/index.d.ts +5 -0
- package/{mobile.js → mobile/index.js} +18 -18
- package/mobile/package.json +3 -0
- package/modern/Component.desktop.d.ts +1 -2
- package/modern/Component.mobile.js +1 -1
- package/modern/Component.modal.mobile.d.ts +202 -4
- package/modern/Component.modal.mobile.js +1 -1
- package/modern/Component.responsive.js +1 -1
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-checkmark/Component.js +1 -1
- package/modern/components/base-checkmark/index.css +4 -4
- package/modern/components/base-option/Component.js +1 -1
- package/modern/components/base-option/index.css +13 -13
- package/modern/components/base-select/Component.js +1 -1
- package/modern/components/base-select/index.css +11 -11
- package/modern/components/base-select-mobile/Component.d.ts +4 -3
- package/modern/components/base-select-mobile/Component.js +3 -3
- package/modern/components/base-select-mobile/footer/Component.js +1 -1
- package/modern/components/base-select-mobile/footer/index.css +5 -5
- package/modern/components/base-select-mobile/index.css +16 -16
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +10 -10
- package/modern/components/checkmark-mobile/Component.js +1 -1
- package/modern/components/checkmark-mobile/index.css +6 -6
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +12 -12
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +1 -1
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +9 -9
- package/modern/components/search/Component.js +1 -1
- package/modern/components/search/index.css +2 -2
- package/modern/components/virtual-options-list/Component.js +9 -5
- package/modern/components/virtual-options-list/index.css +15 -15
- package/modern/desktop/index.d.ts +2 -0
- package/modern/{desktop.js → desktop/index.js} +13 -13
- package/modern/index.js +1 -1
- package/modern/mobile/index.d.ts +5 -0
- package/modern/mobile/index.js +39 -0
- package/modern/presets/index.js +1 -1
- package/modern/presets/useSelectWithApply/hook.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/shared/index.d.ts +5 -0
- package/modern/shared/index.js +40 -0
- package/package.json +8 -32
- package/presets/index.js +1 -1
- package/presets/useSelectWithApply/hook.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/shared/index.d.ts +5 -0
- package/{shared.js → shared/index.js} +20 -20
- package/shared/package.json +3 -0
- package/src/components/base-select-mobile/Component.tsx +2 -1
- package/src/components/virtual-options-list/Component.tsx +8 -4
- package/src/desktop/index.ts +1 -0
- package/src/desktop/package.json +3 -0
- package/src/mobile/index.ts +5 -0
- package/src/mobile/package.json +3 -0
- package/src/shared/index.ts +5 -0
- package/src/shared/package.json +3 -0
- package/Component-89f0cb07.d.ts +0 -38
- package/Component.mobile-ebda875c.d.ts +0 -6
- package/Component.mobile-f1f15074.d.ts +0 -404
- package/cssm/Component-89f0cb07.d.ts +0 -38
- package/cssm/Component.mobile-ebda875c.d.ts +0 -6
- package/cssm/Component.mobile-f1f15074.d.ts +0 -404
- package/cssm/desktop-69921c40.d.ts +0 -6
- package/cssm/desktop.d.ts +0 -2
- package/cssm/desktop.js +0 -48
- package/cssm/index-ebda875c.d.ts +0 -2
- package/cssm/mobile-96988a65.d.ts +0 -2
- package/cssm/mobile.d.ts +0 -5
- package/cssm/mobile.js +0 -62
- package/cssm/shared.d.ts +0 -5
- package/cssm/shared.js +0 -85
- package/cssm/typings-89f0cb07.d.ts +0 -93
- package/cssm/typings-baf4875b.d.ts +0 -52
- package/desktop-69921c40.d.ts +0 -6
- package/desktop.d.ts +0 -2
- package/esm/Component-89f0cb07.d.ts +0 -38
- package/esm/Component.mobile-ebda875c.d.ts +0 -6
- package/esm/Component.mobile-f1f15074.d.ts +0 -404
- package/esm/desktop-69921c40.d.ts +0 -6
- package/esm/desktop.d.ts +0 -2
- package/esm/index-ebda875c.d.ts +0 -2
- package/esm/mobile-96988a65.d.ts +0 -2
- package/esm/mobile.d.ts +0 -5
- package/esm/mobile.js +0 -40
- package/esm/shared.d.ts +0 -5
- package/esm/shared.js +0 -41
- package/esm/typings-89f0cb07.d.ts +0 -93
- package/esm/typings-baf4875b.d.ts +0 -52
- package/index-ebda875c.d.ts +0 -2
- package/mobile-96988a65.d.ts +0 -2
- package/mobile.d.ts +0 -5
- package/modern/Component-89f0cb07.d.ts +0 -38
- package/modern/Component.mobile-ebda875c.d.ts +0 -6
- package/modern/Component.mobile-f1f15074.d.ts +0 -404
- package/modern/desktop-69921c40.d.ts +0 -6
- package/modern/desktop.d.ts +0 -2
- package/modern/index-ebda875c.d.ts +0 -2
- package/modern/mobile-96988a65.d.ts +0 -2
- package/modern/mobile.d.ts +0 -5
- package/modern/mobile.js +0 -39
- package/modern/shared.d.ts +0 -5
- package/modern/shared.js +0 -40
- package/modern/typings-89f0cb07.d.ts +0 -93
- package/modern/typings-baf4875b.d.ts +0 -52
- package/shared.d.ts +0 -5
- package/src/desktop.ts +0 -1
- package/src/mobile.ts +0 -5
- package/src/shared.ts +0 -5
- package/typings-89f0cb07.d.ts +0 -93
- package/typings-baf4875b.d.ts +0 -52
- /package/esm/{hook-571dca86.d.ts → hook-70d58270.d.ts} +0 -0
- /package/esm/{hook-571dca86.js → hook-70d58270.js} +0 -0
- /package/{hook-a6f060a1.d.ts → hook-0a5c9f56.d.ts} +0 -0
- /package/{hook-a6f060a1.js → hook-0a5c9f56.js} +0 -0
- /package/modern/{hook-7e628eb4.d.ts → hook-4eceefed.d.ts} +0 -0
- /package/modern/{hook-7e628eb4.js → hook-4eceefed.js} +0 -0
|
@@ -1,8 +1,206 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ReactNode, ButtonHTMLAttributes, ElementType } from "react";
|
|
4
|
+
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
4
5
|
import { UseSelectWithApplyProps } from "./hook-8abfea97";
|
|
5
6
|
import { BaseSelectProps } from "./typings";
|
|
7
|
+
type ModalDesktopProps = BaseModalProps & {
|
|
8
|
+
/**
|
|
9
|
+
* Ширина модального окна
|
|
10
|
+
* @default "m"
|
|
11
|
+
*/
|
|
12
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen";
|
|
13
|
+
/**
|
|
14
|
+
* Растягивает модальное окно на весь экран
|
|
15
|
+
* @deprecated Используйте размер fullscreen
|
|
16
|
+
*/
|
|
17
|
+
fullscreen?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Фиксирует позицию модального окна после открытия,
|
|
20
|
+
* предотвращая скачки, если контент внутри будет меняться
|
|
21
|
+
*/
|
|
22
|
+
fixedPosition?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Управление наличием закрывающего крестика
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
hasCloser?: boolean;
|
|
28
|
+
};
|
|
29
|
+
type ModalMobileProps = Omit<ModalDesktopProps, "size" | "fixedPosition" | "fullscreen">;
|
|
30
|
+
type ContentProps = {
|
|
31
|
+
/**
|
|
32
|
+
* Контент
|
|
33
|
+
*/
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Дополнительный класс
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Растягивает контент на всю высоту
|
|
41
|
+
*/
|
|
42
|
+
flex?: boolean;
|
|
43
|
+
};
|
|
44
|
+
interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
45
|
+
/**
|
|
46
|
+
* Вид компонента
|
|
47
|
+
*/
|
|
48
|
+
view: "desktop" | "mobile";
|
|
49
|
+
/**
|
|
50
|
+
* Дополнительный класс
|
|
51
|
+
*/
|
|
52
|
+
className?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Позиция крестика
|
|
55
|
+
*/
|
|
56
|
+
align?: "left" | "right";
|
|
57
|
+
/**
|
|
58
|
+
* Фиксирует крестик
|
|
59
|
+
*/
|
|
60
|
+
sticky?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Иконка
|
|
63
|
+
*/
|
|
64
|
+
icon?: ElementType;
|
|
65
|
+
/**
|
|
66
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
67
|
+
*/
|
|
68
|
+
dataTestId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Коллбэк закрытия.
|
|
71
|
+
*/
|
|
72
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
73
|
+
}
|
|
74
|
+
type NavigationBarProps = {
|
|
75
|
+
/**
|
|
76
|
+
* Контент шапки
|
|
77
|
+
*/
|
|
78
|
+
children?: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Заголовок шапки
|
|
81
|
+
*/
|
|
82
|
+
title?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Подзаголовок (доступен только в мобильной версии)
|
|
85
|
+
*/
|
|
86
|
+
subtitle?: ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Размер заголовка (compact доступен только в мобильной версии)
|
|
89
|
+
*/
|
|
90
|
+
titleSize?: "default" | "compact";
|
|
91
|
+
/**
|
|
92
|
+
* Доп. класс для аддонов
|
|
93
|
+
*/
|
|
94
|
+
addonClassName?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Слот слева
|
|
97
|
+
*/
|
|
98
|
+
leftAddons?: ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Слот справа
|
|
101
|
+
*/
|
|
102
|
+
rightAddons?: ReactNode;
|
|
103
|
+
/**
|
|
104
|
+
* Дополнительный класс для closer
|
|
105
|
+
*/
|
|
106
|
+
closerClassName?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Слот снизу
|
|
109
|
+
*/
|
|
110
|
+
bottomAddons?: ReactNode;
|
|
111
|
+
/**
|
|
112
|
+
* Наличие компонента крестика
|
|
113
|
+
*/
|
|
114
|
+
hasCloser?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Наличие кнопки "Назад"
|
|
117
|
+
*/
|
|
118
|
+
hasBackButton?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Дополнительный класс для правого аддона
|
|
121
|
+
*/
|
|
122
|
+
backButtonClassName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Дополнительный класс
|
|
125
|
+
*/
|
|
126
|
+
className?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Дополнительный класс для контента
|
|
129
|
+
*/
|
|
130
|
+
contentClassName?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Дополнительный класс для нижнего аддона
|
|
133
|
+
*/
|
|
134
|
+
bottomAddonsClassName?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Выравнивание заголовка
|
|
137
|
+
*/
|
|
138
|
+
align?: "left" | "center";
|
|
139
|
+
/**
|
|
140
|
+
* Обрезать ли заголовок
|
|
141
|
+
*/
|
|
142
|
+
trim?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Фиксирует шапку
|
|
145
|
+
*/
|
|
146
|
+
sticky?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
149
|
+
*/
|
|
150
|
+
dataTestId?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Фоновое изображение
|
|
153
|
+
*/
|
|
154
|
+
imageUrl?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Иконка closer.
|
|
157
|
+
*/
|
|
158
|
+
closerIcon?: React.ElementType;
|
|
159
|
+
/**
|
|
160
|
+
* Обработчик закрытия
|
|
161
|
+
*/
|
|
162
|
+
onClose?: CloserProps["onClose"];
|
|
163
|
+
/**
|
|
164
|
+
* обработчик клика по кнопке "назад"
|
|
165
|
+
*/
|
|
166
|
+
onBack?: () => void;
|
|
167
|
+
/**
|
|
168
|
+
* Вид шапки - мобильный или десктоп
|
|
169
|
+
*/
|
|
170
|
+
view: "desktop" | "mobile";
|
|
171
|
+
/**
|
|
172
|
+
* Ссылка на родительскую ноду overflow: auto
|
|
173
|
+
*/
|
|
174
|
+
scrollableParentRef?: React.RefObject<HTMLDivElement>;
|
|
175
|
+
};
|
|
176
|
+
type HeaderProps = Omit<NavigationBarProps, "size" | "view" | "parentRef">;
|
|
177
|
+
type FooterProps = {
|
|
178
|
+
/**
|
|
179
|
+
* Контент футера
|
|
180
|
+
*/
|
|
181
|
+
children?: ReactNode;
|
|
182
|
+
/**
|
|
183
|
+
* Дополнительный класс
|
|
184
|
+
*/
|
|
185
|
+
className?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Фиксирует футер
|
|
188
|
+
*/
|
|
189
|
+
sticky?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Выравнивание элементов футера
|
|
192
|
+
*/
|
|
193
|
+
layout?: "start" | "center" | "space-between" | "column";
|
|
194
|
+
/**
|
|
195
|
+
* Отступы между элементами футера
|
|
196
|
+
*/
|
|
197
|
+
gap?: 16 | 24 | 32;
|
|
198
|
+
};
|
|
199
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
200
|
+
Content: React.FC<ContentProps>;
|
|
201
|
+
Header: React.FC<HeaderProps>;
|
|
202
|
+
Footer: React.FC<FooterProps>;
|
|
203
|
+
};
|
|
6
204
|
type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
7
205
|
/**
|
|
8
206
|
* Показывать кнопку очистки
|
|
@@ -42,15 +240,15 @@ declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
42
240
|
/**
|
|
43
241
|
* Дополнительные пропсы шапки модалки
|
|
44
242
|
*/
|
|
45
|
-
modalHeaderProps?: Partial<
|
|
243
|
+
modalHeaderProps?: Partial<HeaderProps> | undefined;
|
|
46
244
|
/**
|
|
47
245
|
* Дополнительные пропсы модалки
|
|
48
246
|
*/
|
|
49
|
-
modalProps?: Partial<
|
|
247
|
+
modalProps?: Partial<ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
50
248
|
/**
|
|
51
249
|
* Дополнительные пропсы футера модалки
|
|
52
250
|
*/
|
|
53
|
-
modalFooterProps?: Partial<
|
|
251
|
+
modalFooterProps?: Partial<FooterProps> | undefined;
|
|
54
252
|
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
55
253
|
/**
|
|
56
254
|
* Использовать ли хук useSelectWithApply
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
5
|
+
import { ModalMobile } from "@alfalab/core-components-modal/mobile";
|
|
5
6
|
import { BaseSelectProps } from "../../typings";
|
|
6
7
|
type SelectMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
7
8
|
/**
|
|
@@ -57,14 +58,14 @@ declare const BaseSelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectP
|
|
|
57
58
|
/**
|
|
58
59
|
* Дополнительные пропсы модалки
|
|
59
60
|
*/
|
|
60
|
-
modalProps?: Partial<ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
61
|
+
modalProps?: Partial<import("@alfalab/core-components-modal/mobile").ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
61
62
|
/**
|
|
62
63
|
* Дополнительные пропсы шапки модалки
|
|
63
64
|
*/
|
|
64
|
-
modalHeaderProps?: Partial<import("../../Component.mobile
|
|
65
|
+
modalHeaderProps?: Partial<import("../../Component.modal.mobile").HeaderProps> | undefined;
|
|
65
66
|
/**
|
|
66
67
|
* Дополнительные пропсы футера модалки
|
|
67
68
|
*/
|
|
68
|
-
modalFooterProps?: Partial<import("../../Component.mobile
|
|
69
|
+
modalFooterProps?: Partial<import("../../Component.modal.mobile").FooterProps> | undefined;
|
|
69
70
|
} & React.RefAttributes<unknown>>;
|
|
70
71
|
export { SelectMobileProps, BaseSelectMobile };
|
|
@@ -293,9 +293,9 @@ var BaseSelectMobile = React.forwardRef(function (_a, ref) {
|
|
|
293
293
|
scrollableContainerRef,
|
|
294
294
|
modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
|
|
295
295
|
]) }),
|
|
296
|
-
React__default.default.createElement(mobile.ModalMobile.Header, tslib.__assign({ hasCloser: true, sticky: true }, modalHeaderProps, { bottomAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
296
|
+
React__default.default.createElement(mobile.ModalMobile.Header, tslib.__assign({ hasCloser: true, sticky: true }, modalHeaderProps, { title: undefined, bottomAddons: React__default.default.createElement(React__default.default.Fragment, null,
|
|
297
297
|
renderSearch(), modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 :
|
|
298
|
-
modalHeaderProps.bottomAddons) }), label || placeholder),
|
|
298
|
+
modalHeaderProps.bottomAddons) }), (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.title) || label || placeholder),
|
|
299
299
|
React__default.default.createElement(mobile.ModalMobile.Content, { flex: true, className: styles__default.default.modalContent }, renderOptionsList()),
|
|
300
300
|
(modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React__default.default.createElement(mobile.ModalMobile.Footer, tslib.__assign({}, modalFooterProps))))));
|
|
301
301
|
});
|
|
@@ -28,7 +28,7 @@ var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
|
28
28
|
var listRef = React.useRef(null);
|
|
29
29
|
var parentRef = React.useRef(null);
|
|
30
30
|
var scrollbarRef = React.useRef(null);
|
|
31
|
-
var _k = React.useState(
|
|
31
|
+
var _k = React.useState(''), visibleOptionsInvalidateKey = _k[0], setVisibleOptionsInvalidateKey = _k[1];
|
|
32
32
|
var prevHighlightedIndex = utils.usePrevious(highlightedIndex) || -1;
|
|
33
33
|
var nativeScrollbar = hooks.useMedia([[true, '(max-width: 1023px)']], false)[0];
|
|
34
34
|
var rowVirtualizer = reactVirtual.useVirtual({
|
|
@@ -73,10 +73,14 @@ var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
|
73
73
|
/**
|
|
74
74
|
* react-virtual может несколько раз отрендерить список с одним элементом,
|
|
75
75
|
* поэтому нужно еще раз пересчитать высоту, когда список ВИДИМЫХ пунктов будет отрендерен полностью
|
|
76
|
-
* Также, высоту нужно пересчитывать при изменении
|
|
76
|
+
* Также, высоту нужно пересчитывать при изменении пунктов меню
|
|
77
77
|
*/
|
|
78
|
-
rowVirtualizer.virtualItems
|
|
79
|
-
|
|
78
|
+
rowVirtualizer.virtualItems
|
|
79
|
+
.slice(0, Math.min(rowVirtualizer.virtualItems.length, visibleOptions + 1))
|
|
80
|
+
.map(function (item) { return flatOptions[item.index].key; })
|
|
81
|
+
.join('_'));
|
|
82
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
|
+
}, [rowVirtualizer.virtualItems.length, flatOptions]);
|
|
80
84
|
utils.useVisibleOptions({
|
|
81
85
|
visibleOptions: visibleOptions,
|
|
82
86
|
invalidate: visibleOptionsInvalidateKey,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Component_desktop = require('../Component.desktop.js');
|
|
6
|
+
require('tslib');
|
|
7
|
+
require('react');
|
|
8
|
+
require('@alfalab/core-components-form-control/cssm/desktop');
|
|
9
|
+
require('../components/arrow/Component.js');
|
|
10
|
+
require('classnames');
|
|
11
|
+
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
12
|
+
require('../components/arrow/index.module.css');
|
|
13
|
+
require('../components/base-select/Component.js');
|
|
14
|
+
require('react-merge-refs');
|
|
15
|
+
require('@juggle/resize-observer');
|
|
16
|
+
require('downshift');
|
|
17
|
+
require('@alfalab/core-components-popover/cssm');
|
|
18
|
+
require('@alfalab/core-components-shared/cssm');
|
|
19
|
+
require('@alfalab/hooks');
|
|
20
|
+
require('../utils.js');
|
|
21
|
+
require('../components/native-select/Component.js');
|
|
22
|
+
require('../components/base-select/index.module.css');
|
|
23
|
+
require('../components/field/Component.js');
|
|
24
|
+
require('../components/field/index.module.css');
|
|
25
|
+
require('../components/optgroup/Component.js');
|
|
26
|
+
require('../components/optgroup/index.module.css');
|
|
27
|
+
require('../components/option/Component.js');
|
|
28
|
+
require('../components/checkmark/Component.js');
|
|
29
|
+
require('@alfalab/core-components-badge/cssm');
|
|
30
|
+
require('@alfalab/core-components-checkbox/cssm');
|
|
31
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
32
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
33
|
+
require('../components/checkmark/index.module.css');
|
|
34
|
+
require('../components/checkmark-mobile/Component.js');
|
|
35
|
+
require('../components/checkmark-mobile/index.module.css');
|
|
36
|
+
require('../components/option/index.module.css');
|
|
37
|
+
require('../components/options-list/Component.js');
|
|
38
|
+
require('@alfalab/core-components-scrollbar/cssm');
|
|
39
|
+
require('../consts.js');
|
|
40
|
+
require('../components/options-list/index.module.css');
|
|
41
|
+
require('../components/search/Component.js');
|
|
42
|
+
require('@alfalab/core-components-input/cssm');
|
|
43
|
+
require('@alfalab/icons-glyph/MagnifierMIcon');
|
|
44
|
+
require('../components/search/index.module.css');
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
exports.SelectDesktop = Component_desktop.SelectDesktop;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Component_mobile = require('../Component.mobile.js');
|
|
6
|
+
var Component_modal_mobile = require('../Component.modal.mobile.js');
|
|
7
|
+
require('tslib');
|
|
8
|
+
require('react');
|
|
9
|
+
require('@alfalab/core-components-form-control/cssm/mobile');
|
|
10
|
+
require('../components/arrow/Component.js');
|
|
11
|
+
require('classnames');
|
|
12
|
+
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
13
|
+
require('../components/arrow/index.module.css');
|
|
14
|
+
require('../components/base-select-mobile/Component.js');
|
|
15
|
+
require('react-merge-refs');
|
|
16
|
+
require('downshift');
|
|
17
|
+
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
18
|
+
require('@alfalab/core-components-modal/cssm/mobile');
|
|
19
|
+
require('@alfalab/core-components-shared/cssm');
|
|
20
|
+
require('../utils.js');
|
|
21
|
+
require('../components/field/Component.js');
|
|
22
|
+
require('@alfalab/hooks');
|
|
23
|
+
require('../components/field/index.module.css');
|
|
24
|
+
require('../components/optgroup/Component.js');
|
|
25
|
+
require('../components/optgroup/index.module.css');
|
|
26
|
+
require('../components/option/Component.js');
|
|
27
|
+
require('../components/checkmark/Component.js');
|
|
28
|
+
require('@alfalab/core-components-badge/cssm');
|
|
29
|
+
require('@alfalab/core-components-checkbox/cssm');
|
|
30
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
31
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
32
|
+
require('../components/checkmark/index.module.css');
|
|
33
|
+
require('../components/checkmark-mobile/Component.js');
|
|
34
|
+
require('../components/checkmark-mobile/index.module.css');
|
|
35
|
+
require('../components/option/index.module.css');
|
|
36
|
+
require('../components/options-list/Component.js');
|
|
37
|
+
require('@alfalab/core-components-scrollbar/cssm');
|
|
38
|
+
require('../consts.js');
|
|
39
|
+
require('../components/options-list/index.module.css');
|
|
40
|
+
require('../components/search/Component.js');
|
|
41
|
+
require('@alfalab/core-components-input/cssm');
|
|
42
|
+
require('@alfalab/icons-glyph/MagnifierMIcon');
|
|
43
|
+
require('../components/search/index.module.css');
|
|
44
|
+
require('../components/base-select-mobile/index.module.css');
|
|
45
|
+
require('../components/base-select-mobile/footer/Component.js');
|
|
46
|
+
require('@alfalab/core-components-base-modal/cssm');
|
|
47
|
+
require('@alfalab/core-components-button/cssm/mobile');
|
|
48
|
+
require('../components/base-select-mobile/footer/index.module.css');
|
|
49
|
+
require('../components/virtual-options-list/Component.js');
|
|
50
|
+
require('react-virtual');
|
|
51
|
+
require('../components/virtual-options-list/index.module.css');
|
|
52
|
+
require('../hook-244c8d6e.js');
|
|
53
|
+
require('../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
54
|
+
require('@alfalab/core-components-button/cssm/desktop');
|
|
55
|
+
require('../presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
|
56
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
57
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
exports.SelectMobile = Component_mobile.SelectMobile;
|
|
62
|
+
exports.SelectModalMobile = Component_modal_mobile.SelectModalMobile;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var components_arrow_Component = require('../components/arrow/Component.js');
|
|
6
|
+
var components_baseSelect_Component = require('../components/base-select/Component.js');
|
|
7
|
+
var components_field_Component = require('../components/field/Component.js');
|
|
8
|
+
var components_optgroup_Component = require('../components/optgroup/Component.js');
|
|
9
|
+
var components_option_Component = require('../components/option/Component.js');
|
|
10
|
+
var components_optionsList_Component = require('../components/options-list/Component.js');
|
|
11
|
+
var components_virtualOptionsList_Component = require('../components/virtual-options-list/Component.js');
|
|
12
|
+
var components_baseOption_Component = require('../components/base-option/Component.js');
|
|
13
|
+
var components_search_Component = require('../components/search/Component.js');
|
|
14
|
+
var presets_useSelectWithLoading_hook = require('../presets/useSelectWithLoading/hook.js');
|
|
15
|
+
var presets_useLazyLoading_hook = require('../presets/useLazyLoading/hook.js');
|
|
16
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-244c8d6e.js');
|
|
17
|
+
var utils = require('../utils.js');
|
|
18
|
+
require('react');
|
|
19
|
+
require('classnames');
|
|
20
|
+
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
21
|
+
require('../components/arrow/index.module.css');
|
|
22
|
+
require('tslib');
|
|
23
|
+
require('react-merge-refs');
|
|
24
|
+
require('@juggle/resize-observer');
|
|
25
|
+
require('downshift');
|
|
26
|
+
require('@alfalab/core-components-popover/cssm');
|
|
27
|
+
require('@alfalab/core-components-shared/cssm');
|
|
28
|
+
require('@alfalab/hooks');
|
|
29
|
+
require('../components/native-select/Component.js');
|
|
30
|
+
require('../components/base-select/index.module.css');
|
|
31
|
+
require('../components/field/index.module.css');
|
|
32
|
+
require('../components/optgroup/index.module.css');
|
|
33
|
+
require('../components/checkmark/Component.js');
|
|
34
|
+
require('@alfalab/core-components-badge/cssm');
|
|
35
|
+
require('@alfalab/core-components-checkbox/cssm');
|
|
36
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
37
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
38
|
+
require('../components/checkmark/index.module.css');
|
|
39
|
+
require('../components/checkmark-mobile/Component.js');
|
|
40
|
+
require('../components/checkmark-mobile/index.module.css');
|
|
41
|
+
require('../components/option/index.module.css');
|
|
42
|
+
require('@alfalab/core-components-scrollbar/cssm');
|
|
43
|
+
require('../consts.js');
|
|
44
|
+
require('../components/options-list/index.module.css');
|
|
45
|
+
require('react-virtual');
|
|
46
|
+
require('../components/virtual-options-list/index.module.css');
|
|
47
|
+
require('../components/base-checkmark/Component.js');
|
|
48
|
+
require('../components/base-checkmark/index.module.css');
|
|
49
|
+
require('../components/base-option/index.module.css');
|
|
50
|
+
require('@alfalab/core-components-input/cssm');
|
|
51
|
+
require('@alfalab/icons-glyph/MagnifierMIcon');
|
|
52
|
+
require('../components/search/index.module.css');
|
|
53
|
+
require('@alfalab/core-components-skeleton/cssm');
|
|
54
|
+
require('../presets/useSelectWithLoading/index.module.css');
|
|
55
|
+
require('intersection-observer');
|
|
56
|
+
require('../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
57
|
+
require('@alfalab/core-components-button/cssm/desktop');
|
|
58
|
+
require('../presets/useSelectWithApply/options-list-with-apply/footer/index.module.css');
|
|
59
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
60
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
exports.Arrow = components_arrow_Component.Arrow;
|
|
65
|
+
exports.BaseSelect = components_baseSelect_Component.BaseSelect;
|
|
66
|
+
exports.Field = components_field_Component.Field;
|
|
67
|
+
exports.Optgroup = components_optgroup_Component.Optgroup;
|
|
68
|
+
exports.Option = components_option_Component.Option;
|
|
69
|
+
exports.OptionsList = components_optionsList_Component.OptionsList;
|
|
70
|
+
exports.VirtualOptionsList = components_virtualOptionsList_Component.VirtualOptionsList;
|
|
71
|
+
exports.BaseOption = components_baseOption_Component.BaseOption;
|
|
72
|
+
exports.Search = components_search_Component.Search;
|
|
73
|
+
exports.useSelectWithLoading = presets_useSelectWithLoading_hook.useSelectWithLoading;
|
|
74
|
+
exports.useLazyLoading = presets_useLazyLoading_hook.useLazyLoading;
|
|
75
|
+
exports.SELECT_ALL_KEY = presets_useSelectWithApply_optionsListWithApply_Component.SELECT_ALL_KEY;
|
|
76
|
+
exports.useSelectWithApply = presets_useSelectWithApply_optionsListWithApply_Component.useSelectWithApply;
|
|
77
|
+
exports.defaultAccessor = utils.defaultAccessor;
|
|
78
|
+
exports.defaultFilterFn = utils.defaultFilterFn;
|
|
79
|
+
exports.isGroup = utils.isGroup;
|
|
80
|
+
exports.isOptionShape = utils.isOptionShape;
|
|
81
|
+
exports.joinOptions = utils.joinOptions;
|
|
82
|
+
exports.lastIndexOf = utils.lastIndexOf;
|
|
83
|
+
exports.processOptions = utils.processOptions;
|
|
84
|
+
exports.usePrevious = utils.usePrevious;
|
|
85
|
+
exports.useVisibleOptions = utils.useVisibleOptions;
|
|
@@ -2,35 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Component_desktop = require('
|
|
5
|
+
var Component_desktop = require('../Component.desktop.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('@alfalab/core-components-form-control/desktop');
|
|
9
|
-
require('
|
|
9
|
+
require('../components/arrow/Component.js');
|
|
10
10
|
require('classnames');
|
|
11
11
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
12
|
-
require('
|
|
12
|
+
require('../components/base-select/Component.js');
|
|
13
13
|
require('react-merge-refs');
|
|
14
14
|
require('@juggle/resize-observer');
|
|
15
15
|
require('downshift');
|
|
16
16
|
require('@alfalab/core-components-popover');
|
|
17
17
|
require('@alfalab/core-components-shared');
|
|
18
18
|
require('@alfalab/hooks');
|
|
19
|
-
require('
|
|
20
|
-
require('
|
|
21
|
-
require('
|
|
22
|
-
require('
|
|
23
|
-
require('
|
|
24
|
-
require('
|
|
19
|
+
require('../utils.js');
|
|
20
|
+
require('../components/native-select/Component.js');
|
|
21
|
+
require('../components/field/Component.js');
|
|
22
|
+
require('../components/optgroup/Component.js');
|
|
23
|
+
require('../components/option/Component.js');
|
|
24
|
+
require('../components/checkmark/Component.js');
|
|
25
25
|
require('@alfalab/core-components-badge');
|
|
26
26
|
require('@alfalab/core-components-checkbox');
|
|
27
27
|
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
28
28
|
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
29
|
-
require('
|
|
30
|
-
require('
|
|
29
|
+
require('../components/checkmark-mobile/Component.js');
|
|
30
|
+
require('../components/options-list/Component.js');
|
|
31
31
|
require('@alfalab/core-components-scrollbar');
|
|
32
|
-
require('
|
|
33
|
-
require('
|
|
32
|
+
require('../consts.js');
|
|
33
|
+
require('../components/search/Component.js');
|
|
34
34
|
require('@alfalab/core-components-input');
|
|
35
35
|
require('@alfalab/icons-glyph/MagnifierMIcon');
|
|
36
36
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { FormControlDesktopProps } from "@alfalab/core-components-form-control/desktop";
|
|
4
4
|
import { BaseSelectProps } from "./typings";
|
|
5
|
-
type FormControlDesktopProps = Omit<BaseFormControlProps, "styles" | "colorStyles">;
|
|
6
5
|
type SelectFieldProps = Omit<FormControlDesktopProps, 'size'> & Record<string, unknown>;
|
|
7
6
|
type SelectDesktopProps = Omit<BaseSelectProps, 'fieldProps'> & {
|
|
8
7
|
/**
|
package/esm/Component.mobile.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Option } from './components/option/Component.js';
|
|
|
10
10
|
import { OptionsList } from './components/options-list/Component.js';
|
|
11
11
|
import { Search } from './components/search/Component.js';
|
|
12
12
|
import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
13
|
-
import { u as useSelectWithApply } from './hook-
|
|
13
|
+
import { u as useSelectWithApply } from './hook-70d58270.js';
|
|
14
14
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
15
15
|
import 'classnames';
|
|
16
16
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|