@alfalab/core-components-select 17.14.0 → 17.14.2
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/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 +6 -6
- package/components/base-option/Component.js +1 -1
- package/components/base-option/index.css +15 -15
- package/components/base-select/Component.js +2 -2
- package/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +1 -1
- package/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/components/base-select/index.css +11 -11
- package/components/base-select/mobile.css +12 -12
- 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/clear-button/Component.js +1 -1
- package/components/clear-button/index.css +6 -6
- package/components/field/Component.js +1 -1
- package/components/field/index.css +12 -12
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +5 -5
- 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 +19 -19
- package/components/options-list/Component.js +1 -1
- package/components/options-list/index.css +11 -11
- package/components/search/Component.js +1 -1
- package/components/search/index.css +2 -2
- package/components/virtual-options-list/Component.js +2 -2
- package/components/virtual-options-list/index.css +15 -15
- package/cssm/components/virtual-options-list/Component.js +1 -1
- package/cssm/shared/index.js +1 -0
- package/cssm/utils.d.ts +2 -1
- package/cssm/utils.js +46 -0
- 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 +6 -6
- package/esm/components/base-option/Component.js +1 -1
- package/esm/components/base-option/index.css +15 -15
- package/esm/components/base-select/Component.js +2 -2
- package/esm/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/esm/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/esm/components/base-select/index.css +11 -11
- package/esm/components/base-select/mobile.css +12 -12
- 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/clear-button/Component.js +1 -1
- package/esm/components/clear-button/index.css +6 -6
- package/esm/components/field/Component.js +1 -1
- package/esm/components/field/index.css +12 -12
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +5 -5
- 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 +19 -19
- package/esm/components/options-list/Component.js +1 -1
- package/esm/components/options-list/index.css +11 -11
- package/esm/components/search/Component.js +1 -1
- package/esm/components/search/index.css +2 -2
- package/esm/components/virtual-options-list/Component.js +3 -3
- package/esm/components/virtual-options-list/index.css +15 -15
- package/esm/{list-popover-desktop-2b8c7de9.js → list-popover-desktop-887652b7.js} +1 -1
- package/esm/mobile/Component.mobile.js +1 -1
- package/esm/mobile.module-4e795c47.js +4 -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.js +2 -2
- package/esm/utils.d.ts +2 -1
- package/esm/utils.js +47 -2
- package/{list-popover-desktop-5be0267e.js → list-popover-desktop-cbc31679.js} +1 -1
- package/mobile/Component.mobile.js +1 -1
- package/mobile.module-1cf424b0.js +6 -0
- 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 +6 -6
- package/modern/components/base-option/Component.js +1 -1
- package/modern/components/base-option/index.css +15 -15
- package/modern/components/base-select/Component.js +2 -2
- package/modern/components/base-select/components/list-desktop/list-popover-desktop.js +1 -1
- package/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +1 -1
- package/modern/components/base-select/components/list-mobile/list-modal-mobile.js +1 -1
- package/modern/components/base-select/index.css +11 -11
- package/modern/components/base-select/mobile.css +12 -12
- 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/clear-button/Component.js +1 -1
- package/modern/components/clear-button/index.css +6 -6
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +12 -12
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +5 -5
- 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 +19 -19
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +11 -11
- package/modern/components/search/Component.js +1 -1
- package/modern/components/search/index.css +2 -2
- package/modern/components/virtual-options-list/Component.js +3 -3
- package/modern/components/virtual-options-list/index.css +15 -15
- package/modern/{list-popover-desktop-483aa9cb.js → list-popover-desktop-9ae81274.js} +1 -1
- package/modern/mobile/Component.mobile.js +1 -1
- package/modern/mobile.module-e9497052.js +4 -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.js +2 -2
- package/modern/utils.d.ts +2 -1
- package/modern/utils.js +44 -2
- package/moderncssm/components/virtual-options-list/Component.js +2 -2
- package/moderncssm/shared/index.js +1 -1
- package/moderncssm/utils.d.ts +2 -1
- package/moderncssm/utils.js +44 -2
- package/package.json +4 -4
- 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.js +2 -1
- package/src/components/virtual-options-list/Component.tsx +2 -2
- package/src/utils.ts +76 -0
- package/utils.d.ts +2 -1
- package/utils.js +46 -0
- package/esm/mobile.module-e0ef84c0.js +0 -4
- package/mobile.module-7c4bac8a.js +0 -6
- package/modern/mobile.module-cf121ed8.js +0 -4
- /package/esm/{hook-abcdce24.d.ts → hook-2671ed8c.d.ts} +0 -0
- /package/esm/{hook-abcdce24.js → hook-2671ed8c.js} +0 -0
- /package/esm/{list-popover-desktop-2b8c7de9.d.ts → list-popover-desktop-887652b7.d.ts} +0 -0
- /package/{hook-15f009ec.d.ts → hook-915ae008.d.ts} +0 -0
- /package/{hook-15f009ec.js → hook-915ae008.js} +0 -0
- /package/{list-popover-desktop-5be0267e.d.ts → list-popover-desktop-cbc31679.d.ts} +0 -0
- /package/modern/{hook-3f889408.d.ts → hook-3033a0ac.d.ts} +0 -0
- /package/modern/{hook-3f889408.js → hook-3033a0ac.js} +0 -0
- /package/modern/{list-popover-desktop-483aa9cb.d.ts → list-popover-desktop-9ae81274.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 35144 */
|
|
2
2
|
: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 */ /* 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 */
|
|
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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
/* checkmark */
|
|
28
28
|
|
|
29
29
|
/* optgroup */
|
|
30
|
-
} .
|
|
30
|
+
} .select__component_7il34.select__component_7il34 {
|
|
31
31
|
width: auto;
|
|
32
32
|
}
|
|
@@ -6,10 +6,10 @@ import { useMatchMedia } from '@alfalab/core-components-mq/modern';
|
|
|
6
6
|
import { Scrollbar } from '@alfalab/core-components-scrollbar/modern';
|
|
7
7
|
import { isClient } from '@alfalab/core-components-shared/modern';
|
|
8
8
|
import { SIZE_TO_CLASSNAME_MAP, DEFAULT_VISIBLE_OPTIONS } from '../../consts.js';
|
|
9
|
-
import { usePrevious, lastIndexOf,
|
|
9
|
+
import { usePrevious, lastIndexOf, useVirtualVisibleOptions, isGroup } from '../../utils.js';
|
|
10
10
|
import { Optgroup } from '../optgroup/Component.js';
|
|
11
11
|
|
|
12
|
-
const styles = {"virtualOptionsList":"
|
|
12
|
+
const styles = {"virtualOptionsList":"select__virtualOptionsList_d0h1g","virtualOptionsListHeader":"select__virtualOptionsListHeader_d0h1g","virtualOptionsListFooter":"select__virtualOptionsListFooter_d0h1g","withBorder":"select__withBorder_d0h1g","scrollable":"select__scrollable_d0h1g","inner":"select__inner_d0h1g","virtualRow":"select__virtualRow_d0h1g","highlighted":"select__highlighted_d0h1g","emptyPlaceholder":"select__emptyPlaceholder_d0h1g","size-64":"select__size-64_d0h1g","size-72":"select__size-72_d0h1g"};
|
|
13
13
|
require('./index.css')
|
|
14
14
|
|
|
15
15
|
const VirtualOptionsList = forwardRef(({ size = 48, flatOptions = [], highlightedIndex = -1, optionGroupClassName, className, getOptionProps, groupOptionProps = {}, Option, open, options = [], Optgroup: Optgroup$1 = Optgroup, dataTestId, emptyPlaceholder, visibleOptions = DEFAULT_VISIBLE_OPTIONS, header, footer, showFooter = true, optionsListWidth, onScroll, nativeScrollbar: nativeScrollbarProp, setHighlightedIndex, selectedItems, setSelectedItems, search, multiple, }, ref) => {
|
|
@@ -70,7 +70,7 @@ const VirtualOptionsList = forwardRef(({ size = 48, flatOptions = [], highlighte
|
|
|
70
70
|
.join('_'));
|
|
71
71
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
72
|
}, [rowVirtualizer.virtualItems.length, flatOptions]);
|
|
73
|
-
|
|
73
|
+
useVirtualVisibleOptions({
|
|
74
74
|
visibleOptions,
|
|
75
75
|
invalidate: visibleOptionsInvalidateKey,
|
|
76
76
|
listRef,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1305y */
|
|
2
2
|
: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 */ /* 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 */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-neutral-300: #e7e8eb;
|
|
@@ -43,35 +43,35 @@
|
|
|
43
43
|
/* checkmark */
|
|
44
44
|
|
|
45
45
|
/* optgroup */
|
|
46
|
-
} .
|
|
46
|
+
} .select__virtualOptionsList_d0h1g {
|
|
47
47
|
width: 100%;
|
|
48
48
|
outline: none;
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
position: sticky;
|
|
51
51
|
justify-content: space-between;
|
|
52
|
-
} .
|
|
52
|
+
} .select__virtualOptionsListHeader_d0h1g {
|
|
53
53
|
box-sizing: border-box;
|
|
54
54
|
border-bottom: 1px solid var(--color-light-neutral-300);
|
|
55
|
-
} .
|
|
55
|
+
} .select__virtualOptionsListFooter_d0h1g {
|
|
56
56
|
position: sticky;
|
|
57
57
|
bottom: var(--gap-0);
|
|
58
58
|
box-sizing: border-box;
|
|
59
59
|
border-top: 1px solid transparent
|
|
60
|
-
} .
|
|
60
|
+
} .select__virtualOptionsListFooter_d0h1g.select__withBorder_d0h1g {
|
|
61
61
|
border-top: 1px solid var(--color-light-neutral-300);
|
|
62
|
-
} .
|
|
62
|
+
} .select__scrollable_d0h1g {
|
|
63
63
|
position: relative;
|
|
64
64
|
overflow: auto;
|
|
65
65
|
width: 100%;
|
|
66
|
-
} .
|
|
66
|
+
} .select__inner_d0h1g {
|
|
67
67
|
position: relative;
|
|
68
68
|
width: 100%;
|
|
69
|
-
} .
|
|
69
|
+
} .select__virtualRow_d0h1g {
|
|
70
70
|
position: absolute;
|
|
71
71
|
top: var(--gap-0);
|
|
72
72
|
left: var(--gap-0);
|
|
73
73
|
width: 100%
|
|
74
|
-
} .
|
|
74
|
+
} .select__virtualRow_d0h1g:before {
|
|
75
75
|
content: '';
|
|
76
76
|
position: absolute;
|
|
77
77
|
z-index: 1;
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
height: 1px;
|
|
82
82
|
background: var(--select-option-divider-background);
|
|
83
83
|
display: var(--select-option-divider-display);
|
|
84
|
-
} .
|
|
84
|
+
} .select__virtualRow_d0h1g:first-child:before {
|
|
85
85
|
display: none;
|
|
86
|
-
} .
|
|
87
|
-
.
|
|
86
|
+
} .select__highlighted_d0h1g:before,
|
|
87
|
+
.select__highlighted_d0h1g + .select__virtualRow_d0h1g:before {
|
|
88
88
|
display: none;
|
|
89
|
-
} .
|
|
89
|
+
} .select__emptyPlaceholder_d0h1g {
|
|
90
90
|
padding: var(--gap-16) var(--gap-12);
|
|
91
91
|
color: var(--select-options-list-empty-placeholder-color);
|
|
92
92
|
flex: 1;
|
|
93
|
-
} .select__size-
|
|
94
|
-
.select__size-
|
|
93
|
+
} .select__size-64_d0h1g .select__emptyPlaceholder_d0h1g,
|
|
94
|
+
.select__size-72_d0h1g .select__emptyPlaceholder_d0h1g {
|
|
95
95
|
padding: var(--gap-24) var(--gap-16);
|
|
96
96
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
const styles = {"component":"
|
|
4
|
+
const styles = {"component":"select__component_1kggs","popoverInner":"select__popoverInner_1kggs","optionsListWrapper":"select__optionsListWrapper_1kggs","optionsListBorder":"select__optionsListBorder_1kggs","nativeSelect":"select__nativeSelect_1kggs","block":"select__block_1kggs","emptySearchPlaceholder":"select__emptySearchPlaceholder_1kggs","search":"select__search_1kggs"};
|
|
5
5
|
require('./components/base-select/index.css')
|
|
6
6
|
|
|
7
7
|
const ListPopoverDesktop = (props) => {
|
|
@@ -11,7 +11,7 @@ import { Option } from '../components/option/Component.js';
|
|
|
11
11
|
import { OptionsList } from '../components/options-list/Component.js';
|
|
12
12
|
import { Search } from '../components/search/Component.js';
|
|
13
13
|
import { VirtualOptionsList } from '../components/virtual-options-list/Component.js';
|
|
14
|
-
import { u as useSelectWithApply } from '../hook-
|
|
14
|
+
import { u as useSelectWithApply } from '../hook-3033a0ac.js';
|
|
15
15
|
import { Header } from '../presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
16
16
|
|
|
17
17
|
const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const mobileStyles = {"sheet":"select__sheet_1qwlo","sheetContent":"select__sheetContent_1qwlo","modalContent":"select__modalContent_1qwlo","sheetContainer":"select__sheetContainer_1qwlo","optionsListWrapper":"select__optionsListWrapper_1qwlo","optionsList":"select__optionsList_1qwlo","scrollbar":"select__scrollbar_1qwlo","search":"select__search_1qwlo","option":"select__option_1qwlo","optionGroup":"select__optionGroup_1qwlo"};
|
|
2
|
+
require('./components/base-select/mobile.css')
|
|
3
|
+
|
|
4
|
+
export { mobileStyles as m };
|
package/modern/presets/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { useSelectWithLoading } from './useSelectWithLoading/hook.js';
|
|
2
2
|
export { useLazyLoading } from './useLazyLoading/hook.js';
|
|
3
|
-
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-
|
|
3
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-3033a0ac.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import '../../../components/options-list/Component.js';
|
|
3
3
|
import '../../../consts.js';
|
|
4
|
-
export { O as OptionsListWithApply } from '../../../hook-
|
|
4
|
+
export { O as OptionsListWithApply } from '../../../hook-3033a0ac.js';
|
|
5
5
|
import './footer/Component.js';
|
|
6
6
|
import './header/Component.js';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ButtonDesktop } from '@alfalab/core-components-button/modern/desktop';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
4
4
|
|
|
5
|
-
const styles = {"footer":"
|
|
5
|
+
const styles = {"footer":"select__footer_1c2wo","button":"select__button_1c2wo"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Footer = ({ handleApply, handleClear, showClear, selectedDraft = [], dataTestId, }) => (React.createElement("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 31hjz */
|
|
2
2
|
: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 */ /* 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 */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-base-bg-primary: #fff; /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
--gap-12: var(--gap-s);
|
|
24
24
|
} :root {
|
|
25
25
|
} :root {
|
|
26
|
-
} /* сбрасывает синюю подсветку при нажатии */ .
|
|
26
|
+
} /* сбрасывает синюю подсветку при нажатии */ .select__footer_1c2wo {
|
|
27
27
|
background-color: var(--color-light-base-bg-primary);
|
|
28
28
|
padding: var(--gap-12);
|
|
29
29
|
outline: none
|
|
30
|
-
} .
|
|
30
|
+
} .select__footer_1c2wo > .select__button_1c2wo + .select__button_1c2wo {
|
|
31
31
|
margin-left: var(--gap-8);
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/modern';
|
|
4
4
|
|
|
5
|
-
const styles = {"desktop":"
|
|
5
|
+
const styles = {"desktop":"select__desktop_19sbe","mobile":"select__mobile_19sbe"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Header = ({ onChange, checked, indeterminate, mobile }) => (React.createElement("div", { className: cn({ [styles.desktop]: !mobile, [styles.mobile]: mobile }) },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1vth5 */
|
|
2
2
|
: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 */ /* 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 */
|
|
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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
--gap-12: var(--gap-s);
|
|
23
23
|
} :root {
|
|
24
24
|
} :root {
|
|
25
|
-
} /* сбрасывает синюю подсветку при нажатии */ .
|
|
25
|
+
} /* сбрасывает синюю подсветку при нажатии */ .select__desktop_19sbe {
|
|
26
26
|
padding: var(--gap-12);
|
|
27
|
-
} .
|
|
27
|
+
} .select__mobile_19sbe {
|
|
28
28
|
padding: var(--gap-12) var(--gap-8);
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../../hook-
|
|
1
|
+
export * from "../../../hook-3033a0ac";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { O as OptionsListWithApply } from '../../../hook-
|
|
1
|
+
export { O as OptionsListWithApply } from '../../../hook-3033a0ac.js';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Skeleton } from '@alfalab/core-components-skeleton/modern';
|
|
3
3
|
import { Option } from '../../components/option/Component.js';
|
|
4
4
|
|
|
5
|
-
const styles = {"skeleton":"
|
|
5
|
+
const styles = {"skeleton":"select__skeleton_18lwl"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
function useSelectWithLoading({ loading = false, visibleOptions = 6, Option: Option$1 = Option, }) {
|
package/modern/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { useSelectWithLoading } from '../presets/useSelectWithLoading/hook.js';
|
|
2
2
|
export { useLazyLoading } from '../presets/useLazyLoading/hook.js';
|
|
3
|
-
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-
|
|
4
|
-
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from '../utils.js';
|
|
3
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-3033a0ac.js';
|
|
4
|
+
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVirtualVisibleOptions, useVisibleOptions } from '../utils.js';
|
|
5
5
|
export { Option } from '../components/option/Component.js';
|
|
6
6
|
export { BaseOption } from '../components/base-option/Component.js';
|
|
7
7
|
export { OptionsList } from '../components/options-list/Component.js';
|
package/modern/utils.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ type useVisibleOptionsArgs = {
|
|
|
45
45
|
*/
|
|
46
46
|
actualOptionsCount?: boolean;
|
|
47
47
|
};
|
|
48
|
+
declare function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): void;
|
|
48
49
|
declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): boolean;
|
|
49
50
|
declare function defaultFilterFn(optionText: string, search: string): boolean;
|
|
50
51
|
declare function defaultGroupAccessor(option: GroupShape): string | undefined;
|
|
@@ -78,4 +79,4 @@ declare function getSelectTestIds(dataTestId: string): {
|
|
|
78
79
|
modalHeader: string;
|
|
79
80
|
modalContent: string;
|
|
80
81
|
};
|
|
81
|
-
export { isGroup, isOptionShape, joinOptions, processOptions, useVisibleOptions, defaultFilterFn, defaultGroupAccessor, defaultAccessor, usePrevious, lastIndexOf, getSelectTestIds };
|
|
82
|
+
export { isGroup, isOptionShape, joinOptions, processOptions, useVirtualVisibleOptions, useVisibleOptions, defaultFilterFn, defaultGroupAccessor, defaultAccessor, usePrevious, lastIndexOf, getSelectTestIds };
|
package/modern/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isValidElement, cloneElement,
|
|
1
|
+
import { isValidElement, cloneElement, useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { useIsMounted, fnUtils, getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
3
3
|
|
|
4
4
|
const isGroup = (item) => Object.prototype.hasOwnProperty.call(item, 'options');
|
|
@@ -68,6 +68,48 @@ function processOptions(options, selected = [], filterFn = () => true, filterGro
|
|
|
68
68
|
});
|
|
69
69
|
return { filteredOptions, flatOptions, selectedOptions };
|
|
70
70
|
}
|
|
71
|
+
// copy-paste of original `useVisibleOptions` before https://github.com/core-ds/core-components/pull/1368
|
|
72
|
+
function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef = listRef, open, invalidate, options, size, actualOptionsCount, }) {
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const measureOptionHeight = (element) => typeof size === 'number' ? Math.min(element.clientHeight, size) : element.clientHeight;
|
|
75
|
+
const list = listRef.current;
|
|
76
|
+
const styleTarget = styleTargetRef.current;
|
|
77
|
+
if (open && list && styleTarget && visibleOptions > 0) {
|
|
78
|
+
const childCount = list.children.length;
|
|
79
|
+
const optionsNodes = [].slice.call(list.children, 0, visibleOptions + 1);
|
|
80
|
+
let height = optionsNodes
|
|
81
|
+
.slice(0, visibleOptions)
|
|
82
|
+
.reduce((acc, child) => acc + measureOptionHeight(child), 0);
|
|
83
|
+
if (visibleOptions < childCount) {
|
|
84
|
+
const lastVisibleOptionHeight = measureOptionHeight(optionsNodes[optionsNodes.length - 1]);
|
|
85
|
+
// Если кол-во опций больше visibleOptions на 1, то показываем все опции, иначе добавляем половинку
|
|
86
|
+
height += Math.round(childCount - visibleOptions === 1
|
|
87
|
+
? lastVisibleOptionHeight
|
|
88
|
+
: lastVisibleOptionHeight / 2);
|
|
89
|
+
}
|
|
90
|
+
else if (visibleOptions > childCount &&
|
|
91
|
+
actualOptionsCount &&
|
|
92
|
+
typeof size === 'number') {
|
|
93
|
+
const actualCount = (options ?? []).reduce((sum, option) => sum + 1 + (isGroup(option) ? option.options.length : 0), 0);
|
|
94
|
+
height =
|
|
95
|
+
Math.min(actualCount === 0 ? /** empty placeholder */ 1 : actualCount, visibleOptions) * size;
|
|
96
|
+
if (visibleOptions < actualCount) {
|
|
97
|
+
height += size / 2;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
styleTarget.style.height = `${height}px`;
|
|
101
|
+
}
|
|
102
|
+
}, [
|
|
103
|
+
actualOptionsCount,
|
|
104
|
+
listRef,
|
|
105
|
+
open,
|
|
106
|
+
options,
|
|
107
|
+
size,
|
|
108
|
+
styleTargetRef,
|
|
109
|
+
visibleOptions,
|
|
110
|
+
invalidate,
|
|
111
|
+
]);
|
|
112
|
+
}
|
|
71
113
|
function useVisibleOptions({ visibleOptions, listRef, styleTargetRef = listRef, open, invalidate, options, size, actualOptionsCount, }) {
|
|
72
114
|
const [, runIfMounted] = useIsMounted();
|
|
73
115
|
const [measured, setMeasured] = useState(false);
|
|
@@ -181,4 +223,4 @@ function getSelectTestIds(dataTestId) {
|
|
|
181
223
|
};
|
|
182
224
|
}
|
|
183
225
|
|
|
184
|
-
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions };
|
|
226
|
+
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVirtualVisibleOptions, useVisibleOptions };
|
|
@@ -6,7 +6,7 @@ import { useMatchMedia } from '@alfalab/core-components-mq/moderncssm';
|
|
|
6
6
|
import { Scrollbar } from '@alfalab/core-components-scrollbar/moderncssm';
|
|
7
7
|
import { isClient } from '@alfalab/core-components-shared/moderncssm';
|
|
8
8
|
import { SIZE_TO_CLASSNAME_MAP, DEFAULT_VISIBLE_OPTIONS } from '../../consts.js';
|
|
9
|
-
import { usePrevious, lastIndexOf,
|
|
9
|
+
import { usePrevious, lastIndexOf, useVirtualVisibleOptions, isGroup } from '../../utils.js';
|
|
10
10
|
import { Optgroup } from '../optgroup/Component.js';
|
|
11
11
|
import styles from './index.module.css';
|
|
12
12
|
|
|
@@ -68,7 +68,7 @@ const VirtualOptionsList = forwardRef(({ size = 48, flatOptions = [], highlighte
|
|
|
68
68
|
.join('_'));
|
|
69
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
70
|
}, [rowVirtualizer.virtualItems.length, flatOptions]);
|
|
71
|
-
|
|
71
|
+
useVirtualVisibleOptions({
|
|
72
72
|
visibleOptions,
|
|
73
73
|
invalidate: visibleOptionsInvalidateKey,
|
|
74
74
|
listRef,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { useSelectWithLoading } from '../presets/useSelectWithLoading/hook.js';
|
|
2
2
|
export { useLazyLoading } from '../presets/useLazyLoading/hook.js';
|
|
3
3
|
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../hook-a8bc7fe8.js';
|
|
4
|
-
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from '../utils.js';
|
|
4
|
+
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVirtualVisibleOptions, useVisibleOptions } from '../utils.js';
|
|
5
5
|
export { Option } from '../components/option/Component.js';
|
|
6
6
|
export { BaseOption } from '../components/base-option/Component.js';
|
|
7
7
|
export { OptionsList } from '../components/options-list/Component.js';
|
package/moderncssm/utils.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ type useVisibleOptionsArgs = {
|
|
|
45
45
|
*/
|
|
46
46
|
actualOptionsCount?: boolean;
|
|
47
47
|
};
|
|
48
|
+
declare function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): void;
|
|
48
49
|
declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): boolean;
|
|
49
50
|
declare function defaultFilterFn(optionText: string, search: string): boolean;
|
|
50
51
|
declare function defaultGroupAccessor(option: GroupShape): string | undefined;
|
|
@@ -78,4 +79,4 @@ declare function getSelectTestIds(dataTestId: string): {
|
|
|
78
79
|
modalHeader: string;
|
|
79
80
|
modalContent: string;
|
|
80
81
|
};
|
|
81
|
-
export { isGroup, isOptionShape, joinOptions, processOptions, useVisibleOptions, defaultFilterFn, defaultGroupAccessor, defaultAccessor, usePrevious, lastIndexOf, getSelectTestIds };
|
|
82
|
+
export { isGroup, isOptionShape, joinOptions, processOptions, useVirtualVisibleOptions, useVisibleOptions, defaultFilterFn, defaultGroupAccessor, defaultAccessor, usePrevious, lastIndexOf, getSelectTestIds };
|
package/moderncssm/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isValidElement, cloneElement,
|
|
1
|
+
import { isValidElement, cloneElement, useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { useIsMounted, fnUtils, getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
3
3
|
|
|
4
4
|
const isGroup = (item) => Object.prototype.hasOwnProperty.call(item, 'options');
|
|
@@ -68,6 +68,48 @@ function processOptions(options, selected = [], filterFn = () => true, filterGro
|
|
|
68
68
|
});
|
|
69
69
|
return { filteredOptions, flatOptions, selectedOptions };
|
|
70
70
|
}
|
|
71
|
+
// copy-paste of original `useVisibleOptions` before https://github.com/core-ds/core-components/pull/1368
|
|
72
|
+
function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef = listRef, open, invalidate, options, size, actualOptionsCount, }) {
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const measureOptionHeight = (element) => typeof size === 'number' ? Math.min(element.clientHeight, size) : element.clientHeight;
|
|
75
|
+
const list = listRef.current;
|
|
76
|
+
const styleTarget = styleTargetRef.current;
|
|
77
|
+
if (open && list && styleTarget && visibleOptions > 0) {
|
|
78
|
+
const childCount = list.children.length;
|
|
79
|
+
const optionsNodes = [].slice.call(list.children, 0, visibleOptions + 1);
|
|
80
|
+
let height = optionsNodes
|
|
81
|
+
.slice(0, visibleOptions)
|
|
82
|
+
.reduce((acc, child) => acc + measureOptionHeight(child), 0);
|
|
83
|
+
if (visibleOptions < childCount) {
|
|
84
|
+
const lastVisibleOptionHeight = measureOptionHeight(optionsNodes[optionsNodes.length - 1]);
|
|
85
|
+
// Если кол-во опций больше visibleOptions на 1, то показываем все опции, иначе добавляем половинку
|
|
86
|
+
height += Math.round(childCount - visibleOptions === 1
|
|
87
|
+
? lastVisibleOptionHeight
|
|
88
|
+
: lastVisibleOptionHeight / 2);
|
|
89
|
+
}
|
|
90
|
+
else if (visibleOptions > childCount &&
|
|
91
|
+
actualOptionsCount &&
|
|
92
|
+
typeof size === 'number') {
|
|
93
|
+
const actualCount = (options ?? []).reduce((sum, option) => sum + 1 + (isGroup(option) ? option.options.length : 0), 0);
|
|
94
|
+
height =
|
|
95
|
+
Math.min(actualCount === 0 ? /** empty placeholder */ 1 : actualCount, visibleOptions) * size;
|
|
96
|
+
if (visibleOptions < actualCount) {
|
|
97
|
+
height += size / 2;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
styleTarget.style.height = `${height}px`;
|
|
101
|
+
}
|
|
102
|
+
}, [
|
|
103
|
+
actualOptionsCount,
|
|
104
|
+
listRef,
|
|
105
|
+
open,
|
|
106
|
+
options,
|
|
107
|
+
size,
|
|
108
|
+
styleTargetRef,
|
|
109
|
+
visibleOptions,
|
|
110
|
+
invalidate,
|
|
111
|
+
]);
|
|
112
|
+
}
|
|
71
113
|
function useVisibleOptions({ visibleOptions, listRef, styleTargetRef = listRef, open, invalidate, options, size, actualOptionsCount, }) {
|
|
72
114
|
const [, runIfMounted] = useIsMounted();
|
|
73
115
|
const [measured, setMeasured] = useState(false);
|
|
@@ -181,4 +223,4 @@ function getSelectTestIds(dataTestId) {
|
|
|
181
223
|
};
|
|
182
224
|
}
|
|
183
225
|
|
|
184
|
-
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions };
|
|
226
|
+
export { defaultAccessor, defaultFilterFn, defaultGroupAccessor, getSelectTestIds, isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVirtualVisibleOptions, useVisibleOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-select",
|
|
3
|
-
"version": "17.14.
|
|
3
|
+
"version": "17.14.2",
|
|
4
4
|
"description": "Select component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@alfalab/core-components-badge": "^5.6.1",
|
|
19
19
|
"@alfalab/core-components-base-modal": "^5.8.2",
|
|
20
|
-
"@alfalab/core-components-bottom-sheet": "^6.17.
|
|
20
|
+
"@alfalab/core-components-bottom-sheet": "^6.17.5",
|
|
21
21
|
"@alfalab/core-components-button": "^11.9.0",
|
|
22
|
-
"@alfalab/core-components-checkbox": "^4.7.
|
|
22
|
+
"@alfalab/core-components-checkbox": "^4.7.1",
|
|
23
23
|
"@alfalab/core-components-form-control": "^12.6.0",
|
|
24
24
|
"@alfalab/core-components-input": "^15.2.0",
|
|
25
|
-
"@alfalab/core-components-modal": "^9.7.
|
|
25
|
+
"@alfalab/core-components-modal": "^9.7.1",
|
|
26
26
|
"@alfalab/core-components-mq": "^4.3.0",
|
|
27
27
|
"@alfalab/core-components-popover": "^6.3.2",
|
|
28
28
|
"@alfalab/core-components-scrollbar": "^3.1.1",
|
package/presets/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var presets_useSelectWithLoading_hook = require('./useSelectWithLoading/hook.js');
|
|
6
6
|
var presets_useLazyLoading_hook = require('./useLazyLoading/hook.js');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../hook-915ae008.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -6,7 +6,7 @@ require('tslib');
|
|
|
6
6
|
require('react');
|
|
7
7
|
require('deep-equal');
|
|
8
8
|
require('../../utils.js');
|
|
9
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../hook-
|
|
9
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../hook-915ae008.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|