@alfalab/core-components-select 13.2.1 → 13.2.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/{Component-696851ef.d.ts → Component-4e5b4c78.d.ts} +0 -0
- package/{Component-696851ef.js → Component-4e5b4c78.js} +78 -84
- package/{Component-d956e288.d.ts → Component-dc8aa97a.d.ts} +0 -0
- package/{Component-d956e288.js → Component-dc8aa97a.js} +14 -20
- package/Component.d.ts +4 -26
- package/Component.js +10 -16
- package/Component.responsive.d.ts +19 -0
- package/Component.responsive.js +50 -0
- package/components/arrow/Component.js +2 -9
- package/components/arrow/index.css +3 -3
- package/components/arrow/index.js +1 -3
- package/components/base-checkmark/Component.js +4 -11
- package/components/base-checkmark/index.css +4 -4
- package/components/base-checkmark/index.js +2 -4
- package/components/base-option/Component.js +7 -14
- package/components/base-option/index.css +11 -11
- package/components/base-option/index.js +4 -6
- package/components/base-select/Component.js +3 -5
- package/components/base-select/index.css +7 -7
- package/components/base-select/index.d.ts +1 -1
- package/components/base-select/index.js +3 -5
- package/components/base-select-mobile/Component.js +25 -27
- package/components/base-select-mobile/checkmark/Component.js +4 -11
- package/components/base-select-mobile/checkmark/index.css +6 -6
- package/components/base-select-mobile/checkmark/index.js +1 -3
- package/components/base-select-mobile/index.css +11 -11
- package/components/base-select-mobile/index.d.ts +1 -1
- package/components/base-select-mobile/index.js +19 -21
- package/components/base-select-mobile/options-list/Component.js +11 -18
- package/components/base-select-mobile/options-list/index.css +9 -9
- package/components/base-select-mobile/options-list/index.js +4 -6
- package/components/checkmark/Component.js +5 -12
- package/components/checkmark/index.css +8 -8
- package/components/checkmark/index.js +2 -4
- package/components/field/Component.js +11 -18
- package/components/field/index.css +9 -9
- package/components/field/index.js +3 -5
- package/components/index.js +21 -23
- package/components/native-select/Component.js +5 -11
- package/components/native-select/index.js +2 -4
- package/components/optgroup/Component.js +4 -11
- package/components/optgroup/index.css +6 -6
- package/components/optgroup/index.js +1 -3
- package/components/option/Component.js +8 -15
- package/components/option/index.css +20 -20
- package/components/option/index.js +4 -6
- package/components/options-list/Component.js +11 -19
- package/components/options-list/index.css +6 -6
- package/components/options-list/index.js +4 -6
- package/components/select-mobile/Component.js +21 -23
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +19 -21
- package/components/select-modal-mobile/Component.js +21 -23
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +19 -21
- package/components/virtual-options-list/Component.js +14 -21
- package/components/virtual-options-list/index.css +12 -12
- package/components/virtual-options-list/index.js +4 -6
- package/cssm/{Component-f4dd589a.d.ts → Component-07f6200f.d.ts} +0 -0
- package/cssm/{Component-f4dd589a.js → Component-07f6200f.js} +13 -20
- package/cssm/{Component-a41f165e.d.ts → Component-b5c43f14.d.ts} +0 -0
- package/cssm/{Component-a41f165e.js → Component-b5c43f14.js} +81 -89
- package/cssm/Component.d.ts +4 -26
- package/cssm/Component.js +10 -16
- package/cssm/Component.responsive.d.ts +19 -0
- package/cssm/Component.responsive.js +66 -0
- package/cssm/components/arrow/Component.js +1 -9
- package/cssm/components/arrow/index.js +1 -3
- package/cssm/components/base-checkmark/Component.js +6 -14
- package/cssm/components/base-checkmark/index.js +2 -4
- package/cssm/components/base-option/Component.js +14 -22
- package/cssm/components/base-option/index.js +4 -6
- package/cssm/components/base-select/Component.js +3 -5
- package/cssm/components/base-select/index.d.ts +1 -1
- package/cssm/components/base-select/index.js +3 -5
- package/cssm/components/base-select-mobile/Component.js +31 -33
- package/cssm/components/base-select-mobile/checkmark/Component.js +4 -12
- package/cssm/components/base-select-mobile/checkmark/index.js +1 -3
- package/cssm/components/base-select-mobile/index.d.ts +1 -1
- package/cssm/components/base-select-mobile/index.js +25 -27
- package/cssm/components/base-select-mobile/options-list/Component.js +12 -20
- package/cssm/components/base-select-mobile/options-list/index.js +5 -7
- package/cssm/components/checkmark/Component.js +7 -15
- package/cssm/components/checkmark/index.js +2 -4
- package/cssm/components/field/Component.js +12 -20
- package/cssm/components/field/index.js +3 -5
- package/cssm/components/index.js +26 -28
- package/cssm/components/native-select/Component.js +5 -11
- package/cssm/components/native-select/index.js +2 -4
- package/cssm/components/optgroup/Component.js +3 -11
- package/cssm/components/optgroup/index.js +1 -3
- package/cssm/components/option/Component.js +12 -20
- package/cssm/components/option/index.js +4 -6
- package/cssm/components/options-list/Component.js +11 -20
- package/cssm/components/options-list/index.js +5 -7
- package/cssm/components/select-mobile/Component.js +28 -30
- package/cssm/components/select-mobile/index.d.ts +1 -1
- package/cssm/components/select-mobile/index.js +25 -27
- package/cssm/components/select-modal-mobile/Component.js +28 -30
- package/cssm/components/select-modal-mobile/index.d.ts +1 -1
- package/cssm/components/select-modal-mobile/index.js +25 -27
- package/cssm/components/virtual-options-list/Component.js +16 -24
- package/cssm/components/virtual-options-list/index.js +5 -7
- package/cssm/getDataTestId-3fe0d3e6.d.ts +1 -1
- package/cssm/index.js +37 -39
- package/cssm/{intersection-observer-8c55e13a.d.ts → intersection-observer-9ec5cf59.d.ts} +0 -0
- package/cssm/{intersection-observer-8c55e13a.js → intersection-observer-9ec5cf59.js} +0 -0
- package/cssm/presets/index.js +36 -38
- package/cssm/presets/useLazyLoading/hook.js +10 -17
- package/cssm/presets/useSelectWithApply/hook.js +31 -33
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +32 -34
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +25 -27
- package/cssm/presets/useSelectWithLoading/hook.js +9 -16
- package/cssm/responsive.d.ts +2 -0
- package/cssm/responsive.js +60 -0
- package/cssm/{tslib.es6-0857346e.d.ts → tslib.es6-0e9bf404.d.ts} +0 -0
- package/cssm/{tslib.es6-0857346e.js → tslib.es6-0e9bf404.js} +0 -0
- package/cssm/utils.js +1 -3
- package/esm/{Component-e500d89a.d.ts → Component-18490c10.d.ts} +0 -0
- package/esm/{Component-e500d89a.js → Component-18490c10.js} +6 -6
- package/esm/{Component-5f7d1f74.d.ts → Component-90edf135.d.ts} +0 -0
- package/esm/{Component-5f7d1f74.js → Component-90edf135.js} +71 -71
- package/esm/Component.d.ts +4 -26
- package/esm/Component.js +9 -9
- package/esm/Component.responsive.d.ts +19 -0
- package/esm/Component.responsive.js +48 -0
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/arrow/index.js +1 -1
- package/esm/components/base-checkmark/Component.js +2 -2
- package/esm/components/base-checkmark/index.css +4 -4
- package/esm/components/base-checkmark/index.js +2 -2
- package/esm/components/base-option/Component.js +4 -4
- package/esm/components/base-option/index.css +11 -11
- package/esm/components/base-option/index.js +4 -4
- package/esm/components/base-select/Component.js +3 -3
- package/esm/components/base-select/index.css +7 -7
- package/esm/components/base-select/index.d.ts +1 -1
- package/esm/components/base-select/index.js +3 -3
- package/esm/components/base-select-mobile/Component.js +24 -24
- package/esm/components/base-select-mobile/checkmark/Component.js +1 -1
- package/esm/components/base-select-mobile/checkmark/index.css +6 -6
- package/esm/components/base-select-mobile/checkmark/index.js +1 -1
- package/esm/components/base-select-mobile/index.css +11 -11
- package/esm/components/base-select-mobile/index.d.ts +1 -1
- package/esm/components/base-select-mobile/index.js +18 -18
- package/esm/components/base-select-mobile/options-list/Component.js +4 -4
- package/esm/components/base-select-mobile/options-list/index.css +9 -9
- package/esm/components/base-select-mobile/options-list/index.js +4 -4
- package/esm/components/checkmark/Component.js +2 -2
- package/esm/components/checkmark/index.css +8 -8
- package/esm/components/checkmark/index.js +2 -2
- package/esm/components/field/Component.js +4 -4
- package/esm/components/field/index.css +9 -9
- package/esm/components/field/index.js +3 -3
- package/esm/components/index.js +19 -19
- package/esm/components/native-select/Component.js +1 -1
- package/esm/components/native-select/index.js +2 -2
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/optgroup/index.js +1 -1
- package/esm/components/option/Component.js +4 -4
- package/esm/components/option/index.css +20 -20
- package/esm/components/option/index.js +4 -4
- package/esm/components/options-list/Component.js +4 -4
- package/esm/components/options-list/index.css +6 -6
- package/esm/components/options-list/index.js +4 -4
- package/esm/components/select-mobile/Component.js +20 -20
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +18 -18
- package/esm/components/select-modal-mobile/Component.js +20 -20
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +18 -18
- package/esm/components/virtual-options-list/Component.js +6 -6
- package/esm/components/virtual-options-list/index.css +12 -12
- package/esm/components/virtual-options-list/index.js +4 -4
- package/esm/getDataTestId-3fe0d3e6.d.ts +1 -1
- package/esm/index.js +20 -20
- package/esm/{intersection-observer-3551ee02.d.ts → intersection-observer-f951196f.d.ts} +0 -0
- package/esm/{intersection-observer-3551ee02.js → intersection-observer-f951196f.js} +0 -0
- package/esm/presets/index.js +25 -25
- package/esm/presets/useLazyLoading/hook.js +8 -8
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +23 -23
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +22 -22
- 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 +18 -18
- package/esm/presets/useSelectWithLoading/hook.js +7 -7
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/responsive.d.ts +2 -0
- package/esm/responsive.js +38 -0
- package/esm/{tslib.es6-cba5aa0b.d.ts → tslib.es6-b843a0de.d.ts} +0 -0
- package/esm/{tslib.es6-cba5aa0b.js → tslib.es6-b843a0de.js} +0 -0
- package/esm/utils.js +1 -1
- package/getDataTestId-3fe0d3e6.d.ts +1 -1
- package/index.js +32 -34
- package/{intersection-observer-54f0cbb3.d.ts → intersection-observer-54c021a4.d.ts} +0 -0
- package/{intersection-observer-54f0cbb3.js → intersection-observer-54c021a4.js} +0 -0
- package/modern/{Component-24030f26.d.ts → Component-633cd6ec.d.ts} +0 -0
- package/modern/{Component-24030f26.js → Component-633cd6ec.js} +2 -2
- package/modern/{Component-ef0fece1.d.ts → Component-b4cd876c.d.ts} +0 -0
- package/modern/{Component-ef0fece1.js → Component-b4cd876c.js} +71 -71
- package/modern/Component.d.ts +4 -26
- package/modern/Component.js +8 -8
- package/modern/Component.responsive.d.ts +19 -0
- package/modern/Component.responsive.js +46 -0
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/arrow/index.js +1 -1
- package/modern/components/base-checkmark/Component.js +2 -2
- package/modern/components/base-checkmark/index.css +4 -4
- package/modern/components/base-checkmark/index.js +2 -2
- package/modern/components/base-option/Component.js +3 -3
- package/modern/components/base-option/index.css +11 -11
- package/modern/components/base-option/index.js +3 -3
- package/modern/components/base-select/Component.js +2 -2
- package/modern/components/base-select/index.css +7 -7
- package/modern/components/base-select/index.d.ts +1 -1
- package/modern/components/base-select/index.js +2 -2
- package/modern/components/base-select-mobile/Component.js +23 -23
- package/modern/components/base-select-mobile/checkmark/Component.js +1 -1
- package/modern/components/base-select-mobile/checkmark/index.css +6 -6
- package/modern/components/base-select-mobile/checkmark/index.js +1 -1
- package/modern/components/base-select-mobile/index.css +11 -11
- package/modern/components/base-select-mobile/index.d.ts +1 -1
- package/modern/components/base-select-mobile/index.js +17 -17
- package/modern/components/base-select-mobile/options-list/Component.js +3 -3
- package/modern/components/base-select-mobile/options-list/index.css +9 -9
- package/modern/components/base-select-mobile/options-list/index.js +3 -3
- package/modern/components/checkmark/Component.js +2 -2
- package/modern/components/checkmark/index.css +8 -8
- package/modern/components/checkmark/index.js +2 -2
- package/modern/components/field/Component.js +2 -2
- package/modern/components/field/index.css +9 -9
- package/modern/components/field/index.js +2 -2
- package/modern/components/index.js +18 -18
- package/modern/components/native-select/index.js +1 -1
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/optgroup/index.js +1 -1
- package/modern/components/option/Component.js +3 -3
- package/modern/components/option/index.css +20 -20
- package/modern/components/option/index.js +3 -3
- package/modern/components/options-list/Component.js +3 -3
- package/modern/components/options-list/index.css +6 -6
- package/modern/components/options-list/index.js +3 -3
- package/modern/components/select-mobile/Component.js +19 -19
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +17 -17
- package/modern/components/select-modal-mobile/Component.js +19 -19
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +17 -17
- package/modern/components/virtual-options-list/Component.js +3 -3
- package/modern/components/virtual-options-list/index.css +12 -12
- package/modern/components/virtual-options-list/index.js +3 -3
- package/modern/getDataTestId-3fe0d3e6.d.ts +1 -1
- package/modern/index.js +19 -19
- package/modern/{intersection-observer-3551ee02.d.ts → intersection-observer-f951196f.d.ts} +0 -0
- package/modern/{intersection-observer-3551ee02.js → intersection-observer-f951196f.js} +0 -0
- package/modern/presets/index.js +24 -24
- package/modern/presets/useLazyLoading/hook.js +6 -6
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +22 -22
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +21 -21
- 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 +17 -17
- package/modern/presets/useSelectWithLoading/hook.js +5 -5
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/responsive.d.ts +2 -0
- package/modern/responsive.js +37 -0
- package/package.json +2 -2
- package/presets/index.js +27 -29
- package/presets/useLazyLoading/hook.js +10 -16
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +25 -27
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +23 -25
- 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 +19 -21
- package/presets/useSelectWithLoading/hook.js +9 -15
- package/presets/useSelectWithLoading/index.css +2 -2
- package/responsive.d.ts +2 -0
- package/responsive.js +44 -0
- package/{tslib.es6-ff15dcdb.d.ts → tslib.es6-b8d245fd.d.ts} +0 -0
- package/{tslib.es6-ff15dcdb.js → tslib.es6-b8d245fd.js} +0 -0
- package/utils.js +1 -3
|
@@ -1,33 +1,80 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import cn from 'classnames';
|
|
3
|
-
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
1
|
+
import React, { forwardRef, useRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
2
|
import { Arrow } from './components/arrow/Component.js';
|
|
5
3
|
import mergeRefs from 'react-merge-refs';
|
|
4
|
+
import cn from 'classnames';
|
|
6
5
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
6
|
+
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/modern';
|
|
7
|
+
import { ModalMobile } from '@alfalab/core-components-modal/modern/mobile';
|
|
8
|
+
import './Component.js';
|
|
9
|
+
import { g as getDataTestId } from './Component-633cd6ec.js';
|
|
10
|
+
import { Field } from './components/field/Component.js';
|
|
11
|
+
import { Optgroup } from './components/optgroup/Component.js';
|
|
12
|
+
import { Option } from './components/option/Component.js';
|
|
13
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
14
|
+
import 'react-virtual';
|
|
15
|
+
import '@alfalab/core-components-scrollbar/modern';
|
|
7
16
|
import '@alfalab/hooks';
|
|
8
|
-
import { g as getDataTestId } from './Component-24030f26.js';
|
|
9
17
|
import { processOptions } from './utils.js';
|
|
18
|
+
import { BaseOption } from './components/base-option/Component.js';
|
|
19
|
+
import '@alfalab/core-components-skeleton/modern';
|
|
20
|
+
import './intersection-observer-f951196f.js';
|
|
21
|
+
import { Button } from '@alfalab/core-components-button/modern';
|
|
22
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
10
23
|
import '@alfalab/core-components-form-control/modern';
|
|
11
|
-
import { Field } from './components/field/Component.js';
|
|
12
|
-
import { Optgroup } from './components/optgroup/Component.js';
|
|
13
24
|
import '@alfalab/core-components/badge';
|
|
14
25
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
15
26
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
16
|
-
import { Checkmark } from './components/base-select-mobile/checkmark/Component.js';
|
|
17
27
|
import '@alfalab/core-components-checkbox/modern';
|
|
18
|
-
import { Option } from './components/option/Component.js';
|
|
19
|
-
import '@alfalab/core-components-scrollbar/modern';
|
|
20
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
21
|
-
import './Component.js';
|
|
22
|
-
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/modern';
|
|
23
|
-
import { ModalMobile } from '@alfalab/core-components-modal/modern/mobile';
|
|
24
|
-
import { Button } from '@alfalab/core-components-button/modern';
|
|
25
28
|
import { BaseCheckmark } from './components/base-checkmark/Component.js';
|
|
29
|
+
import { Checkmark } from './components/base-select-mobile/checkmark/Component.js';
|
|
26
30
|
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
const styles$1 = {"footer":"select__footer_1gjww","withBorder":"select__withBorder_1gjww"};
|
|
33
|
+
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
34
|
+
|
|
35
|
+
const OptionsListWithApply = forwardRef(({ toggleMenu, OptionsList: OptionsList$1 = OptionsList, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = 5, ...restProps }, ref) => {
|
|
36
|
+
const footerRef = useRef(null);
|
|
37
|
+
const getOptionProps = useCallback((option, index) => {
|
|
38
|
+
const optionProps = defaultGetOptionProps(option, index);
|
|
39
|
+
const selected = option.key === SELECT_ALL_KEY
|
|
40
|
+
? selectedDraft.length === flatOptions.length - 1
|
|
41
|
+
: selectedDraft.includes(option);
|
|
42
|
+
return {
|
|
43
|
+
...optionProps,
|
|
44
|
+
selected,
|
|
45
|
+
};
|
|
46
|
+
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
47
|
+
const handleApply = useCallback(() => {
|
|
48
|
+
onApply();
|
|
49
|
+
toggleMenu();
|
|
50
|
+
}, [onApply, toggleMenu]);
|
|
51
|
+
const handleClear = useCallback(() => {
|
|
52
|
+
onClear();
|
|
53
|
+
toggleMenu();
|
|
54
|
+
}, [onClear, toggleMenu]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const activeElement = document.activeElement;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
if (footerRef.current) {
|
|
59
|
+
footerRef.current.focus();
|
|
60
|
+
}
|
|
61
|
+
}, 0);
|
|
62
|
+
return () => {
|
|
63
|
+
onClose();
|
|
64
|
+
if (activeElement) {
|
|
65
|
+
activeElement.focus();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
|
+
}, []);
|
|
70
|
+
return (React.createElement(OptionsList$1, { ...restProps, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React.createElement("div", {
|
|
71
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
72
|
+
tabIndex: 0, className: cn(styles$1.footer, {
|
|
73
|
+
[styles$1.withBorder]: visibleOptions && flatOptions.length > visibleOptions,
|
|
74
|
+
}), ref: footerRef },
|
|
75
|
+
React.createElement(Button, { size: 'xxs', view: 'primary', onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
76
|
+
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) }));
|
|
77
|
+
});
|
|
31
78
|
|
|
32
79
|
const SELECT_ALL_KEY = 'select_all';
|
|
33
80
|
const selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
@@ -95,54 +142,7 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
95
142
|
};
|
|
96
143
|
}
|
|
97
144
|
|
|
98
|
-
|
|
99
|
-
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
100
|
-
|
|
101
|
-
const OptionsListWithApply = forwardRef(({ toggleMenu, OptionsList: OptionsList$1 = OptionsList, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = 5, ...restProps }, ref) => {
|
|
102
|
-
const footerRef = useRef(null);
|
|
103
|
-
const getOptionProps = useCallback((option, index) => {
|
|
104
|
-
const optionProps = defaultGetOptionProps(option, index);
|
|
105
|
-
const selected = option.key === SELECT_ALL_KEY
|
|
106
|
-
? selectedDraft.length === flatOptions.length - 1
|
|
107
|
-
: selectedDraft.includes(option);
|
|
108
|
-
return {
|
|
109
|
-
...optionProps,
|
|
110
|
-
selected,
|
|
111
|
-
};
|
|
112
|
-
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
113
|
-
const handleApply = useCallback(() => {
|
|
114
|
-
onApply();
|
|
115
|
-
toggleMenu();
|
|
116
|
-
}, [onApply, toggleMenu]);
|
|
117
|
-
const handleClear = useCallback(() => {
|
|
118
|
-
onClear();
|
|
119
|
-
toggleMenu();
|
|
120
|
-
}, [onClear, toggleMenu]);
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
const activeElement = document.activeElement;
|
|
123
|
-
setTimeout(() => {
|
|
124
|
-
if (footerRef.current) {
|
|
125
|
-
footerRef.current.focus();
|
|
126
|
-
}
|
|
127
|
-
}, 0);
|
|
128
|
-
return () => {
|
|
129
|
-
onClose();
|
|
130
|
-
if (activeElement) {
|
|
131
|
-
activeElement.focus();
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
|
-
}, []);
|
|
136
|
-
return (React.createElement(OptionsList$1, { ...restProps, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React.createElement("div", {
|
|
137
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
138
|
-
tabIndex: 0, className: cn(styles.footer, {
|
|
139
|
-
[styles.withBorder]: visibleOptions && flatOptions.length > visibleOptions,
|
|
140
|
-
}), ref: footerRef },
|
|
141
|
-
React.createElement(Button, { size: 'xxs', view: 'primary', onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
142
|
-
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) }));
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
var styles$1 = {"component":"select__component_17umy","popoverInner":"select__popoverInner_17umy","sheet":"select__sheet_17umy","sheetContent":"select__sheetContent_17umy","sheetContainer":"select__sheetContainer_17umy","block":"select__block_17umy","option":"select__option_17umy","optionGroup":"select__optionGroup_17umy"};
|
|
145
|
+
const styles = {"component":"select__component_o2vrf","popoverInner":"select__popoverInner_o2vrf","sheet":"select__sheet_o2vrf","sheetContent":"select__sheetContent_o2vrf","sheetContainer":"select__sheetContainer_o2vrf","block":"select__block_o2vrf","option":"select__option_o2vrf","optionGroup":"select__optionGroup_o2vrf"};
|
|
146
146
|
require('./components/base-select-mobile/index.css')
|
|
147
147
|
|
|
148
148
|
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, OptionsList = OptionsList$1, swipeable, footer, isBottomSheet, bottomSheetProps, }, ref) => {
|
|
@@ -291,7 +291,7 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
291
291
|
return {
|
|
292
292
|
...optionProps,
|
|
293
293
|
mobile: true,
|
|
294
|
-
className: cn(styles
|
|
294
|
+
className: cn(styles.option, optionClassName),
|
|
295
295
|
innerProps: getItemProps({
|
|
296
296
|
index,
|
|
297
297
|
item: option,
|
|
@@ -337,7 +337,7 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
337
337
|
return (React.createElement("div", { ...getComboboxProps({
|
|
338
338
|
ref: rootRef,
|
|
339
339
|
...(disabled && { 'aria-disabled': true }),
|
|
340
|
-
className: cn(styles
|
|
340
|
+
className: cn(styles.component, { [styles.block]: block }, className),
|
|
341
341
|
}), onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) },
|
|
342
342
|
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: {
|
|
343
343
|
onFocus: disabled ? undefined : handleFieldFocus,
|
|
@@ -352,12 +352,12 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
352
352
|
: undefined,
|
|
353
353
|
}, dataTestId: getDataTestId(dataTestId, 'field'), ...fieldProps }),
|
|
354
354
|
name && renderValue(),
|
|
355
|
-
isBottomSheet ? (React.createElement(BottomSheet, { open: open, onClose: handleClose, className: styles
|
|
355
|
+
isBottomSheet ? (React.createElement(BottomSheet, { open: open, onClose: handleClose, className: styles.sheet, contentClassName: styles.sheetContent, containerClassName: styles.sheetContainer, title: placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, ...bottomSheetProps },
|
|
356
356
|
React.createElement("div", { ...menuProps, className: optionsListClassName },
|
|
357
|
-
React.createElement(OptionsListWithApply, { ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles
|
|
357
|
+
React.createElement(OptionsListWithApply, { showFooter: multiple, ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles.optionGroup, optionGroupClassName), onApply: handleApply, onClear: handleClear })))) : (React.createElement(ModalMobile, { open: open, onClose: handleClose, contentClassName: styles.sheetContent, hasCloser: true },
|
|
358
358
|
React.createElement(ModalMobile.Header, { hasCloser: true, title: placeholder, sticky: true }),
|
|
359
359
|
React.createElement("div", { ...menuProps, className: optionsListClassName },
|
|
360
|
-
React.createElement(OptionsListWithApply, { ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles
|
|
360
|
+
React.createElement(OptionsListWithApply, { showFooter: multiple, ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles.optionGroup, optionGroupClassName), onApply: handleApply, onClear: handleClear }))))));
|
|
361
361
|
});
|
|
362
362
|
|
|
363
363
|
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 })));
|
package/modern/Component.d.ts
CHANGED
|
@@ -84,39 +84,17 @@ type FormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
84
84
|
*/
|
|
85
85
|
children?: ReactNode;
|
|
86
86
|
};
|
|
87
|
+
type SelectFieldProps = FormControlProps & Record<string, unknown>;
|
|
87
88
|
type SelectProps = Omit<BaseSelectProps, 'fieldProps'> & {
|
|
88
89
|
/**
|
|
89
90
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
90
91
|
*/
|
|
91
|
-
fieldProps?:
|
|
92
|
+
fieldProps?: SelectFieldProps;
|
|
92
93
|
};
|
|
93
94
|
declare const Select: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "fieldProps"> & {
|
|
94
95
|
/**
|
|
95
96
|
* Пропсы, которые будут прокинуты в компонент поля
|
|
96
97
|
*/
|
|
97
|
-
fieldProps?:
|
|
98
|
-
block?: boolean | undefined;
|
|
99
|
-
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
100
|
-
colors?: "default" | "inverted" | undefined; /**
|
|
101
|
-
* Пропсы, которые будут прокинуты в компонент поля
|
|
102
|
-
*/
|
|
103
|
-
disabled?: boolean | undefined;
|
|
104
|
-
readOnly?: boolean | undefined;
|
|
105
|
-
filled?: boolean | undefined;
|
|
106
|
-
focused?: boolean | undefined;
|
|
107
|
-
error?: React.ReactNode;
|
|
108
|
-
hint?: React.ReactNode;
|
|
109
|
-
label?: React.ReactNode;
|
|
110
|
-
labelView?: "inner" | "outer" | undefined;
|
|
111
|
-
leftAddons?: React.ReactNode;
|
|
112
|
-
rightAddons?: React.ReactNode;
|
|
113
|
-
bottomAddons?: React.ReactNode;
|
|
114
|
-
className?: string | undefined;
|
|
115
|
-
fieldClassName?: string | undefined;
|
|
116
|
-
labelClassName?: string | undefined;
|
|
117
|
-
addonsClassName?: string | undefined;
|
|
118
|
-
dataTestId?: string | undefined;
|
|
119
|
-
children?: React.ReactNode;
|
|
120
|
-
} & Record<string, unknown>) | undefined;
|
|
98
|
+
fieldProps?: SelectFieldProps | undefined;
|
|
121
99
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
122
|
-
export { SelectProps, Select };
|
|
100
|
+
export { SelectFieldProps, SelectProps, Select };
|
package/modern/Component.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Arrow } from './components/arrow/Component.js';
|
|
3
|
+
import { B as BaseSelect } from './Component-633cd6ec.js';
|
|
4
|
+
import { Field } from './components/field/Component.js';
|
|
5
|
+
import { Optgroup } from './components/optgroup/Component.js';
|
|
6
|
+
import { Option } from './components/option/Component.js';
|
|
7
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
2
8
|
import 'classnames';
|
|
3
9
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
4
|
-
import { Arrow } from './components/arrow/Component.js';
|
|
5
10
|
import 'react-merge-refs';
|
|
6
11
|
import '@juggle/resize-observer';
|
|
7
12
|
import 'downshift';
|
|
8
13
|
import '@alfalab/core-components-popover/modern';
|
|
9
14
|
import '@alfalab/hooks';
|
|
10
|
-
import { B as BaseSelect } from './Component-24030f26.js';
|
|
11
15
|
import './utils.js';
|
|
12
16
|
import './components/native-select/Component.js';
|
|
13
17
|
import '@alfalab/core-components-form-control/modern';
|
|
14
|
-
import
|
|
15
|
-
import { Optgroup } from './components/optgroup/Component.js';
|
|
18
|
+
import './components/base-select-mobile/checkmark/Component.js';
|
|
16
19
|
import '@alfalab/core-components/badge';
|
|
17
20
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
18
21
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
19
|
-
import './components/base-select-mobile/checkmark/Component.js';
|
|
20
|
-
import '@alfalab/core-components-checkbox/modern';
|
|
21
22
|
import './components/checkmark/Component.js';
|
|
22
|
-
import
|
|
23
|
+
import '@alfalab/core-components-checkbox/modern';
|
|
23
24
|
import '@alfalab/core-components-scrollbar/modern';
|
|
24
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
25
25
|
|
|
26
26
|
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 })));
|
|
27
27
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AdditionalMobileProps } from "./components/index";
|
|
4
|
+
import { BaseSelectProps } from "./typings";
|
|
5
|
+
type SelectResponsiveProps = BaseSelectProps & AdditionalMobileProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
8
|
+
* @default 1024
|
|
9
|
+
*/
|
|
10
|
+
breakpoint?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const SelectResponsive: React.ForwardRefExoticComponent<BaseSelectProps & AdditionalMobileProps & {
|
|
13
|
+
/**
|
|
14
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
15
|
+
* @default 1024
|
|
16
|
+
*/
|
|
17
|
+
breakpoint?: number | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export { SelectResponsiveProps, SelectResponsive };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useMedia } from '@alfalab/hooks';
|
|
3
|
+
import { Select } from './Component.js';
|
|
4
|
+
import 'classnames';
|
|
5
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
6
|
+
import './Component-633cd6ec.js';
|
|
7
|
+
import { S as SelectMobile } from './Component-b4cd876c.js';
|
|
8
|
+
import '@alfalab/core-components-form-control/modern';
|
|
9
|
+
import '@alfalab/core-components/badge';
|
|
10
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
11
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
12
|
+
import '@alfalab/core-components-checkbox/modern';
|
|
13
|
+
import './components/options-list/Component.js';
|
|
14
|
+
import 'react-virtual';
|
|
15
|
+
import '@alfalab/core-components-scrollbar/modern';
|
|
16
|
+
import './components/arrow/Component.js';
|
|
17
|
+
import './components/field/Component.js';
|
|
18
|
+
import './utils.js';
|
|
19
|
+
import './components/optgroup/Component.js';
|
|
20
|
+
import './components/option/Component.js';
|
|
21
|
+
import './components/base-select-mobile/checkmark/Component.js';
|
|
22
|
+
import './components/checkmark/Component.js';
|
|
23
|
+
import 'react-merge-refs';
|
|
24
|
+
import '@juggle/resize-observer';
|
|
25
|
+
import 'downshift';
|
|
26
|
+
import '@alfalab/core-components-popover/modern';
|
|
27
|
+
import './components/native-select/Component.js';
|
|
28
|
+
import '@alfalab/core-components-bottom-sheet/modern';
|
|
29
|
+
import '@alfalab/core-components-modal/modern/mobile';
|
|
30
|
+
import './components/base-option/Component.js';
|
|
31
|
+
import './components/base-checkmark/Component.js';
|
|
32
|
+
import '@alfalab/core-components-skeleton/modern';
|
|
33
|
+
import './intersection-observer-f951196f.js';
|
|
34
|
+
import '@alfalab/core-components-button/modern';
|
|
35
|
+
import './components/base-select-mobile/options-list/Component.js';
|
|
36
|
+
import '@alfalab/core-components-base-modal/modern';
|
|
37
|
+
|
|
38
|
+
const SelectResponsive = forwardRef(({ footer, swipeable, bottomSheetProps, OptionsList, onScroll, fieldProps, breakpoint = 1024, ...restProps }, ref) => {
|
|
39
|
+
const [view] = useMedia([
|
|
40
|
+
['mobile', `(max-width: ${breakpoint - 1}px)`],
|
|
41
|
+
['desktop', `(min-width: ${breakpoint}px)`],
|
|
42
|
+
], 'desktop');
|
|
43
|
+
return view === 'desktop' ? (React.createElement(Select, { OptionsList: OptionsList, onScroll: onScroll, ...restProps, ref: ref, fieldProps: fieldProps })) : (React.createElement(SelectMobile, { footer: footer, swipeable: swipeable, bottomSheetProps: bottomSheetProps, fieldProps: fieldProps, ...restProps, ref: ref }));
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { SelectResponsive };
|
|
@@ -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
|
-
|
|
5
|
+
const styles = {"arrow":"select__arrow_1lzf1","open":"select__open_1lzf1"};
|
|
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: 11ced */
|
|
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_1lzf1 {
|
|
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_1lzf1 {
|
|
36
36
|
transform: var(--arrow-transform);
|
|
37
37
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
4
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/modern';
|
|
4
|
+
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const styles = {"checkmark":"select__checkmark_16sla","single":"select__single_16sla","selected":"select__selected_16sla"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const BaseCheckmark = ({ selected, disabled = false, className, multiple, }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 17qcu */
|
|
2
2
|
:root {
|
|
3
3
|
|
|
4
4
|
/* Hard */
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
/* optgroup */
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.select__checkmark_16sla {
|
|
21
21
|
flex-shrink: 0;
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.select__single_16sla {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
opacity: 0
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.select__single_16sla.select__selected_16sla {
|
|
31
31
|
opacity: 1;
|
|
32
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export { BaseCheckmark } from './Component.js';
|
|
1
2
|
import 'react';
|
|
2
3
|
import 'classnames';
|
|
3
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
4
4
|
import '@alfalab/core-components-checkbox/modern';
|
|
5
|
-
|
|
5
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { isValidElement } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
4
|
-
import '@alfalab/core-components-checkbox/modern';
|
|
5
3
|
import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
4
|
+
import '@alfalab/core-components-checkbox/modern';
|
|
5
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const styles = {"option":"select__option_1bmwl","disabled":"select__disabled_1bmwl","checkmarkBefore":"select__checkmarkBefore_1bmwl","checkmarkAfter":"select__checkmarkAfter_1bmwl","textContent":"select__textContent_1bmwl","mobileTextContent":"select__mobileTextContent_1bmwl","selected":"select__selected_1bmwl","highlighted":"select__highlighted_1bmwl","content":"select__content_1bmwl"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
const BaseOption = ({ className, option, children, selected, highlighted, disabled, multiple, Checkmark = BaseCheckmark, checkmarkPosition = multiple ? 'before' : 'after', innerProps, dataTestId, mobile = false, }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1nld6 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-bg-secondary: #f3f4f5;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
/* optgroup */
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.select__option_1bmwl {
|
|
46
46
|
font-size: 16px;
|
|
47
47
|
line-height: 20px;
|
|
48
48
|
font-weight: 400;
|
|
@@ -60,36 +60,36 @@
|
|
|
60
60
|
cursor: pointer;
|
|
61
61
|
min-height: var(--size-s-height)
|
|
62
62
|
}
|
|
63
|
-
.
|
|
63
|
+
.select__option_1bmwl:not(.select__disabled_1bmwl):active {
|
|
64
64
|
background: var(--select-option-active-background);
|
|
65
65
|
color: var(--select-option-active-color);
|
|
66
66
|
}
|
|
67
|
-
.
|
|
67
|
+
.select__option_1bmwl.select__checkmarkBefore_1bmwl {
|
|
68
68
|
padding: 0 0 0 var(--gap-s);
|
|
69
69
|
}
|
|
70
|
-
.
|
|
70
|
+
.select__option_1bmwl.select__checkmarkAfter_1bmwl {
|
|
71
71
|
padding: 0 var(--gap-s) 0 0;
|
|
72
72
|
}
|
|
73
|
-
.
|
|
73
|
+
.select__option_1bmwl.select__textContent_1bmwl {
|
|
74
74
|
padding: var(--gap-s);
|
|
75
75
|
}
|
|
76
|
-
.
|
|
76
|
+
.select__option_1bmwl.select__mobileTextContent_1bmwl {
|
|
77
77
|
padding: var(--gap-m);
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
.select__selected_1bmwl {
|
|
80
80
|
background: var(--select-option-selected-background);
|
|
81
81
|
color: var(--select-option-selected-color);
|
|
82
82
|
cursor: default;
|
|
83
83
|
}
|
|
84
|
-
.
|
|
84
|
+
.select__highlighted_1bmwl {
|
|
85
85
|
background: var(--select-option-hover-background);
|
|
86
86
|
color: var(--select-option-hover-color);
|
|
87
87
|
}
|
|
88
|
-
.
|
|
88
|
+
.select__disabled_1bmwl {
|
|
89
89
|
cursor: var(--disabled-cursor);
|
|
90
90
|
background: var(--select-option-disabled-background);
|
|
91
91
|
color: var(--select-option-disabled-color);
|
|
92
92
|
}
|
|
93
|
-
.
|
|
93
|
+
.select__content_1bmwl {
|
|
94
94
|
flex: 1;
|
|
95
95
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export { BaseOption } from './Component.js';
|
|
1
2
|
import 'react';
|
|
2
3
|
import 'classnames';
|
|
3
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
4
|
-
import '@alfalab/core-components-checkbox/modern';
|
|
5
4
|
import '../base-checkmark/Component.js';
|
|
6
|
-
|
|
5
|
+
import '@alfalab/core-components-checkbox/modern';
|
|
6
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
import 'classnames';
|
|
3
2
|
import 'react-merge-refs';
|
|
4
3
|
import '@juggle/resize-observer';
|
|
4
|
+
import 'classnames';
|
|
5
5
|
import 'downshift';
|
|
6
6
|
import '@alfalab/core-components-popover/modern';
|
|
7
7
|
import '@alfalab/hooks';
|
|
8
|
-
export { B as BaseSelect } from '../../Component-
|
|
8
|
+
export { B as BaseSelect } from '../../Component-633cd6ec.js';
|
|
9
9
|
import '../../utils.js';
|
|
10
10
|
import '../native-select/Component.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: ooobd */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
|
|
35
35
|
/* optgroup */
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
.select__component_62rls {
|
|
38
38
|
width: max-content;
|
|
39
39
|
position: relative;
|
|
40
40
|
outline: 0;
|
|
41
41
|
}
|
|
42
|
-
.
|
|
42
|
+
.select__popoverInner_62rls {
|
|
43
43
|
padding-top: var(--select-options-list-offset);
|
|
44
44
|
padding-bottom: var(--select-options-list-offset);
|
|
45
45
|
box-shadow: none;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
border-radius: 0;
|
|
49
49
|
position: relative;
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
.select__optionsList_62rls {
|
|
52
52
|
padding-top: var(--select-options-list-top-padding);
|
|
53
53
|
padding-bottom: var(--select-options-list-bottom-padding);
|
|
54
54
|
box-shadow: var(--select-options-list-box-shadow);
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
overflow: hidden;
|
|
58
58
|
will-change: transform;
|
|
59
59
|
}
|
|
60
|
-
.
|
|
60
|
+
.select__nativeSelect_62rls {
|
|
61
61
|
opacity: 0;
|
|
62
62
|
overflow: hidden;
|
|
63
63
|
position: absolute;
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
cursor: pointer;
|
|
72
72
|
z-index: 1;
|
|
73
73
|
}
|
|
74
|
-
.
|
|
74
|
+
.select__block_62rls {
|
|
75
75
|
width: 100%;
|
|
76
76
|
}
|
|
77
77
|
/* width: max-content; fix for IE */
|
|
78
78
|
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
79
|
-
.
|
|
79
|
+
.select__component_62rls {
|
|
80
80
|
float: left;
|
|
81
81
|
clear: left;
|
|
82
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-633cd6ec";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
export { B as BaseSelect } from '../../Component-633cd6ec.js';
|
|
1
2
|
import 'react';
|
|
2
|
-
import 'classnames';
|
|
3
3
|
import 'react-merge-refs';
|
|
4
4
|
import '@juggle/resize-observer';
|
|
5
|
+
import 'classnames';
|
|
5
6
|
import 'downshift';
|
|
6
7
|
import '@alfalab/core-components-popover/modern';
|
|
7
8
|
import '@alfalab/hooks';
|
|
8
|
-
export { B as BaseSelect } from '../../Component-24030f26.js';
|
|
9
9
|
import '../../utils.js';
|
|
10
10
|
import '../native-select/Component.js';
|