@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
|
-
/* hash:
|
|
1
|
+
/* hash: 1541y */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb;
|
|
@@ -29,28 +29,28 @@
|
|
|
29
29
|
/* checkmark */
|
|
30
30
|
|
|
31
31
|
/* optgroup */
|
|
32
|
-
} .
|
|
32
|
+
} .select__optionsList_1iyoz {
|
|
33
33
|
width: 100%;
|
|
34
34
|
outline: none;
|
|
35
35
|
box-sizing: border-box;
|
|
36
36
|
position: relative;
|
|
37
|
-
} .
|
|
37
|
+
} .select__optionsListHeader_1iyoz {
|
|
38
38
|
box-sizing: border-box;
|
|
39
39
|
border-bottom: 1px solid var(--color-light-border-secondary);
|
|
40
|
-
} .
|
|
40
|
+
} .select__optionsListFooter_1iyoz {
|
|
41
41
|
position: sticky;
|
|
42
42
|
bottom: 0;
|
|
43
43
|
box-sizing: border-box;
|
|
44
44
|
border-top: 1px solid transparent
|
|
45
|
-
} .
|
|
45
|
+
} .select__optionsListFooter_1iyoz.select__withBorder_1iyoz {
|
|
46
46
|
border-top: 1px solid var(--color-light-border-secondary);
|
|
47
|
-
} .
|
|
47
|
+
} .select__scrollable_1iyoz {
|
|
48
48
|
overflow: auto;
|
|
49
49
|
width: 100%;
|
|
50
|
-
} .
|
|
50
|
+
} .select__emptyPlaceholder_1iyoz {
|
|
51
51
|
padding: var(--gap-m) var(--gap-s);
|
|
52
52
|
color: var(--select-options-list-empty-placeholder-color);
|
|
53
|
-
} .
|
|
54
|
-
.
|
|
53
|
+
} .select__l_1iyoz .select__emptyPlaceholder_1iyoz,
|
|
54
|
+
.select__xl_1iyoz .select__emptyPlaceholder_1iyoz {
|
|
55
55
|
padding: var(--gap-xl) var(--gap-m);
|
|
56
56
|
}
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('tslib');
|
|
6
6
|
require('react');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-3eb05f44.js');
|
|
8
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
8
9
|
require('../arrow/Component.js');
|
|
9
10
|
require('../base-select-mobile/Component.js');
|
|
10
11
|
require('../base-select-mobile/footer/Component.js');
|
|
@@ -21,7 +22,7 @@ require('classnames');
|
|
|
21
22
|
require('downshift');
|
|
22
23
|
require('@alfalab/core-components-popover');
|
|
23
24
|
require('@alfalab/hooks');
|
|
24
|
-
require('../../getDataTestId-
|
|
25
|
+
require('../../getDataTestId-e8d9eb23.js');
|
|
25
26
|
require('../../utils.js');
|
|
26
27
|
require('../native-select/Component.js');
|
|
27
28
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
@@ -35,7 +36,7 @@ require('../checkmark-mobile/Component.js');
|
|
|
35
36
|
require('@alfalab/core-components-scrollbar');
|
|
36
37
|
require('../../consts.js');
|
|
37
38
|
require('@alfalab/core-components-skeleton');
|
|
38
|
-
require('../../intersection-observer-
|
|
39
|
+
require('../../intersection-observer-c227d471.js');
|
|
39
40
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
40
41
|
require('@alfalab/core-components-button');
|
|
41
42
|
require('@alfalab/core-components-bottom-sheet');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-3eb05f44";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-3eb05f44.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../../Component.js');
|
|
@@ -15,7 +15,7 @@ require('@juggle/resize-observer');
|
|
|
15
15
|
require('downshift');
|
|
16
16
|
require('@alfalab/core-components-popover');
|
|
17
17
|
require('@alfalab/hooks');
|
|
18
|
-
require('../../getDataTestId-
|
|
18
|
+
require('../../getDataTestId-e8d9eb23.js');
|
|
19
19
|
require('../../utils.js');
|
|
20
20
|
require('../native-select/Component.js');
|
|
21
21
|
require('../field/Component.js');
|
|
@@ -31,6 +31,7 @@ require('../checkmark-mobile/Component.js');
|
|
|
31
31
|
require('../options-list/Component.js');
|
|
32
32
|
require('@alfalab/core-components-scrollbar');
|
|
33
33
|
require('../../consts.js');
|
|
34
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
34
35
|
require('../base-select-mobile/Component.js');
|
|
35
36
|
require('@alfalab/core-components-bottom-sheet');
|
|
36
37
|
require('@alfalab/core-components-modal/mobile');
|
|
@@ -40,7 +41,7 @@ require('@alfalab/core-components-button');
|
|
|
40
41
|
require('../virtual-options-list/Component.js');
|
|
41
42
|
require('react-virtual');
|
|
42
43
|
require('@alfalab/core-components-skeleton');
|
|
43
|
-
require('../../intersection-observer-
|
|
44
|
+
require('../../intersection-observer-c227d471.js');
|
|
44
45
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
45
46
|
|
|
46
47
|
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('tslib');
|
|
6
6
|
require('react');
|
|
7
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
7
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-3eb05f44.js');
|
|
8
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
8
9
|
require('../arrow/Component.js');
|
|
9
10
|
require('../base-select-mobile/Component.js');
|
|
10
11
|
require('../base-select-mobile/footer/Component.js');
|
|
@@ -21,7 +22,7 @@ require('classnames');
|
|
|
21
22
|
require('downshift');
|
|
22
23
|
require('@alfalab/core-components-popover');
|
|
23
24
|
require('@alfalab/hooks');
|
|
24
|
-
require('../../getDataTestId-
|
|
25
|
+
require('../../getDataTestId-e8d9eb23.js');
|
|
25
26
|
require('../../utils.js');
|
|
26
27
|
require('../native-select/Component.js');
|
|
27
28
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
@@ -35,7 +36,7 @@ require('../checkmark-mobile/Component.js');
|
|
|
35
36
|
require('@alfalab/core-components-scrollbar');
|
|
36
37
|
require('../../consts.js');
|
|
37
38
|
require('@alfalab/core-components-skeleton');
|
|
38
|
-
require('../../intersection-observer-
|
|
39
|
+
require('../../intersection-observer-c227d471.js');
|
|
39
40
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
40
41
|
require('@alfalab/core-components-button');
|
|
41
42
|
require('@alfalab/core-components-bottom-sheet');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-3eb05f44";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-
|
|
5
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('../../Component-3eb05f44.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../../Component.js');
|
|
@@ -15,7 +15,7 @@ require('@juggle/resize-observer');
|
|
|
15
15
|
require('downshift');
|
|
16
16
|
require('@alfalab/core-components-popover');
|
|
17
17
|
require('@alfalab/hooks');
|
|
18
|
-
require('../../getDataTestId-
|
|
18
|
+
require('../../getDataTestId-e8d9eb23.js');
|
|
19
19
|
require('../../utils.js');
|
|
20
20
|
require('../native-select/Component.js');
|
|
21
21
|
require('../field/Component.js');
|
|
@@ -31,6 +31,7 @@ require('../checkmark-mobile/Component.js');
|
|
|
31
31
|
require('../options-list/Component.js');
|
|
32
32
|
require('@alfalab/core-components-scrollbar');
|
|
33
33
|
require('../../consts.js');
|
|
34
|
+
require('../../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
34
35
|
require('../base-select-mobile/Component.js');
|
|
35
36
|
require('@alfalab/core-components-bottom-sheet');
|
|
36
37
|
require('@alfalab/core-components-modal/mobile');
|
|
@@ -40,7 +41,7 @@ require('@alfalab/core-components-button');
|
|
|
40
41
|
require('../virtual-options-list/Component.js');
|
|
41
42
|
require('react-virtual');
|
|
42
43
|
require('@alfalab/core-components-skeleton');
|
|
43
|
-
require('../../intersection-observer-
|
|
44
|
+
require('../../intersection-observer-c227d471.js');
|
|
44
45
|
require('../../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
45
46
|
|
|
46
47
|
|
|
@@ -19,16 +19,16 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
19
19
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
20
20
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
21
21
|
|
|
22
|
-
var styles = {"virtualOptionsList":"
|
|
22
|
+
var styles = {"virtualOptionsList":"select__virtualOptionsList_520i7","virtualOptionsListHeader":"select__virtualOptionsListHeader_520i7","virtualOptionsListFooter":"select__virtualOptionsListFooter_520i7","withBorder":"select__withBorder_520i7","scrollable":"select__scrollable_520i7","inner":"select__inner_520i7","virtualRow":"select__virtualRow_520i7","highlighted":"select__highlighted_520i7","emptyPlaceholder":"select__emptyPlaceholder_520i7","l":"select__l_520i7","xl":"select__xl_520i7"};
|
|
23
23
|
require('./index.css')
|
|
24
24
|
|
|
25
25
|
var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
26
26
|
var _b;
|
|
27
|
-
var _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.highlightedIndex, highlightedIndex = _e === void 0 ? -1 : _e, className = _a.className, getOptionProps = _a.getOptionProps, Option = _a.Option, open = _a.open, _f = _a.options, options = _f === void 0 ? [] : _f, _g = _a.Optgroup, Optgroup = _g === void 0 ? components_optgroup_Component.Optgroup : _g, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _h = _a.visibleOptions, visibleOptions = _h === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _h, header = _a.header, footer = _a.footer, optionsListWidth = _a.optionsListWidth, onScroll = _a.onScroll, nativeScrollbarProp = _a.nativeScrollbar;
|
|
27
|
+
var _c = _a.size, size = _c === void 0 ? 's' : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.highlightedIndex, highlightedIndex = _e === void 0 ? -1 : _e, className = _a.className, getOptionProps = _a.getOptionProps, Option = _a.Option, open = _a.open, _f = _a.options, options = _f === void 0 ? [] : _f, _g = _a.Optgroup, Optgroup = _g === void 0 ? components_optgroup_Component.Optgroup : _g, dataTestId = _a.dataTestId, emptyPlaceholder = _a.emptyPlaceholder, _h = _a.visibleOptions, visibleOptions = _h === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _h, header = _a.header, footer = _a.footer, _j = _a.showFooter, showFooter = _j === void 0 ? true : _j, optionsListWidth = _a.optionsListWidth, onScroll = _a.onScroll, nativeScrollbarProp = _a.nativeScrollbar;
|
|
28
28
|
var listRef = React.useRef(null);
|
|
29
29
|
var parentRef = React.useRef(null);
|
|
30
30
|
var scrollbarRef = React.useRef(null);
|
|
31
|
-
var
|
|
31
|
+
var _k = React.useState(0), visibleOptionsInvalidateKey = _k[0], setVisibleOptionsInvalidateKey = _k[1];
|
|
32
32
|
var prevHighlightedIndex = utils.usePrevious(highlightedIndex) || -1;
|
|
33
33
|
var nativeScrollbar = hooks.useMedia([[true, '(max-width: 1023px)']], false)[0];
|
|
34
34
|
var rowVirtualizer = reactVirtual.useVirtual({
|
|
@@ -132,7 +132,7 @@ var VirtualOptionsList = React.forwardRef(function (_a, ref) {
|
|
|
132
132
|
header && React__default.default.createElement("div", { className: styles.virtualOptionsListHeader }, header),
|
|
133
133
|
nativeScrollbar ? renderWithNativeScrollbar() : renderWithCustomScrollbar(),
|
|
134
134
|
emptyPlaceholder && options.length === 0 && (React__default.default.createElement("div", { className: styles.emptyPlaceholder }, emptyPlaceholder)),
|
|
135
|
-
footer && (React__default.default.createElement("div", { className: cn__default.default(styles.virtualOptionsListFooter, (_b = {},
|
|
135
|
+
showFooter && footer && (React__default.default.createElement("div", { className: cn__default.default(styles.virtualOptionsListFooter, (_b = {},
|
|
136
136
|
_b[styles.withBorder] = visibleOptions && flatOptions.length > visibleOptions,
|
|
137
137
|
_b)) }, footer))));
|
|
138
138
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: aezsy */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-primary: #dcdcdd;
|
|
@@ -35,34 +35,34 @@
|
|
|
35
35
|
/* checkmark */
|
|
36
36
|
|
|
37
37
|
/* optgroup */
|
|
38
|
-
} .
|
|
38
|
+
} .select__virtualOptionsList_520i7 {
|
|
39
39
|
width: 100%;
|
|
40
40
|
outline: none;
|
|
41
41
|
box-sizing: border-box;
|
|
42
42
|
position: sticky;
|
|
43
|
-
} .
|
|
43
|
+
} .select__virtualOptionsListHeader_520i7 {
|
|
44
44
|
box-sizing: border-box;
|
|
45
45
|
border-bottom: 1px solid var(--color-light-border-secondary);
|
|
46
|
-
} .
|
|
46
|
+
} .select__virtualOptionsListFooter_520i7 {
|
|
47
47
|
position: sticky;
|
|
48
48
|
bottom: 0;
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
border-top: 1px solid transparent
|
|
51
|
-
} .
|
|
51
|
+
} .select__virtualOptionsListFooter_520i7.select__withBorder_520i7 {
|
|
52
52
|
border-top: 1px solid var(--color-light-border-secondary);
|
|
53
|
-
} .
|
|
53
|
+
} .select__scrollable_520i7 {
|
|
54
54
|
position: relative;
|
|
55
55
|
overflow: auto;
|
|
56
56
|
width: 100%;
|
|
57
|
-
} .
|
|
57
|
+
} .select__inner_520i7 {
|
|
58
58
|
position: relative;
|
|
59
59
|
width: 100%;
|
|
60
|
-
} .
|
|
60
|
+
} .select__virtualRow_520i7 {
|
|
61
61
|
position: absolute;
|
|
62
62
|
top: 0;
|
|
63
63
|
left: 0;
|
|
64
64
|
width: 100%
|
|
65
|
-
} .
|
|
65
|
+
} .select__virtualRow_520i7:before {
|
|
66
66
|
content: '';
|
|
67
67
|
position: absolute;
|
|
68
68
|
z-index: 1;
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
height: 1px;
|
|
73
73
|
background: var(--select-option-divider-background);
|
|
74
74
|
display: var(--select-option-divider-display);
|
|
75
|
-
} .
|
|
75
|
+
} .select__virtualRow_520i7:first-child:before {
|
|
76
76
|
display: none;
|
|
77
|
-
} .
|
|
78
|
-
.
|
|
77
|
+
} .select__highlighted_520i7:before,
|
|
78
|
+
.select__highlighted_520i7 + .select__virtualRow_520i7:before {
|
|
79
79
|
display: none;
|
|
80
|
-
} .
|
|
80
|
+
} .select__emptyPlaceholder_520i7 {
|
|
81
81
|
padding: var(--gap-m) var(--gap-s);
|
|
82
82
|
color: var(--select-options-list-empty-placeholder-color);
|
|
83
|
-
} .
|
|
84
|
-
.
|
|
83
|
+
} .select__l_520i7 .select__emptyPlaceholder_520i7,
|
|
84
|
+
.select__xl_520i7 .select__emptyPlaceholder_520i7 {
|
|
85
85
|
padding: var(--gap-xl) var(--gap-m);
|
|
86
86
|
}
|
|
@@ -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 };
|
|
@@ -7,6 +7,7 @@ require('classnames');
|
|
|
7
7
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
8
8
|
require('./components/arrow/index.module.css');
|
|
9
9
|
require('./components/base-select/Component.js');
|
|
10
|
+
var presets_useSelectWithApply_optionsListWithApply_header_Component = require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
10
11
|
var components_arrow_Component = require('./components/arrow/Component.js');
|
|
11
12
|
var components_baseSelectMobile_Component = require('./components/base-select-mobile/Component.js');
|
|
12
13
|
var components_baseSelectMobile_footer_Component = require('./components/base-select-mobile/footer/Component.js');
|
|
@@ -41,7 +42,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
41
42
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
42
43
|
|
|
43
44
|
var OptionsListWithApply = React.forwardRef(function (_a, ref) {
|
|
44
|
-
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 = _e === void 0 ? components_optionsList_Component.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 ? consts.DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer = _k === void 0 ? presets_useSelectWithApply_optionsListWithApply_footer_Component.Footer : _k, restProps = tslib.__rest(_a, ["toggleMenu", "getOptionProps", "showClear", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer"]);
|
|
45
|
+
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 = _e === void 0 ? components_optionsList_Component.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 ? consts.DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer = _k === void 0 ? presets_useSelectWithApply_optionsListWithApply_footer_Component.Footer : _k, _l = _a.Header, Header = _l === void 0 ? presets_useSelectWithApply_optionsListWithApply_header_Component.Header : _l, headerProps = _a.headerProps, restProps = tslib.__rest(_a, ["toggleMenu", "getOptionProps", "showClear", "showHeaderWithSelectAll", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer", "Header", "headerProps"]);
|
|
45
46
|
var getOptionProps = React.useCallback(function (option, index) {
|
|
46
47
|
var optionProps = defaultGetOptionProps(option, index);
|
|
47
48
|
var selected = option.key === SELECT_ALL_KEY
|
|
@@ -67,32 +68,35 @@ var OptionsListWithApply = React.forwardRef(function (_a, ref) {
|
|
|
67
68
|
};
|
|
68
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
70
|
}, []);
|
|
70
|
-
return (React__default.default.createElement(OptionsList, tslib.__assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, footer: React__default.default.createElement(Footer, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
|
|
71
|
+
return (React__default.default.createElement(OptionsList, tslib.__assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: showHeaderWithSelectAll ? React__default.default.createElement(Header, tslib.__assign({}, headerProps)) : undefined, footer: React__default.default.createElement(Footer, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
|
|
71
72
|
});
|
|
72
73
|
|
|
73
74
|
var SELECT_ALL_KEY = 'select_all';
|
|
74
75
|
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
75
76
|
function useSelectWithApply(_a) {
|
|
76
|
-
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;
|
|
77
|
-
var
|
|
78
|
-
var
|
|
77
|
+
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;
|
|
78
|
+
var _g = React.useMemo(function () { return utils.processOptions(options, selected); }, [options, selected]), flatOptions = _g.flatOptions, selectedOptions = _g.selectedOptions;
|
|
79
|
+
var _h = React.useState(selectedOptions), selectedDraft = _h[0], setSelectedDraft = _h[1];
|
|
79
80
|
var selectedOptionsRef = React.useRef(selectedOptions);
|
|
80
|
-
var handleApply =
|
|
81
|
+
var handleApply = function () {
|
|
81
82
|
onChange({
|
|
82
83
|
selected: selectedDraft[0],
|
|
83
84
|
selectedMultiple: selectedDraft,
|
|
84
85
|
initiator: null,
|
|
85
86
|
});
|
|
86
|
-
}
|
|
87
|
-
var handleClear =
|
|
87
|
+
};
|
|
88
|
+
var handleClear = function () {
|
|
88
89
|
setSelectedDraft([]);
|
|
89
90
|
onChange({
|
|
90
91
|
selected: null,
|
|
91
92
|
selectedMultiple: [],
|
|
92
93
|
initiator: null,
|
|
93
94
|
});
|
|
94
|
-
}
|
|
95
|
-
var
|
|
95
|
+
};
|
|
96
|
+
var handleToggleAll = function () {
|
|
97
|
+
setSelectedDraft(flatOptions.length === selectedDraft.length ? [] : flatOptions);
|
|
98
|
+
};
|
|
99
|
+
var handleChange = function (_a) {
|
|
96
100
|
var initiator = _a.initiator, restArgs = tslib.__rest(_a, ["initiator"]);
|
|
97
101
|
if (!initiator) {
|
|
98
102
|
onChange(tslib.__assign({ initiator: null }, restArgs));
|
|
@@ -108,10 +112,8 @@ function useSelectWithApply(_a) {
|
|
|
108
112
|
? selectedDraft.filter(function (o) { return o !== initiator; })
|
|
109
113
|
: selectedDraft.concat(initiator));
|
|
110
114
|
}
|
|
111
|
-
}
|
|
112
|
-
var handleClose =
|
|
113
|
-
setSelectedDraft(selectedOptionsRef.current);
|
|
114
|
-
}, []);
|
|
115
|
+
};
|
|
116
|
+
var handleClose = function () { return setSelectedDraft(selectedOptionsRef.current); };
|
|
115
117
|
React.useEffect(function () {
|
|
116
118
|
setSelectedDraft(selectedOptions);
|
|
117
119
|
selectedOptionsRef.current = selectedOptions;
|
|
@@ -119,7 +121,11 @@ function useSelectWithApply(_a) {
|
|
|
119
121
|
var memoizedOptions = React.useMemo(function () { return (showSelectAll ? tslib.__spreadArray([selectAllOption], options, true) : options); }, [options, showSelectAll]);
|
|
120
122
|
return {
|
|
121
123
|
OptionsList: OptionsListWithApply,
|
|
122
|
-
optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft
|
|
124
|
+
optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft, showHeaderWithSelectAll: showHeaderWithSelectAll, headerProps: {
|
|
125
|
+
indeterminate: !!selectedDraft.length && selectedDraft.length < flatOptions.length,
|
|
126
|
+
checked: selectedDraft.length === flatOptions.length,
|
|
127
|
+
onChange: handleToggleAll,
|
|
128
|
+
} }),
|
|
123
129
|
allowUnselect: true,
|
|
124
130
|
multiple: true,
|
|
125
131
|
options: memoizedOptions,
|
|
@@ -132,7 +138,7 @@ var VIRTUAL_OPTIONS_LIST_THRESHOLD$1 = 30;
|
|
|
132
138
|
var SelectMobile = React.forwardRef(function (_a, ref) {
|
|
133
139
|
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 = _p === void 0 ? components_arrow_Component.Arrow : _p, _q = _a.Field, Field = _q === void 0 ? components_field_Component.Field : _q, _r = _a.Optgroup, Optgroup = _r === void 0 ? components_optgroup_Component.Optgroup : _r, _s = _a.Option, Option = _s === void 0 ? components_option_Component.Option : _s, selected = _a.selected, options = _a.options, _t = _a.OptionsList, OptionsList = _t === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD$1
|
|
134
140
|
? components_virtualOptionsList_Component.VirtualOptionsList
|
|
135
|
-
: components_optionsList_Component.OptionsList : _t, onChange = _a.onChange, bottomSheetProps = _a.bottomSheetProps, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, restProps = tslib.__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"]);
|
|
141
|
+
: components_optionsList_Component.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 = tslib.__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"]);
|
|
136
142
|
var applyProps = useSelectWithApply({
|
|
137
143
|
optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { Footer: components_baseSelectMobile_footer_Component.Footer }),
|
|
138
144
|
OptionsList: OptionsList,
|
|
@@ -142,14 +148,14 @@ var SelectMobile = React.forwardRef(function (_a, ref) {
|
|
|
142
148
|
showClear: showClear,
|
|
143
149
|
showSelectAll: showSelectAll,
|
|
144
150
|
});
|
|
145
|
-
return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__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, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, bottomSheetProps:
|
|
151
|
+
return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__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, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: true, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, bottomSheetProps: tslib.__assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React__default.default.createElement(presets_useSelectWithApply_optionsListWithApply_header_Component.Header, tslib.__assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, bottomSheetProps), optionsListProps: optionsListProps }, restProps, (useWithApplyHook && applyProps))));
|
|
146
152
|
});
|
|
147
153
|
|
|
148
154
|
var VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
149
155
|
var SelectModalMobile = React.forwardRef(function (_a, ref) {
|
|
150
156
|
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 = _p === void 0 ? components_arrow_Component.Arrow : _p, _q = _a.Field, Field = _q === void 0 ? components_field_Component.Field : _q, _r = _a.Optgroup, Optgroup = _r === void 0 ? components_optgroup_Component.Optgroup : _r, _s = _a.Option, Option = _s === void 0 ? components_option_Component.Option : _s, selected = _a.selected, options = _a.options, _t = _a.OptionsList, OptionsList = _t === void 0 ? options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
151
157
|
? components_virtualOptionsList_Component.VirtualOptionsList
|
|
152
|
-
: components_optionsList_Component.OptionsList : _t, onChange = _a.onChange, _u = _a.showClear, showClear = _u === void 0 ? true : _u, showSelectAll = _a.showSelectAll, restProps = tslib.__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"]);
|
|
158
|
+
: components_optionsList_Component.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 = tslib.__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"]);
|
|
153
159
|
var applyProps = useSelectWithApply({
|
|
154
160
|
optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { Footer: components_baseSelectMobile_footer_Component.Footer }),
|
|
155
161
|
OptionsList: OptionsList,
|
|
@@ -159,7 +165,7 @@ var SelectModalMobile = React.forwardRef(function (_a, ref) {
|
|
|
159
165
|
showClear: showClear,
|
|
160
166
|
showSelectAll: showSelectAll,
|
|
161
167
|
});
|
|
162
|
-
return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__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, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, optionsListProps: optionsListProps }, restProps, (
|
|
168
|
+
return (React__default.default.createElement(components_baseSelectMobile_Component.BaseSelectMobile, tslib.__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, Field: Field, Optgroup: Optgroup, Option: Option, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList, optionsListProps: optionsListProps, modalHeaderProps: tslib.__assign({ bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React__default.default.createElement(presets_useSelectWithApply_optionsListWithApply_header_Component.Header, tslib.__assign({}, applyProps.optionsListProps.headerProps, { mobile: true }))) }, modalHeaderProps) }, restProps, (useWithApplyHook && applyProps))));
|
|
163
169
|
});
|
|
164
170
|
|
|
165
171
|
exports.OptionsListWithApply = OptionsListWithApply;
|
|
@@ -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 };
|
|
@@ -10,7 +10,7 @@ require('classnames');
|
|
|
10
10
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
11
11
|
require('./components/arrow/index.module.css');
|
|
12
12
|
require('./components/base-select/Component.js');
|
|
13
|
-
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-
|
|
13
|
+
var presets_useSelectWithApply_optionsListWithApply_Component = require('./Component-4727d474.js');
|
|
14
14
|
require('@alfalab/core-components-form-control/cssm');
|
|
15
15
|
require('./components/field/index.module.css');
|
|
16
16
|
require('./components/optgroup/index.module.css');
|
|
@@ -39,6 +39,8 @@ require('@alfalab/core-components-popover/cssm');
|
|
|
39
39
|
require('./getDataTestId-5c876d98.js');
|
|
40
40
|
require('./components/native-select/Component.js');
|
|
41
41
|
require('./components/base-select/index.module.css');
|
|
42
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
43
|
+
require('./presets/useSelectWithApply/options-list-with-apply/header/index.module.css');
|
|
42
44
|
require('./components/base-select-mobile/Component.js');
|
|
43
45
|
require('@alfalab/core-components-bottom-sheet/cssm');
|
|
44
46
|
require('@alfalab/core-components-modal/cssm/mobile');
|