@alfalab/core-components-select 13.0.1 → 13.0.3
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-21b7a86d.d.ts +241 -0
- package/{Component-42bffe35.js → Component-21b7a86d.js} +5 -5
- package/{Component-09f82c1f.d.ts → Component-ed89ed0b.d.ts} +0 -0
- package/{Component-09f82c1f.js → Component-ed89ed0b.js} +2 -2
- package/Component.js +2 -2
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-select/Component.js +2 -2
- package/components/base-select/index.css +7 -7
- package/components/base-select/index.d.ts +1 -1
- package/components/base-select/index.js +2 -2
- package/components/base-select-mobile/Component.js +4 -4
- package/components/base-select-mobile/checkmark/Component.js +1 -1
- package/components/base-select-mobile/checkmark/index.css +4 -4
- package/components/base-select-mobile/index.css +11 -11
- package/components/base-select-mobile/index.d.ts +1 -1
- package/components/base-select-mobile/index.js +4 -4
- package/components/base-select-mobile/options-list/Component.js +2 -2
- package/components/base-select-mobile/options-list/index.css +9 -9
- package/components/base-select-mobile/options-list/index.js +1 -1
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +7 -7
- package/components/field/Component.js +2 -2
- package/components/field/index.css +9 -9
- package/components/field/index.js +1 -1
- package/components/index.js +4 -4
- package/components/native-select/Component.js +1 -1
- package/components/native-select/index.js +1 -1
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +2 -2
- package/components/option/index.css +20 -20
- package/components/option/index.js +1 -1
- package/components/options-list/Component.js +2 -2
- package/components/options-list/index.css +6 -6
- package/components/options-list/index.js +1 -1
- package/components/select-mobile/Component.js +4 -4
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +4 -4
- package/components/select-modal-mobile/Component.js +4 -4
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +4 -4
- package/components/virtual-options-list/Component.js +2 -2
- package/components/virtual-options-list/index.css +12 -12
- package/components/virtual-options-list/index.js +1 -1
- package/cssm/Component-095a346d.d.ts +140 -13
- package/esm/Component-ce96c3e2.d.ts +241 -0
- package/esm/{Component-889ce29b.js → Component-ce96c3e2.js} +5 -5
- package/esm/{Component-3cfcec1a.d.ts → Component-ff051dbb.d.ts} +0 -0
- package/esm/{Component-3cfcec1a.js → Component-ff051dbb.js} +2 -2
- package/esm/Component.js +2 -2
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-select/Component.js +2 -2
- package/esm/components/base-select/index.css +7 -7
- package/esm/components/base-select/index.d.ts +1 -1
- package/esm/components/base-select/index.js +2 -2
- package/esm/components/base-select-mobile/Component.js +4 -4
- package/esm/components/base-select-mobile/checkmark/Component.js +1 -1
- package/esm/components/base-select-mobile/checkmark/index.css +4 -4
- package/esm/components/base-select-mobile/index.css +11 -11
- package/esm/components/base-select-mobile/index.d.ts +1 -1
- package/esm/components/base-select-mobile/index.js +4 -4
- package/esm/components/base-select-mobile/options-list/Component.js +2 -2
- package/esm/components/base-select-mobile/options-list/index.css +9 -9
- package/esm/components/base-select-mobile/options-list/index.js +1 -1
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +7 -7
- package/esm/components/field/Component.js +2 -2
- package/esm/components/field/index.css +9 -9
- package/esm/components/field/index.js +1 -1
- package/esm/components/index.js +4 -4
- package/esm/components/native-select/Component.js +1 -1
- package/esm/components/native-select/index.js +1 -1
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +2 -2
- package/esm/components/option/index.css +20 -20
- package/esm/components/option/index.js +1 -1
- package/esm/components/options-list/Component.js +2 -2
- package/esm/components/options-list/index.css +6 -6
- package/esm/components/options-list/index.js +1 -1
- package/esm/components/select-mobile/Component.js +4 -4
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +4 -4
- package/esm/components/select-modal-mobile/Component.js +4 -4
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +4 -4
- package/esm/components/virtual-options-list/Component.js +2 -2
- package/esm/components/virtual-options-list/index.css +12 -12
- package/esm/components/virtual-options-list/index.js +1 -1
- package/esm/index.js +4 -4
- package/esm/{intersection-observer-46ae308d.d.ts → intersection-observer-aafd2281.d.ts} +0 -0
- package/esm/{intersection-observer-46ae308d.js → intersection-observer-aafd2281.js} +0 -0
- package/esm/presets/index.js +4 -4
- package/esm/presets/useLazyLoading/hook.js +3 -3
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +4 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +4 -4
- package/esm/presets/useSelectWithLoading/hook.js +2 -2
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/{tslib.es6-c4534f67.d.ts → tslib.es6-7b5f4eba.d.ts} +0 -0
- package/esm/{tslib.es6-c4534f67.js → tslib.es6-7b5f4eba.js} +0 -0
- package/index.js +4 -4
- package/{intersection-observer-fc42e563.d.ts → intersection-observer-6dcf1728.d.ts} +0 -0
- package/{intersection-observer-fc42e563.js → intersection-observer-6dcf1728.js} +0 -0
- package/modern/{Component-ac4d8093.d.ts → Component-81ee14d4.d.ts} +0 -0
- package/modern/{Component-ac4d8093.js → Component-81ee14d4.js} +1 -1
- package/modern/Component-b6cd6efa.d.ts +241 -0
- package/modern/{Component-dc7907a7.js → Component-b6cd6efa.js} +4 -4
- package/modern/Component.js +1 -1
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-select/Component.js +1 -1
- package/modern/components/base-select/index.css +7 -7
- package/modern/components/base-select/index.d.ts +1 -1
- package/modern/components/base-select/index.js +1 -1
- package/modern/components/base-select-mobile/Component.js +3 -3
- package/modern/components/base-select-mobile/checkmark/Component.js +1 -1
- package/modern/components/base-select-mobile/checkmark/index.css +4 -4
- package/modern/components/base-select-mobile/index.css +11 -11
- package/modern/components/base-select-mobile/index.d.ts +1 -1
- package/modern/components/base-select-mobile/index.js +3 -3
- package/modern/components/base-select-mobile/options-list/Component.js +3 -3
- package/modern/components/base-select-mobile/options-list/index.css +9 -9
- package/modern/components/checkmark/Component.js +2 -2
- package/modern/components/checkmark/index.css +7 -7
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +9 -9
- package/modern/components/index.js +3 -3
- package/modern/components/native-select/Component.js +2 -2
- 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 +6 -6
- package/modern/components/select-mobile/Component.js +3 -3
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +3 -3
- package/modern/components/select-modal-mobile/Component.js +3 -3
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +3 -3
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +12 -12
- package/modern/index.js +3 -3
- package/modern/{intersection-observer-46ae308d.d.ts → intersection-observer-aafd2281.d.ts} +0 -0
- package/modern/{intersection-observer-46ae308d.js → intersection-observer-aafd2281.js} +0 -0
- package/modern/presets/index.js +3 -3
- package/modern/presets/useLazyLoading/hook.js +2 -2
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +3 -3
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/package.json +8 -8
- package/presets/index.js +4 -4
- package/presets/useLazyLoading/hook.js +3 -3
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +4 -4
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -4
- package/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +4 -4
- package/presets/useSelectWithLoading/hook.js +2 -2
- package/presets/useSelectWithLoading/index.css +2 -2
- package/send-stats.js +1 -1
- package/{tslib.es6-911daf6f.d.ts → tslib.es6-e8cb2975.d.ts} +0 -0
- package/{tslib.es6-911daf6f.js → tslib.es6-e8cb2975.js} +0 -0
- package/Component-42bffe35.d.ts +0 -114
- package/Component-db573794.d.ts +0 -73
- package/Component.mobile-3fe0d3e6.d.ts +0 -56
- package/Context-c2e6f1b2.d.ts +0 -4
- package/cssm/Component-db573794.d.ts +0 -73
- package/cssm/Component.mobile-3fe0d3e6.d.ts +0 -56
- package/cssm/Context-c2e6f1b2.d.ts +0 -4
- package/esm/Component-889ce29b.d.ts +0 -114
- package/esm/Component-db573794.d.ts +0 -73
- package/esm/Component.mobile-3fe0d3e6.d.ts +0 -56
- package/esm/Context-c2e6f1b2.d.ts +0 -4
- package/modern/Component-db573794.d.ts +0 -73
- package/modern/Component-dc7907a7.d.ts +0 -114
- package/modern/Component.mobile-3fe0d3e6.d.ts +0 -56
- package/modern/Context-c2e6f1b2.d.ts +0 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('../../tslib.es6-
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-e8cb2975.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var hooks = require('@alfalab/hooks');
|
|
@@ -16,7 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
16
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
17
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
18
18
|
|
|
19
|
-
var styles = {"virtualOptionsList":"
|
|
19
|
+
var styles = {"virtualOptionsList":"select__virtualOptionsList_5gcfj","scrollable":"select__scrollable_5gcfj","inner":"select__inner_5gcfj","virtualRow":"select__virtualRow_5gcfj","highlighted":"select__highlighted_5gcfj","emptyPlaceholder":"select__emptyPlaceholder_5gcfj","l":"select__l_5gcfj","xl":"select__xl_5gcfj"};
|
|
20
20
|
require('./index.css')
|
|
21
21
|
|
|
22
22
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 184nu */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-border-primary: #dbdee1;
|
|
4
4
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
@@ -32,27 +32,27 @@
|
|
|
32
32
|
|
|
33
33
|
/* optgroup */
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.select__virtualOptionsList_5gcfj {
|
|
36
36
|
width: 100%;
|
|
37
37
|
outline: none;
|
|
38
38
|
box-sizing: border-box;
|
|
39
39
|
position: relative;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.select__scrollable_5gcfj {
|
|
42
42
|
overflow: auto;
|
|
43
43
|
width: 100%;
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.select__inner_5gcfj {
|
|
46
46
|
position: relative;
|
|
47
47
|
width: 100%;
|
|
48
48
|
}
|
|
49
|
-
.
|
|
49
|
+
.select__virtualRow_5gcfj {
|
|
50
50
|
position: absolute;
|
|
51
51
|
top: 0;
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%
|
|
54
54
|
}
|
|
55
|
-
.
|
|
55
|
+
.select__virtualRow_5gcfj:before {
|
|
56
56
|
content: '';
|
|
57
57
|
position: absolute;
|
|
58
58
|
z-index: 1;
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
background: var(--select-option-divider-background);
|
|
64
64
|
display: var(--select-option-divider-display);
|
|
65
65
|
}
|
|
66
|
-
.
|
|
66
|
+
.select__virtualRow_5gcfj:first-child:before {
|
|
67
67
|
display: none;
|
|
68
68
|
}
|
|
69
|
-
.
|
|
70
|
-
.
|
|
69
|
+
.select__highlighted_5gcfj:before,
|
|
70
|
+
.select__highlighted_5gcfj + .select__virtualRow_5gcfj:before {
|
|
71
71
|
display: none;
|
|
72
72
|
}
|
|
73
|
-
.
|
|
73
|
+
.select__emptyPlaceholder_5gcfj {
|
|
74
74
|
padding: var(--gap-m) var(--gap-s);
|
|
75
75
|
color: var(--select-options-list-empty-placeholder-color);
|
|
76
76
|
}
|
|
77
|
-
.
|
|
78
|
-
.
|
|
77
|
+
.select__l_5gcfj .select__emptyPlaceholder_5gcfj,
|
|
78
|
+
.select__xl_5gcfj .select__emptyPlaceholder_5gcfj {
|
|
79
79
|
padding: var(--gap-xl) var(--gap-m);
|
|
80
80
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { ReactNode, FC } from "react";
|
|
3
|
+
import { ReactNode, FC, ButtonHTMLAttributes, ElementType, AnchorHTMLAttributes } from "react";
|
|
4
4
|
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
5
5
|
import { BaseSelectProps, OptionShape, OptionsListProps } from "./typings";
|
|
6
|
-
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
6
|
+
import { BaseModalProps, BaseModalContext } from "@alfalab/core-components-base-modal";
|
|
7
|
+
import { ButtonProps } from "@alfalab/core-components-button";
|
|
7
8
|
type AdditionalMobileProps = {
|
|
8
9
|
/**
|
|
9
10
|
* Футер
|
|
@@ -54,13 +55,34 @@ declare const OptionsListWithApply: React.ForwardRefExoticComponent<OptionsListP
|
|
|
54
55
|
selectedDraft?: OptionShape[] | undefined;
|
|
55
56
|
OptionsList?: React.FC<OptionsListProps & React.RefAttributes<unknown>> | undefined;
|
|
56
57
|
} & React.RefAttributes<unknown>>;
|
|
57
|
-
type
|
|
58
|
+
type ModalDesktopProps = BaseModalProps & {
|
|
59
|
+
/**
|
|
60
|
+
* Ширина модального окна
|
|
61
|
+
* @default "m"
|
|
62
|
+
*/
|
|
63
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen";
|
|
64
|
+
/**
|
|
65
|
+
* Растягивает модальное окно на весь экран
|
|
66
|
+
* @deprecated Используйте размер fullscreen
|
|
67
|
+
*/
|
|
68
|
+
fullscreen?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Фиксирует позицию модального окна после открытия,
|
|
71
|
+
* предотвращая скачки, если контент внутри будет меняться
|
|
72
|
+
*/
|
|
73
|
+
fixedPosition?: boolean;
|
|
58
74
|
/**
|
|
59
75
|
* Управление наличием закрывающего крестика
|
|
60
76
|
* @default false
|
|
61
77
|
*/
|
|
62
78
|
hasCloser?: boolean;
|
|
63
79
|
};
|
|
80
|
+
type ModalMobileProps = Omit<ModalDesktopProps, "size" | "fixedPosition" | "fullscreen">;
|
|
81
|
+
type View = "desktop" | "mobile";
|
|
82
|
+
type TResponsiveModalContext = {
|
|
83
|
+
view: View;
|
|
84
|
+
size: NonNullable<ModalDesktopProps["size"]>;
|
|
85
|
+
};
|
|
64
86
|
type ContentProps = {
|
|
65
87
|
/**
|
|
66
88
|
* Контент
|
|
@@ -75,6 +97,52 @@ type ContentProps = {
|
|
|
75
97
|
*/
|
|
76
98
|
flex?: boolean;
|
|
77
99
|
};
|
|
100
|
+
type HeaderProps = {
|
|
101
|
+
/**
|
|
102
|
+
* Контент шапки
|
|
103
|
+
*/
|
|
104
|
+
children?: ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Слот слева
|
|
107
|
+
*/
|
|
108
|
+
leftAddons?: ReactNode;
|
|
109
|
+
/**
|
|
110
|
+
* Наличие компонента крестика
|
|
111
|
+
*/
|
|
112
|
+
hasCloser?: ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* Дополнительный класс
|
|
115
|
+
*/
|
|
116
|
+
className?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Дополнительный класс для аддонов
|
|
119
|
+
*/
|
|
120
|
+
addonClassName?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Дополнительный класс для контента
|
|
123
|
+
*/
|
|
124
|
+
contentClassName?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Заголовок шапки
|
|
127
|
+
*/
|
|
128
|
+
title?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Выравнивание заголовка
|
|
131
|
+
*/
|
|
132
|
+
align?: "left" | "center";
|
|
133
|
+
/**
|
|
134
|
+
* Обрезать ли заголовок
|
|
135
|
+
*/
|
|
136
|
+
trim?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Фиксирует шапку
|
|
139
|
+
*/
|
|
140
|
+
sticky?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
143
|
+
*/
|
|
144
|
+
dataTestId?: string;
|
|
145
|
+
};
|
|
78
146
|
type FooterProps = {
|
|
79
147
|
/**
|
|
80
148
|
* Контент футера
|
|
@@ -97,18 +165,77 @@ type FooterProps = {
|
|
|
97
165
|
*/
|
|
98
166
|
gap?: 16 | 24 | 32;
|
|
99
167
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
168
|
+
type IconButtonProps = {
|
|
169
|
+
/**
|
|
170
|
+
* Компонент иконки
|
|
171
|
+
*/
|
|
172
|
+
icon: ElementType<{
|
|
173
|
+
className?: string;
|
|
174
|
+
}>;
|
|
175
|
+
/**
|
|
176
|
+
* Тип кнопки
|
|
177
|
+
*/
|
|
178
|
+
view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
|
|
179
|
+
/**
|
|
180
|
+
* Размер компонента
|
|
181
|
+
*/
|
|
182
|
+
size?: "xxs" | "xs" | "s";
|
|
183
|
+
/**
|
|
184
|
+
* Дополнительный класс
|
|
185
|
+
*/
|
|
186
|
+
className?: string;
|
|
187
|
+
/**
|
|
188
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
189
|
+
*/
|
|
190
|
+
dataTestId?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Набор цветов для компонента
|
|
193
|
+
*/
|
|
194
|
+
colors?: "default" | "inverted";
|
|
195
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
|
|
196
|
+
type CloserProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
197
|
+
/**
|
|
198
|
+
* Дополнительный класс
|
|
199
|
+
*/
|
|
200
|
+
className?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Позиция крестика
|
|
203
|
+
*/
|
|
204
|
+
align?: "left" | "right";
|
|
205
|
+
/**
|
|
206
|
+
* Размер кнопки
|
|
207
|
+
*/
|
|
208
|
+
size?: IconButtonProps["size"];
|
|
209
|
+
/**
|
|
210
|
+
* Фиксирует крестик
|
|
211
|
+
*/
|
|
212
|
+
sticky?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Иконка
|
|
215
|
+
*/
|
|
216
|
+
icon?: ElementType;
|
|
217
|
+
/**
|
|
218
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
219
|
+
*/
|
|
220
|
+
dataTestId?: string;
|
|
221
|
+
};
|
|
222
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
103
223
|
Content: React.FC<ContentProps>;
|
|
104
|
-
Header: React.FC<
|
|
224
|
+
Header: React.FC<HeaderProps>;
|
|
105
225
|
Footer: React.FC<FooterProps>;
|
|
106
|
-
Closer: React.FC<
|
|
226
|
+
Closer: React.FC<CloserProps>;
|
|
107
227
|
};
|
|
108
|
-
|
|
109
|
-
declare const
|
|
110
|
-
|
|
111
|
-
|
|
228
|
+
declare const Content: FC<ContentProps>;
|
|
229
|
+
declare const Modal: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
230
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen" | undefined;
|
|
231
|
+
fullscreen?: boolean | undefined;
|
|
232
|
+
fixedPosition?: boolean | undefined;
|
|
233
|
+
hasCloser?: boolean | undefined;
|
|
234
|
+
} & {
|
|
235
|
+
view: View;
|
|
236
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
237
|
+
declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
|
|
238
|
+
declare const ModalContext: import("react").Context<BaseModalContext>;
|
|
112
239
|
type SelectModalMobileProps = Omit<BaseSelectProps, 'OptionsList' | 'Checkmark' | 'onScroll'>;
|
|
113
240
|
declare const SelectModalMobile: React.ForwardRefExoticComponent<SelectModalMobileProps & React.RefAttributes<unknown>>;
|
|
114
|
-
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, BaseSelectMobile, OptionsListWithApply,
|
|
241
|
+
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, BaseSelectMobile, OptionsListWithApply, ModalMobile, Content, Modal, ResponsiveContext, ModalContext, SelectModalMobileProps, SelectModalMobile };
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode, FC, ButtonHTMLAttributes, ElementType, AnchorHTMLAttributes } from "react";
|
|
4
|
+
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
5
|
+
import { BaseSelectProps, OptionShape, OptionsListProps } from "./typings";
|
|
6
|
+
import { BaseModalProps, BaseModalContext } from "@alfalab/core-components-base-modal";
|
|
7
|
+
import { ButtonProps } from "@alfalab/core-components-button";
|
|
8
|
+
type AdditionalMobileProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Футер
|
|
11
|
+
* @deprecated Используйте bottomSheetProps.actionButton
|
|
12
|
+
*/
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Будет ли свайпаться шторка
|
|
16
|
+
* @deprecated Используйте bottomSheetProps.swipeable
|
|
17
|
+
*/
|
|
18
|
+
swipeable?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Дополнительные пропсы шторки
|
|
21
|
+
*/
|
|
22
|
+
bottomSheetProps?: Partial<BottomSheetProps>;
|
|
23
|
+
};
|
|
24
|
+
type SelectMobileProps = Omit<BaseSelectProps, "OptionsList" | "Checkmark" | "onScroll"> & AdditionalMobileProps;
|
|
25
|
+
declare const SelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "OptionsList" | "Checkmark"> & AdditionalMobileProps & React.RefAttributes<unknown>>;
|
|
26
|
+
type SelectMobileProps$0 = Omit<BaseSelectProps, "OptionsList" | "Checkmark" | "onScroll"> & {
|
|
27
|
+
/**
|
|
28
|
+
* Футер
|
|
29
|
+
* @deprecated Используйте bottomSheetProps.actionButton
|
|
30
|
+
*/
|
|
31
|
+
footer?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Будет ли свайпаться шторка
|
|
34
|
+
* @deprecated Используйте bottomSheetProps.swipeable
|
|
35
|
+
*/
|
|
36
|
+
swipeable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Отображать в BottomSheet
|
|
39
|
+
*/
|
|
40
|
+
isBottomSheet?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Дополнительные пропсы шторки
|
|
43
|
+
*/
|
|
44
|
+
bottomSheetProps?: Partial<BottomSheetProps>;
|
|
45
|
+
};
|
|
46
|
+
declare const BaseSelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "OptionsList" | "Checkmark"> & {
|
|
47
|
+
footer?: ReactNode;
|
|
48
|
+
swipeable?: boolean | undefined;
|
|
49
|
+
isBottomSheet?: boolean | undefined;
|
|
50
|
+
bottomSheetProps?: Partial<BottomSheetProps> | undefined;
|
|
51
|
+
} & React.RefAttributes<unknown>>;
|
|
52
|
+
declare const OptionsListWithApply: React.ForwardRefExoticComponent<OptionsListProps & {
|
|
53
|
+
showClear?: boolean | undefined;
|
|
54
|
+
onClose?: (() => void) | undefined;
|
|
55
|
+
selectedDraft?: OptionShape[] | undefined;
|
|
56
|
+
OptionsList?: React.FC<OptionsListProps & React.RefAttributes<unknown>> | undefined;
|
|
57
|
+
} & React.RefAttributes<unknown>>;
|
|
58
|
+
type ModalDesktopProps = BaseModalProps & {
|
|
59
|
+
/**
|
|
60
|
+
* Ширина модального окна
|
|
61
|
+
* @default "m"
|
|
62
|
+
*/
|
|
63
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen";
|
|
64
|
+
/**
|
|
65
|
+
* Растягивает модальное окно на весь экран
|
|
66
|
+
* @deprecated Используйте размер fullscreen
|
|
67
|
+
*/
|
|
68
|
+
fullscreen?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Фиксирует позицию модального окна после открытия,
|
|
71
|
+
* предотвращая скачки, если контент внутри будет меняться
|
|
72
|
+
*/
|
|
73
|
+
fixedPosition?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Управление наличием закрывающего крестика
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
hasCloser?: boolean;
|
|
79
|
+
};
|
|
80
|
+
type ModalMobileProps = Omit<ModalDesktopProps, "size" | "fixedPosition" | "fullscreen">;
|
|
81
|
+
type View = "desktop" | "mobile";
|
|
82
|
+
type TResponsiveModalContext = {
|
|
83
|
+
view: View;
|
|
84
|
+
size: NonNullable<ModalDesktopProps["size"]>;
|
|
85
|
+
};
|
|
86
|
+
type ContentProps = {
|
|
87
|
+
/**
|
|
88
|
+
* Контент
|
|
89
|
+
*/
|
|
90
|
+
children?: ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* Дополнительный класс
|
|
93
|
+
*/
|
|
94
|
+
className?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Растягивает контент на всю высоту
|
|
97
|
+
*/
|
|
98
|
+
flex?: boolean;
|
|
99
|
+
};
|
|
100
|
+
type HeaderProps = {
|
|
101
|
+
/**
|
|
102
|
+
* Контент шапки
|
|
103
|
+
*/
|
|
104
|
+
children?: ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Слот слева
|
|
107
|
+
*/
|
|
108
|
+
leftAddons?: ReactNode;
|
|
109
|
+
/**
|
|
110
|
+
* Наличие компонента крестика
|
|
111
|
+
*/
|
|
112
|
+
hasCloser?: ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* Дополнительный класс
|
|
115
|
+
*/
|
|
116
|
+
className?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Дополнительный класс для аддонов
|
|
119
|
+
*/
|
|
120
|
+
addonClassName?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Дополнительный класс для контента
|
|
123
|
+
*/
|
|
124
|
+
contentClassName?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Заголовок шапки
|
|
127
|
+
*/
|
|
128
|
+
title?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Выравнивание заголовка
|
|
131
|
+
*/
|
|
132
|
+
align?: "left" | "center";
|
|
133
|
+
/**
|
|
134
|
+
* Обрезать ли заголовок
|
|
135
|
+
*/
|
|
136
|
+
trim?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Фиксирует шапку
|
|
139
|
+
*/
|
|
140
|
+
sticky?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
143
|
+
*/
|
|
144
|
+
dataTestId?: string;
|
|
145
|
+
};
|
|
146
|
+
type FooterProps = {
|
|
147
|
+
/**
|
|
148
|
+
* Контент футера
|
|
149
|
+
*/
|
|
150
|
+
children?: ReactNode;
|
|
151
|
+
/**
|
|
152
|
+
* Дополнительный класс
|
|
153
|
+
*/
|
|
154
|
+
className?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Фиксирует футер
|
|
157
|
+
*/
|
|
158
|
+
sticky?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Выравнивание элементов футера
|
|
161
|
+
*/
|
|
162
|
+
layout?: "start" | "center" | "space-between" | "column";
|
|
163
|
+
/**
|
|
164
|
+
* Отступы между элементами футера
|
|
165
|
+
*/
|
|
166
|
+
gap?: 16 | 24 | 32;
|
|
167
|
+
};
|
|
168
|
+
type IconButtonProps = {
|
|
169
|
+
/**
|
|
170
|
+
* Компонент иконки
|
|
171
|
+
*/
|
|
172
|
+
icon: ElementType<{
|
|
173
|
+
className?: string;
|
|
174
|
+
}>;
|
|
175
|
+
/**
|
|
176
|
+
* Тип кнопки
|
|
177
|
+
*/
|
|
178
|
+
view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
|
|
179
|
+
/**
|
|
180
|
+
* Размер компонента
|
|
181
|
+
*/
|
|
182
|
+
size?: "xxs" | "xs" | "s";
|
|
183
|
+
/**
|
|
184
|
+
* Дополнительный класс
|
|
185
|
+
*/
|
|
186
|
+
className?: string;
|
|
187
|
+
/**
|
|
188
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
189
|
+
*/
|
|
190
|
+
dataTestId?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Набор цветов для компонента
|
|
193
|
+
*/
|
|
194
|
+
colors?: "default" | "inverted";
|
|
195
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
|
|
196
|
+
type CloserProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
197
|
+
/**
|
|
198
|
+
* Дополнительный класс
|
|
199
|
+
*/
|
|
200
|
+
className?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Позиция крестика
|
|
203
|
+
*/
|
|
204
|
+
align?: "left" | "right";
|
|
205
|
+
/**
|
|
206
|
+
* Размер кнопки
|
|
207
|
+
*/
|
|
208
|
+
size?: IconButtonProps["size"];
|
|
209
|
+
/**
|
|
210
|
+
* Фиксирует крестик
|
|
211
|
+
*/
|
|
212
|
+
sticky?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Иконка
|
|
215
|
+
*/
|
|
216
|
+
icon?: ElementType;
|
|
217
|
+
/**
|
|
218
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
219
|
+
*/
|
|
220
|
+
dataTestId?: string;
|
|
221
|
+
};
|
|
222
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
223
|
+
Content: React.FC<ContentProps>;
|
|
224
|
+
Header: React.FC<HeaderProps>;
|
|
225
|
+
Footer: React.FC<FooterProps>;
|
|
226
|
+
Closer: React.FC<CloserProps>;
|
|
227
|
+
};
|
|
228
|
+
declare const Content: FC<ContentProps>;
|
|
229
|
+
declare const Modal: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
230
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen" | undefined;
|
|
231
|
+
fullscreen?: boolean | undefined;
|
|
232
|
+
fixedPosition?: boolean | undefined;
|
|
233
|
+
hasCloser?: boolean | undefined;
|
|
234
|
+
} & {
|
|
235
|
+
view: View;
|
|
236
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
237
|
+
declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
|
|
238
|
+
declare const ModalContext: import("react").Context<BaseModalContext>;
|
|
239
|
+
type SelectModalMobileProps = Omit<BaseSelectProps, 'OptionsList' | 'Checkmark' | 'onScroll'>;
|
|
240
|
+
declare const SelectModalMobile: React.ForwardRefExoticComponent<SelectModalMobileProps & React.RefAttributes<unknown>>;
|
|
241
|
+
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, BaseSelectMobile, OptionsListWithApply, ModalMobile, Content, Modal, ResponsiveContext, ModalContext, SelectModalMobileProps, SelectModalMobile };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign, b as __spreadArray } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign, b as __spreadArray } from './tslib.es6-7b5f4eba.js';
|
|
2
2
|
import React, { useMemo, useState, useRef, useCallback, useEffect, forwardRef } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -6,7 +6,7 @@ import { Arrow } from './components/arrow/Component.js';
|
|
|
6
6
|
import mergeRefs from 'react-merge-refs';
|
|
7
7
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
8
8
|
import '@alfalab/hooks';
|
|
9
|
-
import { g as getDataTestId } from './Component-
|
|
9
|
+
import { g as getDataTestId } from './Component-ff051dbb.js';
|
|
10
10
|
import { processOptions } from './utils.js';
|
|
11
11
|
import '@alfalab/core-components-form-control/esm';
|
|
12
12
|
import { Field } from './components/field/Component.js';
|
|
@@ -23,7 +23,7 @@ import { Checkmark } from './components/base-select-mobile/checkmark/Component.j
|
|
|
23
23
|
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
24
24
|
import 'react-virtual';
|
|
25
25
|
import '@alfalab/core-components-skeleton/esm';
|
|
26
|
-
import './intersection-observer-
|
|
26
|
+
import './intersection-observer-aafd2281.js';
|
|
27
27
|
|
|
28
28
|
var SELECT_ALL_KEY = 'select_all';
|
|
29
29
|
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
@@ -90,7 +90,7 @@ function useSelectWithApply(_a) {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
var styles = {"footer":"
|
|
93
|
+
var styles = {"footer":"select__footer_izxok","withBorder":"select__withBorder_izxok"};
|
|
94
94
|
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
95
95
|
|
|
96
96
|
var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
@@ -136,7 +136,7 @@ var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
|
136
136
|
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) })));
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
var styles$1 = {"component":"
|
|
139
|
+
var styles$1 = {"component":"select__component_1pk0l","popoverInner":"select__popoverInner_1pk0l","sheet":"select__sheet_1pk0l","sheetContent":"select__sheetContent_1pk0l","sheetContainer":"select__sheetContainer_1pk0l","block":"select__block_1pk0l","option":"select__option_1pk0l","optionGroup":"select__optionGroup_1pk0l"};
|
|
140
140
|
require('./components/base-select-mobile/index.css')
|
|
141
141
|
|
|
142
142
|
var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __assign, b as __spreadArray } from './tslib.es6-
|
|
1
|
+
import { a as __assign, b as __spreadArray } from './tslib.es6-7b5f4eba.js';
|
|
2
2
|
import React, { forwardRef, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import mergeRefs from 'react-merge-refs';
|
|
@@ -14,7 +14,7 @@ var getDataTestId = function (dataTestId, element) {
|
|
|
14
14
|
return dataTestId ? "" + dataTestId + elementPart : undefined;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
var styles = {"component":"
|
|
17
|
+
var styles = {"component":"select__component_kmgc8","popoverInner":"select__popoverInner_kmgc8","optionsList":"select__optionsList_kmgc8","nativeSelect":"select__nativeSelect_kmgc8","block":"select__block_kmgc8"};
|
|
18
18
|
require('./components/base-select/index.css')
|
|
19
19
|
|
|
20
20
|
var BaseSelect = forwardRef(function (_a, ref) {
|
package/esm/Component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign } from './tslib.es6-7b5f4eba.js';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -8,7 +8,7 @@ import '@juggle/resize-observer';
|
|
|
8
8
|
import 'downshift';
|
|
9
9
|
import '@alfalab/core-components-popover/esm';
|
|
10
10
|
import '@alfalab/hooks';
|
|
11
|
-
import { B as BaseSelect } from './Component-
|
|
11
|
+
import { B as BaseSelect } from './Component-ff051dbb.js';
|
|
12
12
|
import './utils.js';
|
|
13
13
|
import './components/native-select/Component.js';
|
|
14
14
|
import '@alfalab/core-components-form-control/esm';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
4
4
|
|
|
5
|
-
var styles = {"arrow":"
|
|
5
|
+
var styles = {"arrow":"select__arrow_1w4em","open":"select__open_1w4em"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Arrow = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1g38u */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-graphic-primary: #0b1f35;
|
|
4
4
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.select__arrow_1w4em {
|
|
28
28
|
display: block;
|
|
29
29
|
width: 24px;
|
|
30
30
|
height: 24px;
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.select__open_1w4em {
|
|
36
36
|
transform: var(--arrow-transform);
|
|
37
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-7b5f4eba.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'react-merge-refs';
|
|
@@ -6,6 +6,6 @@ import '@juggle/resize-observer';
|
|
|
6
6
|
import 'downshift';
|
|
7
7
|
import '@alfalab/core-components-popover/esm';
|
|
8
8
|
import '@alfalab/hooks';
|
|
9
|
-
export { B as BaseSelect } from '../../Component-
|
|
9
|
+
export { B as BaseSelect } from '../../Component-ff051dbb.js';
|
|
10
10
|
import '../../utils.js';
|
|
11
11
|
import '../native-select/Component.js';
|