@alfalab/core-components-select 15.2.2 → 15.2.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.mobile.js +1 -1
- 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.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/components/base-select-mobile/Component.js +2 -2
- package/cssm/components/virtual-options-list/Component.js +8 -4
- package/esm/Component.mobile.js +1 -1
- 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.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/index.js +1 -1
- package/esm/mobile.js +1 -1
- 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.js +1 -1
- package/index.js +1 -1
- package/mobile.js +1 -1
- package/modern/Component.mobile.js +1 -1
- 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.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/index.js +1 -1
- package/modern/mobile.js +1 -1
- 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.js +1 -1
- package/package.json +2 -26
- 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.js +1 -1
- package/src/components/base-select-mobile/Component.tsx +2 -1
- package/src/components/virtual-options-list/Component.tsx +8 -4
- /package/esm/{hook-571dca86.d.ts → hook-e63a15d0.d.ts} +0 -0
- /package/esm/{hook-571dca86.js → hook-e63a15d0.js} +0 -0
- /package/{hook-a6f060a1.d.ts → hook-74d61833.d.ts} +0 -0
- /package/{hook-a6f060a1.js → hook-74d61833.js} +0 -0
- /package/modern/{hook-7e628eb4.d.ts → hook-5e1db0b0.d.ts} +0 -0
- /package/modern/{hook-7e628eb4.js → hook-5e1db0b0.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 12c4k */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
/* checkmark */
|
|
54
54
|
|
|
55
55
|
/* optgroup */
|
|
56
|
-
} .
|
|
56
|
+
} .select__option_qs0c8 {
|
|
57
57
|
font-size: 16px;
|
|
58
58
|
line-height: 20px;
|
|
59
59
|
font-weight: 400;
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
box-sizing: border-box;
|
|
69
69
|
position: relative;
|
|
70
70
|
cursor: pointer
|
|
71
|
-
} .
|
|
71
|
+
} .select__option_qs0c8:not(.select__disabled_qs0c8):active {
|
|
72
72
|
background: var(--select-option-active-background);
|
|
73
73
|
color: var(--select-option-active-color);
|
|
74
|
-
} .
|
|
74
|
+
} .select__option_qs0c8:before {
|
|
75
75
|
content: '';
|
|
76
76
|
position: absolute;
|
|
77
77
|
left: var(--select-option-left-padding);
|
|
@@ -81,46 +81,46 @@
|
|
|
81
81
|
background: var(--select-option-divider-background);
|
|
82
82
|
display: var(--select-option-divider-display);
|
|
83
83
|
transition: opacity 0.2s ease;
|
|
84
|
-
} .
|
|
84
|
+
} .select__option_qs0c8:first-child:before {
|
|
85
85
|
display: none;
|
|
86
|
-
} .
|
|
86
|
+
} .select__s_qs0c8 {
|
|
87
87
|
min-height: var(--size-s-height);
|
|
88
|
-
} .
|
|
88
|
+
} .select__m_qs0c8 {
|
|
89
89
|
min-height: var(--size-m-height);
|
|
90
|
-
} .
|
|
90
|
+
} .select__l_qs0c8 {
|
|
91
91
|
min-height: var(--size-l-height);
|
|
92
|
-
} .
|
|
92
|
+
} .select__xl_qs0c8 {
|
|
93
93
|
min-height: var(--size-xl-height);
|
|
94
|
-
} .
|
|
95
|
-
.
|
|
94
|
+
} .select__l_qs0c8,
|
|
95
|
+
.select__xl_qs0c8 {
|
|
96
96
|
padding-left: var(--select-option-l-left-padding);
|
|
97
97
|
padding-right: var(--select-option-l-right-padding)
|
|
98
|
-
} .
|
|
98
|
+
} .select__l_qs0c8:before, .select__xl_qs0c8:before {
|
|
99
99
|
left: var(--select-option-l-left-padding);
|
|
100
100
|
right: var(--select-option-l-right-padding);
|
|
101
|
-
} .
|
|
101
|
+
} .select__selected_qs0c8 {
|
|
102
102
|
background: var(--select-option-selected-background);
|
|
103
103
|
color: var(--select-option-selected-color);
|
|
104
104
|
cursor: default;
|
|
105
|
-
} .
|
|
105
|
+
} .select__highlighted_qs0c8 {
|
|
106
106
|
background: var(--select-option-hover-background);
|
|
107
107
|
color: var(--select-option-hover-color)
|
|
108
|
-
} .
|
|
109
|
-
.
|
|
108
|
+
} .select__highlighted_qs0c8:before,
|
|
109
|
+
.select__highlighted_qs0c8 + .select__option_qs0c8:before {
|
|
110
110
|
opacity: 0;
|
|
111
|
-
} .
|
|
111
|
+
} .select__disabled_qs0c8 {
|
|
112
112
|
cursor: var(--disabled-cursor);
|
|
113
113
|
background: var(--select-option-disabled-background);
|
|
114
114
|
color: var(--select-option-disabled-color);
|
|
115
|
-
} .
|
|
115
|
+
} .select__content_qs0c8 {
|
|
116
116
|
overflow: hidden;
|
|
117
117
|
flex: 1;
|
|
118
118
|
text-overflow: ellipsis;
|
|
119
|
-
} .
|
|
119
|
+
} .select__textContent_qs0c8 {
|
|
120
120
|
padding-top: var(--gap-s);
|
|
121
121
|
padding-bottom: var(--gap-s);
|
|
122
122
|
} /* IE min-height fix */ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
123
|
-
.
|
|
123
|
+
.select__option_qs0c8:after {
|
|
124
124
|
min-height: inherit;
|
|
125
125
|
font-size: 0;
|
|
126
126
|
content: '';
|
|
@@ -18,7 +18,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
18
18
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
19
19
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
20
20
|
|
|
21
|
-
var styles = {"optionsList":"
|
|
21
|
+
var styles = {"optionsList":"select__optionsList_1lw96","optionsListHeader":"select__optionsListHeader_1lw96","optionsListFooter":"select__optionsListFooter_1lw96","withBorder":"select__withBorder_1lw96","scrollable":"select__scrollable_1lw96","emptyPlaceholder":"select__emptyPlaceholder_1lw96","l":"select__l_1lw96","xl":"select__xl_1lw96"};
|
|
22
22
|
require('./index.css')
|
|
23
23
|
|
|
24
24
|
var createCounter = function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: am7v4 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb;
|
|
@@ -29,28 +29,28 @@
|
|
|
29
29
|
/* checkmark */
|
|
30
30
|
|
|
31
31
|
/* optgroup */
|
|
32
|
-
} .
|
|
32
|
+
} .select__optionsList_1lw96 {
|
|
33
33
|
width: 100%;
|
|
34
34
|
outline: none;
|
|
35
35
|
box-sizing: border-box;
|
|
36
36
|
position: relative;
|
|
37
|
-
} .
|
|
37
|
+
} .select__optionsListHeader_1lw96 {
|
|
38
38
|
box-sizing: border-box;
|
|
39
39
|
border-bottom: 1px solid var(--color-light-border-secondary);
|
|
40
|
-
} .
|
|
40
|
+
} .select__optionsListFooter_1lw96 {
|
|
41
41
|
position: sticky;
|
|
42
42
|
bottom: 0;
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
border-top: 1px solid transparent
|
|
45
|
-
} .
|
|
45
|
+
} .select__optionsListFooter_1lw96.select__withBorder_1lw96 {
|
|
46
46
|
border-top: 1px solid var(--color-light-border-secondary);
|
|
47
|
-
} .
|
|
47
|
+
} .select__scrollable_1lw96 {
|
|
48
48
|
overflow: auto;
|
|
49
49
|
width: 100%;
|
|
50
|
-
} .
|
|
50
|
+
} .select__emptyPlaceholder_1lw96 {
|
|
51
51
|
padding: var(--gap-m) var(--gap-s);
|
|
52
52
|
color: var(--select-options-list-empty-placeholder-color);
|
|
53
|
-
} .
|
|
54
|
-
.
|
|
53
|
+
} .select__l_1lw96 .select__emptyPlaceholder_1lw96,
|
|
54
|
+
.select__xl_1lw96 .select__emptyPlaceholder_1lw96 {
|
|
55
55
|
padding: var(--gap-xl) var(--gap-m);
|
|
56
56
|
}
|
|
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
14
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
15
15
|
|
|
16
|
-
var styles = {"component":"
|
|
16
|
+
var styles = {"component":"select__component_dwm0l"};
|
|
17
17
|
require('./index.css')
|
|
18
18
|
|
|
19
19
|
var Search = React.forwardRef(function (_a, ref) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: x278w */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
/* checkmark */
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
|
-
} .
|
|
26
|
+
} .select__component_dwm0l {
|
|
27
27
|
width: auto;
|
|
28
28
|
}
|
|
@@ -19,7 +19,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
19
19
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
20
20
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
21
21
|
|
|
22
|
-
var styles = {"virtualOptionsList":"
|
|
22
|
+
var styles = {"virtualOptionsList":"select__virtualOptionsList_12nzi","virtualOptionsListHeader":"select__virtualOptionsListHeader_12nzi","virtualOptionsListFooter":"select__virtualOptionsListFooter_12nzi","withBorder":"select__withBorder_12nzi","scrollable":"select__scrollable_12nzi","inner":"select__inner_12nzi","virtualRow":"select__virtualRow_12nzi","highlighted":"select__highlighted_12nzi","emptyPlaceholder":"select__emptyPlaceholder_12nzi","l":"select__l_12nzi","xl":"select__xl_12nzi"};
|
|
23
23
|
require('./index.css')
|
|
24
24
|
|
|
25
25
|
var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
@@ -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,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 186st */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-primary: #dcdcdd;
|
|
@@ -35,34 +35,34 @@
|
|
|
35
35
|
/* checkmark */
|
|
36
36
|
|
|
37
37
|
/* optgroup */
|
|
38
|
-
} .
|
|
38
|
+
} .select__virtualOptionsList_12nzi {
|
|
39
39
|
width: 100%;
|
|
40
40
|
outline: none;
|
|
41
41
|
box-sizing: border-box;
|
|
42
42
|
position: sticky;
|
|
43
|
-
} .
|
|
43
|
+
} .select__virtualOptionsListHeader_12nzi {
|
|
44
44
|
box-sizing: border-box;
|
|
45
45
|
border-bottom: 1px solid var(--color-light-border-secondary);
|
|
46
|
-
} .
|
|
46
|
+
} .select__virtualOptionsListFooter_12nzi {
|
|
47
47
|
position: sticky;
|
|
48
48
|
bottom: 0;
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
border-top: 1px solid transparent
|
|
51
|
-
} .
|
|
51
|
+
} .select__virtualOptionsListFooter_12nzi.select__withBorder_12nzi {
|
|
52
52
|
border-top: 1px solid var(--color-light-border-secondary);
|
|
53
|
-
} .
|
|
53
|
+
} .select__scrollable_12nzi {
|
|
54
54
|
position: relative;
|
|
55
55
|
overflow: auto;
|
|
56
56
|
width: 100%;
|
|
57
|
-
} .
|
|
57
|
+
} .select__inner_12nzi {
|
|
58
58
|
position: relative;
|
|
59
59
|
width: 100%;
|
|
60
|
-
} .
|
|
60
|
+
} .select__virtualRow_12nzi {
|
|
61
61
|
position: absolute;
|
|
62
62
|
top: 0;
|
|
63
63
|
left: 0;
|
|
64
64
|
width: 100%
|
|
65
|
-
} .
|
|
65
|
+
} .select__virtualRow_12nzi:before {
|
|
66
66
|
content: '';
|
|
67
67
|
position: absolute;
|
|
68
68
|
z-index: 1;
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
height: 1px;
|
|
73
73
|
background: var(--select-option-divider-background);
|
|
74
74
|
display: var(--select-option-divider-display);
|
|
75
|
-
} .
|
|
75
|
+
} .select__virtualRow_12nzi:first-child:before {
|
|
76
76
|
display: none;
|
|
77
|
-
} .
|
|
78
|
-
.
|
|
77
|
+
} .select__highlighted_12nzi:before,
|
|
78
|
+
.select__highlighted_12nzi + .select__virtualRow_12nzi:before {
|
|
79
79
|
display: none;
|
|
80
|
-
} .
|
|
80
|
+
} .select__emptyPlaceholder_12nzi {
|
|
81
81
|
padding: var(--gap-m) var(--gap-s);
|
|
82
82
|
color: var(--select-options-list-empty-placeholder-color);
|
|
83
|
-
} .
|
|
84
|
-
.
|
|
83
|
+
} .select__l_12nzi .select__emptyPlaceholder_12nzi,
|
|
84
|
+
.select__xl_12nzi .select__emptyPlaceholder_12nzi {
|
|
85
85
|
padding: var(--gap-xl) var(--gap-m);
|
|
86
86
|
}
|
|
@@ -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,
|
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-e63a15d0.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';
|
|
@@ -9,7 +9,7 @@ import { Optgroup } from './components/optgroup/Component.js';
|
|
|
9
9
|
import { Option } from './components/option/Component.js';
|
|
10
10
|
import { OptionsList } from './components/options-list/Component.js';
|
|
11
11
|
import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
12
|
-
import { u as useSelectWithApply } from './hook-
|
|
12
|
+
import { u as useSelectWithApply } from './hook-e63a15d0.js';
|
|
13
13
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
14
14
|
import 'classnames';
|
|
15
15
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -39,7 +39,7 @@ import '@alfalab/core-components-base-modal/esm';
|
|
|
39
39
|
import '@alfalab/core-components-button/esm/mobile';
|
|
40
40
|
import './components/virtual-options-list/Component.js';
|
|
41
41
|
import 'react-virtual';
|
|
42
|
-
import './hook-
|
|
42
|
+
import './hook-e63a15d0.js';
|
|
43
43
|
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
44
44
|
import '@alfalab/core-components-button/esm/desktop';
|
|
45
45
|
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
@@ -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_19zoj","open":"select__open_19zoj"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Arrow = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1eyum */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
/* checkmark */
|
|
27
27
|
|
|
28
28
|
/* optgroup */
|
|
29
|
-
} .
|
|
29
|
+
} .select__arrow_19zoj {
|
|
30
30
|
display: block;
|
|
31
31
|
width: 24px;
|
|
32
32
|
height: 24px;
|
|
33
33
|
color: var(--select-arrow-color);
|
|
34
34
|
|
|
35
35
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
36
|
-
} .
|
|
36
|
+
} .select__open_19zoj {
|
|
37
37
|
transform: var(--arrow-transform);
|
|
38
38
|
}
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/esm';
|
|
4
4
|
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
var styles = {"checkmark":"
|
|
6
|
+
var styles = {"checkmark":"select__checkmark_wvptr","single":"select__single_wvptr","selected":"select__selected_wvptr"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
var BaseCheckmark = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1ul90 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
/* checkmark */
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
|
-
} .
|
|
26
|
+
} .select__checkmark_wvptr {
|
|
27
27
|
flex-shrink: 0;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
} .
|
|
29
|
+
} .select__single_wvptr {
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
opacity: 0
|
|
34
|
-
} .
|
|
34
|
+
} .select__single_wvptr.select__selected_wvptr {
|
|
35
35
|
opacity: 1;
|
|
36
36
|
}
|
|
@@ -5,7 +5,7 @@ import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
|
5
5
|
import '@alfalab/core-components-checkbox/esm';
|
|
6
6
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
7
|
|
|
8
|
-
var styles = {"option":"
|
|
8
|
+
var styles = {"option":"select__option_fidy5","disabled":"select__disabled_fidy5","checkmarkBefore":"select__checkmarkBefore_fidy5","mobile":"select__mobile_fidy5","checkmarkAfter":"select__checkmarkAfter_fidy5","textContent":"select__textContent_fidy5","selected":"select__selected_fidy5","highlighted":"select__highlighted_fidy5","content":"select__content_fidy5"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
var BaseOption = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1t3jg */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
/* checkmark */
|
|
44
44
|
|
|
45
45
|
/* optgroup */
|
|
46
|
-
} .
|
|
46
|
+
} .select__option_fidy5 {
|
|
47
47
|
font-size: 16px;
|
|
48
48
|
line-height: 20px;
|
|
49
49
|
font-weight: 400;
|
|
@@ -60,32 +60,32 @@
|
|
|
60
60
|
position: relative;
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
min-height: var(--size-s-height)
|
|
63
|
-
} .
|
|
63
|
+
} .select__option_fidy5:not(.select__disabled_fidy5):active {
|
|
64
64
|
background: var(--select-option-active-background);
|
|
65
65
|
color: var(--select-option-active-color);
|
|
66
|
-
} .
|
|
66
|
+
} .select__option_fidy5.select__checkmarkBefore_fidy5 {
|
|
67
67
|
padding: 0 0 0 var(--gap-s)
|
|
68
|
-
} .
|
|
68
|
+
} .select__option_fidy5.select__checkmarkBefore_fidy5.select__mobile_fidy5 {
|
|
69
69
|
padding-left: var(--gap-m);
|
|
70
|
-
} .
|
|
70
|
+
} .select__option_fidy5.select__checkmarkAfter_fidy5 {
|
|
71
71
|
padding: 0 var(--gap-s) 0 0
|
|
72
|
-
} .
|
|
72
|
+
} .select__option_fidy5.select__checkmarkAfter_fidy5.select__mobile_fidy5 {
|
|
73
73
|
padding-right: var(--gap-l);
|
|
74
|
-
} .
|
|
74
|
+
} .select__option_fidy5.select__textContent_fidy5 {
|
|
75
75
|
padding: var(--gap-s)
|
|
76
|
-
} .
|
|
76
|
+
} .select__option_fidy5.select__textContent_fidy5.select__mobile_fidy5 {
|
|
77
77
|
padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
|
|
78
|
-
} .
|
|
78
|
+
} .select__selected_fidy5 {
|
|
79
79
|
background: var(--select-option-selected-background);
|
|
80
80
|
color: var(--select-option-selected-color);
|
|
81
81
|
cursor: default;
|
|
82
|
-
} .
|
|
82
|
+
} .select__highlighted_fidy5 {
|
|
83
83
|
background: var(--select-option-hover-background);
|
|
84
84
|
color: var(--select-option-hover-color);
|
|
85
|
-
} .
|
|
85
|
+
} .select__disabled_fidy5 {
|
|
86
86
|
cursor: var(--disabled-cursor);
|
|
87
87
|
background: var(--select-option-disabled-background);
|
|
88
88
|
color: var(--select-option-disabled-color);
|
|
89
|
-
} .
|
|
89
|
+
} .select__content_fidy5 {
|
|
90
90
|
flex: 1;
|
|
91
91
|
}
|
|
@@ -10,7 +10,7 @@ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
|
|
|
10
10
|
import { defaultAccessor, processOptions, defaultFilterFn } from '../../utils.js';
|
|
11
11
|
import { NativeSelect } from '../native-select/Component.js';
|
|
12
12
|
|
|
13
|
-
var styles = {"component":"
|
|
13
|
+
var styles = {"component":"select__component_1ba4q","popoverInner":"select__popoverInner_1ba4q","optionsList":"select__optionsList_1ba4q","optionsListBorder":"select__optionsListBorder_1ba4q","nativeSelect":"select__nativeSelect_1ba4q","block":"select__block_1ba4q","emptySearchPlaceholder":"select__emptySearchPlaceholder_1ba4q","search":"select__search_1ba4q"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var BaseSelect = forwardRef(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1hb7x */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
/* checkmark */
|
|
38
38
|
|
|
39
39
|
/* optgroup */
|
|
40
|
-
} .
|
|
40
|
+
} .select__component_1ba4q {
|
|
41
41
|
width: max-content;
|
|
42
42
|
position: relative;
|
|
43
43
|
outline: 0;
|
|
44
44
|
max-width: 100%;
|
|
45
|
-
} .
|
|
45
|
+
} .select__popoverInner_1ba4q {
|
|
46
46
|
padding-top: var(--select-options-list-offset);
|
|
47
47
|
padding-bottom: var(--select-options-list-offset);
|
|
48
48
|
box-shadow: none;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
background: transparent;
|
|
51
51
|
border-radius: 0;
|
|
52
52
|
position: relative;
|
|
53
|
-
} .
|
|
53
|
+
} .select__optionsList_1ba4q {
|
|
54
54
|
position: relative;
|
|
55
55
|
padding-top: var(--select-options-list-top-padding);
|
|
56
56
|
padding-bottom: var(--select-options-list-bottom-padding);
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
background: var(--select-option-background);
|
|
60
60
|
overflow: hidden;
|
|
61
61
|
will-change: transform;
|
|
62
|
-
} .
|
|
62
|
+
} .select__optionsListBorder_1ba4q {
|
|
63
63
|
position: absolute;
|
|
64
64
|
top: 0;
|
|
65
65
|
right: 0;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
box-shadow: inset 0 0 0 1px var(--color-light-border-secondary);
|
|
69
69
|
border-radius: inherit;
|
|
70
70
|
pointer-events: none;
|
|
71
|
-
} .
|
|
71
|
+
} .select__nativeSelect_1ba4q {
|
|
72
72
|
opacity: 0;
|
|
73
73
|
overflow: hidden;
|
|
74
74
|
position: absolute;
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
height: 100%;
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
z-index: 1;
|
|
84
|
-
} .
|
|
84
|
+
} .select__block_1ba4q {
|
|
85
85
|
width: 100%;
|
|
86
|
-
} .
|
|
86
|
+
} .select__emptySearchPlaceholder_1ba4q {
|
|
87
87
|
text-align: center;
|
|
88
|
-
} .
|
|
88
|
+
} .select__search_1ba4q {
|
|
89
89
|
margin: var(--gap-s) var(--gap-s) 0
|
|
90
|
-
} .
|
|
90
|
+
} .select__search_1ba4q:last-child {
|
|
91
91
|
margin-bottom: var(--gap-s);
|
|
92
92
|
} /* width: max-content; fix for IE */ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
93
|
-
.
|
|
93
|
+
.select__component_1ba4q {
|
|
94
94
|
float: left;
|
|
95
95
|
clear: left;
|
|
96
96
|
}
|
|
@@ -26,7 +26,7 @@ import '../../consts.js';
|
|
|
26
26
|
import '@alfalab/core-components-input/esm';
|
|
27
27
|
import '@alfalab/icons-glyph/MagnifierMIcon';
|
|
28
28
|
|
|
29
|
-
var styles = {"component":"
|
|
29
|
+
var styles = {"component":"select__component_r2ukf","sheet":"select__sheet_r2ukf","sheetContent":"select__sheetContent_r2ukf","modalContent":"select__modalContent_r2ukf","sheetContainer":"select__sheetContainer_r2ukf","block":"select__block_r2ukf","optionsListWrapper":"select__optionsListWrapper_r2ukf","optionsList":"select__optionsList_r2ukf","scrollbar":"select__scrollbar_r2ukf","emptySearchPlaceholder":"select__emptySearchPlaceholder_r2ukf","search":"select__search_r2ukf","option":"select__option_r2ukf","optionGroup":"select__optionGroup_r2ukf"};
|
|
30
30
|
require('./index.css')
|
|
31
31
|
|
|
32
32
|
var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
@@ -276,9 +276,9 @@ var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
|
276
276
|
scrollableContainerRef,
|
|
277
277
|
modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
|
|
278
278
|
]) }),
|
|
279
|
-
React.createElement(ModalMobile.Header, __assign({ hasCloser: true, sticky: true }, modalHeaderProps, { bottomAddons: React.createElement(React.Fragment, null,
|
|
279
|
+
React.createElement(ModalMobile.Header, __assign({ hasCloser: true, sticky: true }, modalHeaderProps, { title: undefined, bottomAddons: React.createElement(React.Fragment, null,
|
|
280
280
|
renderSearch(), modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 :
|
|
281
|
-
modalHeaderProps.bottomAddons) }), label || placeholder),
|
|
281
|
+
modalHeaderProps.bottomAddons) }), (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.title) || label || placeholder),
|
|
282
282
|
React.createElement(ModalMobile.Content, { flex: true, className: styles.modalContent }, renderOptionsList()),
|
|
283
283
|
(modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React.createElement(ModalMobile.Footer, __assign({}, modalFooterProps))))));
|
|
284
284
|
});
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { BaseModalContext } from '@alfalab/core-components-base-modal/esm';
|
|
4
4
|
import { ButtonMobile } from '@alfalab/core-components-button/esm/mobile';
|
|
5
5
|
|
|
6
|
-
var styles = {"footer":"
|
|
6
|
+
var styles = {"footer":"select__footer_ukgsb","button":"select__button_ukgsb","highlighted":"select__highlighted_ukgsb"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
var Footer = function (_a) {
|