@alfalab/core-components-select 14.2.0 → 14.3.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-3b7dfcdb.d.ts → Component-6359d86d.d.ts} +23 -1
- package/{Component-3b7dfcdb.js → Component-6359d86d.js} +27 -22
- package/Component.js +1 -1
- package/Component.responsive.js +4 -3
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +4 -4
- package/components/base-option/Component.js +2 -2
- package/components/base-option/index.css +13 -13
- package/components/base-select/Component.js +2 -2
- package/components/base-select/index.css +8 -8
- package/components/base-select/index.js +1 -1
- package/components/base-select-mobile/Component.js +2 -2
- package/components/base-select-mobile/footer/Component.js +1 -1
- package/components/base-select-mobile/footer/index.css +5 -5
- package/components/base-select-mobile/index.css +10 -10
- package/components/base-select-mobile/index.js +1 -1
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +10 -10
- package/components/checkmark-mobile/Component.js +1 -1
- package/components/checkmark-mobile/index.css +6 -6
- package/components/field/Component.js +1 -1
- package/components/field/index.css +9 -9
- package/components/index.js +5 -4
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +2 -2
- package/components/option/index.css +20 -20
- package/components/options-list/Component.js +1 -1
- package/components/options-list/index.css +9 -9
- package/components/select-mobile/Component.js +4 -3
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +4 -3
- package/components/select-modal-mobile/Component.js +4 -3
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +4 -3
- package/components/virtual-options-list/Component.js +1 -1
- package/components/virtual-options-list/index.css +15 -15
- package/{modern/Component-8dc39be2.d.ts → cssm/Component-4727d474.d.ts} +23 -1
- package/cssm/{Component-75d13e23.js → Component-4727d474.js} +26 -21
- package/cssm/Component.responsive.js +3 -1
- package/cssm/components/base-option/Component.js +1 -1
- package/cssm/components/index.js +4 -2
- package/cssm/components/option/Component.js +1 -1
- package/cssm/components/select-mobile/Component.js +3 -1
- package/cssm/components/select-mobile/index.d.ts +1 -1
- package/cssm/components/select-mobile/index.js +3 -1
- package/cssm/components/select-modal-mobile/Component.js +3 -1
- package/cssm/components/select-modal-mobile/index.d.ts +1 -1
- package/cssm/components/select-modal-mobile/index.js +3 -1
- package/{esm/hook-4b555174.d.ts → cssm/hook-b4e70cb0.d.ts} +15 -4
- package/cssm/index.js +4 -2
- package/cssm/mobile.js +3 -1
- package/cssm/presets/index.d.ts +1 -1
- package/cssm/presets/index.js +3 -1
- package/cssm/presets/useSelectWithApply/hook.js +3 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +0 -9
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +23 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +22 -0
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +3 -1
- package/cssm/responsive.js +3 -1
- package/{cssm/Component-75d13e23.d.ts → esm/Component-770ea482.d.ts} +23 -1
- package/esm/{Component-06bb5812.js → Component-770ea482.js} +27 -22
- package/esm/Component.js +1 -1
- package/esm/Component.responsive.js +4 -3
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-checkmark/Component.js +1 -1
- package/esm/components/base-checkmark/index.css +4 -4
- package/esm/components/base-option/Component.js +2 -2
- package/esm/components/base-option/index.css +13 -13
- package/esm/components/base-select/Component.js +2 -2
- package/esm/components/base-select/index.css +8 -8
- package/esm/components/base-select/index.js +1 -1
- package/esm/components/base-select-mobile/Component.js +2 -2
- package/esm/components/base-select-mobile/footer/Component.js +1 -1
- package/esm/components/base-select-mobile/footer/index.css +5 -5
- package/esm/components/base-select-mobile/index.css +10 -10
- package/esm/components/base-select-mobile/index.js +1 -1
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +10 -10
- package/esm/components/checkmark-mobile/Component.js +1 -1
- package/esm/components/checkmark-mobile/index.css +6 -6
- package/esm/components/field/Component.js +1 -1
- package/esm/components/field/index.css +9 -9
- package/esm/components/index.js +5 -4
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +2 -2
- package/esm/components/option/index.css +20 -20
- package/esm/components/options-list/Component.js +1 -1
- package/esm/components/options-list/index.css +9 -9
- package/esm/components/select-mobile/Component.js +4 -3
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +4 -3
- package/esm/components/select-modal-mobile/Component.js +4 -3
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +4 -3
- package/esm/components/virtual-options-list/Component.js +1 -1
- package/esm/components/virtual-options-list/index.css +15 -15
- package/{cssm/hook-4b555174.d.ts → esm/hook-b4e70cb0.d.ts} +15 -4
- package/esm/index-3885b0d7.d.ts +1 -1
- package/esm/index.js +5 -4
- package/esm/mobile.js +4 -3
- package/esm/presets/index.d.ts +1 -1
- package/esm/presets/index.js +4 -3
- package/esm/presets/useLazyLoading/hook.js +2 -2
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +4 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -12
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +15 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/responsive.js +4 -3
- package/{hook-4b555174.d.ts → hook-b4e70cb0.d.ts} +15 -4
- package/index-3885b0d7.d.ts +1 -1
- package/index.js +5 -4
- package/mobile.js +4 -3
- package/{esm/Component-06bb5812.d.ts → modern/Component-dfa36aee.d.ts} +23 -1
- package/modern/{Component-8dc39be2.js → Component-dfa36aee.js} +31 -17
- package/modern/Component.js +1 -1
- package/modern/Component.responsive.js +4 -3
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-checkmark/Component.js +1 -1
- package/modern/components/base-checkmark/index.css +4 -4
- package/modern/components/base-option/Component.js +2 -2
- package/modern/components/base-option/index.css +13 -13
- package/modern/components/base-select/Component.js +2 -2
- package/modern/components/base-select/index.css +8 -8
- package/modern/components/base-select/index.js +1 -1
- package/modern/components/base-select-mobile/Component.js +2 -2
- package/modern/components/base-select-mobile/footer/Component.js +1 -1
- package/modern/components/base-select-mobile/footer/index.css +5 -5
- package/modern/components/base-select-mobile/index.css +10 -10
- package/modern/components/base-select-mobile/index.js +1 -1
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +10 -10
- package/modern/components/checkmark-mobile/Component.js +1 -1
- package/modern/components/checkmark-mobile/index.css +6 -6
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +9 -9
- package/modern/components/index.js +5 -4
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +2 -2
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +9 -9
- package/modern/components/select-mobile/Component.js +4 -3
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +4 -3
- package/modern/components/select-modal-mobile/Component.js +4 -3
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +4 -3
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +15 -15
- package/modern/{hook-4b555174.d.ts → hook-b4e70cb0.d.ts} +15 -4
- package/modern/index-3885b0d7.d.ts +1 -1
- package/modern/index.js +5 -4
- package/modern/mobile.js +4 -3
- package/modern/presets/index.d.ts +1 -1
- package/modern/presets/index.js +4 -3
- package/modern/presets/useLazyLoading/hook.js +2 -2
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +4 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -12
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +11 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/responsive.js +4 -3
- package/package.json +2 -2
- package/presets/index.d.ts +1 -1
- package/presets/index.js +4 -3
- package/presets/useLazyLoading/hook.js +2 -2
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +4 -3
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +4 -3
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -12
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.d.ts +11 -0
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +24 -0
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +23 -0
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +4 -3
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/responsive.js +4 -3
- /package/esm/{getDataTestId-8aabb6b6.d.ts → getDataTestId-ebc56304.d.ts} +0 -0
- /package/esm/{getDataTestId-8aabb6b6.js → getDataTestId-ebc56304.js} +0 -0
- /package/esm/{intersection-observer-6b92b662.d.ts → intersection-observer-867b89db.d.ts} +0 -0
- /package/esm/{intersection-observer-6b92b662.js → intersection-observer-867b89db.js} +0 -0
- /package/{getDataTestId-1bda9cae.d.ts → getDataTestId-67b69501.d.ts} +0 -0
- /package/{getDataTestId-1bda9cae.js → getDataTestId-67b69501.js} +0 -0
- /package/{intersection-observer-38296236.d.ts → intersection-observer-eca2c2bb.d.ts} +0 -0
- /package/{intersection-observer-38296236.js → intersection-observer-eca2c2bb.js} +0 -0
- /package/modern/{getDataTestId-59fdb29b.d.ts → getDataTestId-44d88f22.d.ts} +0 -0
- /package/modern/{getDataTestId-59fdb29b.js → getDataTestId-44d88f22.js} +0 -0
- /package/modern/{intersection-observer-6b92b662.d.ts → intersection-observer-867b89db.d.ts} +0 -0
- /package/modern/{intersection-observer-6b92b662.js → intersection-observer-867b89db.js} +0 -0
package/cssm/responsive.js
CHANGED
|
@@ -39,7 +39,9 @@ require('./components/options-list/Component.js');
|
|
|
39
39
|
require('@alfalab/core-components-scrollbar/cssm');
|
|
40
40
|
require('./consts.js');
|
|
41
41
|
require('./components/options-list/index.module.css');
|
|
42
|
-
require('./Component-
|
|
42
|
+
require('./Component-4727d474.js');
|
|
43
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
44
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
43
45
|
require('./components/base-select-mobile/Component.js');
|
|
44
46
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
45
47
|
require('@alfalab/core-components-modal/cssm/mobile');
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
5
|
-
import { UseSelectWithApplyProps } from "./hook-
|
|
5
|
+
import { UseSelectWithApplyProps } from "./hook-b4e70cb0";
|
|
6
6
|
import { BaseSelectProps, OptionShape, OptionsListProps } from "./typings";
|
|
7
7
|
import { FooterProps } from "./presets/useSelectWithApply/options-list-with-apply/footer/Component";
|
|
8
|
+
import { HeaderProps } from "./presets/useSelectWithApply/options-list-with-apply/header/Component";
|
|
8
9
|
import { ModalMobile } from "./Component.mobile-b2c0420d";
|
|
9
10
|
type AdditionalMobileProps = {
|
|
10
11
|
/**
|
|
@@ -29,6 +30,14 @@ type AdditionalMobileProps = {
|
|
|
29
30
|
* Показывать пункт "Выбрать все"
|
|
30
31
|
*/
|
|
31
32
|
showSelectAll?: UseSelectWithApplyProps["showSelectAll"];
|
|
33
|
+
/**
|
|
34
|
+
* Показывать пункт "Выбрать все" в заголовке списка
|
|
35
|
+
*/
|
|
36
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps["showHeaderWithSelectAll"];
|
|
37
|
+
/**
|
|
38
|
+
* Использовать ли хук useSelectWithApply
|
|
39
|
+
*/
|
|
40
|
+
useWithApplyHook?: boolean;
|
|
32
41
|
};
|
|
33
42
|
type SelectMobileProps = Omit<BaseSelectProps, "Checkmark" | "onScroll"> & AdditionalMobileProps;
|
|
34
43
|
declare const SelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & AdditionalMobileProps & React.RefAttributes<unknown>>;
|
|
@@ -38,6 +47,9 @@ declare const OptionsListWithApply: React.ForwardRefExoticComponent<OptionsListP
|
|
|
38
47
|
selectedDraft?: OptionShape[] | undefined;
|
|
39
48
|
OptionsList?: React.FC<OptionsListProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
40
49
|
Footer?: React.FC<FooterProps> | undefined;
|
|
50
|
+
Header?: React.FC<HeaderProps> | undefined;
|
|
51
|
+
headerProps?: HeaderProps | undefined;
|
|
52
|
+
showHeaderWithSelectAll?: boolean | undefined;
|
|
41
53
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
42
54
|
type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
43
55
|
/**
|
|
@@ -60,6 +72,11 @@ type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> &
|
|
|
60
72
|
* Дополнительные пропсы футера модалки
|
|
61
73
|
*/
|
|
62
74
|
modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
|
|
75
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
76
|
+
/**
|
|
77
|
+
* Использовать ли хук useSelectWithApply
|
|
78
|
+
*/
|
|
79
|
+
useWithApplyHook?: boolean;
|
|
63
80
|
};
|
|
64
81
|
declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
|
|
65
82
|
/**
|
|
@@ -82,5 +99,10 @@ declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
82
99
|
* Дополнительные пропсы футера модалки
|
|
83
100
|
*/
|
|
84
101
|
modalFooterProps?: Partial<import("./Component.mobile-b2c0420d").FooterProps> | undefined;
|
|
102
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
103
|
+
/**
|
|
104
|
+
* Использовать ли хук useSelectWithApply
|
|
105
|
+
*/
|
|
106
|
+
useWithApplyHook?: boolean | undefined;
|
|
85
107
|
} & React.RefAttributes<unknown>>;
|
|
86
108
|
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, OptionsListWithApply, SelectModalMobileProps, SelectModalMobile };
|
|
@@ -4,6 +4,7 @@ import './Component.js';
|
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
6
6
|
import './components/base-select/Component.js';
|
|
7
|
+
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
7
8
|
import { Arrow } from './components/arrow/Component.js';
|
|
8
9
|
import { BaseSelectMobile } from './components/base-select-mobile/Component.js';
|
|
9
10
|
import { Footer as Footer$1 } from './components/base-select-mobile/footer/Component.js';
|
|
@@ -20,12 +21,12 @@ import '@alfalab/core-components-checkbox/esm';
|
|
|
20
21
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
21
22
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
22
23
|
import '@alfalab/core-components-skeleton/esm';
|
|
23
|
-
import './intersection-observer-
|
|
24
|
+
import './intersection-observer-867b89db.js';
|
|
24
25
|
import { DEFAULT_VISIBLE_OPTIONS } from './consts.js';
|
|
25
26
|
import { Footer } from './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
26
27
|
|
|
27
28
|
var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
28
|
-
var toggleMenu = _a.toggleMenu, defaultGetOptionProps = _a.getOptionProps, _b = _a.showClear, showClear = _b === void 0 ? true : _b, _c = _a.selectedDraft, selectedDraft = _c === void 0 ? [] : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.OptionsList, OptionsList$1 = _e === void 0 ? OptionsList : _e, _f = _a.onApply, onApply = _f === void 0 ? function () { return null; } : _f, _g = _a.onClear, onClear = _g === void 0 ? function () { return null; } : _g, _h = _a.onClose, onClose = _h === void 0 ? function () { return null; } : _h, _j = _a.visibleOptions, visibleOptions = _j === void 0 ? DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer$1 = _k === void 0 ? Footer : _k, restProps = __rest(_a, ["toggleMenu", "getOptionProps", "showClear", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer"]);
|
|
29
|
+
var toggleMenu = _a.toggleMenu, defaultGetOptionProps = _a.getOptionProps, _b = _a.showClear, showClear = _b === void 0 ? true : _b, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, _c = _a.selectedDraft, selectedDraft = _c === void 0 ? [] : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.OptionsList, OptionsList$1 = _e === void 0 ? OptionsList : _e, _f = _a.onApply, onApply = _f === void 0 ? function () { return null; } : _f, _g = _a.onClear, onClear = _g === void 0 ? function () { return null; } : _g, _h = _a.onClose, onClose = _h === void 0 ? function () { return null; } : _h, _j = _a.visibleOptions, visibleOptions = _j === void 0 ? DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer$1 = _k === void 0 ? Footer : _k, _l = _a.Header, Header$1 = _l === void 0 ? Header : _l, headerProps = _a.headerProps, restProps = __rest(_a, ["toggleMenu", "getOptionProps", "showClear", "showHeaderWithSelectAll", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer", "Header", "headerProps"]);
|
|
29
30
|
var getOptionProps = useCallback(function (option, index) {
|
|
30
31
|
var optionProps = defaultGetOptionProps(option, index);
|
|
31
32
|
var selected = option.key === SELECT_ALL_KEY
|
|
@@ -51,32 +52,35 @@ var OptionsListWithApply = forwardRef(function (_a, ref) {
|
|
|
51
52
|
};
|
|
52
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
54
|
}, []);
|
|
54
|
-
return (React.createElement(OptionsList$1, __assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
|
|
55
|
+
return (React.createElement(OptionsList$1, __assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: showHeaderWithSelectAll ? React.createElement(Header$1, __assign({}, headerProps)) : undefined, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
|
|
55
56
|
});
|
|
56
57
|
|
|
57
58
|
var SELECT_ALL_KEY = 'select_all';
|
|
58
59
|
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
59
60
|
function useSelectWithApply(_a) {
|
|
60
|
-
var options = _a.options, selected = _a.selected, _b = _a.onChange, onChange = _b === void 0 ? function () { return null; } : _b, OptionsList = _a.OptionsList, _c = _a.optionsListProps, optionsListProps = _c === void 0 ? {} : _c, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.showSelectAll, showSelectAll = _e === void 0 ? false : _e;
|
|
61
|
-
var
|
|
62
|
-
var
|
|
61
|
+
var options = _a.options, selected = _a.selected, _b = _a.onChange, onChange = _b === void 0 ? function () { return null; } : _b, OptionsList = _a.OptionsList, _c = _a.optionsListProps, optionsListProps = _c === void 0 ? {} : _c, _d = _a.showClear, showClear = _d === void 0 ? true : _d, _e = _a.showSelectAll, showSelectAll = _e === void 0 ? false : _e, _f = _a.showHeaderWithSelectAll, showHeaderWithSelectAll = _f === void 0 ? false : _f;
|
|
62
|
+
var _g = useMemo(function () { return processOptions(options, selected); }, [options, selected]), flatOptions = _g.flatOptions, selectedOptions = _g.selectedOptions;
|
|
63
|
+
var _h = useState(selectedOptions), selectedDraft = _h[0], setSelectedDraft = _h[1];
|
|
63
64
|
var selectedOptionsRef = useRef(selectedOptions);
|
|
64
|
-
var handleApply =
|
|
65
|
+
var handleApply = function () {
|
|
65
66
|
onChange({
|
|
66
67
|
selected: selectedDraft[0],
|
|
67
68
|
selectedMultiple: selectedDraft,
|
|
68
69
|
initiator: null,
|
|
69
70
|
});
|
|
70
|
-
}
|
|
71
|
-
var handleClear =
|
|
71
|
+
};
|
|
72
|
+
var handleClear = function () {
|
|
72
73
|
setSelectedDraft([]);
|
|
73
74
|
onChange({
|
|
74
75
|
selected: null,
|
|
75
76
|
selectedMultiple: [],
|
|
76
77
|
initiator: null,
|
|
77
78
|
});
|
|
78
|
-
}
|
|
79
|
-
var
|
|
79
|
+
};
|
|
80
|
+
var handleToggleAll = function () {
|
|
81
|
+
setSelectedDraft(flatOptions.length === selectedDraft.length ? [] : flatOptions);
|
|
82
|
+
};
|
|
83
|
+
var handleChange = function (_a) {
|
|
80
84
|
var initiator = _a.initiator, restArgs = __rest(_a, ["initiator"]);
|
|
81
85
|
if (!initiator) {
|
|
82
86
|
onChange(__assign({ initiator: null }, restArgs));
|
|
@@ -92,10 +96,8 @@ function useSelectWithApply(_a) {
|
|
|
92
96
|
? selectedDraft.filter(function (o) { return o !== initiator; })
|
|
93
97
|
: selectedDraft.concat(initiator));
|
|
94
98
|
}
|
|
95
|
-
}
|
|
96
|
-
var handleClose =
|
|
97
|
-
setSelectedDraft(selectedOptionsRef.current);
|
|
98
|
-
}, []);
|
|
99
|
+
};
|
|
100
|
+
var handleClose = function () { return setSelectedDraft(selectedOptionsRef.current); };
|
|
99
101
|
useEffect(function () {
|
|
100
102
|
setSelectedDraft(selectedOptions);
|
|
101
103
|
selectedOptionsRef.current = selectedOptions;
|
|
@@ -103,7 +105,11 @@ function useSelectWithApply(_a) {
|
|
|
103
105
|
var memoizedOptions = useMemo(function () { return (showSelectAll ? __spreadArray([selectAllOption], options, true) : options); }, [options, showSelectAll]);
|
|
104
106
|
return {
|
|
105
107
|
OptionsList: OptionsListWithApply,
|
|
106
|
-
optionsListProps: __assign(__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft
|
|
108
|
+
optionsListProps: __assign(__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft, showHeaderWithSelectAll: showHeaderWithSelectAll, headerProps: {
|
|
109
|
+
indeterminate: !!selectedDraft.length && selectedDraft.length < flatOptions.length,
|
|
110
|
+
checked: selectedDraft.length === flatOptions.length,
|
|
111
|
+
onChange: handleToggleAll,
|
|
112
|
+
} }),
|
|
107
113
|
allowUnselect: true,
|
|
108
114
|
multiple: true,
|
|
109
115
|
options: memoizedOptions,
|
|
@@ -116,7 +122,7 @@ var VIRTUAL_OPTIONS_LIST_THRESHOLD$1 = 30;
|
|
|
116
122
|
var SelectMobile = forwardRef(function (_a, ref) {
|
|
117
123
|
var _b = _a.autocomplete, autocomplete = _b === void 0 ? false : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.allowUnselect, allowUnselect = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? !multiple : _f, _g = _a.circularNavigation, circularNavigation = _g === void 0 ? false : _g, _h = _a.defaultOpen, defaultOpen = _h === void 0 ? false : _h, openProp = _a.open, _j = _a.size, size = _j === void 0 ? 'm' : _j, _k = _a.optionsSize, optionsSize = _k === void 0 ? 'm' : _k, _l = _a.fieldProps, fieldProps = _l === void 0 ? {} : _l, _m = _a.optionProps, optionProps = _m === void 0 ? {} : _m, _o = _a.optionsListProps, optionsListProps = _o === void 0 ? {} : _o, _p = _a.Arrow, Arrow$1 = _p === void 0 ? Arrow : _p, _q = _a.Field, Field$1 = _q === void 0 ? Field : _q, _r = _a.Optgroup, Optgroup$1 = _r === void 0 ? Optgroup : _r, _s = _a.Option, Option$1 = _s === void 0 ? Option : _s, selected = _a.selected, options = _a.options, _t = _a.OptionsList, OptionsList$1 = _t === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD$1
|
|
118
124
|
? VirtualOptionsList
|
|
119
|
-
: OptionsList : _t, onChange = _a.onChange, bottomSheetProps = _a.bottomSheetProps, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, restProps = __rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "bottomSheetProps", "showClear", "showSelectAll"]);
|
|
125
|
+
: OptionsList : _t, onChange = _a.onChange, bottomSheetProps = _a.bottomSheetProps, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, _v = _a.useWithApplyHook, useWithApplyHook = _v === void 0 ? multiple : _v, restProps = __rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "bottomSheetProps", "showClear", "showSelectAll", "showHeaderWithSelectAll", "useWithApplyHook"]);
|
|
120
126
|
var applyProps = useSelectWithApply({
|
|
121
127
|
optionsListProps: __assign(__assign({}, optionsListProps), { Footer: Footer$1 }),
|
|
122
128
|
OptionsList: OptionsList$1,
|
|
@@ -126,15 +132,14 @@ var SelectMobile = forwardRef(function (_a, ref) {
|
|
|
126
132
|
showClear: showClear,
|
|
127
133
|
showSelectAll: showSelectAll,
|
|
128
134
|
});
|
|
129
|
-
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps:
|
|
135
|
+
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps: __assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, __assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, bottomSheetProps), optionsListProps: optionsListProps }, restProps, (useWithApplyHook && applyProps))));
|
|
130
136
|
});
|
|
131
137
|
|
|
132
138
|
var VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
133
139
|
var SelectModalMobile = forwardRef(function (_a, ref) {
|
|
134
|
-
var _b
|
|
135
|
-
var _c = _a.autocomplete, autocomplete = _c === void 0 ? false : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.allowUnselect, allowUnselect = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.closeOnSelect, closeOnSelect = _g === void 0 ? !multiple : _g, _h = _a.circularNavigation, circularNavigation = _h === void 0 ? false : _h, _j = _a.defaultOpen, defaultOpen = _j === void 0 ? false : _j, openProp = _a.open, _k = _a.size, size = _k === void 0 ? 'm' : _k, _l = _a.optionsSize, optionsSize = _l === void 0 ? 'm' : _l, _m = _a.fieldProps, fieldProps = _m === void 0 ? {} : _m, _o = _a.optionProps, optionProps = _o === void 0 ? {} : _o, _p = _a.optionsListProps, optionsListProps = _p === void 0 ? {} : _p, _q = _a.Arrow, Arrow$1 = _q === void 0 ? Arrow : _q, _r = _a.Field, Field$1 = _r === void 0 ? Field : _r, _s = _a.Optgroup, Optgroup$1 = _s === void 0 ? Optgroup : _s, _t = _a.Option, Option$1 = _t === void 0 ? Option : _t, selected = _a.selected, options = _a.options, _u = _a.OptionsList, OptionsList$1 = _u === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
140
|
+
var _b = _a.autocomplete, autocomplete = _b === void 0 ? false : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.allowUnselect, allowUnselect = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.closeOnSelect, closeOnSelect = _f === void 0 ? !multiple : _f, _g = _a.circularNavigation, circularNavigation = _g === void 0 ? false : _g, _h = _a.defaultOpen, defaultOpen = _h === void 0 ? false : _h, openProp = _a.open, _j = _a.size, size = _j === void 0 ? 'm' : _j, _k = _a.optionsSize, optionsSize = _k === void 0 ? 'm' : _k, _l = _a.fieldProps, fieldProps = _l === void 0 ? {} : _l, _m = _a.optionProps, optionProps = _m === void 0 ? {} : _m, _o = _a.optionsListProps, optionsListProps = _o === void 0 ? {} : _o, _p = _a.Arrow, Arrow$1 = _p === void 0 ? Arrow : _p, _q = _a.Field, Field$1 = _q === void 0 ? Field : _q, _r = _a.Optgroup, Optgroup$1 = _r === void 0 ? Optgroup : _r, _s = _a.Option, Option$1 = _s === void 0 ? Option : _s, selected = _a.selected, options = _a.options, _t = _a.OptionsList, OptionsList$1 = _t === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
136
141
|
? VirtualOptionsList
|
|
137
|
-
: OptionsList :
|
|
142
|
+
: OptionsList : _t, onChange = _a.onChange, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, _v = _a.useWithApplyHook, useWithApplyHook = _v === void 0 ? multiple : _v, modalHeaderProps = _a.modalHeaderProps, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, restProps = __rest(_a, ["autocomplete", "multiple", "allowUnselect", "disabled", "closeOnSelect", "circularNavigation", "defaultOpen", "open", "size", "optionsSize", "fieldProps", "optionProps", "optionsListProps", "Arrow", "Field", "Optgroup", "Option", "selected", "options", "OptionsList", "onChange", "showClear", "showSelectAll", "useWithApplyHook", "modalHeaderProps", "showHeaderWithSelectAll"]);
|
|
138
143
|
var applyProps = useSelectWithApply({
|
|
139
144
|
optionsListProps: __assign(__assign({}, optionsListProps), { Footer: Footer$1 }),
|
|
140
145
|
OptionsList: OptionsList$1,
|
|
@@ -144,7 +149,7 @@ var SelectModalMobile = forwardRef(function (_a, ref) {
|
|
|
144
149
|
showClear: showClear,
|
|
145
150
|
showSelectAll: showSelectAll,
|
|
146
151
|
});
|
|
147
|
-
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps
|
|
152
|
+
return (React.createElement(BaseSelectMobile, __assign({ ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps, modalHeaderProps: __assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, __assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, modalHeaderProps) }, restProps, (useWithApplyHook && applyProps))));
|
|
148
153
|
});
|
|
149
154
|
|
|
150
155
|
export { OptionsListWithApply as O, SelectMobile as S, SelectModalMobile as a, SELECT_ALL_KEY as b, useSelectWithApply as u };
|
package/esm/Component.js
CHANGED
|
@@ -13,7 +13,7 @@ import '@juggle/resize-observer';
|
|
|
13
13
|
import 'downshift';
|
|
14
14
|
import '@alfalab/core-components-popover/esm';
|
|
15
15
|
import '@alfalab/hooks';
|
|
16
|
-
import './getDataTestId-
|
|
16
|
+
import './getDataTestId-ebc56304.js';
|
|
17
17
|
import './utils.js';
|
|
18
18
|
import './components/native-select/Component.js';
|
|
19
19
|
import '@alfalab/core-components-form-control/esm';
|
|
@@ -5,7 +5,7 @@ import { Select } from './Component.js';
|
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
7
7
|
import './components/base-select/Component.js';
|
|
8
|
-
import { S as SelectMobile } from './Component-
|
|
8
|
+
import { S as SelectMobile } from './Component-770ea482.js';
|
|
9
9
|
import '@alfalab/core-components-form-control/esm';
|
|
10
10
|
import '@alfalab/core-components-badge/esm';
|
|
11
11
|
import '@alfalab/core-components-checkbox/esm';
|
|
@@ -24,8 +24,9 @@ import 'react-merge-refs';
|
|
|
24
24
|
import '@juggle/resize-observer';
|
|
25
25
|
import 'downshift';
|
|
26
26
|
import '@alfalab/core-components-popover/esm';
|
|
27
|
-
import './getDataTestId-
|
|
27
|
+
import './getDataTestId-ebc56304.js';
|
|
28
28
|
import './components/native-select/Component.js';
|
|
29
|
+
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
29
30
|
import './components/base-select-mobile/Component.js';
|
|
30
31
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
31
32
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
@@ -33,7 +34,7 @@ import './components/base-select-mobile/footer/Component.js';
|
|
|
33
34
|
import '@alfalab/core-components-base-modal/esm';
|
|
34
35
|
import '@alfalab/core-components-button/esm';
|
|
35
36
|
import '@alfalab/core-components-skeleton/esm';
|
|
36
|
-
import './intersection-observer-
|
|
37
|
+
import './intersection-observer-867b89db.js';
|
|
37
38
|
import './consts.js';
|
|
38
39
|
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
39
40
|
import '@alfalab/core-components-scrollbar/esm';
|
|
@@ -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_19yql","open":"select__open_19yql"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Arrow = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: ej2ih */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
/* checkmark */
|
|
27
27
|
|
|
28
28
|
/* optgroup */
|
|
29
|
-
} .
|
|
29
|
+
} .select__arrow_19yql {
|
|
30
30
|
display: block;
|
|
31
31
|
width: 24px;
|
|
32
32
|
height: 24px;
|
|
33
33
|
color: var(--select-arrow-color);
|
|
34
34
|
|
|
35
35
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
36
|
-
} .
|
|
36
|
+
} .select__open_19yql {
|
|
37
37
|
transform: var(--arrow-transform);
|
|
38
38
|
}
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/esm';
|
|
4
4
|
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
var styles = {"checkmark":"
|
|
6
|
+
var styles = {"checkmark":"select__checkmark_1zd4s","single":"select__single_1zd4s","selected":"select__selected_1zd4s"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
var BaseCheckmark = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: bna0g */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
/* checkmark */
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
|
-
} .
|
|
26
|
+
} .select__checkmark_1zd4s {
|
|
27
27
|
flex-shrink: 0;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
} .
|
|
29
|
+
} .select__single_1zd4s {
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
opacity: 0
|
|
34
|
-
} .
|
|
34
|
+
} .select__single_1zd4s.select__selected_1zd4s {
|
|
35
35
|
opacity: 1;
|
|
36
36
|
}
|
|
@@ -5,7 +5,7 @@ import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
|
5
5
|
import '@alfalab/core-components-checkbox/esm';
|
|
6
6
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
7
|
|
|
8
|
-
var styles = {"option":"
|
|
8
|
+
var styles = {"option":"select__option_1elub","disabled":"select__disabled_1elub","checkmarkBefore":"select__checkmarkBefore_1elub","mobile":"select__mobile_1elub","checkmarkAfter":"select__checkmarkAfter_1elub","textContent":"select__textContent_1elub","selected":"select__selected_1elub","highlighted":"select__highlighted_1elub","content":"select__content_1elub"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
var BaseOption = function (_a) {
|
|
@@ -21,7 +21,7 @@ var BaseOption = function (_a) {
|
|
|
21
21
|
return null;
|
|
22
22
|
};
|
|
23
23
|
return (React.createElement("div", __assign({}, innerProps, { className: cn(styles.option, className, (_b = {},
|
|
24
|
-
_b[styles.highlighted] = highlighted,
|
|
24
|
+
_b[styles.highlighted] = !mobile && highlighted,
|
|
25
25
|
_b[styles.selected] = selected,
|
|
26
26
|
_b[styles.disabled] = disabled,
|
|
27
27
|
_b[styles.textContent] = isTextContent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: x8rua */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
/* checkmark */
|
|
44
44
|
|
|
45
45
|
/* optgroup */
|
|
46
|
-
} .
|
|
46
|
+
} .select__option_1elub {
|
|
47
47
|
font-size: 16px;
|
|
48
48
|
line-height: 20px;
|
|
49
49
|
font-weight: 400;
|
|
@@ -60,32 +60,32 @@
|
|
|
60
60
|
position: relative;
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
min-height: var(--size-s-height)
|
|
63
|
-
} .
|
|
63
|
+
} .select__option_1elub:not(.select__disabled_1elub):active {
|
|
64
64
|
background: var(--select-option-active-background);
|
|
65
65
|
color: var(--select-option-active-color);
|
|
66
|
-
} .
|
|
66
|
+
} .select__option_1elub.select__checkmarkBefore_1elub {
|
|
67
67
|
padding: 0 0 0 var(--gap-s)
|
|
68
|
-
} .
|
|
68
|
+
} .select__option_1elub.select__checkmarkBefore_1elub.select__mobile_1elub {
|
|
69
69
|
padding-left: var(--gap-m);
|
|
70
|
-
} .
|
|
70
|
+
} .select__option_1elub.select__checkmarkAfter_1elub {
|
|
71
71
|
padding: 0 var(--gap-s) 0 0
|
|
72
|
-
} .
|
|
72
|
+
} .select__option_1elub.select__checkmarkAfter_1elub.select__mobile_1elub {
|
|
73
73
|
padding-right: var(--gap-l);
|
|
74
|
-
} .
|
|
74
|
+
} .select__option_1elub.select__textContent_1elub {
|
|
75
75
|
padding: var(--gap-s)
|
|
76
|
-
} .
|
|
76
|
+
} .select__option_1elub.select__textContent_1elub.select__mobile_1elub {
|
|
77
77
|
padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
|
|
78
|
-
} .
|
|
78
|
+
} .select__selected_1elub {
|
|
79
79
|
background: var(--select-option-selected-background);
|
|
80
80
|
color: var(--select-option-selected-color);
|
|
81
81
|
cursor: default;
|
|
82
|
-
} .
|
|
82
|
+
} .select__highlighted_1elub {
|
|
83
83
|
background: var(--select-option-hover-background);
|
|
84
84
|
color: var(--select-option-hover-color);
|
|
85
|
-
} .
|
|
85
|
+
} .select__disabled_1elub {
|
|
86
86
|
cursor: var(--disabled-cursor);
|
|
87
87
|
background: var(--select-option-disabled-background);
|
|
88
88
|
color: var(--select-option-disabled-color);
|
|
89
|
-
} .
|
|
89
|
+
} .select__content_1elub {
|
|
90
90
|
flex: 1;
|
|
91
91
|
}
|
|
@@ -6,11 +6,11 @@ import cn from 'classnames';
|
|
|
6
6
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
7
7
|
import { Popover } from '@alfalab/core-components-popover/esm';
|
|
8
8
|
import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
|
|
9
|
-
import { g as getDataTestId } from '../../getDataTestId-
|
|
9
|
+
import { g as getDataTestId } from '../../getDataTestId-ebc56304.js';
|
|
10
10
|
import { processOptions } from '../../utils.js';
|
|
11
11
|
import { NativeSelect } from '../native-select/Component.js';
|
|
12
12
|
|
|
13
|
-
var styles = {"component":"
|
|
13
|
+
var styles = {"component":"select__component_g8vry","popoverInner":"select__popoverInner_g8vry","optionsList":"select__optionsList_g8vry","optionsListBorder":"select__optionsListBorder_g8vry","nativeSelect":"select__nativeSelect_g8vry","block":"select__block_g8vry"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var BaseSelect = forwardRef(function (_a, ref) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 6a1lu */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
/* checkmark */
|
|
37
37
|
|
|
38
38
|
/* optgroup */
|
|
39
|
-
} .
|
|
39
|
+
} .select__component_g8vry {
|
|
40
40
|
width: max-content;
|
|
41
41
|
position: relative;
|
|
42
42
|
outline: 0;
|
|
43
|
-
} .
|
|
43
|
+
} .select__popoverInner_g8vry {
|
|
44
44
|
padding-top: var(--select-options-list-offset);
|
|
45
45
|
padding-bottom: var(--select-options-list-offset);
|
|
46
46
|
box-shadow: none;
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
background: transparent;
|
|
49
49
|
border-radius: 0;
|
|
50
50
|
position: relative;
|
|
51
|
-
} .
|
|
51
|
+
} .select__optionsList_g8vry {
|
|
52
52
|
position: relative;
|
|
53
53
|
padding-top: var(--select-options-list-top-padding);
|
|
54
54
|
padding-bottom: var(--select-options-list-bottom-padding);
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
background: var(--select-option-background);
|
|
58
58
|
overflow: hidden;
|
|
59
59
|
will-change: transform;
|
|
60
|
-
} .
|
|
60
|
+
} .select__optionsListBorder_g8vry {
|
|
61
61
|
position: absolute;
|
|
62
62
|
top: 0;
|
|
63
63
|
right: 0;
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
box-shadow: inset 0 0 0 1px var(--color-light-border-secondary);
|
|
67
67
|
border-radius: inherit;
|
|
68
68
|
pointer-events: none;
|
|
69
|
-
} .
|
|
69
|
+
} .select__nativeSelect_g8vry {
|
|
70
70
|
opacity: 0;
|
|
71
71
|
overflow: hidden;
|
|
72
72
|
position: absolute;
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
height: 100%;
|
|
80
80
|
cursor: pointer;
|
|
81
81
|
z-index: 1;
|
|
82
|
-
} .
|
|
82
|
+
} .select__block_g8vry {
|
|
83
83
|
width: 100%;
|
|
84
84
|
} /* width: max-content; fix for IE */ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
85
|
-
.
|
|
85
|
+
.select__component_g8vry {
|
|
86
86
|
float: left;
|
|
87
87
|
clear: left;
|
|
88
88
|
}
|
|
@@ -7,6 +7,6 @@ import 'classnames';
|
|
|
7
7
|
import 'downshift';
|
|
8
8
|
import '@alfalab/core-components-popover/esm';
|
|
9
9
|
import '@alfalab/hooks';
|
|
10
|
-
import '../../getDataTestId-
|
|
10
|
+
import '../../getDataTestId-ebc56304.js';
|
|
11
11
|
import '../../utils.js';
|
|
12
12
|
import '../native-select/Component.js';
|
|
@@ -5,7 +5,7 @@ import cn from 'classnames';
|
|
|
5
5
|
import { useMultipleSelection, useCombobox } from 'downshift';
|
|
6
6
|
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/esm';
|
|
7
7
|
import { ModalMobile } from '@alfalab/core-components-modal/esm/mobile';
|
|
8
|
-
import { g as getDataTestId } from '../../getDataTestId-
|
|
8
|
+
import { g as getDataTestId } from '../../getDataTestId-ebc56304.js';
|
|
9
9
|
import { processOptions } from '../../utils.js';
|
|
10
10
|
import { Arrow } from '../arrow/Component.js';
|
|
11
11
|
import { Field } from '../field/Component.js';
|
|
@@ -24,7 +24,7 @@ import '../checkmark-mobile/Component.js';
|
|
|
24
24
|
import '@alfalab/core-components-scrollbar/esm';
|
|
25
25
|
import '../../consts.js';
|
|
26
26
|
|
|
27
|
-
var styles = {"component":"
|
|
27
|
+
var styles = {"component":"select__component_14h99","sheet":"select__sheet_14h99","sheetContent":"select__sheetContent_14h99","sheetContainer":"select__sheetContainer_14h99","block":"select__block_14h99","option":"select__option_14h99","optionGroup":"select__optionGroup_14h99"};
|
|
28
28
|
require('./index.css')
|
|
29
29
|
|
|
30
30
|
var BaseSelectMobile = forwardRef(function (_a, ref) {
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { BaseModalContext } from '@alfalab/core-components-base-modal/esm';
|
|
4
4
|
import { Button } from '@alfalab/core-components-button/esm';
|
|
5
5
|
|
|
6
|
-
var styles = {"footer":"
|
|
6
|
+
var styles = {"footer":"select__footer_1aqvg","button":"select__button_1aqvg","highlighted":"select__highlighted_1aqvg"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
var Footer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1iq7l */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
/* checkmark */
|
|
27
27
|
|
|
28
28
|
/* optgroup */
|
|
29
|
-
} .
|
|
29
|
+
} .select__footer_1aqvg {
|
|
30
30
|
display: flex;
|
|
31
31
|
box-sizing: border-box;
|
|
32
32
|
width: 100%;
|
|
33
33
|
padding: var(--gap-m) var(--gap-m);
|
|
34
34
|
background-color: var(--color-light-bg-primary)
|
|
35
|
-
} .
|
|
35
|
+
} .select__footer_1aqvg .select__button_1aqvg:first-of-type {
|
|
36
36
|
margin-right: var(--gap-m);
|
|
37
|
-
} .
|
|
37
|
+
} .select__button_1aqvg {
|
|
38
38
|
width: 50%;
|
|
39
|
-
} .
|
|
39
|
+
} .select__highlighted_1aqvg {
|
|
40
40
|
border-top: 1px solid var(--color-light-border-primary);
|
|
41
41
|
background-color: var(--color-light-bg-primary);
|
|
42
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: iki81 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -27,27 +27,27 @@
|
|
|
27
27
|
/* checkmark */
|
|
28
28
|
|
|
29
29
|
/* optgroup */
|
|
30
|
-
} .
|
|
30
|
+
} .select__component_14h99 {
|
|
31
31
|
width: max-content;
|
|
32
32
|
position: relative;
|
|
33
33
|
outline: 0;
|
|
34
|
-
} .
|
|
34
|
+
} .select__sheet_14h99 {
|
|
35
35
|
overflow: hidden;
|
|
36
|
-
} .
|
|
36
|
+
} .select__sheetContent_14h99 {
|
|
37
37
|
padding: 0;
|
|
38
|
-
} .
|
|
38
|
+
} .select__sheetContainer_14h99 {
|
|
39
39
|
padding: 0;
|
|
40
|
-
} .
|
|
40
|
+
} .select__block_14h99 {
|
|
41
41
|
width: 100%;
|
|
42
42
|
} /* width: max-content; fix for IE */ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
|
|
43
|
-
.
|
|
43
|
+
.select__component_14h99 {
|
|
44
44
|
float: left;
|
|
45
45
|
clear: left;
|
|
46
46
|
}
|
|
47
|
-
} .
|
|
47
|
+
} .select__option_14h99 {
|
|
48
48
|
padding: var(--gap-2xs) var(--gap-l) var(--gap-2xs) var(--gap-m)
|
|
49
|
-
} .
|
|
49
|
+
} .select__option_14h99:before {
|
|
50
50
|
display: none;
|
|
51
|
-
} .
|
|
51
|
+
} .select__optionGroup_14h99 {
|
|
52
52
|
padding: var(--gap-m) var(--gap-m) var(--gap-xs);
|
|
53
53
|
}
|
|
@@ -6,7 +6,7 @@ import 'classnames';
|
|
|
6
6
|
import 'downshift';
|
|
7
7
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
8
8
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
9
|
-
import '../../getDataTestId-
|
|
9
|
+
import '../../getDataTestId-ebc56304.js';
|
|
10
10
|
import '../../utils.js';
|
|
11
11
|
import '../arrow/Component.js';
|
|
12
12
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
@@ -5,7 +5,7 @@ import { Checkbox } from '@alfalab/core-components-checkbox/esm';
|
|
|
5
5
|
import { CheckmarkCircleMIcon } from '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
6
6
|
import CheckmarkMIcon from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
7
7
|
|
|
8
|
-
var styles = {"checkmark":"
|
|
8
|
+
var styles = {"checkmark":"select__checkmark_1q1p5","after":"select__after_1q1p5","single":"select__single_1q1p5","selected":"select__selected_1q1p5","before":"select__before_1q1p5","multiple":"select__multiple_1q1p5","colorIcon":"select__colorIcon_1q1p5"};
|
|
9
9
|
require('./index.css')
|
|
10
10
|
|
|
11
11
|
var Checkmark = function (_a) {
|