@alfalab/core-components-select 13.0.3 → 13.1.1
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-21b7a86d.d.ts → Component-7546861a.d.ts} +0 -0
- package/{Component-21b7a86d.js → Component-7546861a.js} +27 -17
- package/{Component-ed89ed0b.d.ts → Component-ecfd1f2b.d.ts} +0 -0
- package/{Component-ed89ed0b.js → Component-ecfd1f2b.js} +2 -2
- package/Component.js +6 -2
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-checkmark/Component.d.ts +4 -0
- package/components/base-checkmark/Component.js +29 -0
- package/components/base-checkmark/index.css +32 -0
- package/components/base-checkmark/index.d.ts +1 -0
- package/components/base-checkmark/index.js +13 -0
- package/components/base-option/Component.d.ts +4 -0
- package/components/base-option/Component.js +46 -0
- package/components/base-option/index.css +95 -0
- package/components/base-option/index.d.ts +1 -0
- package/components/base-option/index.js +15 -0
- package/components/base-select/Component.js +2 -2
- package/components/base-select/index.css +7 -7
- package/components/base-select/index.d.ts +1 -1
- package/components/base-select/index.js +2 -2
- package/components/base-select-mobile/Component.js +10 -5
- package/components/base-select-mobile/checkmark/Component.js +8 -3
- package/components/base-select-mobile/checkmark/index.css +12 -7
- package/components/base-select-mobile/checkmark/index.js +3 -0
- 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 +10 -5
- package/components/base-select-mobile/options-list/Component.js +2 -2
- package/components/base-select-mobile/options-list/index.css +9 -9
- package/components/base-select-mobile/options-list/index.js +1 -1
- package/components/checkmark/Component.js +5 -2
- package/components/checkmark/index.css +11 -7
- package/components/checkmark/index.js +2 -0
- package/components/field/Component.js +2 -2
- package/components/field/index.css +9 -9
- package/components/field/index.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +11 -5
- package/components/native-select/Component.js +1 -1
- package/components/native-select/index.js +1 -1
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +8 -8
- package/components/option/Component.js +7 -3
- package/components/option/index.css +20 -20
- package/components/option/index.js +5 -1
- package/components/options-list/Component.js +2 -2
- package/components/options-list/index.css +6 -6
- package/components/options-list/index.js +1 -1
- package/components/select-mobile/Component.js +10 -5
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +10 -5
- package/components/select-modal-mobile/Component.js +10 -5
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +10 -5
- package/components/virtual-options-list/Component.js +2 -2
- package/components/virtual-options-list/index.css +12 -12
- package/components/virtual-options-list/index.js +1 -1
- package/cssm/{Component-095a346d.d.ts → Component-c7975bd7.d.ts} +0 -0
- package/cssm/{Component-095a346d.js → Component-c7975bd7.js} +25 -12
- package/cssm/Component.js +5 -0
- package/cssm/components/base-checkmark/Component.d.ts +4 -0
- package/cssm/components/base-checkmark/Component.js +28 -0
- package/cssm/components/base-checkmark/index.d.ts +1 -0
- package/cssm/components/base-checkmark/index.js +14 -0
- package/cssm/components/base-checkmark/index.module.css +31 -0
- package/cssm/components/base-option/Component.d.ts +4 -0
- package/cssm/components/base-option/Component.js +46 -0
- package/cssm/components/base-option/index.d.ts +1 -0
- package/cssm/components/base-option/index.js +17 -0
- package/cssm/components/base-option/index.module.css +93 -0
- package/cssm/components/base-select-mobile/Component.js +10 -3
- package/cssm/components/base-select-mobile/checkmark/Component.js +7 -2
- package/cssm/components/base-select-mobile/checkmark/index.js +3 -0
- package/cssm/components/base-select-mobile/checkmark/index.module.css +8 -3
- package/cssm/components/base-select-mobile/index.d.ts +1 -1
- package/cssm/components/base-select-mobile/index.js +10 -3
- package/cssm/components/checkmark/Component.js +4 -1
- package/cssm/components/checkmark/index.js +2 -0
- package/cssm/components/checkmark/index.module.css +4 -0
- package/cssm/components/index.d.ts +1 -0
- package/cssm/components/index.js +11 -3
- package/cssm/components/optgroup/index.module.css +2 -2
- package/cssm/components/option/Component.js +6 -1
- package/cssm/components/option/index.js +5 -0
- package/cssm/components/select-mobile/Component.js +10 -3
- package/cssm/components/select-mobile/index.d.ts +1 -1
- package/cssm/components/select-mobile/index.js +10 -3
- package/cssm/components/select-modal-mobile/Component.js +10 -3
- package/cssm/components/select-modal-mobile/index.d.ts +1 -1
- package/cssm/components/select-modal-mobile/index.js +10 -3
- package/cssm/index.js +11 -3
- package/cssm/presets/index.js +10 -3
- package/cssm/presets/useLazyLoading/hook.d.ts +3 -1
- package/cssm/presets/useLazyLoading/hook.js +8 -3
- package/cssm/presets/useSelectWithApply/hook.js +10 -3
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +10 -3
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +10 -3
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.module.css +1 -2
- package/cssm/presets/useSelectWithLoading/hook.d.ts +3 -1
- package/cssm/presets/useSelectWithLoading/hook.js +7 -2
- package/cssm/typings.d.ts +8 -0
- package/esm/{Component-ff051dbb.d.ts → Component-42145c7f.d.ts} +0 -0
- package/esm/{Component-ff051dbb.js → Component-42145c7f.js} +2 -2
- package/esm/{Component-ce96c3e2.d.ts → Component-904366d4.d.ts} +0 -0
- package/esm/{Component-ce96c3e2.js → Component-904366d4.js} +27 -17
- package/esm/Component.js +6 -2
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-checkmark/Component.d.ts +4 -0
- package/esm/components/base-checkmark/Component.js +20 -0
- package/esm/components/base-checkmark/index.css +32 -0
- package/esm/components/base-checkmark/index.d.ts +1 -0
- package/esm/components/base-checkmark/index.js +5 -0
- package/esm/components/base-option/Component.d.ts +4 -0
- package/esm/components/base-option/Component.js +37 -0
- package/esm/components/base-option/index.css +95 -0
- package/esm/components/base-option/index.d.ts +1 -0
- package/esm/components/base-option/index.js +7 -0
- package/esm/components/base-select/Component.js +2 -2
- 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 +2 -2
- package/esm/components/base-select-mobile/Component.js +10 -5
- package/esm/components/base-select-mobile/checkmark/Component.js +8 -3
- package/esm/components/base-select-mobile/checkmark/index.css +12 -7
- package/esm/components/base-select-mobile/checkmark/index.js +3 -0
- 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 +10 -5
- package/esm/components/base-select-mobile/options-list/Component.js +2 -2
- package/esm/components/base-select-mobile/options-list/index.css +9 -9
- package/esm/components/base-select-mobile/options-list/index.js +1 -1
- package/esm/components/checkmark/Component.js +5 -2
- package/esm/components/checkmark/index.css +11 -7
- package/esm/components/checkmark/index.js +2 -0
- package/esm/components/field/Component.js +2 -2
- package/esm/components/field/index.css +9 -9
- package/esm/components/field/index.js +1 -1
- package/esm/components/index.d.ts +1 -0
- package/esm/components/index.js +10 -5
- package/esm/components/native-select/Component.js +1 -1
- package/esm/components/native-select/index.js +1 -1
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +8 -8
- package/esm/components/option/Component.js +10 -6
- package/esm/components/option/index.css +20 -20
- package/esm/components/option/index.js +5 -1
- package/esm/components/options-list/Component.js +2 -2
- package/esm/components/options-list/index.css +6 -6
- package/esm/components/options-list/index.js +1 -1
- package/esm/components/select-mobile/Component.js +10 -5
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +10 -5
- package/esm/components/select-modal-mobile/Component.js +10 -5
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +10 -5
- package/esm/components/virtual-options-list/Component.js +2 -2
- package/esm/components/virtual-options-list/index.css +12 -12
- package/esm/components/virtual-options-list/index.js +1 -1
- package/esm/index.js +10 -5
- package/esm/{intersection-observer-aafd2281.d.ts → intersection-observer-54d01139.d.ts} +0 -0
- package/esm/{intersection-observer-aafd2281.js → intersection-observer-54d01139.js} +0 -0
- package/esm/presets/index.js +10 -5
- package/esm/presets/useLazyLoading/hook.d.ts +3 -1
- package/esm/presets/useLazyLoading/hook.js +10 -6
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +10 -5
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +10 -5
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.css +5 -6
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +10 -5
- package/esm/presets/useSelectWithLoading/hook.d.ts +3 -1
- package/esm/presets/useSelectWithLoading/hook.js +9 -5
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/{tslib.es6-7b5f4eba.d.ts → tslib.es6-795118d5.d.ts} +0 -0
- package/esm/{tslib.es6-7b5f4eba.js → tslib.es6-795118d5.js} +0 -0
- package/esm/typings.d.ts +8 -0
- package/index.js +11 -5
- package/{intersection-observer-6dcf1728.d.ts → intersection-observer-0340401e.d.ts} +0 -0
- package/{intersection-observer-6dcf1728.js → intersection-observer-0340401e.js} +0 -0
- package/modern/{Component-b6cd6efa.d.ts → Component-81d1cf96.d.ts} +0 -0
- package/modern/{Component-b6cd6efa.js → Component-81d1cf96.js} +35 -26
- package/modern/{Component-81ee14d4.d.ts → Component-83edf513.d.ts} +0 -0
- package/modern/{Component-81ee14d4.js → Component-83edf513.js} +1 -1
- package/modern/Component.js +5 -1
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-checkmark/Component.d.ts +4 -0
- package/modern/components/base-checkmark/Component.js +18 -0
- package/modern/components/base-checkmark/index.css +32 -0
- package/modern/components/base-checkmark/index.d.ts +1 -0
- package/modern/components/base-checkmark/index.js +5 -0
- package/modern/components/base-option/Component.d.ts +4 -0
- package/modern/components/base-option/Component.js +34 -0
- package/modern/components/base-option/index.css +95 -0
- package/modern/components/base-option/index.d.ts +1 -0
- package/modern/components/base-option/index.js +6 -0
- package/modern/components/base-select/Component.js +1 -1
- 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 +1 -1
- package/modern/components/base-select-mobile/Component.js +9 -4
- package/modern/components/base-select-mobile/checkmark/Component.js +8 -3
- package/modern/components/base-select-mobile/checkmark/index.css +12 -7
- package/modern/components/base-select-mobile/checkmark/index.js +3 -0
- 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 +9 -4
- package/modern/components/base-select-mobile/options-list/Component.js +1 -1
- package/modern/components/base-select-mobile/options-list/index.css +9 -9
- package/modern/components/checkmark/Component.js +5 -2
- package/modern/components/checkmark/index.css +11 -7
- package/modern/components/checkmark/index.js +2 -0
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +9 -9
- package/modern/components/index.d.ts +1 -0
- package/modern/components/index.js +9 -4
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +8 -8
- package/modern/components/option/Component.js +9 -5
- package/modern/components/option/index.css +20 -20
- package/modern/components/option/index.js +4 -0
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +6 -6
- package/modern/components/select-mobile/Component.js +9 -4
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +9 -4
- package/modern/components/select-modal-mobile/Component.js +9 -4
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +9 -4
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +12 -12
- package/modern/index.js +9 -4
- package/modern/{intersection-observer-aafd2281.d.ts → intersection-observer-54d01139.d.ts} +0 -0
- package/modern/{intersection-observer-aafd2281.js → intersection-observer-54d01139.js} +0 -0
- package/modern/presets/index.js +9 -4
- package/modern/presets/useLazyLoading/hook.d.ts +3 -1
- package/modern/presets/useLazyLoading/hook.js +8 -4
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +9 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +9 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.css +5 -6
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +9 -4
- package/modern/presets/useSelectWithLoading/hook.d.ts +3 -1
- package/modern/presets/useSelectWithLoading/hook.js +8 -4
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/typings.d.ts +8 -0
- package/package.json +6 -4
- package/presets/index.js +10 -5
- package/presets/useLazyLoading/hook.d.ts +3 -1
- package/presets/useLazyLoading/hook.js +10 -6
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +10 -5
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +10 -5
- package/presets/useSelectWithApply/options-list-with-apply/index.css +5 -6
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +10 -5
- package/presets/useSelectWithLoading/hook.d.ts +3 -1
- package/presets/useSelectWithLoading/hook.js +8 -4
- package/presets/useSelectWithLoading/index.css +2 -2
- package/{tslib.es6-e8cb2975.d.ts → tslib.es6-adf850c3.d.ts} +0 -0
- package/{tslib.es6-e8cb2975.js → tslib.es6-adf850c3.js} +0 -0
- package/typings.d.ts +8 -0
package/esm/presets/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../tslib.es6-
|
|
1
|
+
import '../tslib.es6-795118d5.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -8,12 +8,16 @@ import '@juggle/resize-observer';
|
|
|
8
8
|
import 'downshift';
|
|
9
9
|
import '@alfalab/core-components-popover/esm';
|
|
10
10
|
import '@alfalab/hooks';
|
|
11
|
-
import '../Component-
|
|
11
|
+
import '../Component-42145c7f.js';
|
|
12
12
|
import '../utils.js';
|
|
13
13
|
import '../components/native-select/Component.js';
|
|
14
14
|
import '@alfalab/core-components-form-control/esm';
|
|
15
15
|
import '../components/field/Component.js';
|
|
16
16
|
import '../components/optgroup/Component.js';
|
|
17
|
+
import '@alfalab/core-components/badge';
|
|
18
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
19
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
20
|
+
import '../components/base-select-mobile/checkmark/Component.js';
|
|
17
21
|
import '@alfalab/core-components-checkbox/esm';
|
|
18
22
|
import '../components/checkmark/Component.js';
|
|
19
23
|
import '../components/option/Component.js';
|
|
@@ -23,12 +27,13 @@ import '../Component.js';
|
|
|
23
27
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
28
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
29
|
import '@alfalab/core-components-button/esm';
|
|
26
|
-
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../Component-
|
|
27
|
-
import '../components/base-
|
|
30
|
+
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../Component-904366d4.js';
|
|
31
|
+
import '../components/base-checkmark/Component.js';
|
|
28
32
|
import '@alfalab/core-components-base-modal/esm';
|
|
29
33
|
import '../components/base-select-mobile/options-list/Component.js';
|
|
30
34
|
import 'react-virtual';
|
|
35
|
+
import '../components/base-option/Component.js';
|
|
31
36
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
37
|
export { useSelectWithLoading } from './useSelectWithLoading/hook.js';
|
|
33
38
|
export { useLazyLoading } from './useLazyLoading/hook.js';
|
|
34
|
-
import '../intersection-observer-
|
|
39
|
+
import '../intersection-observer-54d01139.js';
|
|
@@ -12,6 +12,8 @@ type useLazyLoadingProps = {
|
|
|
12
12
|
initialOffset?: number;
|
|
13
13
|
/** Скелетон загружаемых элементов */
|
|
14
14
|
skeleton?: React.ReactNode;
|
|
15
|
+
/** Компонент пункта меню */
|
|
16
|
+
Option?: React.FC<OptionProps>;
|
|
15
17
|
/**
|
|
16
18
|
* Функция-загрузчик опций.
|
|
17
19
|
* @param offset - текущая страница
|
|
@@ -24,7 +26,7 @@ type useLazyLoadingProps = {
|
|
|
24
26
|
*/
|
|
25
27
|
optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
|
|
26
28
|
};
|
|
27
|
-
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, }: useLazyLoadingProps): {
|
|
29
|
+
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, Option, }: useLazyLoadingProps): {
|
|
28
30
|
optionsProps: {
|
|
29
31
|
Option: (props: OptionProps) => JSX.Element;
|
|
30
32
|
options: OptionShape[];
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as __spreadArray, a as __assign } from '../../tslib.es6-795118d5.js';
|
|
2
2
|
import React, { useReducer, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
+
import '@alfalab/core-components/badge';
|
|
5
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
6
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
|
+
import '../../components/base-select-mobile/checkmark/Component.js';
|
|
4
8
|
import '@alfalab/core-components-checkbox/esm';
|
|
5
9
|
import '../../components/checkmark/Component.js';
|
|
6
10
|
import { Option } from '../../components/option/Component.js';
|
|
7
11
|
import { Skeleton } from '@alfalab/core-components-skeleton/esm';
|
|
8
|
-
import '../../intersection-observer-
|
|
12
|
+
import '../../intersection-observer-54d01139.js';
|
|
9
13
|
|
|
10
|
-
var styles = {"skeleton":"
|
|
14
|
+
var styles = {"skeleton":"select__skeleton_1ukg3"};
|
|
11
15
|
require('./index.css')
|
|
12
16
|
|
|
13
17
|
var DEBOUNCE_TIMEOUT = 300;
|
|
@@ -32,7 +36,7 @@ var actions = {
|
|
|
32
36
|
},
|
|
33
37
|
};
|
|
34
38
|
function useLazyLoading(_a) {
|
|
35
|
-
var _b = _a.limit, limit = _b === void 0 ? 10 : _b, _c = _a.initialOffset, initialOffset = _c === void 0 ? 0 : _c, optionsFetcher = _a.optionsFetcher, _d = _a.skeleton, skeleton = _d === void 0 ? React.createElement(Skeleton, { className: styles.skeleton, visible: true }) : _d;
|
|
39
|
+
var _b = _a.limit, limit = _b === void 0 ? 10 : _b, _c = _a.initialOffset, initialOffset = _c === void 0 ? 0 : _c, optionsFetcher = _a.optionsFetcher, _d = _a.skeleton, skeleton = _d === void 0 ? React.createElement(Skeleton, { className: styles.skeleton, visible: true }) : _d, _e = _a.Option, Option$1 = _e === void 0 ? Option : _e;
|
|
36
40
|
var initialOptions = [];
|
|
37
41
|
var initialLoading = false;
|
|
38
42
|
var lazyLoadingInitialState = {
|
|
@@ -68,7 +72,7 @@ function useLazyLoading(_a) {
|
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
};
|
|
71
|
-
var
|
|
75
|
+
var _f = useReducer(lazyLoadingReducer, lazyLoadingInitialState), _g = _f[0], opened = _g.opened, offset = _g.offset, options = _g.options, loading = _g.loading, allOptionsLoaded = _g.allOptionsLoaded, queryString = _g.queryString, dispatch = _f[1];
|
|
72
76
|
var abortFetchingOptionsRef = useRef();
|
|
73
77
|
var fetchNextOffsetOptions = useCallback(function () {
|
|
74
78
|
dispatch(actions.fetchOptionsStart());
|
|
@@ -168,7 +172,7 @@ function useLazyLoading(_a) {
|
|
|
168
172
|
}, DEBOUNCE_TIMEOUT);
|
|
169
173
|
/* eslint-enable */
|
|
170
174
|
}, []);
|
|
171
|
-
var renderOption =
|
|
175
|
+
var renderOption = function (props) { return (React.createElement(Option$1, __assign({}, props, { highlighted: loading ? false : props.highlighted }))); };
|
|
172
176
|
var skeletonOptions = useMemo(function () {
|
|
173
177
|
return Array(loading ? limit : 0)
|
|
174
178
|
.fill(0)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-795118d5.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -8,12 +8,16 @@ import '@juggle/resize-observer';
|
|
|
8
8
|
import 'downshift';
|
|
9
9
|
import '@alfalab/core-components-popover/esm';
|
|
10
10
|
import '@alfalab/hooks';
|
|
11
|
-
import '../../Component-
|
|
11
|
+
import '../../Component-42145c7f.js';
|
|
12
12
|
import '../../utils.js';
|
|
13
13
|
import '../../components/native-select/Component.js';
|
|
14
14
|
import '@alfalab/core-components-form-control/esm';
|
|
15
15
|
import '../../components/field/Component.js';
|
|
16
16
|
import '../../components/optgroup/Component.js';
|
|
17
|
+
import '@alfalab/core-components/badge';
|
|
18
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
19
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
20
|
+
import '../../components/base-select-mobile/checkmark/Component.js';
|
|
17
21
|
import '@alfalab/core-components-checkbox/esm';
|
|
18
22
|
import '../../components/checkmark/Component.js';
|
|
19
23
|
import '../../components/option/Component.js';
|
|
@@ -23,10 +27,11 @@ import '../../Component.js';
|
|
|
23
27
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
28
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
29
|
import '@alfalab/core-components-button/esm';
|
|
26
|
-
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../../Component-
|
|
27
|
-
import '../../components/base-
|
|
30
|
+
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../../Component-904366d4.js';
|
|
31
|
+
import '../../components/base-checkmark/Component.js';
|
|
28
32
|
import '@alfalab/core-components-base-modal/esm';
|
|
29
33
|
import '../../components/base-select-mobile/options-list/Component.js';
|
|
30
34
|
import 'react-virtual';
|
|
35
|
+
import '../../components/base-option/Component.js';
|
|
31
36
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../intersection-observer-
|
|
37
|
+
import '../../intersection-observer-54d01139.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../../tslib.es6-
|
|
1
|
+
import '../../../tslib.es6-795118d5.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -8,12 +8,16 @@ import '@juggle/resize-observer';
|
|
|
8
8
|
import 'downshift';
|
|
9
9
|
import '@alfalab/core-components-popover/esm';
|
|
10
10
|
import '@alfalab/hooks';
|
|
11
|
-
import '../../../Component-
|
|
11
|
+
import '../../../Component-42145c7f.js';
|
|
12
12
|
import '../../../utils.js';
|
|
13
13
|
import '../../../components/native-select/Component.js';
|
|
14
14
|
import '@alfalab/core-components-form-control/esm';
|
|
15
15
|
import '../../../components/field/Component.js';
|
|
16
16
|
import '../../../components/optgroup/Component.js';
|
|
17
|
+
import '@alfalab/core-components/badge';
|
|
18
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
19
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
20
|
+
import '../../../components/base-select-mobile/checkmark/Component.js';
|
|
17
21
|
import '@alfalab/core-components-checkbox/esm';
|
|
18
22
|
import '../../../components/checkmark/Component.js';
|
|
19
23
|
import '../../../components/option/Component.js';
|
|
@@ -23,10 +27,11 @@ import '../../../Component.js';
|
|
|
23
27
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
28
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
29
|
import '@alfalab/core-components-button/esm';
|
|
26
|
-
export { O as OptionsListWithApply } from '../../../Component-
|
|
27
|
-
import '../../../components/base-
|
|
30
|
+
export { O as OptionsListWithApply } from '../../../Component-904366d4.js';
|
|
31
|
+
import '../../../components/base-checkmark/Component.js';
|
|
28
32
|
import '@alfalab/core-components-base-modal/esm';
|
|
29
33
|
import '../../../components/base-select-mobile/options-list/Component.js';
|
|
30
34
|
import 'react-virtual';
|
|
35
|
+
import '../../../components/base-option/Component.js';
|
|
31
36
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../../intersection-observer-
|
|
37
|
+
import '../../../intersection-observer-54d01139.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: xx0eo */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-border-secondary: #e7e9eb;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
:root {
|
|
15
15
|
--gap-xs: 8px;
|
|
16
16
|
--gap-s: 12px;
|
|
17
|
-
--gap-m: 16px;
|
|
18
17
|
}
|
|
19
18
|
:root {
|
|
20
19
|
|
|
@@ -26,14 +25,14 @@
|
|
|
26
25
|
|
|
27
26
|
/* optgroup */
|
|
28
27
|
}
|
|
29
|
-
.
|
|
28
|
+
.select__footer_crag3 {
|
|
30
29
|
background: var(--color-light-bg-primary);
|
|
31
|
-
padding: var(--gap-s)
|
|
30
|
+
padding: var(--gap-s);
|
|
32
31
|
outline: none
|
|
33
32
|
}
|
|
34
|
-
.
|
|
33
|
+
.select__footer_crag3 > * + * {
|
|
35
34
|
margin-left: var(--gap-xs);
|
|
36
35
|
}
|
|
37
|
-
.
|
|
36
|
+
.select__withBorder_crag3 {
|
|
38
37
|
box-shadow: inset 0 1px 0 var(--color-light-border-secondary);
|
|
39
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../../Component-
|
|
1
|
+
export * from "../../../Component-904366d4";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../../tslib.es6-
|
|
1
|
+
import '../../../tslib.es6-795118d5.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -8,12 +8,16 @@ import '@juggle/resize-observer';
|
|
|
8
8
|
import 'downshift';
|
|
9
9
|
import '@alfalab/core-components-popover/esm';
|
|
10
10
|
import '@alfalab/hooks';
|
|
11
|
-
import '../../../Component-
|
|
11
|
+
import '../../../Component-42145c7f.js';
|
|
12
12
|
import '../../../utils.js';
|
|
13
13
|
import '../../../components/native-select/Component.js';
|
|
14
14
|
import '@alfalab/core-components-form-control/esm';
|
|
15
15
|
import '../../../components/field/Component.js';
|
|
16
16
|
import '../../../components/optgroup/Component.js';
|
|
17
|
+
import '@alfalab/core-components/badge';
|
|
18
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
19
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
20
|
+
import '../../../components/base-select-mobile/checkmark/Component.js';
|
|
17
21
|
import '@alfalab/core-components-checkbox/esm';
|
|
18
22
|
import '../../../components/checkmark/Component.js';
|
|
19
23
|
import '../../../components/option/Component.js';
|
|
@@ -23,10 +27,11 @@ import '../../../Component.js';
|
|
|
23
27
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
24
28
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
25
29
|
import '@alfalab/core-components-button/esm';
|
|
26
|
-
export { O as OptionsListWithApply } from '../../../Component-
|
|
27
|
-
import '../../../components/base-
|
|
30
|
+
export { O as OptionsListWithApply } from '../../../Component-904366d4.js';
|
|
31
|
+
import '../../../components/base-checkmark/Component.js';
|
|
28
32
|
import '@alfalab/core-components-base-modal/esm';
|
|
29
33
|
import '../../../components/base-select-mobile/options-list/Component.js';
|
|
30
34
|
import 'react-virtual';
|
|
35
|
+
import '../../../components/base-option/Component.js';
|
|
31
36
|
import '@alfalab/core-components-skeleton/esm';
|
|
32
|
-
import '../../../intersection-observer-
|
|
37
|
+
import '../../../intersection-observer-54d01139.js';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { BaseSelectProps, OptionProps, OptionShape } from "../../typings";
|
|
3
4
|
type useSelectWithLoadingProps = {
|
|
4
5
|
loading?: boolean;
|
|
5
6
|
visibleOptions?: BaseSelectProps['visibleOptions'];
|
|
7
|
+
Option?: React.FC<OptionProps>;
|
|
6
8
|
};
|
|
7
|
-
declare function useSelectWithLoading({ loading, visibleOptions, }: useSelectWithLoadingProps): {
|
|
9
|
+
declare function useSelectWithLoading({ loading, visibleOptions, Option, }: useSelectWithLoadingProps): {
|
|
8
10
|
Option: (props: OptionProps) => JSX.Element;
|
|
9
11
|
options: OptionShape[];
|
|
10
12
|
} | null;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { a as __assign } from '../../tslib.es6-
|
|
2
|
-
import React
|
|
1
|
+
import { a as __assign } from '../../tslib.es6-795118d5.js';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
+
import '@alfalab/core-components/badge';
|
|
5
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
6
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
|
+
import '../../components/base-select-mobile/checkmark/Component.js';
|
|
4
8
|
import '@alfalab/core-components-checkbox/esm';
|
|
5
9
|
import '../../components/checkmark/Component.js';
|
|
6
10
|
import { Option } from '../../components/option/Component.js';
|
|
7
11
|
import { Skeleton } from '@alfalab/core-components-skeleton/esm';
|
|
8
12
|
|
|
9
|
-
var styles = {"skeleton":"
|
|
13
|
+
var styles = {"skeleton":"select__skeleton_d58ax"};
|
|
10
14
|
require('./index.css')
|
|
11
15
|
|
|
12
16
|
function useSelectWithLoading(_a) {
|
|
13
|
-
var _b = _a.loading, loading = _b === void 0 ? false : _b, _c = _a.visibleOptions, visibleOptions = _c === void 0 ? 6 : _c;
|
|
14
|
-
var renderOption =
|
|
17
|
+
var _b = _a.loading, loading = _b === void 0 ? false : _b, _c = _a.visibleOptions, visibleOptions = _c === void 0 ? 6 : _c, _d = _a.Option, Option$1 = _d === void 0 ? Option : _d;
|
|
18
|
+
var renderOption = function (props) { return (React.createElement(Option$1, __assign({}, props, { Checkmark: null, highlighted: loading ? false : props.highlighted }))); };
|
|
15
19
|
var options = Array(visibleOptions)
|
|
16
20
|
.fill(0)
|
|
17
21
|
.map(function (_, key) { return ({
|
|
File without changes
|
|
File without changes
|
package/esm/typings.d.ts
CHANGED
|
@@ -516,6 +516,14 @@ type OptionProps = {
|
|
|
516
516
|
* Идентификатор для систем автоматизированного тестирования
|
|
517
517
|
*/
|
|
518
518
|
dataTestId?: string;
|
|
519
|
+
/**
|
|
520
|
+
* Позиция иконки "галочки"
|
|
521
|
+
*/
|
|
522
|
+
checkmarkPosition?: 'before' | 'after';
|
|
523
|
+
/**
|
|
524
|
+
* Мобильная верcия option.
|
|
525
|
+
*/
|
|
526
|
+
mobile?: boolean;
|
|
519
527
|
};
|
|
520
528
|
type CheckmarkProps = {
|
|
521
529
|
/**
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('./tslib.es6-
|
|
5
|
+
require('./tslib.es6-adf850c3.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
@@ -12,12 +12,16 @@ require('@juggle/resize-observer');
|
|
|
12
12
|
require('downshift');
|
|
13
13
|
require('@alfalab/core-components-popover');
|
|
14
14
|
require('@alfalab/hooks');
|
|
15
|
-
var components_baseSelect_Component = require('./Component-
|
|
15
|
+
var components_baseSelect_Component = require('./Component-ecfd1f2b.js');
|
|
16
16
|
var utils = require('./utils.js');
|
|
17
17
|
require('./components/native-select/Component.js');
|
|
18
18
|
require('@alfalab/core-components-form-control');
|
|
19
19
|
var components_field_Component = require('./components/field/Component.js');
|
|
20
20
|
var components_optgroup_Component = require('./components/optgroup/Component.js');
|
|
21
|
+
require('@alfalab/core-components/badge');
|
|
22
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
23
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
24
|
+
require('./components/base-select-mobile/checkmark/Component.js');
|
|
21
25
|
require('@alfalab/core-components-checkbox');
|
|
22
26
|
require('./components/checkmark/Component.js');
|
|
23
27
|
var components_option_Component = require('./components/option/Component.js');
|
|
@@ -27,16 +31,17 @@ var Component = require('./Component.js');
|
|
|
27
31
|
require('@alfalab/core-components-bottom-sheet');
|
|
28
32
|
require('@alfalab/core-components-modal/mobile');
|
|
29
33
|
require('@alfalab/core-components-button');
|
|
30
|
-
var presets_useSelectWithApply_hook = require('./Component-
|
|
31
|
-
require('./components/base-
|
|
34
|
+
var presets_useSelectWithApply_hook = require('./Component-7546861a.js');
|
|
35
|
+
require('./components/base-checkmark/Component.js');
|
|
32
36
|
require('@alfalab/core-components-base-modal');
|
|
33
37
|
require('./components/base-select-mobile/options-list/Component.js');
|
|
34
38
|
require('react-virtual');
|
|
35
39
|
var components_virtualOptionsList_Component = require('./components/virtual-options-list/Component.js');
|
|
40
|
+
var components_baseOption_Component = require('./components/base-option/Component.js');
|
|
36
41
|
require('@alfalab/core-components-skeleton');
|
|
37
42
|
var presets_useSelectWithLoading_hook = require('./presets/useSelectWithLoading/hook.js');
|
|
38
43
|
var presets_useLazyLoading_hook = require('./presets/useLazyLoading/hook.js');
|
|
39
|
-
require('./intersection-observer-
|
|
44
|
+
require('./intersection-observer-0340401e.js');
|
|
40
45
|
|
|
41
46
|
|
|
42
47
|
|
|
@@ -59,5 +64,6 @@ exports.SelectMobile = presets_useSelectWithApply_hook.SelectMobile;
|
|
|
59
64
|
exports.SelectModalMobile = presets_useSelectWithApply_hook.SelectModalMobile;
|
|
60
65
|
exports.useSelectWithApply = presets_useSelectWithApply_hook.useSelectWithApply;
|
|
61
66
|
exports.VirtualOptionsList = components_virtualOptionsList_Component.VirtualOptionsList;
|
|
67
|
+
exports.BaseOption = components_baseOption_Component.BaseOption;
|
|
62
68
|
exports.useSelectWithLoading = presets_useSelectWithLoading_hook.useSelectWithLoading;
|
|
63
69
|
exports.useLazyLoading = presets_useLazyLoading_hook.useLazyLoading;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,11 +5,15 @@ import { Arrow } from './components/arrow/Component.js';
|
|
|
5
5
|
import mergeRefs from 'react-merge-refs';
|
|
6
6
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
7
7
|
import '@alfalab/hooks';
|
|
8
|
-
import { g as getDataTestId } from './Component-
|
|
8
|
+
import { g as getDataTestId } from './Component-83edf513.js';
|
|
9
9
|
import { processOptions } from './utils.js';
|
|
10
10
|
import '@alfalab/core-components-form-control/modern';
|
|
11
11
|
import { Field } from './components/field/Component.js';
|
|
12
12
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
13
|
+
import '@alfalab/core-components/badge';
|
|
14
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
15
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
16
|
+
import { Checkmark } from './components/base-select-mobile/checkmark/Component.js';
|
|
13
17
|
import '@alfalab/core-components-checkbox/modern';
|
|
14
18
|
import { Option } from './components/option/Component.js';
|
|
15
19
|
import '@alfalab/core-components-scrollbar/modern';
|
|
@@ -18,11 +22,12 @@ import './Component.js';
|
|
|
18
22
|
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/modern';
|
|
19
23
|
import { ModalMobile } from '@alfalab/core-components-modal/modern/mobile';
|
|
20
24
|
import { Button } from '@alfalab/core-components-button/modern';
|
|
21
|
-
import {
|
|
25
|
+
import { BaseCheckmark } from './components/base-checkmark/Component.js';
|
|
22
26
|
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
23
27
|
import 'react-virtual';
|
|
28
|
+
import { BaseOption } from './components/base-option/Component.js';
|
|
24
29
|
import '@alfalab/core-components-skeleton/modern';
|
|
25
|
-
import './intersection-observer-
|
|
30
|
+
import './intersection-observer-54d01139.js';
|
|
26
31
|
|
|
27
32
|
const SELECT_ALL_KEY = 'select_all';
|
|
28
33
|
const selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
@@ -90,7 +95,7 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
90
95
|
};
|
|
91
96
|
}
|
|
92
97
|
|
|
93
|
-
var styles = {"footer":"
|
|
98
|
+
var styles = {"footer":"select__footer_crag3","withBorder":"select__withBorder_crag3"};
|
|
94
99
|
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
95
100
|
|
|
96
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) => {
|
|
@@ -137,7 +142,7 @@ const OptionsListWithApply = forwardRef(({ toggleMenu, OptionsList: OptionsList$
|
|
|
137
142
|
showClear && (React.createElement(Button, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))) }));
|
|
138
143
|
});
|
|
139
144
|
|
|
140
|
-
var styles$1 = {"component":"
|
|
145
|
+
var styles$1 = {"component":"select__component_16wu7","popoverInner":"select__popoverInner_16wu7","sheet":"select__sheet_16wu7","sheetContent":"select__sheetContent_16wu7","sheetContainer":"select__sheetContainer_16wu7","block":"select__block_16wu7","option":"select__option_16wu7","optionGroup":"select__optionGroup_16wu7"};
|
|
141
146
|
require('./components/base-select-mobile/index.css')
|
|
142
147
|
|
|
143
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, swipeable, footer, isBottomSheet, bottomSheetProps, }, ref) => {
|
|
@@ -281,26 +286,30 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
281
286
|
openMenu();
|
|
282
287
|
}
|
|
283
288
|
};
|
|
284
|
-
const getOptionProps = (option, index) =>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
289
|
+
const getOptionProps = (option, index) => {
|
|
290
|
+
const selectedItem = selectedItems.includes(option);
|
|
291
|
+
return {
|
|
292
|
+
...optionProps,
|
|
293
|
+
mobile: true,
|
|
294
|
+
className: cn(styles$1.option, optionClassName),
|
|
295
|
+
innerProps: getItemProps({
|
|
296
|
+
index,
|
|
297
|
+
item: option,
|
|
298
|
+
disabled: option.disabled,
|
|
299
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
300
|
+
}),
|
|
301
|
+
multiple,
|
|
288
302
|
index,
|
|
289
|
-
|
|
303
|
+
option,
|
|
304
|
+
size: optionsSize,
|
|
290
305
|
disabled: option.disabled,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
highlighted: index === highlightedIndex,
|
|
299
|
-
selected: selectedItems.includes(option),
|
|
300
|
-
dataTestId: getDataTestId(dataTestId, 'option'),
|
|
301
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
302
|
-
Checkmark: () => React.createElement(Checkmark, { selected: selectedItems.includes(option) }),
|
|
303
|
-
});
|
|
306
|
+
highlighted: index === highlightedIndex,
|
|
307
|
+
selected: selectedItem,
|
|
308
|
+
dataTestId: getDataTestId(dataTestId, 'option'),
|
|
309
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
310
|
+
Checkmark: () => Option$1 === BaseOption ? (React.createElement(BaseCheckmark, { selected: selectedItem, multiple: multiple })) : (React.createElement(Checkmark, { selected: selectedItem })),
|
|
311
|
+
};
|
|
312
|
+
};
|
|
304
313
|
useEffect(() => {
|
|
305
314
|
if (defaultOpen)
|
|
306
315
|
openMenu();
|
|
@@ -344,10 +353,10 @@ const BaseSelectMobile = forwardRef(({ dataTestId, className, fieldClassName, op
|
|
|
344
353
|
}, dataTestId: getDataTestId(dataTestId, 'field'), ...fieldProps }),
|
|
345
354
|
name && renderValue(),
|
|
346
355
|
isBottomSheet ? (React.createElement(BottomSheet, { open: open, onClose: handleClose, className: styles$1.sheet, contentClassName: styles$1.sheetContent, containerClassName: styles$1.sheetContainer, title: placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, ...bottomSheetProps },
|
|
347
|
-
React.createElement("div", { ...menuProps, className:
|
|
356
|
+
React.createElement("div", { ...menuProps, className: optionsListClassName },
|
|
348
357
|
React.createElement(OptionsListWithApply, { ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList$1, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles$1.optionGroup, optionGroupClassName), showFooter: multiple, onApply: handleApply, onClear: handleClear })))) : (React.createElement(ModalMobile, { open: open, onClose: handleClose, contentClassName: styles$1.sheetContent, hasCloser: true },
|
|
349
|
-
React.createElement(ModalMobile.Header, { hasCloser: true, title: placeholder, sticky: true
|
|
350
|
-
React.createElement("div", { ...menuProps, className:
|
|
358
|
+
React.createElement(ModalMobile.Header, { hasCloser: true, title: placeholder, sticky: true }),
|
|
359
|
+
React.createElement("div", { ...menuProps, className: optionsListClassName },
|
|
351
360
|
React.createElement(OptionsListWithApply, { ...optionsListProps, flatOptions: flatOptions, highlightedIndex: highlightedIndex, size: size, options: options, OptionsList: OptionsList$1, Optgroup: Optgroup$1, Option: Option$1, selectedItems: selectedItems, setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, getOptionProps: getOptionProps, dataTestId: getDataTestId(dataTestId, 'options-list'), optionGroupClassName: cn(styles$1.optionGroup, optionGroupClassName), showFooter: multiple, onApply: handleApply, onClear: handleClear }))))));
|
|
352
361
|
});
|
|
353
362
|
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ const getDataTestId = (dataTestId, element) => {
|
|
|
13
13
|
return dataTestId ? `${dataTestId}${elementPart}` : undefined;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
var styles = {"component":"
|
|
16
|
+
var styles = {"component":"select__component_u7ia8","popoverInner":"select__popoverInner_u7ia8","optionsList":"select__optionsList_u7ia8","nativeSelect":"select__nativeSelect_u7ia8","block":"select__block_u7ia8"};
|
|
17
17
|
require('./components/base-select/index.css')
|
|
18
18
|
|
|
19
19
|
const BaseSelect = forwardRef(({ dataTestId, className, fieldClassName, optionsListClassName, optionClassName, popperClassName, options, autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, nativeSelect = false, defaultOpen = false, open: openProp, popoverPosition = 'bottom-start', preventFlip = true, optionsListWidth = 'content', name, id, selected, size = 's', optionsSize = size, error, hint, block, label, labelView, placeholder, fieldProps = {}, optionsListProps = {}, optionProps = {}, valueRenderer, onChange, onOpen, onFocus, onBlur, onScroll, Arrow, Field = () => null, OptionsList = () => null, Optgroup = () => null, Option = () => null, updatePopover, zIndexPopover, showEmptyOptionsList = false, visibleOptions, }, ref) => {
|
package/modern/Component.js
CHANGED
|
@@ -7,12 +7,16 @@ import '@juggle/resize-observer';
|
|
|
7
7
|
import 'downshift';
|
|
8
8
|
import '@alfalab/core-components-popover/modern';
|
|
9
9
|
import '@alfalab/hooks';
|
|
10
|
-
import { B as BaseSelect } from './Component-
|
|
10
|
+
import { B as BaseSelect } from './Component-83edf513.js';
|
|
11
11
|
import './utils.js';
|
|
12
12
|
import './components/native-select/Component.js';
|
|
13
13
|
import '@alfalab/core-components-form-control/modern';
|
|
14
14
|
import { Field } from './components/field/Component.js';
|
|
15
15
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
16
|
+
import '@alfalab/core-components/badge';
|
|
17
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
18
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
19
|
+
import './components/base-select-mobile/checkmark/Component.js';
|
|
16
20
|
import '@alfalab/core-components-checkbox/modern';
|
|
17
21
|
import './components/checkmark/Component.js';
|
|
18
22
|
import { Option } from './components/option/Component.js';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
4
4
|
|
|
5
|
-
var styles = {"arrow":"
|
|
5
|
+
var styles = {"arrow":"select__arrow_1lcti","open":"select__open_1lcti"};
|
|
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: 15r8t */
|
|
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_1lcti {
|
|
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_1lcti {
|
|
36
36
|
transform: var(--arrow-transform);
|
|
37
37
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
4
|
+
import { Checkbox } from '@alfalab/core-components-checkbox/modern';
|
|
5
|
+
|
|
6
|
+
var styles = {"checkmark":"select__checkmark_678c4","single":"select__single_678c4","selected":"select__selected_678c4"};
|
|
7
|
+
require('./index.css')
|
|
8
|
+
|
|
9
|
+
const BaseCheckmark = ({ selected, disabled = false, className, multiple, }) => {
|
|
10
|
+
const checkmarkClassNames = cn(styles.checkmark, className, {
|
|
11
|
+
[styles.multiple]: multiple,
|
|
12
|
+
[styles.single]: !multiple,
|
|
13
|
+
[styles.selected]: selected,
|
|
14
|
+
});
|
|
15
|
+
return multiple ? (React.createElement(Checkbox, { checked: selected, disabled: disabled, className: checkmarkClassNames, size: 'm', onClick: (event) => event.stopPropagation() })) : (React.createElement(CheckmarkMIcon, { className: checkmarkClassNames }));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { BaseCheckmark };
|