@alfalab/core-components-select 12.4.7 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{Component-c832d566.d.ts → Component-395c666f.d.ts} +0 -0
- package/{Component-c832d566.js → Component-395c666f.js} +8 -13
- package/{Component-0ae85b5e.d.ts → Component-6cb15433.d.ts} +5 -5
- package/{Component-0ae85b5e.js → Component-6cb15433.js} +28 -43
- package/Component-db573794.d.ts +73 -0
- package/Component.d.ts +10 -3
- package/Component.js +12 -12
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-select/Component.js +5 -5
- package/components/base-select/index.css +15 -9
- package/components/base-select/index.d.ts +1 -1
- package/components/base-select/index.js +5 -5
- package/components/base-select-mobile/Component.js +15 -15
- package/components/base-select-mobile/checkmark/Component.js +1 -1
- package/components/base-select-mobile/checkmark/index.css +4 -4
- package/components/base-select-mobile/index.css +12 -12
- package/components/base-select-mobile/index.d.ts +1 -1
- package/components/base-select-mobile/index.js +15 -15
- package/components/base-select-mobile/options-list/Component.js +2 -2
- package/components/base-select-mobile/options-list/index.css +9 -9
- package/components/base-select-mobile/options-list/index.js +1 -1
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +7 -7
- package/components/field/Component.d.ts +2 -22
- package/components/field/Component.js +3 -3
- package/components/field/index.css +9 -9
- package/components/field/index.js +2 -2
- package/components/index.js +18 -18
- package/components/native-select/Component.d.ts +2 -2
- package/components/native-select/Component.js +1 -1
- package/components/native-select/index.js +1 -1
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +2 -2
- package/components/option/index.css +20 -20
- package/components/option/index.js +1 -1
- package/components/options-list/Component.js +13 -19
- package/components/options-list/index.css +6 -6
- package/components/options-list/index.js +3 -3
- package/components/select-mobile/Component.js +15 -15
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +15 -15
- package/components/select-modal-mobile/Component.js +15 -15
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +15 -15
- package/components/virtual-options-list/Component.js +7 -10
- package/components/virtual-options-list/index.css +12 -12
- package/components/virtual-options-list/index.js +2 -2
- package/cssm/{Component-77d7e4fc.d.ts → Component-095a346d.d.ts} +5 -5
- package/cssm/{Component-77d7e4fc.js → Component-095a346d.js} +28 -43
- package/cssm/Component-db573794.d.ts +73 -0
- package/cssm/{Component-4bd2b7ec.d.ts → Component-f4dd589a.d.ts} +0 -0
- package/cssm/{Component-4bd2b7ec.js → Component-f4dd589a.js} +7 -12
- package/cssm/Component.d.ts +10 -3
- package/cssm/Component.js +15 -15
- package/cssm/components/base-select/Component.js +5 -5
- package/cssm/components/base-select/index.d.ts +1 -1
- package/cssm/components/base-select/index.js +5 -5
- package/cssm/components/base-select/index.module.css +8 -2
- package/cssm/components/base-select-mobile/Component.js +20 -20
- package/cssm/components/base-select-mobile/index.d.ts +1 -1
- package/cssm/components/base-select-mobile/index.js +20 -20
- package/cssm/components/base-select-mobile/index.module.css +1 -1
- package/cssm/components/base-select-mobile/options-list/Component.js +1 -1
- package/cssm/components/base-select-mobile/options-list/index.js +1 -1
- package/cssm/components/field/Component.d.ts +2 -22
- package/cssm/components/field/Component.js +2 -2
- package/cssm/components/field/index.js +2 -2
- package/cssm/components/index.js +23 -23
- package/cssm/components/native-select/Component.d.ts +2 -2
- package/cssm/components/native-select/Component.js +1 -1
- package/cssm/components/native-select/index.js +1 -1
- package/cssm/components/option/Component.js +1 -1
- package/cssm/components/option/index.js +1 -1
- package/cssm/components/options-list/Component.js +12 -18
- package/cssm/components/options-list/index.js +3 -3
- package/cssm/components/select-mobile/Component.js +20 -20
- package/cssm/components/select-mobile/index.d.ts +1 -1
- package/cssm/components/select-mobile/index.js +20 -20
- package/cssm/components/select-modal-mobile/Component.js +20 -20
- package/cssm/components/select-modal-mobile/index.d.ts +1 -1
- package/cssm/components/select-modal-mobile/index.js +20 -20
- package/cssm/components/virtual-options-list/Component.js +6 -9
- package/cssm/components/virtual-options-list/index.js +2 -2
- package/cssm/{hook-f5b8fe4f.d.ts → hook-edac5428.d.ts} +2 -4
- package/cssm/index.js +23 -23
- package/cssm/presets/index.d.ts +1 -1
- package/cssm/presets/index.js +20 -20
- package/cssm/presets/useLazyLoading/hook.d.ts +2 -2
- package/cssm/presets/useLazyLoading/hook.js +4 -4
- package/cssm/presets/useSelectWithApply/hook.js +20 -20
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +20 -20
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +20 -20
- package/cssm/presets/useSelectWithLoading/hook.js +1 -1
- package/{esm/tslib.es6-14867fac.d.ts → cssm/tslib.es6-0857346e.d.ts} +8 -4
- package/{tslib.es6-beb5d518.js → cssm/tslib.es6-0857346e.js} +12 -9
- package/cssm/typings.d.ts +2 -2
- package/cssm/utils.d.ts +2 -2
- package/esm/{Component-b4fcaaca.d.ts → Component-2cf53a63.d.ts} +5 -5
- package/esm/{Component-b4fcaaca.js → Component-2cf53a63.js} +28 -43
- package/esm/{Component-d190d712.d.ts → Component-878fd5fa.d.ts} +0 -0
- package/esm/{Component-d190d712.js → Component-878fd5fa.js} +8 -13
- package/esm/Component-db573794.d.ts +73 -0
- package/esm/Component.d.ts +10 -3
- package/esm/Component.js +12 -12
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-select/Component.js +5 -5
- package/esm/components/base-select/index.css +15 -9
- package/esm/components/base-select/index.d.ts +1 -1
- package/esm/components/base-select/index.js +5 -5
- package/esm/components/base-select-mobile/Component.js +15 -15
- package/esm/components/base-select-mobile/checkmark/Component.js +1 -1
- package/esm/components/base-select-mobile/checkmark/index.css +4 -4
- package/esm/components/base-select-mobile/index.css +12 -12
- package/esm/components/base-select-mobile/index.d.ts +1 -1
- package/esm/components/base-select-mobile/index.js +15 -15
- package/esm/components/base-select-mobile/options-list/Component.js +2 -2
- package/esm/components/base-select-mobile/options-list/index.css +9 -9
- package/esm/components/base-select-mobile/options-list/index.js +1 -1
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +7 -7
- package/esm/components/field/Component.d.ts +2 -22
- package/esm/components/field/Component.js +3 -3
- package/esm/components/field/index.css +9 -9
- package/esm/components/field/index.js +2 -2
- package/esm/components/index.js +15 -15
- package/esm/components/native-select/Component.d.ts +2 -2
- package/esm/components/native-select/Component.js +1 -1
- package/esm/components/native-select/index.js +1 -1
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +2 -2
- package/esm/components/option/index.css +20 -20
- package/esm/components/option/index.js +1 -1
- package/esm/components/options-list/Component.js +14 -20
- package/esm/components/options-list/index.css +6 -6
- package/esm/components/options-list/index.js +3 -3
- package/esm/components/select-mobile/Component.js +15 -15
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +15 -15
- package/esm/components/select-modal-mobile/Component.js +15 -15
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +15 -15
- package/esm/components/virtual-options-list/Component.js +7 -10
- package/esm/components/virtual-options-list/index.css +12 -12
- package/esm/components/virtual-options-list/index.js +2 -2
- package/{modern/hook-f5b8fe4f.d.ts → esm/hook-edac5428.d.ts} +2 -4
- package/esm/index.js +15 -15
- package/esm/{intersection-observer-a0b1a83f.d.ts → intersection-observer-5cff2265.d.ts} +0 -0
- package/esm/{intersection-observer-a0b1a83f.js → intersection-observer-5cff2265.js} +0 -0
- package/esm/presets/index.d.ts +1 -1
- package/esm/presets/index.js +15 -15
- package/esm/presets/useLazyLoading/hook.d.ts +2 -2
- package/esm/presets/useLazyLoading/hook.js +5 -5
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +15 -15
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +15 -15
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +15 -15
- package/esm/presets/useSelectWithLoading/hook.js +2 -2
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/{cssm/tslib.es6-f8106a15.d.ts → esm/tslib.es6-8ce25143.d.ts} +8 -4
- package/esm/{tslib.es6-14867fac.js → tslib.es6-8ce25143.js} +12 -9
- package/esm/typings.d.ts +2 -2
- package/esm/utils.d.ts +2 -2
- package/{hook-f5b8fe4f.d.ts → hook-edac5428.d.ts} +2 -4
- package/index.js +18 -18
- package/{intersection-observer-f01dee86.d.ts → intersection-observer-ecb8338a.d.ts} +0 -0
- package/{intersection-observer-f01dee86.js → intersection-observer-ecb8338a.js} +0 -0
- package/modern/{Component-538a2034.d.ts → Component-42762c09.d.ts} +0 -0
- package/modern/{Component-538a2034.js → Component-42762c09.js} +19 -22
- package/modern/{Component-8186c533.d.ts → Component-afb04bfc.d.ts} +5 -5
- package/modern/{Component-8186c533.js → Component-afb04bfc.js} +43 -61
- package/modern/Component-db573794.d.ts +73 -0
- package/modern/Component.d.ts +10 -3
- package/modern/Component.js +12 -12
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-select/Component.js +4 -4
- package/modern/components/base-select/index.css +15 -9
- package/modern/components/base-select/index.d.ts +1 -1
- package/modern/components/base-select/index.js +4 -4
- package/modern/components/base-select-mobile/Component.js +14 -14
- package/modern/components/base-select-mobile/checkmark/Component.js +1 -1
- package/modern/components/base-select-mobile/checkmark/index.css +4 -4
- package/modern/components/base-select-mobile/index.css +12 -12
- package/modern/components/base-select-mobile/index.d.ts +1 -1
- package/modern/components/base-select-mobile/index.js +14 -14
- package/modern/components/base-select-mobile/options-list/Component.js +2 -2
- package/modern/components/base-select-mobile/options-list/index.css +9 -9
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +7 -7
- package/modern/components/field/Component.d.ts +2 -22
- package/modern/components/field/Component.js +4 -4
- package/modern/components/field/index.css +9 -9
- package/modern/components/field/index.js +1 -1
- package/modern/components/index.js +14 -14
- package/modern/components/native-select/Component.d.ts +2 -2
- package/modern/components/native-select/Component.js +1 -1
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +3 -3
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +11 -15
- package/modern/components/options-list/index.css +6 -6
- package/modern/components/options-list/index.js +2 -2
- package/modern/components/select-mobile/Component.js +14 -14
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +14 -14
- package/modern/components/select-modal-mobile/Component.js +14 -14
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +14 -14
- package/modern/components/virtual-options-list/Component.js +18 -23
- package/modern/components/virtual-options-list/index.css +12 -12
- package/modern/components/virtual-options-list/index.js +1 -1
- package/{esm/hook-f5b8fe4f.d.ts → modern/hook-edac5428.d.ts} +2 -4
- package/modern/index.js +14 -14
- package/modern/{intersection-observer-a0b1a83f.d.ts → intersection-observer-5cff2265.d.ts} +0 -0
- package/modern/{intersection-observer-a0b1a83f.js → intersection-observer-5cff2265.js} +0 -0
- package/modern/presets/index.d.ts +1 -1
- package/modern/presets/index.js +14 -14
- package/modern/presets/useLazyLoading/hook.d.ts +2 -2
- package/modern/presets/useLazyLoading/hook.js +13 -15
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +14 -14
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +14 -14
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +14 -14
- package/modern/presets/useSelectWithLoading/hook.js +2 -2
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/typings.d.ts +2 -2
- package/modern/utils.d.ts +2 -2
- package/modern/utils.js +1 -1
- package/package.json +6 -6
- package/presets/index.d.ts +1 -1
- package/presets/index.js +15 -15
- package/presets/useLazyLoading/hook.d.ts +2 -2
- package/presets/useLazyLoading/hook.js +5 -5
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +15 -15
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +15 -15
- package/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +15 -15
- package/presets/useSelectWithLoading/hook.js +2 -2
- package/presets/useSelectWithLoading/index.css +2 -2
- package/{tslib.es6-beb5d518.d.ts → tslib.es6-401ce1ea.d.ts} +8 -4
- package/{cssm/tslib.es6-f8106a15.js → tslib.es6-401ce1ea.js} +12 -9
- package/typings.d.ts +2 -2
- package/utils.d.ts +2 -2
- package/Component-afce40e0.d.ts +0 -73
- package/cssm/Component-afce40e0.d.ts +0 -73
- package/esm/Component-afce40e0.d.ts +0 -73
- package/modern/Component-afce40e0.d.ts +0 -73
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
import React, { useMemo, useState, useRef, useCallback, useEffect, forwardRef } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import '@alfalab/hooks';
|
|
4
|
-
import '@alfalab/core-components-form-control/modern';
|
|
5
|
-
import { processOptions } from './utils.js';
|
|
6
|
-
import { Field } from './components/field/Component.js';
|
|
7
3
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
8
4
|
import { Arrow } from './components/arrow/Component.js';
|
|
9
5
|
import mergeRefs from 'react-merge-refs';
|
|
10
|
-
import '
|
|
6
|
+
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
7
|
+
import '@alfalab/hooks';
|
|
8
|
+
import { g as getDataTestId } from './Component-42762c09.js';
|
|
9
|
+
import { processOptions } from './utils.js';
|
|
10
|
+
import '@alfalab/core-components-form-control/modern';
|
|
11
|
+
import { Field } from './components/field/Component.js';
|
|
11
12
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
12
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
13
13
|
import '@alfalab/core-components-checkbox/modern';
|
|
14
14
|
import { Option } from './components/option/Component.js';
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
15
|
+
import '@alfalab/core-components-scrollbar/modern';
|
|
16
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
17
17
|
import './Component.js';
|
|
18
18
|
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/modern';
|
|
19
19
|
import { ModalMobile } from '@alfalab/core-components-modal/modern/mobile';
|
|
20
20
|
import { Button } from '@alfalab/core-components-button/modern';
|
|
21
|
-
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
22
21
|
import { Checkmark } from './components/base-select-mobile/checkmark/Component.js';
|
|
22
|
+
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
23
23
|
import 'react-virtual';
|
|
24
24
|
import '@alfalab/core-components-skeleton/modern';
|
|
25
|
-
import './intersection-observer-
|
|
25
|
+
import './intersection-observer-5cff2265.js';
|
|
26
26
|
|
|
27
27
|
const SELECT_ALL_KEY = 'select_all';
|
|
28
28
|
const selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
29
29
|
function useSelectWithApply({ options, selected, onChange = () => null, OptionsList, showClear = true, showSelectAll = false, }) {
|
|
30
|
-
const { flatOptions, selectedOptions } = useMemo(() => processOptions(options, selected), [
|
|
31
|
-
options,
|
|
32
|
-
selected,
|
|
33
|
-
]);
|
|
30
|
+
const { flatOptions, selectedOptions } = useMemo(() => processOptions(options, selected), [options, selected]);
|
|
34
31
|
const [selectedDraft, setSelectedDraft] = useState(selectedOptions);
|
|
35
32
|
const selectedOptionsRef = useRef(selectedOptions);
|
|
36
33
|
const handleApply = useCallback(() => {
|
|
@@ -63,7 +60,7 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
63
60
|
}
|
|
64
61
|
else {
|
|
65
62
|
setSelectedDraft(initiatorSelected
|
|
66
|
-
? selectedDraft.filter(o => o !== initiator)
|
|
63
|
+
? selectedDraft.filter((o) => o !== initiator)
|
|
67
64
|
: selectedDraft.concat(initiator));
|
|
68
65
|
}
|
|
69
66
|
}, [flatOptions, onChange, selectedDraft]);
|
|
@@ -93,7 +90,7 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
93
90
|
};
|
|
94
91
|
}
|
|
95
92
|
|
|
96
|
-
var styles = {"footer":"
|
|
93
|
+
var styles = {"footer":"select__footer_107uh","withBorder":"select__withBorder_107uh"};
|
|
97
94
|
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
98
95
|
|
|
99
96
|
const OptionsListWithApply = forwardRef(({ toggleMenu, OptionsList: OptionsList$1 = OptionsList, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = 5, ...restProps }, ref) => {
|
|
@@ -131,16 +128,16 @@ const OptionsListWithApply = forwardRef(({ toggleMenu, OptionsList: OptionsList$
|
|
|
131
128
|
};
|
|
132
129
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
130
|
}, []);
|
|
134
|
-
return (React.createElement(OptionsList$1,
|
|
131
|
+
return (React.createElement(OptionsList$1, { ...restProps, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React.createElement("div", {
|
|
135
132
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
136
133
|
tabIndex: 0, className: cn(styles.footer, {
|
|
137
134
|
[styles.withBorder]: visibleOptions && flatOptions.length > visibleOptions,
|
|
138
135
|
}), ref: footerRef },
|
|
139
136
|
React.createElement(Button, { size: 'xxs', view: 'primary', onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
140
|
-
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) }))
|
|
137
|
+
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) }));
|
|
141
138
|
});
|
|
142
139
|
|
|
143
|
-
var styles$1 = {"component":"
|
|
140
|
+
var styles$1 = {"component":"select__component_7qtci","popoverInner":"select__popoverInner_7qtci","sheet":"select__sheet_7qtci","sheetContent":"select__sheetContent_7qtci","sheetContainer":"select__sheetContainer_7qtci","block":"select__block_7qtci","option":"select__option_7qtci","optionGroup":"select__optionGroup_7qtci"};
|
|
144
141
|
require('./components/base-select-mobile/index.css')
|
|
145
142
|
|
|
146
143
|
const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, optionsListClassName, optionClassName, optionGroupClassName, optionsListProps, options, autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, name, id, selected, size = 'm', optionsSize = 'm', error, hint, block, label, labelView, placeholder, fieldProps = {}, optionProps = {}, valueRenderer, onChange, onOpen, onFocus, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, swipeable, footer, isBottomSheet, bottomSheetProps, }, ref) => {
|
|
@@ -149,15 +146,12 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
149
146
|
const listRef = useRef(null);
|
|
150
147
|
const initiatorRef = useRef(null);
|
|
151
148
|
const itemToString = (option) => (option ? option.key : '');
|
|
152
|
-
const { flatOptions, selectedOptions } = useMemo(() => processOptions(options, selected), [
|
|
153
|
-
options,
|
|
154
|
-
selected,
|
|
155
|
-
]);
|
|
149
|
+
const { flatOptions, selectedOptions } = useMemo(() => processOptions(options, selected), [options, selected]);
|
|
156
150
|
const selectedOptionsRef = useRef(selectedOptions);
|
|
157
151
|
const [selectedDraft, setSelectedDraft] = useState(selectedOptions);
|
|
158
152
|
const useMultipleSelectionProps = {
|
|
159
153
|
itemToString,
|
|
160
|
-
onSelectedItemsChange: changes => {
|
|
154
|
+
onSelectedItemsChange: (changes) => {
|
|
161
155
|
if (onChange) {
|
|
162
156
|
const { selectedItems = [] } = changes;
|
|
163
157
|
onChange({
|
|
@@ -189,7 +183,7 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
189
183
|
items: flatOptions,
|
|
190
184
|
itemToString,
|
|
191
185
|
defaultHighlightedIndex: -1,
|
|
192
|
-
onIsOpenChange: changes => {
|
|
186
|
+
onIsOpenChange: (changes) => {
|
|
193
187
|
if (onOpen) {
|
|
194
188
|
/**
|
|
195
189
|
* Вызываем обработчик асинхронно.
|
|
@@ -287,7 +281,7 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
287
281
|
openMenu();
|
|
288
282
|
}
|
|
289
283
|
};
|
|
290
|
-
const getOptionProps =
|
|
284
|
+
const getOptionProps = (option, index) => ({
|
|
291
285
|
...optionProps,
|
|
292
286
|
className: cn(styles$1.option, optionClassName),
|
|
293
287
|
innerProps: getItemProps({
|
|
@@ -304,17 +298,9 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
304
298
|
highlighted: index === highlightedIndex,
|
|
305
299
|
selected: selectedItems.includes(option),
|
|
306
300
|
dataTestId: getDataTestId(dataTestId, 'option'),
|
|
301
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
307
302
|
Checkmark: () => React.createElement(Checkmark, { selected: selectedItems.includes(option) }),
|
|
308
|
-
})
|
|
309
|
-
dataTestId,
|
|
310
|
-
getItemProps,
|
|
311
|
-
highlightedIndex,
|
|
312
|
-
multiple,
|
|
313
|
-
optionClassName,
|
|
314
|
-
optionProps,
|
|
315
|
-
optionsSize,
|
|
316
|
-
selectedItems,
|
|
317
|
-
]);
|
|
303
|
+
});
|
|
318
304
|
useEffect(() => {
|
|
319
305
|
if (defaultOpen)
|
|
320
306
|
openMenu();
|
|
@@ -325,26 +311,26 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
325
311
|
}
|
|
326
312
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
327
313
|
}, []);
|
|
328
|
-
const renderValue =
|
|
329
|
-
const handleApply =
|
|
314
|
+
const renderValue = () => selectedItems.map((option) => (React.createElement("input", { type: 'hidden', name: name, value: option.key, key: option.key })));
|
|
315
|
+
const handleApply = () => {
|
|
330
316
|
setSelectedDraft(selectedItems);
|
|
331
|
-
}
|
|
332
|
-
const handleClear =
|
|
317
|
+
};
|
|
318
|
+
const handleClear = () => {
|
|
333
319
|
setSelectedDraft([]);
|
|
334
320
|
setSelectedItems([]);
|
|
335
|
-
}
|
|
336
|
-
const handleClose =
|
|
321
|
+
};
|
|
322
|
+
const handleClose = () => {
|
|
337
323
|
if (multiple) {
|
|
338
324
|
setSelectedItems(selectedDraft);
|
|
339
325
|
}
|
|
340
326
|
toggleMenu();
|
|
341
|
-
}
|
|
342
|
-
return (React.createElement("div",
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
React.createElement(Field$1,
|
|
327
|
+
};
|
|
328
|
+
return (React.createElement("div", { ...getComboboxProps({
|
|
329
|
+
ref: rootRef,
|
|
330
|
+
...(disabled && { 'aria-disabled': true }),
|
|
331
|
+
className: cn(styles$1.component, { [styles$1.block]: block }, className),
|
|
332
|
+
}), onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) },
|
|
333
|
+
React.createElement(Field$1, { selectedMultiple: selectedDraft, selected: selectedItems[0], setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, multiple: multiple, open: open, disabled: disabled, size: size, placeholder: placeholder, label: label && React.createElement("span", { ...getLabelProps() }, label), labelView: labelView, Arrow: Arrow$1 && React.createElement(Arrow$1, { open: open }), error: error, hint: hint, valueRenderer: valueRenderer, className: fieldClassName, innerProps: {
|
|
348
334
|
onFocus: disabled ? undefined : handleFieldFocus,
|
|
349
335
|
onClick: disabled ? undefined : handleFieldClick,
|
|
350
336
|
tabIndex: disabled ? -1 : 0,
|
|
@@ -355,22 +341,18 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
355
341
|
'aria-autocomplete': autocomplete
|
|
356
342
|
? inputProps['aria-autocomplete']
|
|
357
343
|
: undefined,
|
|
358
|
-
}, dataTestId: getDataTestId(dataTestId, 'field')
|
|
344
|
+
}, dataTestId: getDataTestId(dataTestId, 'field'), ...fieldProps }),
|
|
359
345
|
name && renderValue(),
|
|
360
|
-
isBottomSheet ? (React.createElement(BottomSheet,
|
|
361
|
-
React.createElement("div",
|
|
362
|
-
React.createElement(OptionsListWithApply,
|
|
346
|
+
isBottomSheet ? (React.createElement(BottomSheet, { open: open, onClose: handleClose, className: styles$1.sheet, contentClassName: styles$1.sheetContent, containerClassName: styles$1.sheetContainer, title: placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, ...bottomSheetProps },
|
|
347
|
+
React.createElement("div", { ...menuProps, className: cn(optionsListClassName, styles$1.optionsList) },
|
|
348
|
+
React.createElement(OptionsListWithApply, { ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList$1, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles$1.optionGroup, optionGroupClassName), showFooter: multiple, onApply: handleApply, onClear: handleClear })))) : (React.createElement(ModalMobile, { open: open, onClose: handleClose, contentClassName: styles$1.sheetContent, hasCloser: true },
|
|
363
349
|
React.createElement(ModalMobile.Header, { hasCloser: true, title: placeholder, sticky: true, className: styles$1.sticky }),
|
|
364
|
-
React.createElement("div",
|
|
365
|
-
React.createElement(OptionsListWithApply,
|
|
350
|
+
React.createElement("div", { ...menuProps, className: cn(optionsListClassName, styles$1.optionsList) },
|
|
351
|
+
React.createElement(OptionsListWithApply, { ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList$1, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles$1.optionGroup, optionGroupClassName), showFooter: multiple, onApply: handleApply, onClear: handleClear }))))));
|
|
366
352
|
});
|
|
367
353
|
|
|
368
|
-
const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => {
|
|
369
|
-
return (React.createElement(BaseSelectMobile, Object.assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true }, restProps)));
|
|
370
|
-
});
|
|
354
|
+
const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true, ...restProps })));
|
|
371
355
|
|
|
372
|
-
const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => {
|
|
373
|
-
return (React.createElement(BaseSelectMobile, Object.assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false }, restProps)));
|
|
374
|
-
});
|
|
356
|
+
const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, ...restProps })));
|
|
375
357
|
|
|
376
358
|
export { BaseSelectMobile as B, OptionsListWithApply as O, SelectMobile as S, SelectModalMobile as a, SELECT_ALL_KEY as b, useSelectWithApply as u };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ElementType, FC } from "react";
|
|
4
|
+
import { ButtonProps } from "@alfalab/core-components-button";
|
|
5
|
+
type IconButtonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Компонент иконки
|
|
8
|
+
*/
|
|
9
|
+
icon: ElementType<{
|
|
10
|
+
className?: string;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Тип кнопки
|
|
14
|
+
*/
|
|
15
|
+
view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
|
|
16
|
+
/**
|
|
17
|
+
* Размер компонента
|
|
18
|
+
*/
|
|
19
|
+
size?: "xxs" | "xs" | "s";
|
|
20
|
+
/**
|
|
21
|
+
* Дополнительный класс
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
26
|
+
*/
|
|
27
|
+
dataTestId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Набор цветов для компонента
|
|
30
|
+
*/
|
|
31
|
+
colors?: "default" | "inverted";
|
|
32
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
|
|
33
|
+
declare const IconButton: React.ForwardRefExoticComponent<{
|
|
34
|
+
icon: ElementType<{
|
|
35
|
+
className?: string;
|
|
36
|
+
}>;
|
|
37
|
+
view?: "primary" | "secondary" | "tertiary" | "transparent" | "negative" | undefined;
|
|
38
|
+
size?: "s" | "xs" | "xxs" | undefined;
|
|
39
|
+
className?: string | undefined;
|
|
40
|
+
dataTestId?: string | undefined;
|
|
41
|
+
colors?: "default" | "inverted" | undefined;
|
|
42
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
type CloserProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
44
|
+
/**
|
|
45
|
+
* Дополнительный класс
|
|
46
|
+
*/
|
|
47
|
+
className?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Позиция крестика
|
|
50
|
+
*/
|
|
51
|
+
align?: 'left' | 'right';
|
|
52
|
+
/**
|
|
53
|
+
* Размер кнопки
|
|
54
|
+
*/
|
|
55
|
+
size?: IconButtonProps['size'];
|
|
56
|
+
/**
|
|
57
|
+
* Фиксирует крестик
|
|
58
|
+
*/
|
|
59
|
+
sticky?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Иконка
|
|
62
|
+
*/
|
|
63
|
+
icon?: ElementType;
|
|
64
|
+
/**
|
|
65
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
66
|
+
*/
|
|
67
|
+
dataTestId?: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated Компонент только для внутреннего использования. Используйте <Header />
|
|
71
|
+
*/
|
|
72
|
+
declare const Closer: FC<CloserProps>;
|
|
73
|
+
export { IconButtonProps, IconButton, CloserProps, Closer };
|
package/modern/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
4
4
|
import { BaseSelectProps } from "./typings";
|
|
5
5
|
type FormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
/**
|
|
@@ -19,6 +19,10 @@ type FormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
19
19
|
* Заблокированное состояние
|
|
20
20
|
*/
|
|
21
21
|
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Cостояние только для чтения
|
|
24
|
+
*/
|
|
25
|
+
readOnly?: boolean;
|
|
22
26
|
/**
|
|
23
27
|
* Заполненное состояние
|
|
24
28
|
*/
|
|
@@ -86,15 +90,18 @@ type SelectProps = Omit<BaseSelectProps, 'fieldProps'> & {
|
|
|
86
90
|
*/
|
|
87
91
|
fieldProps?: FormControlProps & Record<string, unknown>;
|
|
88
92
|
};
|
|
89
|
-
declare const Select: React.ForwardRefExoticComponent<
|
|
93
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "fieldProps"> & {
|
|
90
94
|
/**
|
|
91
95
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
92
96
|
*/
|
|
93
97
|
fieldProps?: (React.HTMLAttributes<HTMLDivElement> & {
|
|
94
98
|
block?: boolean | undefined;
|
|
95
99
|
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
96
|
-
colors?: "default" | "inverted" | undefined;
|
|
100
|
+
colors?: "default" | "inverted" | undefined; /**
|
|
101
|
+
* Пропсы, которые будут прокинуты в компонент поля
|
|
102
|
+
*/
|
|
97
103
|
disabled?: boolean | undefined;
|
|
104
|
+
readOnly?: boolean | undefined;
|
|
98
105
|
filled?: boolean | undefined;
|
|
99
106
|
focused?: boolean | undefined;
|
|
100
107
|
error?: React.ReactNode;
|
package/modern/Component.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import 'classnames';
|
|
3
|
-
import '@alfalab/hooks';
|
|
4
|
-
import '@alfalab/core-components-form-control/modern';
|
|
5
|
-
import './utils.js';
|
|
6
|
-
import { Field } from './components/field/Component.js';
|
|
7
3
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
8
4
|
import { Arrow } from './components/arrow/Component.js';
|
|
9
5
|
import 'react-merge-refs';
|
|
10
|
-
import '@
|
|
6
|
+
import '@juggle/resize-observer';
|
|
7
|
+
import 'downshift';
|
|
8
|
+
import '@alfalab/core-components-popover/modern';
|
|
9
|
+
import '@alfalab/hooks';
|
|
10
|
+
import { B as BaseSelect } from './Component-42762c09.js';
|
|
11
|
+
import './utils.js';
|
|
12
|
+
import './components/native-select/Component.js';
|
|
13
|
+
import '@alfalab/core-components-form-control/modern';
|
|
14
|
+
import { Field } from './components/field/Component.js';
|
|
11
15
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
12
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
13
16
|
import '@alfalab/core-components-checkbox/modern';
|
|
14
17
|
import './components/checkmark/Component.js';
|
|
15
18
|
import { Option } from './components/option/Component.js';
|
|
16
|
-
import '@
|
|
17
|
-
import '
|
|
18
|
-
import 'downshift';
|
|
19
|
-
import './components/native-select/Component.js';
|
|
20
|
-
import { B as BaseSelect } from './Component-538a2034.js';
|
|
19
|
+
import '@alfalab/core-components-scrollbar/modern';
|
|
20
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
21
21
|
|
|
22
|
-
const Select = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => (React.createElement(BaseSelect,
|
|
22
|
+
const Select = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, Option: Option$1, Field: Field$1, Optgroup: Optgroup$1, OptionsList: OptionsList$1, Arrow: Arrow$1, ...restProps })));
|
|
23
23
|
|
|
24
24
|
export { Select };
|
|
@@ -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_1lre0","open":"select__open_1lre0"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Arrow = ({ open, className }) => (React.createElement(ChevronDownMIcon, { className: cn(styles.arrow, className, { [styles.open]: open }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1dllh */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-graphic-primary: #0b1f35;
|
|
4
4
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.select__arrow_1lre0 {
|
|
28
28
|
display: block;
|
|
29
29
|
width: 24px;
|
|
30
30
|
height: 24px;
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.select__open_1lre0 {
|
|
36
36
|
transform: var(--arrow-transform);
|
|
37
37
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import 'classnames';
|
|
3
|
-
import '@alfalab/hooks';
|
|
4
|
-
import '../../utils.js';
|
|
5
3
|
import 'react-merge-refs';
|
|
6
4
|
import '@juggle/resize-observer';
|
|
7
|
-
import '@alfalab/core-components-popover/modern';
|
|
8
5
|
import 'downshift';
|
|
6
|
+
import '@alfalab/core-components-popover/modern';
|
|
7
|
+
import '@alfalab/hooks';
|
|
8
|
+
export { B as BaseSelect } from '../../Component-42762c09.js';
|
|
9
|
+
import '../../utils.js';
|
|
9
10
|
import '../native-select/Component.js';
|
|
10
|
-
export { B as BaseSelect } from '../../Component-538a2034.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1zyxb */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -11,13 +11,19 @@
|
|
|
11
11
|
|
|
12
12
|
/* Hard up */
|
|
13
13
|
}
|
|
14
|
+
:root {
|
|
15
|
+
--gap-2xs: 4px;
|
|
16
|
+
}
|
|
17
|
+
:root {
|
|
18
|
+
--border-radius-m: 8px;
|
|
19
|
+
}
|
|
14
20
|
:root {
|
|
15
21
|
|
|
16
22
|
/* options list */
|
|
17
23
|
|
|
18
|
-
--select-options-list-border-radius:
|
|
24
|
+
--select-options-list-border-radius: var(--border-radius-m);
|
|
19
25
|
--select-options-list-box-shadow: var(--shadow-m);
|
|
20
|
-
--select-options-list-offset:
|
|
26
|
+
--select-options-list-offset: var(--gap-2xs);
|
|
21
27
|
--select-options-list-top-padding: 0;
|
|
22
28
|
--select-options-list-bottom-padding: 0;
|
|
23
29
|
|
|
@@ -28,12 +34,12 @@
|
|
|
28
34
|
|
|
29
35
|
/* optgroup */
|
|
30
36
|
}
|
|
31
|
-
.
|
|
37
|
+
.select__component_549gu {
|
|
32
38
|
width: max-content;
|
|
33
39
|
position: relative;
|
|
34
40
|
outline: 0;
|
|
35
41
|
}
|
|
36
|
-
.
|
|
42
|
+
.select__popoverInner_549gu {
|
|
37
43
|
padding-top: var(--select-options-list-offset);
|
|
38
44
|
padding-bottom: var(--select-options-list-offset);
|
|
39
45
|
box-shadow: none;
|
|
@@ -42,7 +48,7 @@
|
|
|
42
48
|
border-radius: 0;
|
|
43
49
|
position: relative;
|
|
44
50
|
}
|
|
45
|
-
.
|
|
51
|
+
.select__optionsList_549gu {
|
|
46
52
|
padding-top: var(--select-options-list-top-padding);
|
|
47
53
|
padding-bottom: var(--select-options-list-bottom-padding);
|
|
48
54
|
box-shadow: var(--select-options-list-box-shadow);
|
|
@@ -51,7 +57,7 @@
|
|
|
51
57
|
overflow: hidden;
|
|
52
58
|
will-change: transform;
|
|
53
59
|
}
|
|
54
|
-
.
|
|
60
|
+
.select__nativeSelect_549gu {
|
|
55
61
|
opacity: 0;
|
|
56
62
|
overflow: hidden;
|
|
57
63
|
position: absolute;
|
|
@@ -65,12 +71,12 @@
|
|
|
65
71
|
cursor: pointer;
|
|
66
72
|
z-index: 1;
|
|
67
73
|
}
|
|
68
|
-
.
|
|
74
|
+
.select__block_549gu {
|
|
69
75
|
width: 100%;
|
|
70
76
|
}
|
|
71
77
|
/* width: max-content; fix for IE */
|
|
72
78
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
73
|
-
.
|
|
79
|
+
.select__component_549gu {
|
|
74
80
|
float: left;
|
|
75
81
|
clear: left;
|
|
76
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-42762c09";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import 'classnames';
|
|
3
|
-
import '@alfalab/hooks';
|
|
4
|
-
import '../../utils.js';
|
|
5
3
|
import 'react-merge-refs';
|
|
6
4
|
import '@juggle/resize-observer';
|
|
7
|
-
import '@alfalab/core-components-popover/modern';
|
|
8
5
|
import 'downshift';
|
|
6
|
+
import '@alfalab/core-components-popover/modern';
|
|
7
|
+
import '@alfalab/hooks';
|
|
8
|
+
export { B as BaseSelect } from '../../Component-42762c09.js';
|
|
9
|
+
import '../../utils.js';
|
|
9
10
|
import '../native-select/Component.js';
|
|
10
|
-
export { B as BaseSelect } from '../../Component-538a2034.js';
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import 'classnames';
|
|
3
|
-
import '@alfalab/hooks';
|
|
4
|
-
import '@alfalab/core-components-form-control/modern';
|
|
5
|
-
import '../../utils.js';
|
|
6
|
-
import '../field/Component.js';
|
|
7
3
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
8
4
|
import '../arrow/Component.js';
|
|
9
5
|
import 'react-merge-refs';
|
|
10
|
-
import '@
|
|
6
|
+
import '@juggle/resize-observer';
|
|
7
|
+
import 'downshift';
|
|
8
|
+
import '@alfalab/core-components-popover/modern';
|
|
9
|
+
import '@alfalab/hooks';
|
|
10
|
+
import '../../Component-42762c09.js';
|
|
11
|
+
import '../../utils.js';
|
|
12
|
+
import '../native-select/Component.js';
|
|
13
|
+
import '@alfalab/core-components-form-control/modern';
|
|
14
|
+
import '../field/Component.js';
|
|
11
15
|
import '../optgroup/Component.js';
|
|
12
|
-
import '../options-list/Component.js';
|
|
13
16
|
import '@alfalab/core-components-checkbox/modern';
|
|
14
17
|
import '../checkmark/Component.js';
|
|
15
18
|
import '../option/Component.js';
|
|
16
|
-
import '@
|
|
17
|
-
import '
|
|
18
|
-
import 'downshift';
|
|
19
|
-
import '../native-select/Component.js';
|
|
20
|
-
import '../../Component-538a2034.js';
|
|
19
|
+
import '@alfalab/core-components-scrollbar/modern';
|
|
20
|
+
import '../options-list/Component.js';
|
|
21
21
|
import '../../Component.js';
|
|
22
22
|
import '@alfalab/core-components-bottom-sheet/modern';
|
|
23
23
|
import '@alfalab/core-components-modal/modern/mobile';
|
|
24
24
|
import '@alfalab/core-components-button/modern';
|
|
25
|
+
export { B as BaseSelectMobile } from '../../Component-afb04bfc.js';
|
|
26
|
+
import './checkmark/Component.js';
|
|
25
27
|
import '@alfalab/core-components-base-modal/modern';
|
|
26
28
|
import './options-list/Component.js';
|
|
27
|
-
import './checkmark/Component.js';
|
|
28
|
-
export { B as BaseSelectMobile } from '../../Component-8186c533.js';
|
|
29
29
|
import 'react-virtual';
|
|
30
30
|
import '@alfalab/core-components-skeleton/modern';
|
|
31
|
-
import '../../intersection-observer-
|
|
31
|
+
import '../../intersection-observer-5cff2265.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
|
|
4
|
-
var styles = {"checkmark":"
|
|
4
|
+
var styles = {"checkmark":"select__checkmark_g5iox","selected":"select__selected_g5iox"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
const Checkmark = ({ selected, className }) => (React.createElement("span", { className: cn(styles.checkmark, className, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: qw0i6 */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* optgroup */
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.select__checkmark_g5iox {
|
|
22
22
|
flex-shrink: 0;
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
height: 24px;
|
|
30
30
|
opacity: 0
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.select__checkmark_g5iox:first-child {
|
|
33
33
|
display: none;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.select__checkmark_g5iox.select__selected_g5iox {
|
|
36
36
|
opacity: 1;
|
|
37
37
|
}
|