@alfalab/core-components-select 14.1.2 → 14.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Component-3885b0d7.d.ts +1 -1
- package/{Component-00c64376.d.ts → Component-3eb05f44.d.ts} +48 -1
- package/{Component-00c64376.js → Component-3eb05f44.js} +26 -20
- package/Component.js +1 -1
- package/Component.mobile-b2c0420d.d.ts +93 -0
- 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.d.ts +24 -0
- package/components/base-select-mobile/Component.js +25 -7
- package/components/base-select-mobile/footer/Component.js +3 -3
- 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 +3 -3
- 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 +4 -4
- package/components/virtual-options-list/index.css +15 -15
- package/cssm/Component-3885b0d7.d.ts +1 -1
- package/{modern/Component-0b711513.d.ts → cssm/Component-4727d474.d.ts} +48 -1
- package/cssm/{Component-f86f43e3.js → Component-4727d474.js} +25 -19
- package/cssm/Component.mobile-b2c0420d.d.ts +93 -0
- package/cssm/Component.responsive.js +3 -1
- package/cssm/components/base-option/Component.js +1 -1
- package/cssm/components/base-select-mobile/Component.d.ts +24 -0
- package/cssm/components/base-select-mobile/Component.js +23 -5
- package/cssm/components/base-select-mobile/footer/Component.js +2 -2
- package/cssm/components/index.js +4 -2
- package/cssm/components/option/Component.js +1 -1
- package/cssm/components/options-list/Component.js +2 -2
- 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/cssm/components/virtual-options-list/Component.js +3 -3
- package/{esm/hook-4b555174.d.ts → cssm/hook-b4e70cb0.d.ts} +15 -4
- package/cssm/index.js +4 -2
- package/cssm/mobile.d.ts +4 -0
- package/cssm/mobile.js +67 -0
- 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/esm/Component-3885b0d7.d.ts +1 -1
- package/{cssm/Component-f86f43e3.d.ts → esm/Component-b436aedf.d.ts} +48 -1
- package/esm/{Component-2ff63ae2.js → Component-b436aedf.js} +26 -20
- package/esm/Component.js +1 -1
- package/esm/Component.mobile-b2c0420d.d.ts +93 -0
- 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.d.ts +24 -0
- package/esm/components/base-select-mobile/Component.js +26 -8
- package/esm/components/base-select-mobile/footer/Component.js +3 -3
- 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 +3 -3
- 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 +4 -4
- 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.d.ts +4 -0
- package/esm/mobile.js +41 -0
- 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.d.ts +4 -0
- package/mobile.js +50 -0
- package/modern/Component-3885b0d7.d.ts +1 -1
- package/{esm/Component-2ff63ae2.d.ts → modern/Component-c22703bb.d.ts} +48 -1
- package/modern/{Component-0b711513.js → Component-c22703bb.js} +31 -17
- package/modern/Component.js +1 -1
- package/modern/Component.mobile-b2c0420d.d.ts +93 -0
- 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.d.ts +24 -0
- package/modern/components/base-select-mobile/Component.js +20 -7
- package/modern/components/base-select-mobile/footer/Component.js +3 -3
- 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 +3 -3
- 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 +3 -3
- 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.d.ts +4 -0
- package/modern/mobile.js +40 -0
- 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 +6 -6
- 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-d8d91b2e.d.ts → getDataTestId-416fe68c.d.ts} +0 -0
- /package/esm/{getDataTestId-d8d91b2e.js → getDataTestId-416fe68c.js} +0 -0
- /package/esm/{intersection-observer-210062db.d.ts → intersection-observer-71fc11ef.d.ts} +0 -0
- /package/esm/{intersection-observer-210062db.js → intersection-observer-71fc11ef.js} +0 -0
- /package/{getDataTestId-d8391785.d.ts → getDataTestId-e8d9eb23.d.ts} +0 -0
- /package/{getDataTestId-d8391785.js → getDataTestId-e8d9eb23.js} +0 -0
- /package/{intersection-observer-131fbe35.d.ts → intersection-observer-c227d471.d.ts} +0 -0
- /package/{intersection-observer-131fbe35.js → intersection-observer-c227d471.js} +0 -0
- /package/modern/{getDataTestId-b301a7a9.d.ts → getDataTestId-03736ddc.d.ts} +0 -0
- /package/modern/{getDataTestId-b301a7a9.js → getDataTestId-03736ddc.js} +0 -0
- /package/modern/{intersection-observer-210062db.d.ts → intersection-observer-71fc11ef.d.ts} +0 -0
- /package/modern/{intersection-observer-210062db.js → intersection-observer-71fc11ef.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { O as OptionsListWithApply } from '../../../Component-
|
|
1
|
+
export { O as OptionsListWithApply } from '../../../Component-b436aedf.js';
|
|
2
2
|
import 'tslib';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '../../../Component.js';
|
|
@@ -11,7 +11,7 @@ import '@juggle/resize-observer';
|
|
|
11
11
|
import 'downshift';
|
|
12
12
|
import '@alfalab/core-components-popover/esm';
|
|
13
13
|
import '@alfalab/hooks';
|
|
14
|
-
import '../../../getDataTestId-
|
|
14
|
+
import '../../../getDataTestId-416fe68c.js';
|
|
15
15
|
import '../../../utils.js';
|
|
16
16
|
import '../../../components/native-select/Component.js';
|
|
17
17
|
import '../../../components/field/Component.js';
|
|
@@ -27,6 +27,7 @@ import '../../../components/checkmark-mobile/Component.js';
|
|
|
27
27
|
import '../../../components/options-list/Component.js';
|
|
28
28
|
import '@alfalab/core-components-scrollbar/esm';
|
|
29
29
|
import '../../../consts.js';
|
|
30
|
+
import './header/Component.js';
|
|
30
31
|
import '../../../components/base-select-mobile/Component.js';
|
|
31
32
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
32
33
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
@@ -36,5 +37,5 @@ import '@alfalab/core-components-button/esm';
|
|
|
36
37
|
import '../../../components/virtual-options-list/Component.js';
|
|
37
38
|
import 'react-virtual';
|
|
38
39
|
import '@alfalab/core-components-skeleton/esm';
|
|
39
|
-
import '../../../intersection-observer-
|
|
40
|
+
import '../../../intersection-observer-71fc11ef.js';
|
|
40
41
|
import './footer/Component.js';
|
|
@@ -10,7 +10,7 @@ import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
|
10
10
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
11
11
|
import '../../components/checkmark-mobile/Component.js';
|
|
12
12
|
|
|
13
|
-
var styles = {"skeleton":"
|
|
13
|
+
var styles = {"skeleton":"select__skeleton_1oaqe"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
function useSelectWithLoading(_a) {
|
package/esm/responsive.js
CHANGED
|
@@ -11,7 +11,7 @@ import 'react-merge-refs';
|
|
|
11
11
|
import '@juggle/resize-observer';
|
|
12
12
|
import 'downshift';
|
|
13
13
|
import '@alfalab/core-components-popover/esm';
|
|
14
|
-
import './getDataTestId-
|
|
14
|
+
import './getDataTestId-416fe68c.js';
|
|
15
15
|
import './utils.js';
|
|
16
16
|
import './components/native-select/Component.js';
|
|
17
17
|
import './components/field/Component.js';
|
|
@@ -27,7 +27,8 @@ import './components/checkmark-mobile/Component.js';
|
|
|
27
27
|
import './components/options-list/Component.js';
|
|
28
28
|
import '@alfalab/core-components-scrollbar/esm';
|
|
29
29
|
import './consts.js';
|
|
30
|
-
import './Component-
|
|
30
|
+
import './Component-b436aedf.js';
|
|
31
|
+
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
31
32
|
import './components/base-select-mobile/Component.js';
|
|
32
33
|
import '@alfalab/core-components-bottom-sheet/esm';
|
|
33
34
|
import '@alfalab/core-components-modal/esm/mobile';
|
|
@@ -37,5 +38,5 @@ import '@alfalab/core-components-button/esm';
|
|
|
37
38
|
import './components/virtual-options-list/Component.js';
|
|
38
39
|
import 'react-virtual';
|
|
39
40
|
import '@alfalab/core-components-skeleton/esm';
|
|
40
|
-
import './intersection-observer-
|
|
41
|
+
import './intersection-observer-71fc11ef.js';
|
|
41
42
|
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
@@ -29,17 +29,22 @@ type UseSelectWithApplyProps = {
|
|
|
29
29
|
* Показывать пункт "Выбрать все"
|
|
30
30
|
*/
|
|
31
31
|
showSelectAll?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Показывать пункт "Выбрать все" в заголовке списка
|
|
34
|
+
*/
|
|
35
|
+
showHeaderWithSelectAll?: boolean;
|
|
32
36
|
};
|
|
33
37
|
declare const SELECT_ALL_KEY = "select_all";
|
|
34
|
-
declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, }: UseSelectWithApplyProps): {
|
|
38
|
+
declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, showHeaderWithSelectAll, }: UseSelectWithApplyProps): {
|
|
35
39
|
OptionsList: import("react").ForwardRefExoticComponent<import("./index").OptionsListProps & {
|
|
36
40
|
showClear?: boolean | undefined;
|
|
37
41
|
onClose?: (() => void) | undefined;
|
|
38
42
|
selectedDraft?: OptionShape[] | undefined;
|
|
39
|
-
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
40
|
-
* Пропсы, которые будут прокинуты в компонент списка
|
|
41
|
-
*/
|
|
43
|
+
OptionsList?: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
42
44
|
Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
|
|
45
|
+
Header?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps> | undefined;
|
|
46
|
+
headerProps?: import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps | undefined;
|
|
47
|
+
showHeaderWithSelectAll?: boolean | undefined;
|
|
43
48
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
49
|
optionsListProps: {
|
|
45
50
|
OptionsList: import("react").FC<import("./index").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
@@ -48,6 +53,12 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
48
53
|
onApply: () => void;
|
|
49
54
|
onClose: () => void;
|
|
50
55
|
selectedDraft: OptionShape[];
|
|
56
|
+
showHeaderWithSelectAll: boolean;
|
|
57
|
+
headerProps: {
|
|
58
|
+
indeterminate: boolean;
|
|
59
|
+
checked: boolean;
|
|
60
|
+
onChange: () => void;
|
|
61
|
+
};
|
|
51
62
|
};
|
|
52
63
|
allowUnselect: boolean;
|
|
53
64
|
multiple: boolean;
|
package/index-3885b0d7.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var Component = require('./Component.js');
|
|
6
6
|
var components_arrow_Component = require('./components/arrow/Component.js');
|
|
7
7
|
var components_baseSelect_Component = require('./components/base-select/Component.js');
|
|
8
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-
|
|
8
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-3eb05f44.js');
|
|
9
9
|
var components_field_Component = require('./components/field/Component.js');
|
|
10
10
|
var components_optgroup_Component = require('./components/optgroup/Component.js');
|
|
11
11
|
var components_option_Component = require('./components/option/Component.js');
|
|
@@ -24,8 +24,10 @@ require('@juggle/resize-observer');
|
|
|
24
24
|
require('downshift');
|
|
25
25
|
require('@alfalab/core-components-popover');
|
|
26
26
|
require('@alfalab/hooks');
|
|
27
|
-
require('./getDataTestId-
|
|
27
|
+
require('./getDataTestId-e8d9eb23.js');
|
|
28
28
|
require('./components/native-select/Component.js');
|
|
29
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
30
|
+
require('@alfalab/core-components-checkbox');
|
|
29
31
|
require('./components/base-select-mobile/Component.js');
|
|
30
32
|
require('@alfalab/core-components-bottom-sheet');
|
|
31
33
|
require('@alfalab/core-components-modal/mobile');
|
|
@@ -34,11 +36,10 @@ require('@alfalab/core-components-base-modal');
|
|
|
34
36
|
require('@alfalab/core-components-button');
|
|
35
37
|
require('@alfalab/core-components-form-control');
|
|
36
38
|
require('@alfalab/core-components-badge');
|
|
37
|
-
require('@alfalab/core-components-checkbox');
|
|
38
39
|
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
39
40
|
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
40
41
|
require('@alfalab/core-components-skeleton');
|
|
41
|
-
require('./intersection-observer-
|
|
42
|
+
require('./intersection-observer-c227d471.js');
|
|
42
43
|
require('./consts.js');
|
|
43
44
|
require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
44
45
|
require('./components/checkmark/Component.js');
|
package/mobile.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SelectMobile } from "./components/select-mobile/index";
|
|
2
|
+
export { SelectModalMobile } from "./components/select-modal-mobile/index";
|
|
3
|
+
export type { SelectMobileProps } from "./components/select-mobile/index";
|
|
4
|
+
export type { SelectModalMobileProps } from "./components/select-modal-mobile/index";
|
package/mobile.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-3eb05f44.js');
|
|
6
|
+
require('tslib');
|
|
7
|
+
require('react');
|
|
8
|
+
require('./Component.js');
|
|
9
|
+
require('./components/arrow/Component.js');
|
|
10
|
+
require('classnames');
|
|
11
|
+
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
12
|
+
require('./components/base-select/Component.js');
|
|
13
|
+
require('react-merge-refs');
|
|
14
|
+
require('@juggle/resize-observer');
|
|
15
|
+
require('downshift');
|
|
16
|
+
require('@alfalab/core-components-popover');
|
|
17
|
+
require('@alfalab/hooks');
|
|
18
|
+
require('./getDataTestId-e8d9eb23.js');
|
|
19
|
+
require('./utils.js');
|
|
20
|
+
require('./components/native-select/Component.js');
|
|
21
|
+
require('./components/field/Component.js');
|
|
22
|
+
require('@alfalab/core-components-form-control');
|
|
23
|
+
require('./components/optgroup/Component.js');
|
|
24
|
+
require('./components/option/Component.js');
|
|
25
|
+
require('./components/checkmark/Component.js');
|
|
26
|
+
require('@alfalab/core-components-badge');
|
|
27
|
+
require('@alfalab/core-components-checkbox');
|
|
28
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
29
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
30
|
+
require('./components/checkmark-mobile/Component.js');
|
|
31
|
+
require('./components/options-list/Component.js');
|
|
32
|
+
require('@alfalab/core-components-scrollbar');
|
|
33
|
+
require('./consts.js');
|
|
34
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
35
|
+
require('./components/base-select-mobile/Component.js');
|
|
36
|
+
require('@alfalab/core-components-bottom-sheet');
|
|
37
|
+
require('@alfalab/core-components-modal/mobile');
|
|
38
|
+
require('./components/base-select-mobile/footer/Component.js');
|
|
39
|
+
require('@alfalab/core-components-base-modal');
|
|
40
|
+
require('@alfalab/core-components-button');
|
|
41
|
+
require('./components/virtual-options-list/Component.js');
|
|
42
|
+
require('react-virtual');
|
|
43
|
+
require('@alfalab/core-components-skeleton');
|
|
44
|
+
require('./intersection-observer-c227d471.js');
|
|
45
|
+
require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
exports.SelectMobile = presets_useSelectWithApply_optionsListWithApply_Component.SelectMobile;
|
|
50
|
+
exports.SelectModalMobile = presets_useSelectWithApply_optionsListWithApply_Component.SelectModalMobile;
|
|
@@ -51,7 +51,7 @@ type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
|
51
51
|
type NativeProps = HTMLAttributes<HTMLSpanElement>;
|
|
52
52
|
type TextBaseProps = {
|
|
53
53
|
/**
|
|
54
|
-
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/
|
|
54
|
+
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/tokens-assets-типографика--docs)
|
|
55
55
|
*/
|
|
56
56
|
view?: "primary-large" | "primary-medium" | "primary-small" | "secondary-large" | "secondary-medium" | "secondary-small" | "component" | "caps";
|
|
57
57
|
/**
|
|
@@ -2,9 +2,11 @@
|
|
|
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";
|
|
9
|
+
import { ModalMobile } from "./Component.mobile-b2c0420d";
|
|
8
10
|
type AdditionalMobileProps = {
|
|
9
11
|
/**
|
|
10
12
|
* Футер
|
|
@@ -28,6 +30,14 @@ type AdditionalMobileProps = {
|
|
|
28
30
|
* Показывать пункт "Выбрать все"
|
|
29
31
|
*/
|
|
30
32
|
showSelectAll?: UseSelectWithApplyProps["showSelectAll"];
|
|
33
|
+
/**
|
|
34
|
+
* Показывать пункт "Выбрать все" в заголовке списка
|
|
35
|
+
*/
|
|
36
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps["showHeaderWithSelectAll"];
|
|
37
|
+
/**
|
|
38
|
+
* Использовать ли хук useSelectWithApply
|
|
39
|
+
*/
|
|
40
|
+
useWithApplyHook?: boolean;
|
|
31
41
|
};
|
|
32
42
|
type SelectMobileProps = Omit<BaseSelectProps, "Checkmark" | "onScroll"> & AdditionalMobileProps;
|
|
33
43
|
declare const SelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & AdditionalMobileProps & React.RefAttributes<unknown>>;
|
|
@@ -37,6 +47,9 @@ declare const OptionsListWithApply: React.ForwardRefExoticComponent<OptionsListP
|
|
|
37
47
|
selectedDraft?: OptionShape[] | undefined;
|
|
38
48
|
OptionsList?: React.FC<OptionsListProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
39
49
|
Footer?: React.FC<FooterProps> | undefined;
|
|
50
|
+
Header?: React.FC<HeaderProps> | undefined;
|
|
51
|
+
headerProps?: HeaderProps | undefined;
|
|
52
|
+
showHeaderWithSelectAll?: boolean | undefined;
|
|
40
53
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
41
54
|
type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
42
55
|
/**
|
|
@@ -47,6 +60,23 @@ type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> &
|
|
|
47
60
|
* Показывать пункт "Выбрать все"
|
|
48
61
|
*/
|
|
49
62
|
showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
|
|
63
|
+
/**
|
|
64
|
+
* Дополнительные пропсы шапки модалки
|
|
65
|
+
*/
|
|
66
|
+
modalHeaderProps?: Partial<React.ComponentProps<typeof ModalMobile.Header>>;
|
|
67
|
+
/**
|
|
68
|
+
* Дополнительные пропсы модалки
|
|
69
|
+
*/
|
|
70
|
+
modalProps?: Partial<React.ComponentProps<typeof ModalMobile>>;
|
|
71
|
+
/**
|
|
72
|
+
* Дополнительные пропсы футера модалки
|
|
73
|
+
*/
|
|
74
|
+
modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
|
|
75
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
76
|
+
/**
|
|
77
|
+
* Использовать ли хук useSelectWithApply
|
|
78
|
+
*/
|
|
79
|
+
useWithApplyHook?: boolean;
|
|
50
80
|
};
|
|
51
81
|
declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
|
|
52
82
|
/**
|
|
@@ -57,5 +87,22 @@ declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelect
|
|
|
57
87
|
* Показывать пункт "Выбрать все"
|
|
58
88
|
*/
|
|
59
89
|
showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
|
|
90
|
+
/**
|
|
91
|
+
* Дополнительные пропсы шапки модалки
|
|
92
|
+
*/
|
|
93
|
+
modalHeaderProps?: Partial<import("./Component.mobile-b2c0420d").HeaderProps> | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Дополнительные пропсы модалки
|
|
96
|
+
*/
|
|
97
|
+
modalProps?: Partial<import("./Component.mobile-b2c0420d").ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Дополнительные пропсы футера модалки
|
|
100
|
+
*/
|
|
101
|
+
modalFooterProps?: Partial<import("./Component.mobile-b2c0420d").FooterProps> | undefined;
|
|
102
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
103
|
+
/**
|
|
104
|
+
* Использовать ли хук useSelectWithApply
|
|
105
|
+
*/
|
|
106
|
+
useWithApplyHook?: boolean | undefined;
|
|
60
107
|
} & React.RefAttributes<unknown>>;
|
|
61
108
|
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, OptionsListWithApply, SelectModalMobileProps, SelectModalMobile };
|
|
@@ -3,6 +3,7 @@ import './Component.js';
|
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
5
5
|
import './components/base-select/Component.js';
|
|
6
|
+
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
6
7
|
import { Arrow } from './components/arrow/Component.js';
|
|
7
8
|
import { BaseSelectMobile } from './components/base-select-mobile/Component.js';
|
|
8
9
|
import { Footer as Footer$1 } from './components/base-select-mobile/footer/Component.js';
|
|
@@ -19,11 +20,11 @@ import '@alfalab/core-components-checkbox/modern';
|
|
|
19
20
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
20
21
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
21
22
|
import '@alfalab/core-components-skeleton/modern';
|
|
22
|
-
import './intersection-observer-
|
|
23
|
+
import './intersection-observer-71fc11ef.js';
|
|
23
24
|
import { DEFAULT_VISIBLE_OPTIONS } from './consts.js';
|
|
24
25
|
import { Footer } from './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
25
26
|
|
|
26
|
-
const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, ...restProps }, ref) => {
|
|
27
|
+
const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGetOptionProps, showClear = true, showHeaderWithSelectAll, selectedDraft = [], flatOptions = [], OptionsList: OptionsList$1 = OptionsList, onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = DEFAULT_VISIBLE_OPTIONS, Footer: Footer$1 = Footer, Header: Header$1 = Header, headerProps, ...restProps }, ref) => {
|
|
27
28
|
const getOptionProps = useCallback((option, index) => {
|
|
28
29
|
const optionProps = defaultGetOptionProps(option, index);
|
|
29
30
|
const selected = option.key === SELECT_ALL_KEY
|
|
@@ -52,31 +53,34 @@ const OptionsListWithApply = forwardRef(({ toggleMenu, getOptionProps: defaultGe
|
|
|
52
53
|
};
|
|
53
54
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
55
|
}, []);
|
|
55
|
-
return (React.createElement(OptionsList$1, { ...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 }) }));
|
|
56
|
+
return (React.createElement(OptionsList$1, { ...restProps, ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: showHeaderWithSelectAll ? React.createElement(Header$1, { ...headerProps }) : undefined, footer: React.createElement(Footer$1, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) }));
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
const SELECT_ALL_KEY = 'select_all';
|
|
59
60
|
const selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
60
|
-
function useSelectWithApply({ options, selected, onChange = () => null, OptionsList, optionsListProps = {}, showClear = true, showSelectAll = false, }) {
|
|
61
|
+
function useSelectWithApply({ options, selected, onChange = () => null, OptionsList, optionsListProps = {}, showClear = true, showSelectAll = false, showHeaderWithSelectAll = false, }) {
|
|
61
62
|
const { flatOptions, selectedOptions } = useMemo(() => processOptions(options, selected), [options, selected]);
|
|
62
63
|
const [selectedDraft, setSelectedDraft] = useState(selectedOptions);
|
|
63
64
|
const selectedOptionsRef = useRef(selectedOptions);
|
|
64
|
-
const handleApply =
|
|
65
|
+
const handleApply = () => {
|
|
65
66
|
onChange({
|
|
66
67
|
selected: selectedDraft[0],
|
|
67
68
|
selectedMultiple: selectedDraft,
|
|
68
69
|
initiator: null,
|
|
69
70
|
});
|
|
70
|
-
}
|
|
71
|
-
const handleClear =
|
|
71
|
+
};
|
|
72
|
+
const handleClear = () => {
|
|
72
73
|
setSelectedDraft([]);
|
|
73
74
|
onChange({
|
|
74
75
|
selected: null,
|
|
75
76
|
selectedMultiple: [],
|
|
76
77
|
initiator: null,
|
|
77
78
|
});
|
|
78
|
-
}
|
|
79
|
-
const
|
|
79
|
+
};
|
|
80
|
+
const handleToggleAll = () => {
|
|
81
|
+
setSelectedDraft(flatOptions.length === selectedDraft.length ? [] : flatOptions);
|
|
82
|
+
};
|
|
83
|
+
const handleChange = ({ initiator, ...restArgs }) => {
|
|
80
84
|
if (!initiator) {
|
|
81
85
|
onChange({
|
|
82
86
|
initiator: null,
|
|
@@ -94,10 +98,8 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
94
98
|
? selectedDraft.filter((o) => o !== initiator)
|
|
95
99
|
: selectedDraft.concat(initiator));
|
|
96
100
|
}
|
|
97
|
-
}
|
|
98
|
-
const handleClose =
|
|
99
|
-
setSelectedDraft(selectedOptionsRef.current);
|
|
100
|
-
}, []);
|
|
101
|
+
};
|
|
102
|
+
const handleClose = () => setSelectedDraft(selectedOptionsRef.current);
|
|
101
103
|
useEffect(() => {
|
|
102
104
|
setSelectedDraft(selectedOptions);
|
|
103
105
|
selectedOptionsRef.current = selectedOptions;
|
|
@@ -113,6 +115,12 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
113
115
|
onApply: handleApply,
|
|
114
116
|
onClose: handleClose,
|
|
115
117
|
selectedDraft,
|
|
118
|
+
showHeaderWithSelectAll,
|
|
119
|
+
headerProps: {
|
|
120
|
+
indeterminate: !!selectedDraft.length && selectedDraft.length < flatOptions.length,
|
|
121
|
+
checked: selectedDraft.length === flatOptions.length,
|
|
122
|
+
onChange: handleToggleAll,
|
|
123
|
+
},
|
|
116
124
|
},
|
|
117
125
|
allowUnselect: true,
|
|
118
126
|
multiple: true,
|
|
@@ -125,7 +133,7 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
125
133
|
const VIRTUAL_OPTIONS_LIST_THRESHOLD$1 = 30;
|
|
126
134
|
const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD$1
|
|
127
135
|
? VirtualOptionsList
|
|
128
|
-
: OptionsList, onChange, bottomSheetProps, showClear = true, showSelectAll, ...restProps }, ref) => {
|
|
136
|
+
: OptionsList, onChange, bottomSheetProps, showClear = true, showSelectAll, showHeaderWithSelectAll, useWithApplyHook = multiple, ...restProps }, ref) => {
|
|
129
137
|
const applyProps = useSelectWithApply({
|
|
130
138
|
optionsListProps: {
|
|
131
139
|
...optionsListProps,
|
|
@@ -138,13 +146,16 @@ const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allow
|
|
|
138
146
|
showClear,
|
|
139
147
|
showSelectAll,
|
|
140
148
|
});
|
|
141
|
-
return (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps:
|
|
149
|
+
return (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, bottomSheetProps: {
|
|
150
|
+
bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, { ...applyProps.optionsListProps.headerProps, mobile: true })),
|
|
151
|
+
...bottomSheetProps,
|
|
152
|
+
}, optionsListProps: optionsListProps, ...restProps, ...(useWithApplyHook && applyProps) }));
|
|
142
153
|
});
|
|
143
154
|
|
|
144
155
|
const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
145
156
|
const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
146
157
|
? VirtualOptionsList
|
|
147
|
-
: OptionsList, onChange, showClear = true, showSelectAll, ...restProps }, ref) => {
|
|
158
|
+
: OptionsList, onChange, showClear = true, showSelectAll, useWithApplyHook = multiple, modalHeaderProps, showHeaderWithSelectAll, ...restProps }, ref) => {
|
|
148
159
|
const applyProps = useSelectWithApply({
|
|
149
160
|
optionsListProps: {
|
|
150
161
|
...optionsListProps,
|
|
@@ -157,7 +168,10 @@ const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false,
|
|
|
157
168
|
showClear,
|
|
158
169
|
showSelectAll,
|
|
159
170
|
});
|
|
160
|
-
return (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps,
|
|
171
|
+
return (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: fieldProps, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps, modalHeaderProps: {
|
|
172
|
+
bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, { ...applyProps.optionsListProps.headerProps, mobile: true })),
|
|
173
|
+
...modalHeaderProps,
|
|
174
|
+
}, ...restProps, ...(useWithApplyHook && applyProps) }));
|
|
161
175
|
});
|
|
162
176
|
|
|
163
177
|
export { OptionsListWithApply as O, SelectMobile as S, SelectModalMobile as a, SELECT_ALL_KEY as b, useSelectWithApply as u };
|
package/modern/Component.js
CHANGED
|
@@ -12,7 +12,7 @@ import '@juggle/resize-observer';
|
|
|
12
12
|
import 'downshift';
|
|
13
13
|
import '@alfalab/core-components-popover/modern';
|
|
14
14
|
import '@alfalab/hooks';
|
|
15
|
-
import './getDataTestId-
|
|
15
|
+
import './getDataTestId-03736ddc.js';
|
|
16
16
|
import './utils.js';
|
|
17
17
|
import './components/native-select/Component.js';
|
|
18
18
|
import '@alfalab/core-components-form-control/modern';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactNode } from "react";
|
|
4
|
+
import { NavigationBarProps } from "./types-ebda875c";
|
|
5
|
+
import { BaseModalProps, BaseModalContext } from "@alfalab/core-components-base-modal";
|
|
6
|
+
type HeaderProps = Omit<NavigationBarProps, "size" | "view" | "parentRef">;
|
|
7
|
+
declare const Header: FC<HeaderProps>;
|
|
8
|
+
type ModalDesktopProps = BaseModalProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Ширина модального окна
|
|
11
|
+
* @default "m"
|
|
12
|
+
*/
|
|
13
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen";
|
|
14
|
+
/**
|
|
15
|
+
* Растягивает модальное окно на весь экран
|
|
16
|
+
* @deprecated Используйте размер fullscreen
|
|
17
|
+
*/
|
|
18
|
+
fullscreen?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Фиксирует позицию модального окна после открытия,
|
|
21
|
+
* предотвращая скачки, если контент внутри будет меняться
|
|
22
|
+
*/
|
|
23
|
+
fixedPosition?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Управление наличием закрывающего крестика
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
hasCloser?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type ModalMobileProps = Omit<ModalDesktopProps, "size" | "fixedPosition" | "fullscreen">;
|
|
31
|
+
type View = "desktop" | "mobile";
|
|
32
|
+
type TResponsiveModalContext = {
|
|
33
|
+
view: View;
|
|
34
|
+
size: NonNullable<ModalDesktopProps["size"]>;
|
|
35
|
+
};
|
|
36
|
+
type ContentProps = {
|
|
37
|
+
/**
|
|
38
|
+
* Контент
|
|
39
|
+
*/
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Дополнительный класс
|
|
43
|
+
*/
|
|
44
|
+
className?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Растягивает контент на всю высоту
|
|
47
|
+
*/
|
|
48
|
+
flex?: boolean;
|
|
49
|
+
};
|
|
50
|
+
declare const Content: FC<ContentProps>;
|
|
51
|
+
type FooterProps = {
|
|
52
|
+
/**
|
|
53
|
+
* Контент футера
|
|
54
|
+
*/
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Дополнительный класс
|
|
58
|
+
*/
|
|
59
|
+
className?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Фиксирует футер
|
|
62
|
+
*/
|
|
63
|
+
sticky?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Выравнивание элементов футера
|
|
66
|
+
*/
|
|
67
|
+
layout?: "start" | "center" | "space-between" | "column";
|
|
68
|
+
/**
|
|
69
|
+
* Отступы между элементами футера
|
|
70
|
+
*/
|
|
71
|
+
gap?: 16 | 24 | 32;
|
|
72
|
+
};
|
|
73
|
+
declare const Footer: FC<FooterProps>;
|
|
74
|
+
declare const Modal: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
75
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen" | undefined;
|
|
76
|
+
fullscreen?: boolean | undefined;
|
|
77
|
+
fixedPosition?: boolean | undefined;
|
|
78
|
+
hasCloser?: boolean | undefined;
|
|
79
|
+
} & {
|
|
80
|
+
view: View;
|
|
81
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
82
|
+
declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
|
|
83
|
+
declare const ModalContext: import("react").Context<BaseModalContext>;
|
|
84
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
85
|
+
Content: React.FC<ContentProps>;
|
|
86
|
+
Header: React.FC<HeaderProps>;
|
|
87
|
+
Footer: React.FC<FooterProps>;
|
|
88
|
+
Closer: React.FC<CloserProps>;
|
|
89
|
+
};
|
|
90
|
+
export * from "./Component-3885b0d7";
|
|
91
|
+
export * from "./index-ebda875c";
|
|
92
|
+
export type { NavigationBarProps } from "./types-ebda875c";
|
|
93
|
+
export { HeaderProps, Header, Content, FooterProps, Footer, Modal, ResponsiveContext, ModalContext, ModalMobile };
|
|
@@ -4,7 +4,7 @@ import { Select } from './Component.js';
|
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
6
6
|
import './components/base-select/Component.js';
|
|
7
|
-
import { S as SelectMobile } from './Component-
|
|
7
|
+
import { S as SelectMobile } from './Component-c22703bb.js';
|
|
8
8
|
import '@alfalab/core-components-form-control/modern';
|
|
9
9
|
import '@alfalab/core-components-badge/modern';
|
|
10
10
|
import '@alfalab/core-components-checkbox/modern';
|
|
@@ -23,8 +23,9 @@ import 'react-merge-refs';
|
|
|
23
23
|
import '@juggle/resize-observer';
|
|
24
24
|
import 'downshift';
|
|
25
25
|
import '@alfalab/core-components-popover/modern';
|
|
26
|
-
import './getDataTestId-
|
|
26
|
+
import './getDataTestId-03736ddc.js';
|
|
27
27
|
import './components/native-select/Component.js';
|
|
28
|
+
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
28
29
|
import './components/base-select-mobile/Component.js';
|
|
29
30
|
import '@alfalab/core-components-bottom-sheet/modern';
|
|
30
31
|
import '@alfalab/core-components-modal/modern/mobile';
|
|
@@ -32,7 +33,7 @@ import './components/base-select-mobile/footer/Component.js';
|
|
|
32
33
|
import '@alfalab/core-components-base-modal/modern';
|
|
33
34
|
import '@alfalab/core-components-button/modern';
|
|
34
35
|
import '@alfalab/core-components-skeleton/modern';
|
|
35
|
-
import './intersection-observer-
|
|
36
|
+
import './intersection-observer-71fc11ef.js';
|
|
36
37
|
import './consts.js';
|
|
37
38
|
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
38
39
|
import '@alfalab/core-components-scrollbar/modern';
|
|
@@ -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
|
-
const styles = {"arrow":"
|
|
5
|
+
const styles = {"arrow":"select__arrow_pzzaq","open":"select__open_pzzaq"};
|
|
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: gh5a9 */
|
|
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_pzzaq {
|
|
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_pzzaq {
|
|
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/modern';
|
|
4
4
|
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
const styles = {"checkmark":"
|
|
6
|
+
const styles = {"checkmark":"select__checkmark_8e0mi","single":"select__single_8e0mi","selected":"select__selected_8e0mi"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const BaseCheckmark = ({ selected, disabled = false, className, multiple, }) => {
|