@alfalab/core-components-select 13.2.0 → 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-a826582c.d.ts → Component-4e5b4c78.d.ts} +0 -0
- package/{Component-a826582c.js → Component-4e5b4c78.js} +78 -84
- package/{Component-f2f84cb6.d.ts → Component-dc8aa97a.d.ts} +0 -0
- package/{Component-f2f84cb6.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-cf5c933f.d.ts → Component-18490c10.d.ts} +0 -0
- package/esm/{Component-cf5c933f.js → Component-18490c10.js} +6 -6
- package/esm/{Component-804e366f.d.ts → Component-90edf135.d.ts} +0 -0
- package/esm/{Component-804e366f.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-7304e334.d.ts → intersection-observer-f951196f.d.ts} +0 -0
- package/esm/{intersection-observer-7304e334.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-e89d50db.d.ts → tslib.es6-b843a0de.d.ts} +0 -0
- package/esm/{tslib.es6-e89d50db.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-d44a3d44.d.ts → intersection-observer-54c021a4.d.ts} +0 -0
- package/{intersection-observer-d44a3d44.js → intersection-observer-54c021a4.js} +0 -0
- package/modern/{Component-d5c51040.d.ts → Component-633cd6ec.d.ts} +0 -0
- package/modern/{Component-d5c51040.js → Component-633cd6ec.js} +2 -2
- package/modern/{Component-a6d52eb5.d.ts → Component-b4cd876c.d.ts} +0 -0
- package/modern/{Component-a6d52eb5.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-7304e334.d.ts → intersection-observer-f951196f.d.ts} +0 -0
- package/modern/{intersection-observer-7304e334.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 +3 -3
- 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-e8daa31e.d.ts → tslib.es6-b8d245fd.d.ts} +0 -0
- package/{tslib.es6-e8daa31e.js → tslib.es6-b8d245fd.js} +0 -0
- package/utils.js +1 -3
|
@@ -1,34 +1,80 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign, b as __spreadArray } from './tslib.es6-
|
|
2
|
-
import React, {
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
1
|
+
import { _ as __rest, a as __assign, b as __spreadArray } from './tslib.es6-b843a0de.js';
|
|
2
|
+
import React, { forwardRef, useRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
3
|
import { Arrow } from './components/arrow/Component.js';
|
|
6
4
|
import mergeRefs from 'react-merge-refs';
|
|
5
|
+
import cn from 'classnames';
|
|
7
6
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
7
|
+
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/esm';
|
|
8
|
+
import { ModalMobile } from '@alfalab/core-components-modal/esm/mobile';
|
|
9
|
+
import './Component.js';
|
|
10
|
+
import { g as getDataTestId } from './Component-18490c10.js';
|
|
11
|
+
import { Field } from './components/field/Component.js';
|
|
12
|
+
import { Optgroup } from './components/optgroup/Component.js';
|
|
13
|
+
import { Option } from './components/option/Component.js';
|
|
14
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
15
|
+
import 'react-virtual';
|
|
16
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
8
17
|
import '@alfalab/hooks';
|
|
9
|
-
import { g as getDataTestId } from './Component-cf5c933f.js';
|
|
10
18
|
import { processOptions } from './utils.js';
|
|
19
|
+
import { BaseOption } from './components/base-option/Component.js';
|
|
20
|
+
import '@alfalab/core-components-skeleton/esm';
|
|
21
|
+
import './intersection-observer-f951196f.js';
|
|
22
|
+
import { Button } from '@alfalab/core-components-button/esm';
|
|
23
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
11
24
|
import '@alfalab/core-components-form-control/esm';
|
|
12
|
-
import { Field } from './components/field/Component.js';
|
|
13
|
-
import { Optgroup } from './components/optgroup/Component.js';
|
|
14
25
|
import '@alfalab/core-components/badge';
|
|
15
26
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
16
27
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
17
|
-
import { Checkmark } from './components/base-select-mobile/checkmark/Component.js';
|
|
18
28
|
import '@alfalab/core-components-checkbox/esm';
|
|
19
|
-
import { Option } from './components/option/Component.js';
|
|
20
|
-
import '@alfalab/core-components-scrollbar/esm';
|
|
21
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
22
|
-
import './Component.js';
|
|
23
|
-
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/esm';
|
|
24
|
-
import { ModalMobile } from '@alfalab/core-components-modal/esm/mobile';
|
|
25
|
-
import { Button } from '@alfalab/core-components-button/esm';
|
|
26
29
|
import { BaseCheckmark } from './components/base-checkmark/Component.js';
|
|
30
|
+
import { Checkmark } from './components/base-select-mobile/checkmark/Component.js';
|
|
27
31
|
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
|
|
33
|
+
var styles$1 = {"footer":"select__footer_1gjww","withBorder":"select__withBorder_1gjww"};
|
|
34
|
+
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
35
|
+
|
|
36
|
+
var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
37
|
+
var _b;
|
|
38
|
+
var toggleMenu = _a.toggleMenu, _c = _a.OptionsList, OptionsList$1 = _c === void 0 ? OptionsList : _c, defaultGetOptionProps = _a.getOptionProps, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.selectedDraft, selectedDraft = _e === void 0 ? [] : _e, _f = _a.flatOptions, flatOptions = _f === void 0 ? [] : _f, _g = _a.onApply, onApply = _g === void 0 ? function () { return null; } : _g, _h = _a.onClear, onClear = _h === void 0 ? function () { return null; } : _h, _j = _a.onClose, onClose = _j === void 0 ? function () { return null; } : _j, _k = _a.visibleOptions, visibleOptions = _k === void 0 ? 5 : _k, restProps = __rest(_a, ["toggleMenu", "OptionsList", "getOptionProps", "showClear", "selectedDraft", "flatOptions", "onApply", "onClear", "onClose", "visibleOptions"]);
|
|
39
|
+
var footerRef = useRef(null);
|
|
40
|
+
var getOptionProps = useCallback(function (option, index) {
|
|
41
|
+
var optionProps = defaultGetOptionProps(option, index);
|
|
42
|
+
var selected = option.key === SELECT_ALL_KEY
|
|
43
|
+
? selectedDraft.length === flatOptions.length - 1
|
|
44
|
+
: selectedDraft.includes(option);
|
|
45
|
+
return __assign(__assign({}, optionProps), { selected: selected });
|
|
46
|
+
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
47
|
+
var handleApply = useCallback(function () {
|
|
48
|
+
onApply();
|
|
49
|
+
toggleMenu();
|
|
50
|
+
}, [onApply, toggleMenu]);
|
|
51
|
+
var handleClear = useCallback(function () {
|
|
52
|
+
onClear();
|
|
53
|
+
toggleMenu();
|
|
54
|
+
}, [onClear, toggleMenu]);
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
var activeElement = document.activeElement;
|
|
57
|
+
setTimeout(function () {
|
|
58
|
+
if (footerRef.current) {
|
|
59
|
+
footerRef.current.focus();
|
|
60
|
+
}
|
|
61
|
+
}, 0);
|
|
62
|
+
return function () {
|
|
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, __assign({}, 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, (_b = {},
|
|
73
|
+
_b[styles$1.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
74
|
+
_b)), 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
|
+
});
|
|
32
78
|
|
|
33
79
|
var SELECT_ALL_KEY = 'select_all';
|
|
34
80
|
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
@@ -95,53 +141,7 @@ function useSelectWithApply(_a) {
|
|
|
95
141
|
};
|
|
96
142
|
}
|
|
97
143
|
|
|
98
|
-
var styles = {"
|
|
99
|
-
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
100
|
-
|
|
101
|
-
var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
102
|
-
var _b;
|
|
103
|
-
var toggleMenu = _a.toggleMenu, _c = _a.OptionsList, OptionsList$1 = _c === void 0 ? OptionsList : _c, defaultGetOptionProps = _a.getOptionProps, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.selectedDraft, selectedDraft = _e === void 0 ? [] : _e, _f = _a.flatOptions, flatOptions = _f === void 0 ? [] : _f, _g = _a.onApply, onApply = _g === void 0 ? function () { return null; } : _g, _h = _a.onClear, onClear = _h === void 0 ? function () { return null; } : _h, _j = _a.onClose, onClose = _j === void 0 ? function () { return null; } : _j, _k = _a.visibleOptions, visibleOptions = _k === void 0 ? 5 : _k, restProps = __rest(_a, ["toggleMenu", "OptionsList", "getOptionProps", "showClear", "selectedDraft", "flatOptions", "onApply", "onClear", "onClose", "visibleOptions"]);
|
|
104
|
-
var footerRef = useRef(null);
|
|
105
|
-
var getOptionProps = useCallback(function (option, index) {
|
|
106
|
-
var optionProps = defaultGetOptionProps(option, index);
|
|
107
|
-
var selected = option.key === SELECT_ALL_KEY
|
|
108
|
-
? selectedDraft.length === flatOptions.length - 1
|
|
109
|
-
: selectedDraft.includes(option);
|
|
110
|
-
return __assign(__assign({}, optionProps), { selected: selected });
|
|
111
|
-
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
112
|
-
var handleApply = useCallback(function () {
|
|
113
|
-
onApply();
|
|
114
|
-
toggleMenu();
|
|
115
|
-
}, [onApply, toggleMenu]);
|
|
116
|
-
var handleClear = useCallback(function () {
|
|
117
|
-
onClear();
|
|
118
|
-
toggleMenu();
|
|
119
|
-
}, [onClear, toggleMenu]);
|
|
120
|
-
useEffect(function () {
|
|
121
|
-
var activeElement = document.activeElement;
|
|
122
|
-
setTimeout(function () {
|
|
123
|
-
if (footerRef.current) {
|
|
124
|
-
footerRef.current.focus();
|
|
125
|
-
}
|
|
126
|
-
}, 0);
|
|
127
|
-
return function () {
|
|
128
|
-
onClose();
|
|
129
|
-
if (activeElement) {
|
|
130
|
-
activeElement.focus();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
134
|
-
}, []);
|
|
135
|
-
return (React.createElement(OptionsList$1, __assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React.createElement("div", {
|
|
136
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
137
|
-
tabIndex: 0, className: cn(styles.footer, (_b = {},
|
|
138
|
-
_b[styles.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
139
|
-
_b)), ref: footerRef },
|
|
140
|
-
React.createElement(Button, { size: 'xxs', view: 'primary', onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
141
|
-
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) })));
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
var styles$1 = {"component":"select__component_1kear","popoverInner":"select__popoverInner_1kear","sheet":"select__sheet_1kear","sheetContent":"select__sheetContent_1kear","sheetContainer":"select__sheetContainer_1kear","block":"select__block_1kear","option":"select__option_1kear","optionGroup":"select__optionGroup_1kear"};
|
|
144
|
+
var 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"};
|
|
145
145
|
require('./components/base-select-mobile/index.css')
|
|
146
146
|
|
|
147
147
|
var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
@@ -286,7 +286,7 @@ var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
|
286
286
|
};
|
|
287
287
|
var getOptionProps = function (option, index) {
|
|
288
288
|
var selectedItem = selectedItems.includes(option);
|
|
289
|
-
return __assign(__assign({}, optionProps), { mobile: true, className: cn(styles
|
|
289
|
+
return __assign(__assign({}, optionProps), { mobile: true, className: cn(styles.option, optionClassName), innerProps: getItemProps({
|
|
290
290
|
index: index,
|
|
291
291
|
item: option,
|
|
292
292
|
disabled: option.disabled,
|
|
@@ -323,7 +323,7 @@ var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
|
323
323
|
}
|
|
324
324
|
toggleMenu();
|
|
325
325
|
};
|
|
326
|
-
return (React.createElement("div", __assign({}, getComboboxProps(__assign(__assign({ ref: rootRef }, (disabled && { 'aria-disabled': true })), { className: cn(styles
|
|
326
|
+
return (React.createElement("div", __assign({}, getComboboxProps(__assign(__assign({ ref: rootRef }, (disabled && { 'aria-disabled': true })), { className: cn(styles.component, (_b = {}, _b[styles.block] = block, _b), className) })), { onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) }),
|
|
327
327
|
React.createElement(Field$1, __assign({ selectedMultiple: selectedDraft, selected: selectedItems[0], setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, multiple: multiple, open: open, disabled: disabled, size: size, placeholder: placeholder, label: label && React.createElement("span", __assign({}, getLabelProps()), label), labelView: labelView, Arrow: Arrow$1 && React.createElement(Arrow$1, { open: open }), error: error, hint: hint, valueRenderer: valueRenderer, className: fieldClassName, innerProps: {
|
|
328
328
|
onFocus: disabled ? undefined : handleFieldFocus,
|
|
329
329
|
onClick: disabled ? undefined : handleFieldClick,
|
|
@@ -337,12 +337,12 @@ var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
|
337
337
|
: undefined,
|
|
338
338
|
}, dataTestId: getDataTestId(dataTestId, 'field') }, fieldProps)),
|
|
339
339
|
name && renderValue(),
|
|
340
|
-
isBottomSheet ? (React.createElement(BottomSheet, __assign({ open: open, onClose: handleClose, className: styles
|
|
340
|
+
isBottomSheet ? (React.createElement(BottomSheet, __assign({ open: open, onClose: handleClose, className: styles.sheet, contentClassName: styles.sheetContent, containerClassName: styles.sheetContainer, title: placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable }, bottomSheetProps),
|
|
341
341
|
React.createElement("div", __assign({}, menuProps, { className: optionsListClassName }),
|
|
342
|
-
React.createElement(OptionsListWithApply, __assign({}, 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
|
|
342
|
+
React.createElement(OptionsListWithApply, __assign({ 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 },
|
|
343
343
|
React.createElement(ModalMobile.Header, { hasCloser: true, title: placeholder, sticky: true }),
|
|
344
344
|
React.createElement("div", __assign({}, menuProps, { className: optionsListClassName }),
|
|
345
|
-
React.createElement(OptionsListWithApply, __assign({}, 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
|
|
345
|
+
React.createElement(OptionsListWithApply, __assign({ 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 })))))));
|
|
346
346
|
});
|
|
347
347
|
|
|
348
348
|
var SelectMobile = forwardRef(function (_a, ref) {
|
package/esm/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/esm/Component.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __assign } from './tslib.es6-b843a0de.js';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
+
import { Arrow } from './components/arrow/Component.js';
|
|
4
|
+
import { B as BaseSelect } from './Component-18490c10.js';
|
|
5
|
+
import { Field } from './components/field/Component.js';
|
|
6
|
+
import { Optgroup } from './components/optgroup/Component.js';
|
|
7
|
+
import { Option } from './components/option/Component.js';
|
|
8
|
+
import { OptionsList } from './components/options-list/Component.js';
|
|
3
9
|
import 'classnames';
|
|
4
10
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
5
|
-
import { Arrow } from './components/arrow/Component.js';
|
|
6
11
|
import 'react-merge-refs';
|
|
7
12
|
import '@juggle/resize-observer';
|
|
8
13
|
import 'downshift';
|
|
9
14
|
import '@alfalab/core-components-popover/esm';
|
|
10
15
|
import '@alfalab/hooks';
|
|
11
|
-
import { B as BaseSelect } from './Component-cf5c933f.js';
|
|
12
16
|
import './utils.js';
|
|
13
17
|
import './components/native-select/Component.js';
|
|
14
18
|
import '@alfalab/core-components-form-control/esm';
|
|
15
|
-
import
|
|
16
|
-
import { Optgroup } from './components/optgroup/Component.js';
|
|
19
|
+
import './components/base-select-mobile/checkmark/Component.js';
|
|
17
20
|
import '@alfalab/core-components/badge';
|
|
18
21
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
19
22
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
20
|
-
import './components/base-select-mobile/checkmark/Component.js';
|
|
21
|
-
import '@alfalab/core-components-checkbox/esm';
|
|
22
23
|
import './components/checkmark/Component.js';
|
|
23
|
-
import
|
|
24
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
24
25
|
import '@alfalab/core-components-scrollbar/esm';
|
|
25
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
26
26
|
|
|
27
27
|
var Select = forwardRef(function (_a, ref) {
|
|
28
28
|
var _b = _a.Arrow, Arrow$1 = _b === void 0 ? Arrow : _b, _c = _a.Field, Field$1 = _c === void 0 ? Field : _c, _d = _a.OptionsList, OptionsList$1 = _d === void 0 ? OptionsList : _d, _e = _a.Optgroup, Optgroup$1 = _e === void 0 ? Optgroup : _e, _f = _a.Option, Option$1 = _f === void 0 ? Option : _f, restProps = __rest(_a, ["Arrow", "Field", "OptionsList", "Optgroup", "Option"]);
|
|
@@ -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,48 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign } from './tslib.es6-b843a0de.js';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { useMedia } from '@alfalab/hooks';
|
|
4
|
+
import { Select } from './Component.js';
|
|
5
|
+
import 'classnames';
|
|
6
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
7
|
+
import './Component-18490c10.js';
|
|
8
|
+
import { S as SelectMobile } from './Component-90edf135.js';
|
|
9
|
+
import '@alfalab/core-components-form-control/esm';
|
|
10
|
+
import '@alfalab/core-components/badge';
|
|
11
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
12
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
13
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
14
|
+
import './components/options-list/Component.js';
|
|
15
|
+
import 'react-virtual';
|
|
16
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
17
|
+
import './components/arrow/Component.js';
|
|
18
|
+
import './components/field/Component.js';
|
|
19
|
+
import './utils.js';
|
|
20
|
+
import './components/optgroup/Component.js';
|
|
21
|
+
import './components/option/Component.js';
|
|
22
|
+
import './components/base-select-mobile/checkmark/Component.js';
|
|
23
|
+
import './components/checkmark/Component.js';
|
|
24
|
+
import 'react-merge-refs';
|
|
25
|
+
import '@juggle/resize-observer';
|
|
26
|
+
import 'downshift';
|
|
27
|
+
import '@alfalab/core-components-popover/esm';
|
|
28
|
+
import './components/native-select/Component.js';
|
|
29
|
+
import '@alfalab/core-components-bottom-sheet/esm';
|
|
30
|
+
import '@alfalab/core-components-modal/esm/mobile';
|
|
31
|
+
import './components/base-option/Component.js';
|
|
32
|
+
import './components/base-checkmark/Component.js';
|
|
33
|
+
import '@alfalab/core-components-skeleton/esm';
|
|
34
|
+
import './intersection-observer-f951196f.js';
|
|
35
|
+
import '@alfalab/core-components-button/esm';
|
|
36
|
+
import './components/base-select-mobile/options-list/Component.js';
|
|
37
|
+
import '@alfalab/core-components-base-modal/esm';
|
|
38
|
+
|
|
39
|
+
var SelectResponsive = forwardRef(function (_a, ref) {
|
|
40
|
+
var footer = _a.footer, swipeable = _a.swipeable, bottomSheetProps = _a.bottomSheetProps, OptionsList = _a.OptionsList, onScroll = _a.onScroll, fieldProps = _a.fieldProps, _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["footer", "swipeable", "bottomSheetProps", "OptionsList", "onScroll", "fieldProps", "breakpoint"]);
|
|
41
|
+
var view = useMedia([
|
|
42
|
+
['mobile', "(max-width: ".concat(breakpoint - 1, "px)")],
|
|
43
|
+
['desktop', "(min-width: ".concat(breakpoint, "px)")],
|
|
44
|
+
], 'desktop')[0];
|
|
45
|
+
return view === 'desktop' ? (React.createElement(Select, __assign({ OptionsList: OptionsList, onScroll: onScroll }, restProps, { ref: ref, fieldProps: fieldProps }))) : (React.createElement(SelectMobile, __assign({ footer: footer, swipeable: swipeable, bottomSheetProps: bottomSheetProps, fieldProps: fieldProps }, restProps, { ref: ref })));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
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
|
-
var styles = {"arrow":"
|
|
5
|
+
var styles = {"arrow":"select__arrow_1lzf1","open":"select__open_1lzf1"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Arrow = function (_a) {
|
|
@@ -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/esm';
|
|
4
|
+
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
var styles = {"checkmark":"
|
|
6
|
+
var styles = {"checkmark":"select__checkmark_16sla","single":"select__single_16sla","selected":"select__selected_16sla"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
var BaseCheckmark = function (_a) {
|
|
@@ -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/esm';
|
|
5
|
-
|
|
5
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as __assign } from '../../tslib.es6-
|
|
1
|
+
import { a as __assign } from '../../tslib.es6-b843a0de.js';
|
|
2
2
|
import React, { isValidElement } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
|
-
import '@alfalab/core-components-checkbox/esm';
|
|
6
4
|
import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
5
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
6
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
7
|
|
|
8
|
-
var styles = {"option":"
|
|
8
|
+
var 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"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
var BaseOption = function (_a) {
|
|
@@ -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,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { BaseOption } from './Component.js';
|
|
2
|
+
import '../../tslib.es6-b843a0de.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'classnames';
|
|
4
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
|
-
import '@alfalab/core-components-checkbox/esm';
|
|
6
5
|
import '../base-checkmark/Component.js';
|
|
7
|
-
|
|
6
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
7
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-b843a0de.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import 'classnames';
|
|
4
3
|
import 'react-merge-refs';
|
|
5
4
|
import '@juggle/resize-observer';
|
|
5
|
+
import 'classnames';
|
|
6
6
|
import 'downshift';
|
|
7
7
|
import '@alfalab/core-components-popover/esm';
|
|
8
8
|
import '@alfalab/hooks';
|
|
9
|
-
export { B as BaseSelect } from '../../Component-
|
|
9
|
+
export { B as BaseSelect } from '../../Component-18490c10.js';
|
|
10
10
|
import '../../utils.js';
|
|
11
11
|
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-18490c10";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export { B as BaseSelect } from '../../Component-18490c10.js';
|
|
2
|
+
import '../../tslib.es6-b843a0de.js';
|
|
2
3
|
import 'react';
|
|
3
|
-
import 'classnames';
|
|
4
4
|
import 'react-merge-refs';
|
|
5
5
|
import '@juggle/resize-observer';
|
|
6
|
+
import 'classnames';
|
|
6
7
|
import 'downshift';
|
|
7
8
|
import '@alfalab/core-components-popover/esm';
|
|
8
9
|
import '@alfalab/hooks';
|
|
9
|
-
export { B as BaseSelect } from '../../Component-cf5c933f.js';
|
|
10
10
|
import '../../utils.js';
|
|
11
11
|
import '../native-select/Component.js';
|