@alfalab/core-components-select 17.8.2 → 17.8.4
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/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +6 -4
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +9 -7
- package/components/base-option/Component.js +1 -1
- package/components/base-option/index.css +21 -19
- package/components/base-select/Component.d.ts +8 -14
- package/components/base-select/Component.js +48 -75
- package/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
- package/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +19 -0
- package/components/base-select/components/list-desktop/list-popover-desktop.d.ts +0 -0
- package/components/base-select/components/list-desktop/list-popover-desktop.js +12 -0
- package/components/base-select/components/list-desktop/types/types.d.ts +3 -0
- package/components/base-select/components/list-desktop/types/types.js +2 -0
- package/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
- package/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +23 -0
- package/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
- package/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +22 -0
- package/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
- package/components/base-select/components/list-mobile/helpers/index.js +11 -0
- package/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
- package/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +28 -0
- package/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
- package/components/base-select/components/list-mobile/list-mobile.js +26 -0
- package/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
- package/components/base-select/components/list-mobile/list-modal-mobile.js +42 -0
- package/components/base-select/components/list-mobile/types/types.d.ts +4 -0
- package/components/base-select/components/list-mobile/types/types.js +2 -0
- package/components/base-select/index.css +16 -14
- package/components/base-select/mobile.css +19 -17
- package/components/base-select/types/component-types.d.ts +50 -0
- package/components/base-select/types/component-types.js +2 -0
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +15 -13
- package/components/checkmark-mobile/Component.js +1 -1
- package/components/checkmark-mobile/index.css +9 -7
- package/components/field/Component.js +1 -1
- package/components/field/index.css +15 -13
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +9 -7
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +12 -10
- package/components/option/Component.js +1 -1
- package/components/option/index.css +24 -22
- package/components/options-list/Component.js +1 -1
- package/components/options-list/index.css +16 -14
- package/components/search/Component.js +1 -1
- package/components/search/index.css +5 -3
- package/components/virtual-options-list/Component.js +1 -1
- package/components/virtual-options-list/index.css +21 -19
- package/cssm/components/arrow/index.module.css +3 -1
- package/cssm/components/base-checkmark/index.module.css +3 -1
- package/cssm/components/base-option/index.module.css +6 -4
- package/cssm/components/base-select/Component.d.ts +8 -14
- package/cssm/components/base-select/Component.js +38 -60
- package/cssm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
- package/cssm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +19 -0
- package/cssm/components/base-select/components/list-desktop/list-popover-desktop.d.ts +9 -0
- package/cssm/components/base-select/components/list-desktop/list-popover-desktop.js +24 -0
- package/cssm/components/base-select/components/list-desktop/types/types.d.ts +3 -0
- package/cssm/components/base-select/components/list-desktop/types/types.js +2 -0
- package/cssm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
- package/cssm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +23 -0
- package/cssm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
- package/cssm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +22 -0
- package/cssm/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
- package/cssm/components/base-select/components/list-mobile/helpers/index.js +11 -0
- package/cssm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
- package/cssm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +29 -0
- package/cssm/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
- package/cssm/components/base-select/components/list-mobile/list-mobile.js +26 -0
- package/cssm/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
- package/cssm/components/base-select/components/list-mobile/list-modal-mobile.js +43 -0
- package/cssm/components/base-select/components/list-mobile/types/types.d.ts +4 -0
- package/cssm/components/base-select/components/list-mobile/types/types.js +2 -0
- package/cssm/components/base-select/index.module.css +5 -3
- package/cssm/components/base-select/mobile.module.css +7 -5
- package/cssm/components/base-select/types/component-types.d.ts +50 -0
- package/cssm/components/base-select/types/component-types.js +2 -0
- package/cssm/components/checkmark/index.module.css +5 -3
- package/cssm/components/checkmark-mobile/index.module.css +3 -1
- package/cssm/components/field/index.module.css +3 -1
- package/cssm/components/footer/index.module.css +4 -2
- package/cssm/components/optgroup/index.module.css +6 -4
- package/cssm/components/option/index.module.css +5 -3
- package/cssm/components/options-list/index.module.css +6 -4
- package/cssm/components/search/index.module.css +3 -1
- package/cssm/components/virtual-options-list/index.module.css +6 -4
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +5 -3
- package/cssm/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +5 -3
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +6 -4
- package/esm/components/base-checkmark/Component.js +1 -1
- package/esm/components/base-checkmark/index.css +9 -7
- package/esm/components/base-option/Component.js +1 -1
- package/esm/components/base-option/index.css +21 -19
- package/esm/components/base-select/Component.d.ts +8 -14
- package/esm/components/base-select/Component.js +39 -66
- package/esm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
- package/esm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +15 -0
- package/esm/components/base-select/components/list-desktop/list-popover-desktop.d.ts +0 -0
- package/esm/components/base-select/components/list-desktop/list-popover-desktop.js +4 -0
- package/esm/components/base-select/components/list-desktop/types/types.d.ts +3 -0
- package/esm/components/base-select/components/list-desktop/types/types.js +1 -0
- package/esm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
- package/esm/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +19 -0
- package/esm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
- package/esm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +18 -0
- package/esm/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
- package/esm/components/base-select/components/list-mobile/helpers/index.js +2 -0
- package/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
- package/esm/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +20 -0
- package/esm/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
- package/esm/components/base-select/components/list-mobile/list-mobile.js +18 -0
- package/esm/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
- package/esm/components/base-select/components/list-mobile/list-modal-mobile.js +32 -0
- package/esm/components/base-select/components/list-mobile/types/types.d.ts +4 -0
- package/esm/components/base-select/components/list-mobile/types/types.js +1 -0
- package/esm/components/base-select/index.css +16 -14
- package/esm/components/base-select/mobile.css +19 -17
- package/esm/components/base-select/types/component-types.d.ts +50 -0
- package/esm/components/base-select/types/component-types.js +1 -0
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +15 -13
- package/esm/components/checkmark-mobile/Component.js +1 -1
- package/esm/components/checkmark-mobile/index.css +9 -7
- package/esm/components/field/Component.js +1 -1
- package/esm/components/field/index.css +15 -13
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +9 -7
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +12 -10
- package/esm/components/option/Component.js +1 -1
- package/esm/components/option/index.css +24 -22
- package/esm/components/options-list/Component.js +1 -1
- package/esm/components/options-list/index.css +16 -14
- package/esm/components/search/Component.js +1 -1
- package/esm/components/search/index.css +5 -3
- package/esm/components/virtual-options-list/Component.js +1 -1
- package/esm/components/virtual-options-list/index.css +21 -19
- package/esm/list-popover-desktop-f713543b.d.ts +9 -0
- package/esm/list-popover-desktop-f713543b.js +16 -0
- package/esm/mobile/Component.mobile.js +1 -1
- package/esm/mobile.module-98003396.js +4 -0
- package/esm/presets/index.js +1 -1
- package/esm/presets/useSelectWithApply/hook.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -6
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +8 -6
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/shared/index.js +1 -1
- package/list-popover-desktop-11171d84.d.ts +9 -0
- package/list-popover-desktop-11171d84.js +24 -0
- package/mobile/Component.mobile.js +1 -1
- package/mobile.module-8f94cd8b.js +6 -0
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +6 -4
- package/modern/components/base-checkmark/Component.js +1 -1
- package/modern/components/base-checkmark/index.css +9 -7
- package/modern/components/base-option/Component.js +1 -1
- package/modern/components/base-option/index.css +21 -19
- package/modern/components/base-select/Component.d.ts +8 -14
- package/modern/components/base-select/Component.js +23 -56
- package/modern/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.d.ts +12 -0
- package/modern/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js +15 -0
- package/modern/components/base-select/components/list-desktop/list-popover-desktop.d.ts +0 -0
- package/modern/components/base-select/components/list-desktop/list-popover-desktop.js +3 -0
- package/modern/components/base-select/components/list-desktop/types/types.d.ts +3 -0
- package/modern/components/base-select/components/list-desktop/types/types.js +1 -0
- package/modern/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.d.ts +16 -0
- package/modern/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js +19 -0
- package/modern/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts +28 -0
- package/modern/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js +18 -0
- package/modern/components/base-select/components/list-mobile/helpers/index.d.ts +2 -0
- package/modern/components/base-select/components/list-mobile/helpers/index.js +2 -0
- package/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.d.ts +15 -0
- package/modern/components/base-select/components/list-mobile/list-bottom-sheet-mobile.js +24 -0
- package/modern/components/base-select/components/list-mobile/list-mobile.d.ts +16 -0
- package/modern/components/base-select/components/list-mobile/list-mobile.js +17 -0
- package/modern/components/base-select/components/list-mobile/list-modal-mobile.d.ts +15 -0
- package/modern/components/base-select/components/list-mobile/list-modal-mobile.js +32 -0
- package/modern/components/base-select/components/list-mobile/types/types.d.ts +4 -0
- package/modern/components/base-select/components/list-mobile/types/types.js +1 -0
- package/modern/components/base-select/index.css +16 -14
- package/modern/components/base-select/mobile.css +19 -17
- package/modern/components/base-select/types/component-types.d.ts +50 -0
- package/modern/components/base-select/types/component-types.js +1 -0
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +15 -13
- package/modern/components/checkmark-mobile/Component.js +1 -1
- package/modern/components/checkmark-mobile/index.css +9 -7
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +15 -13
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +9 -7
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +12 -10
- package/modern/components/option/Component.js +1 -1
- package/modern/components/option/index.css +24 -22
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +16 -14
- package/modern/components/search/Component.js +1 -1
- package/modern/components/search/index.css +5 -3
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +21 -19
- package/modern/list-popover-desktop-1f55335b.d.ts +9 -0
- package/modern/list-popover-desktop-1f55335b.js +15 -0
- package/modern/mobile/Component.mobile.js +1 -1
- package/modern/mobile.module-815026ad.js +4 -0
- package/modern/presets/index.js +1 -1
- package/modern/presets/useSelectWithApply/hook.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -6
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +8 -6
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/shared/index.js +1 -1
- package/package.json +8 -6
- package/presets/index.js +1 -1
- package/presets/useSelectWithApply/hook.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +8 -6
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +8 -6
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +1 -1
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/shared/index.js +1 -1
- package/src/components/base-select/Component.tsx +49 -185
- package/src/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.tsx +24 -0
- package/src/components/base-select/components/list-desktop/list-popover-desktop.tsx +47 -0
- package/src/components/base-select/components/list-desktop/types/types.ts +3 -0
- package/src/components/base-select/components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.tsx +32 -0
- package/src/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.tsx +30 -0
- package/src/components/base-select/components/list-mobile/helpers/index.ts +2 -0
- package/src/components/base-select/components/list-mobile/list-bottom-sheet-mobile.tsx +84 -0
- package/src/components/base-select/components/list-mobile/list-mobile.tsx +39 -0
- package/src/components/base-select/components/list-mobile/list-modal-mobile.tsx +94 -0
- package/src/components/base-select/components/list-mobile/types/types.ts +4 -0
- package/src/components/base-select/types/component-types.ts +39 -0
- /package/esm/{hook-86063cab.d.ts → hook-9d222e75.d.ts} +0 -0
- /package/esm/{hook-86063cab.js → hook-9d222e75.js} +0 -0
- /package/{hook-777449d0.d.ts → hook-01942cdc.d.ts} +0 -0
- /package/{hook-777449d0.js → hook-01942cdc.js} +0 -0
- /package/modern/{hook-1c546c40.d.ts → hook-ea5654cb.d.ts} +0 -0
- /package/modern/{hook-1c546c40.js → hook-ea5654cb.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 87rr0 */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* 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 */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-modal-bg-primary: #fff;
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
/* Hard up */
|
|
18
18
|
} :root {
|
|
19
|
-
} :root {
|
|
20
|
-
--gap-s: 12px;
|
|
21
|
-
--gap-m: 16px;
|
|
22
|
-
--gap-l: 20px;
|
|
19
|
+
} :root { /* deprecated */ /* deprecated */ /* deprecated */
|
|
20
|
+
--gap-s: 12px; /* deprecated */ /* deprecated */
|
|
21
|
+
--gap-m: 16px; /* deprecated */
|
|
22
|
+
--gap-l: 20px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
23
|
+
|
|
24
|
+
/* новые значения, используйте их */
|
|
23
25
|
} :root {
|
|
24
26
|
} :root {
|
|
25
27
|
--disabled-cursor: not-allowed;
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
/* checkmark */
|
|
44
46
|
|
|
45
47
|
/* optgroup */
|
|
46
|
-
} .
|
|
48
|
+
} .select__option_au5nm {
|
|
47
49
|
font-size: 16px;
|
|
48
50
|
line-height: 20px;
|
|
49
51
|
font-weight: 400;
|
|
@@ -57,36 +59,36 @@
|
|
|
57
59
|
position: relative;
|
|
58
60
|
cursor: pointer;
|
|
59
61
|
min-height: var(--size-s-height)
|
|
60
|
-
} .
|
|
62
|
+
} .select__option_au5nm:not(.select__disabled_au5nm):active {
|
|
61
63
|
background: var(--select-option-active-background);
|
|
62
64
|
color: var(--select-option-active-color);
|
|
63
|
-
} .
|
|
65
|
+
} .select__option_au5nm.select__checkmarkBefore_au5nm {
|
|
64
66
|
padding: 0 0 0 var(--gap-s)
|
|
65
|
-
} .
|
|
67
|
+
} .select__option_au5nm.select__checkmarkBefore_au5nm.select__mobile_au5nm {
|
|
66
68
|
padding-left: var(--gap-m);
|
|
67
|
-
} .
|
|
69
|
+
} .select__option_au5nm.select__checkmarkAfter_au5nm.select__checkmarkAfter_au5nm {
|
|
68
70
|
padding: 0 var(--gap-s) 0 0
|
|
69
|
-
} .
|
|
71
|
+
} .select__option_au5nm.select__checkmarkAfter_au5nm.select__checkmarkAfter_au5nm.select__mobile_au5nm {
|
|
70
72
|
padding-right: var(--gap-l);
|
|
71
|
-
} .
|
|
73
|
+
} .select__option_au5nm.select__textContent_au5nm {
|
|
72
74
|
padding: var(--gap-s)
|
|
73
|
-
} .
|
|
75
|
+
} .select__option_au5nm.select__textContent_au5nm.select__mobile_au5nm {
|
|
74
76
|
padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
|
|
75
|
-
} .
|
|
77
|
+
} .select__selected_au5nm {
|
|
76
78
|
background: var(--select-option-selected-background);
|
|
77
79
|
color: var(--select-option-selected-color);
|
|
78
80
|
cursor: default;
|
|
79
|
-
} .
|
|
81
|
+
} .select__highlighted_au5nm {
|
|
80
82
|
background: var(--select-option-hover-background);
|
|
81
83
|
color: var(--select-option-hover-color);
|
|
82
|
-
} .
|
|
84
|
+
} .select__disabled_au5nm {
|
|
83
85
|
cursor: var(--disabled-cursor);
|
|
84
86
|
background: var(--select-option-disabled-background);
|
|
85
87
|
color: var(--select-option-disabled-color);
|
|
86
|
-
} .
|
|
88
|
+
} .select__checkmarkBeforeContent_au5nm {
|
|
87
89
|
margin-right: var(--gap-s);
|
|
88
|
-
} .
|
|
90
|
+
} .select__checkmarkAfterContent_au5nm {
|
|
89
91
|
margin-left: var(--gap-s);
|
|
90
|
-
} .
|
|
92
|
+
} .select__content_au5nm {
|
|
91
93
|
flex: 1;
|
|
92
94
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
5
|
-
import { ModalMobileProps } from "@alfalab/core-components-modal/mobile";
|
|
6
|
-
import { ModalContentProps, ModalFooterProps, ModalHeaderProps } from "@alfalab/core-components-modal/shared";
|
|
7
|
-
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
8
|
-
import { AdditionalMobileProps, BaseSelectProps, BottomSheetSelectMobileProps, ModalSelectMobileProps } from "../../typings";
|
|
9
|
-
declare const BaseSelect: React.ForwardRefExoticComponent<BaseSelectProps & AdditionalMobileProps & BottomSheetSelectMobileProps & ModalSelectMobileProps & {
|
|
3
|
+
declare const BaseSelect: React.ForwardRefExoticComponent<import("../../typings").BaseSelectProps & import("../../typings").AdditionalMobileProps & import("../../typings").BottomSheetSelectMobileProps & import("../../typings").ModalSelectMobileProps & {
|
|
10
4
|
isBottomSheet?: boolean | undefined;
|
|
11
|
-
view:
|
|
12
|
-
Popover?: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
13
|
-
BottomSheet?: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
14
|
-
ModalMobile?: (React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
15
|
-
Header: FC<ModalHeaderProps>;
|
|
16
|
-
Footer: FC<ModalFooterProps>;
|
|
17
|
-
Content: FC<
|
|
5
|
+
view: "mobile" | "desktop";
|
|
6
|
+
Popover?: React.ForwardRefExoticComponent<import("@alfalab/core-components-popover").PopoverProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
7
|
+
BottomSheet?: React.ForwardRefExoticComponent<import("@alfalab/core-components-bottom-sheet").BottomSheetProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
8
|
+
ModalMobile?: (React.ForwardRefExoticComponent<import("./types/component-types").ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
9
|
+
Header: React.FC<import("@alfalab/core-components-modal/shared").ModalHeaderProps>;
|
|
10
|
+
Footer: React.FC<import("@alfalab/core-components-modal/shared").ModalFooterProps>;
|
|
11
|
+
Content: React.FC<import("./types/component-types").ContentProps>;
|
|
18
12
|
}) | undefined;
|
|
19
13
|
} & React.RefAttributes<unknown>>;
|
|
20
14
|
export { BaseSelect };
|
|
@@ -9,22 +9,23 @@ import { fnUtils, getDataTestId } from '@alfalab/core-components-shared/esm';
|
|
|
9
9
|
import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
|
|
10
10
|
import { defaultAccessor, defaultFilterFn, defaultGroupAccessor, processOptions, isGroup } from '../../utils.js';
|
|
11
11
|
import { NativeSelect } from '../native-select/Component.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
import { getListPopoverDesktopProps } from './components/list-desktop/helpers/get-list-popover-desktop-props.js';
|
|
13
|
+
import { s as styles, L as ListPopoverDesktop } from '../../list-popover-desktop-f713543b.js';
|
|
14
|
+
import { getListModalMobileProps } from './components/list-mobile/helpers/get-list-modal-mobile-props.js';
|
|
15
|
+
import { getListBottomSheetMobileProps } from './components/list-mobile/helpers/get-list-bottom-sheet-mobile-props.js';
|
|
16
|
+
import { ListMobile } from './components/list-mobile/list-mobile.js';
|
|
17
|
+
import { m as mobileStyles } from '../../mobile.module-98003396.js';
|
|
18
18
|
|
|
19
19
|
var itemToString = function (option) { return (option ? option.key : ''); };
|
|
20
20
|
var isItemDisabled = function (option) { return Boolean(option === null || option === void 0 ? void 0 : option.disabled); };
|
|
21
21
|
var BaseSelect = forwardRef(
|
|
22
22
|
// TODO: 😭
|
|
23
23
|
// eslint-disable-next-line complexity
|
|
24
|
-
function (
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var dataTestId =
|
|
24
|
+
function (props, ref) {
|
|
25
|
+
var _a;
|
|
26
|
+
var _b, _c;
|
|
27
|
+
var dataTestId = props.dataTestId, className = props.className, fieldClassName = props.fieldClassName, optionGroupClassName = props.optionGroupClassName, optionsListClassName = props.optionsListClassName, optionClassName = props.optionClassName, options = props.options, _d = props.autocomplete, autocomplete = _d === void 0 ? false : _d, _e = props.multiple, multiple = _e === void 0 ? false : _e, _f = props.allowUnselect, allowUnselect = _f === void 0 ? false : _f, _g = props.disabled, disabled = _g === void 0 ? false : _g, _h = props.closeOnSelect, closeOnSelect = _h === void 0 ? !multiple : _h, _j = props.circularNavigation, circularNavigation = _j === void 0 ? false : _j, _k = props.nativeSelect, nativeSelect = _k === void 0 ? false : _k, _l = props.defaultOpen, defaultOpen = _l === void 0 ? false : _l, openProp = props.open, _m = props.optionsListWidth, optionsListWidth = _m === void 0 ? 'content' : _m, name = props.name, id = props.id, selected = props.selected, _o = props.size, size = _o === void 0 ? 48 : _o, _p = props.optionsSize, optionsSize = _p === void 0 ? size : _p, error = props.error, hint = props.hint, block = props.block, label = props.label, labelView = props.labelView, placeholder = props.placeholder, _q = props.fieldProps, fieldProps = _q === void 0 ? {} : _q, _r = props.optionsListProps, optionsListProps = _r === void 0 ? {} : _r, _s = props.optionProps, optionProps = _s === void 0 ? {} : _s, _t = props.searchProps, searchProps = _t === void 0 ? {} : _t, _u = props.showSearch, showSearch = _u === void 0 ? false : _u, valueRenderer = props.valueRenderer, onChange = props.onChange, onOpen = props.onOpen, onFocus = props.onFocus, onBlur = props.onBlur, onScroll = props.onScroll, Arrow = props.Arrow, _v = props.Field, Field = _v === void 0 ? function () { return null; } : _v, _w = props.OptionsList, OptionsList = _w === void 0 ? function () { return null; } : _w, _x = props.Optgroup, Optgroup = _x === void 0 ? function () { return null; } : _x, _y = props.Option, Option = _y === void 0 ? function () { return null; } : _y, _z = props.Search, Search = _z === void 0 ? function () { return null; } : _z, _0 = props.showEmptyOptionsList, showEmptyOptionsList = _0 === void 0 ? false : _0, visibleOptions = props.visibleOptions, view = props.view, _1 = props.isBottomSheet, isBottomSheet = _1 === void 0 ? true : _1, modalProps = props.modalProps, bottomSheetProps = props.bottomSheetProps, limitDynamicOptionGroupSize = props.limitDynamicOptionGroupSize;
|
|
28
|
+
var shouldSearchBlurRef = useRef(true);
|
|
28
29
|
var rootRef = useRef(null);
|
|
29
30
|
var fieldRef = useRef(null);
|
|
30
31
|
var listRef = useRef(null);
|
|
@@ -32,15 +33,15 @@ function (_a, ref) {
|
|
|
32
33
|
var searchRef = useRef(null);
|
|
33
34
|
var scrollableContainerRef = useRef(null);
|
|
34
35
|
var onOpenRef = useRef(onOpen);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
36
|
+
var _2 = React.useState(''), searchState = _2[0], setSearchState = _2[1];
|
|
37
|
+
var _3 = typeof (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) === 'string'
|
|
37
38
|
? [searchProps.value, searchProps.onChange]
|
|
38
|
-
: [searchState, setSearchState], search =
|
|
39
|
+
: [searchState, setSearchState], search = _3[0], setSearch = _3[1];
|
|
39
40
|
var accessor = searchProps.accessor || defaultAccessor;
|
|
40
41
|
var filterFn = searchProps.filterFn || defaultFilterFn;
|
|
41
|
-
var filterGroup = (
|
|
42
|
-
var groupAccessor = (
|
|
43
|
-
var
|
|
42
|
+
var filterGroup = (_b = searchProps.filterGroup) !== null && _b !== void 0 ? _b : false;
|
|
43
|
+
var groupAccessor = (_c = searchProps.groupAccessor) !== null && _c !== void 0 ? _c : defaultGroupAccessor;
|
|
44
|
+
var _4 = useMemo(function () {
|
|
44
45
|
return processOptions(options, selected, function (option) {
|
|
45
46
|
if (isGroup(option)) {
|
|
46
47
|
var groupAccessorValue = groupAccessor(option);
|
|
@@ -49,7 +50,7 @@ function (_a, ref) {
|
|
|
49
50
|
}
|
|
50
51
|
return filterFn(accessor(option), search);
|
|
51
52
|
}, filterGroup);
|
|
52
|
-
}, [options, selected, filterFn, accessor, search, filterGroup, groupAccessor]), filteredOptions =
|
|
53
|
+
}, [options, selected, filterFn, accessor, search, filterGroup, groupAccessor]), filteredOptions = _4.filteredOptions, flatOptions = _4.flatOptions, selectedOptions = _4.selectedOptions;
|
|
53
54
|
var scrollIntoView = function (node) {
|
|
54
55
|
if (!node || view === 'mobile')
|
|
55
56
|
return;
|
|
@@ -92,8 +93,8 @@ function (_a, ref) {
|
|
|
92
93
|
useMultipleSelectionProps.selectedItems = selectedOptions;
|
|
93
94
|
}
|
|
94
95
|
onOpenRef.current = onOpen;
|
|
95
|
-
var
|
|
96
|
-
var
|
|
96
|
+
var _5 = useMultipleSelection(useMultipleSelectionProps), selectedItems = _5.selectedItems, addSelectedItem = _5.addSelectedItem, setSelectedItems = _5.setSelectedItems, removeSelectedItem = _5.removeSelectedItem, getDropdownProps = _5.getDropdownProps;
|
|
97
|
+
var _6 = useCombobox({
|
|
97
98
|
id: id,
|
|
98
99
|
isOpen: openProp,
|
|
99
100
|
items: flatOptions,
|
|
@@ -174,7 +175,7 @@ function (_a, ref) {
|
|
|
174
175
|
return changes;
|
|
175
176
|
}
|
|
176
177
|
},
|
|
177
|
-
}), open =
|
|
178
|
+
}), open = _6.isOpen, getMenuProps = _6.getMenuProps, getInputProps = _6.getInputProps, getItemProps = _6.getItemProps, getLabelProps = _6.getLabelProps, highlightedIndex = _6.highlightedIndex, toggleMenu = _6.toggleMenu, openMenu = _6.openMenu, closeMenu = _6.closeMenu, setHighlightedIndex = _6.setHighlightedIndex;
|
|
178
179
|
useEffect(function () {
|
|
179
180
|
/*
|
|
180
181
|
* При изменении openProp, состояние внутри downshift в useEnhancedReducer не меняется, поэтому меняем его таким способом
|
|
@@ -190,7 +191,7 @@ function (_a, ref) {
|
|
|
190
191
|
}
|
|
191
192
|
}, [openProp, openMenu, closeMenu]);
|
|
192
193
|
var inputProps = getInputProps(getDropdownProps({ ref: mergeRefs([ref, fieldRef]) }));
|
|
193
|
-
var
|
|
194
|
+
var _7 = getMenuProps({ ref: listRef }, { suppressRefError: true }), menuRef = _7.ref, menuProps = __rest(_7, ["ref"]);
|
|
194
195
|
var handleEntered = function (node, isAppearing) {
|
|
195
196
|
var _a, _b, _c, _d, _e;
|
|
196
197
|
if (showSearch)
|
|
@@ -268,6 +269,15 @@ function (_a, ref) {
|
|
|
268
269
|
index: index,
|
|
269
270
|
item: option,
|
|
270
271
|
onMouseDown: function (event) { return event.preventDefault(); },
|
|
272
|
+
onClick: function () {
|
|
273
|
+
var _a, _b;
|
|
274
|
+
if (view === 'mobile' || !showSearch || multiple)
|
|
275
|
+
return;
|
|
276
|
+
shouldSearchBlurRef.current = false;
|
|
277
|
+
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
278
|
+
shouldSearchBlurRef.current = true;
|
|
279
|
+
(_b = fieldRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
280
|
+
},
|
|
271
281
|
}), multiple: multiple, index: index, option: option, size: optionsSize, disabled: option.disabled, highlighted: index === highlightedIndex, selected: selectedItems.some(function (_a) {
|
|
272
282
|
var key = _a.key;
|
|
273
283
|
return key === option.key;
|
|
@@ -338,6 +348,8 @@ function (_a, ref) {
|
|
|
338
348
|
};
|
|
339
349
|
var handleBlur = function (event) {
|
|
340
350
|
var _a, _b;
|
|
351
|
+
if (!shouldSearchBlurRef.current)
|
|
352
|
+
return;
|
|
341
353
|
(_b = (_a = searchProps.componentProps) === null || _a === void 0 ? void 0 : _a.onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
342
354
|
handleFieldBlur(event);
|
|
343
355
|
};
|
|
@@ -346,7 +358,7 @@ function (_a, ref) {
|
|
|
346
358
|
_a[mobileStyles.search] = view === 'mobile',
|
|
347
359
|
_a)), ref: mergeRefs([searchRef, ((_c = searchProps === null || searchProps === void 0 ? void 0 : searchProps.componentProps) === null || _c === void 0 ? void 0 : _c.ref) || null]) })));
|
|
348
360
|
};
|
|
349
|
-
var
|
|
361
|
+
var _8 = optionsListProps, header = _8.header, emptyPlaceholder = _8.emptyPlaceholder;
|
|
350
362
|
var renderOptionsListHeader = function () {
|
|
351
363
|
if (header || (view === 'desktop' && showSearch)) {
|
|
352
364
|
return (React.createElement(React.Fragment, null,
|
|
@@ -375,47 +387,7 @@ function (_a, ref) {
|
|
|
375
387
|
_c)), emptyPlaceholder: renderEmptyPlaceholder(), onScroll: onScroll, search: search, multiple: multiple, limitDynamicOptionGroupSize: limitDynamicOptionGroupSize })),
|
|
376
388
|
view === 'desktop' && React.createElement("div", { className: styles.optionsListBorder })));
|
|
377
389
|
};
|
|
378
|
-
|
|
379
|
-
if (!nativeSelect && Popover) {
|
|
380
|
-
return (React.createElement(Popover, __assign({}, popoverProps, { open: open, withTransition: false, anchorElement: fieldRef.current, position: popoverPosition, preventFlip: preventFlip, popperClassName: cn(styles.popoverInner, popperClassName), update: updatePopover, zIndex: zIndexPopover }), renderOptionsList()));
|
|
381
|
-
}
|
|
382
|
-
return null;
|
|
383
|
-
};
|
|
384
|
-
var renderInBottomSheet = function () {
|
|
385
|
-
if (!nativeSelect && BottomSheet) {
|
|
386
|
-
return (React.createElement(BottomSheet, __assign({ dataTestId: getDataTestId(dataTestId, 'bottom-sheet'), open: open, className: mobileStyles.sheet, contentClassName: mobileStyles.sheetContent, containerClassName: mobileStyles.sheetContainer, title: label || placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, initialHeight: showSearch ? 'full' : 'default' }, bottomSheetProps, { sheetContainerRef: menuRef, scrollableContainerRef: scrollableContainerRef, onClose: function () {
|
|
387
|
-
var _a;
|
|
388
|
-
closeMenu();
|
|
389
|
-
(_a = bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.onClose) === null || _a === void 0 ? void 0 : _a.call(bottomSheetProps);
|
|
390
|
-
}, transitionProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.transitionProps), { onEntered: handleEntered }), bottomAddons: React.createElement(React.Fragment, null,
|
|
391
|
-
renderSearch(),
|
|
392
|
-
flatOptions.length > 0 && (bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.bottomAddons)), containerProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.containerProps), { onScroll: onScroll }) }), renderOptionsList()));
|
|
393
|
-
}
|
|
394
|
-
return null;
|
|
395
|
-
};
|
|
396
|
-
var renderInModalMobile = function () {
|
|
397
|
-
if (!nativeSelect && ModalMobile) {
|
|
398
|
-
return (React.createElement(ModalMobile, __assign({ dataTestId: getDataTestId(dataTestId, 'modal'), open: open, hasCloser: true }, modalProps, { componentRef: menuRef, onClose: function () {
|
|
399
|
-
var _a;
|
|
400
|
-
var args = [];
|
|
401
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
402
|
-
args[_i] = arguments[_i];
|
|
403
|
-
}
|
|
404
|
-
closeMenu();
|
|
405
|
-
(_a = modalProps === null || modalProps === void 0 ? void 0 : modalProps.onClose) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([modalProps], args, false));
|
|
406
|
-
}, contentClassName: cn(mobileStyles.sheetContent, modalProps === null || modalProps === void 0 ? void 0 : modalProps.contentClassName), ref: mergeRefs([
|
|
407
|
-
scrollableContainerRef,
|
|
408
|
-
modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
|
|
409
|
-
]), wrapperProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.wrapperProps), { onScroll: onScroll }), transitionProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.transitionProps), { onEntered: handleEntered }) }),
|
|
410
|
-
React.createElement(ModalMobile.Header, __assign({ hasCloser: true, sticky: true }, modalHeaderProps, { title: undefined, bottomAddons: React.createElement(React.Fragment, null,
|
|
411
|
-
renderSearch(),
|
|
412
|
-
flatOptions.length > 0 && (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.bottomAddons)) }), (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.title) || label || placeholder),
|
|
413
|
-
React.createElement(ModalMobile.Content, { flex: true, className: mobileStyles.modalContent }, renderOptionsList()),
|
|
414
|
-
(modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React.createElement(ModalMobile.Footer, __assign({}, modalFooterProps))));
|
|
415
|
-
}
|
|
416
|
-
return null;
|
|
417
|
-
};
|
|
418
|
-
return (React.createElement("div", __assign({}, (disabled && { 'aria-disabled': true }), { "aria-expanded": inputProps['aria-expanded'], "aria-haspopup": 'listbox', role: inputProps.role, className: cn(styles.component, (_b = {}, _b[styles.block] = block, _b), className), ref: rootRef, onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) }),
|
|
390
|
+
return (React.createElement("div", __assign({}, (disabled && { 'aria-disabled': true }), { "aria-expanded": inputProps['aria-expanded'], "aria-haspopup": 'listbox', role: inputProps.role, className: cn(styles.component, (_a = {}, _a[styles.block] = block, _a), className), ref: rootRef, onKeyDown: disabled ? undefined : handleFieldKeyDown, tabIndex: -1, "data-test-id": getDataTestId(dataTestId) }),
|
|
419
391
|
nativeSelect && renderNativeSelect(),
|
|
420
392
|
React.createElement(Field, __assign({ selectedMultiple: selectedItems, selected: selectedItems[0], setSelectedItems: setSelectedItems, toggleMenu: toggleMenu, multiple: multiple, open: open, disabled: disabled, size: size, placeholder: placeholder, label: label && React.createElement("span", __assign({}, getLabelProps()), label), labelView: labelView, Arrow: Arrow && React.createElement(Arrow, { open: open }), error: error, hint: hint, valueRenderer: valueRenderer, className: fieldClassName, innerProps: {
|
|
421
393
|
onBlur: handleFieldBlur,
|
|
@@ -431,9 +403,10 @@ function (_a, ref) {
|
|
|
431
403
|
: undefined,
|
|
432
404
|
}, dataTestId: getDataTestId(dataTestId, 'field') }, fieldProps)),
|
|
433
405
|
name && !nativeSelect && renderValue(),
|
|
434
|
-
view === 'desktop' &&
|
|
435
|
-
view === 'mobile' &&
|
|
436
|
-
|
|
406
|
+
view === 'desktop' && !nativeSelect && (React.createElement(ListPopoverDesktop, __assign({}, getListPopoverDesktopProps(props), { open: open, fieldRef: fieldRef, renderOptionsList: renderOptionsList }))),
|
|
407
|
+
view === 'mobile' && (React.createElement(ListMobile, { baseProps: isBottomSheet
|
|
408
|
+
? getListBottomSheetMobileProps(props)
|
|
409
|
+
: getListModalMobileProps(props), open: open, menuRef: menuRef, scrollableContainerRef: scrollableContainerRef, flatOptions: flatOptions, renderOptionsList: renderOptionsList, renderSearch: renderSearch, closeMenu: closeMenu, handleEntered: handleEntered }))));
|
|
437
410
|
});
|
|
438
411
|
|
|
439
412
|
export { BaseSelect };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from "../../../types/component-types";
|
|
3
|
+
declare const getListPopoverDesktopProps: (props: ComponentProps) => {
|
|
4
|
+
Popover: import("react").ForwardRefExoticComponent<import("@alfalab/core-components-popover").PopoverProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
5
|
+
popoverProps: Omit<import("@alfalab/core-components-popover").PopoverProps, "className" | "dataTestId" | "anchorElement" | "position" | "preventFlip" | "open" | "update" | "zIndex"> | undefined;
|
|
6
|
+
popoverPosition: import("@alfalab/core-components-popover").Position;
|
|
7
|
+
preventFlip: boolean;
|
|
8
|
+
popperClassName: string | undefined;
|
|
9
|
+
updatePopover: import("react").MutableRefObject<(() => void) | undefined> | undefined;
|
|
10
|
+
zIndexPopover: number | undefined;
|
|
11
|
+
};
|
|
12
|
+
export { getListPopoverDesktopProps };
|
package/esm/components/base-select/components/list-desktop/helpers/get-list-popover-desktop-props.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// отделяем необходимые пропсы для передачи в компонент
|
|
2
|
+
var getListPopoverDesktopProps = function (props) {
|
|
3
|
+
var Popover = props.Popover, popoverProps = props.popoverProps, _a = props.popoverPosition, popoverPosition = _a === void 0 ? 'bottom-start' : _a, _b = props.preventFlip, preventFlip = _b === void 0 ? true : _b, popperClassName = props.popperClassName, updatePopover = props.updatePopover, zIndexPopover = props.zIndexPopover;
|
|
4
|
+
return {
|
|
5
|
+
Popover: Popover,
|
|
6
|
+
popoverProps: popoverProps,
|
|
7
|
+
popoverPosition: popoverPosition,
|
|
8
|
+
preventFlip: preventFlip,
|
|
9
|
+
popperClassName: popperClassName,
|
|
10
|
+
updatePopover: updatePopover,
|
|
11
|
+
zIndexPopover: zIndexPopover,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { getListPopoverDesktopProps };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from "../../../types/component-types";
|
|
3
|
+
declare const getListBottomSheetMobileProps: (props: ComponentProps) => {
|
|
4
|
+
BottomSheet: import("react").ForwardRefExoticComponent<import("@alfalab/core-components-bottom-sheet").BottomSheetProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
5
|
+
dataTestId: string | undefined;
|
|
6
|
+
label: import("react").ReactNode;
|
|
7
|
+
placeholder: string | undefined;
|
|
8
|
+
footer: import("react").ReactNode;
|
|
9
|
+
swipeable: boolean | undefined;
|
|
10
|
+
showSearch: boolean | undefined;
|
|
11
|
+
bottomSheetProps: Partial<import("@alfalab/core-components-bottom-sheet").BottomSheetProps> | undefined;
|
|
12
|
+
isBottomSheet: boolean;
|
|
13
|
+
nativeSelect: boolean;
|
|
14
|
+
onScroll: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
15
|
+
};
|
|
16
|
+
export { getListBottomSheetMobileProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// отделяем необходимые пропсы для передачи в компонент
|
|
2
|
+
var getListBottomSheetMobileProps = function (props) {
|
|
3
|
+
var BottomSheet = props.BottomSheet, dataTestId = props.dataTestId, label = props.label, placeholder = props.placeholder, footer = props.footer, swipeable = props.swipeable, showSearch = props.showSearch, bottomSheetProps = props.bottomSheetProps, _a = props.isBottomSheet, isBottomSheet = _a === void 0 ? true : _a, _b = props.nativeSelect, nativeSelect = _b === void 0 ? false : _b, onScroll = props.onScroll;
|
|
4
|
+
return {
|
|
5
|
+
BottomSheet: BottomSheet,
|
|
6
|
+
dataTestId: dataTestId,
|
|
7
|
+
label: label,
|
|
8
|
+
placeholder: placeholder,
|
|
9
|
+
footer: footer,
|
|
10
|
+
swipeable: swipeable,
|
|
11
|
+
showSearch: showSearch,
|
|
12
|
+
bottomSheetProps: bottomSheetProps,
|
|
13
|
+
isBottomSheet: isBottomSheet,
|
|
14
|
+
nativeSelect: nativeSelect,
|
|
15
|
+
onScroll: onScroll,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { getListBottomSheetMobileProps };
|
package/esm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from "../../../types/component-types";
|
|
3
|
+
declare const getListModalMobileProps: (props: ComponentProps) => {
|
|
4
|
+
ModalMobile: (import("react").ForwardRefExoticComponent<import("../../../types/component-types").ModalMobileProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
|
+
Header: import("react").FC<import("@alfalab/core-components-modal/shared").ModalHeaderProps>;
|
|
6
|
+
Footer: import("react").FC<import("@alfalab/core-components-modal/shared").ModalFooterProps>;
|
|
7
|
+
Content: import("react").FC<import("../../../types/component-types").ContentProps>;
|
|
8
|
+
}) | undefined;
|
|
9
|
+
dataTestId: string | undefined;
|
|
10
|
+
modalProps: Partial<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
11
|
+
size?: "s" | "m" | "l" | "xl" | 500 | "fullscreen" | 600 | 800 | 1140 | undefined;
|
|
12
|
+
fullscreen?: boolean | undefined;
|
|
13
|
+
fixedPosition?: boolean | undefined;
|
|
14
|
+
hasCloser?: boolean | undefined;
|
|
15
|
+
iOSLock?: boolean | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
breakpoint?: number | undefined;
|
|
18
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
19
|
+
} & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
20
|
+
modalHeaderProps: Partial<import("@alfalab/core-components-modal/shared").ModalHeaderProps> | undefined;
|
|
21
|
+
modalFooterProps: Partial<import("@alfalab/core-components-modal/shared").ModalFooterProps> | undefined;
|
|
22
|
+
label: import("react").ReactNode;
|
|
23
|
+
placeholder: string | undefined;
|
|
24
|
+
isBottomSheet: boolean;
|
|
25
|
+
nativeSelect: boolean;
|
|
26
|
+
onScroll: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
27
|
+
};
|
|
28
|
+
export { getListModalMobileProps };
|
package/esm/components/base-select/components/list-mobile/helpers/get-list-modal-mobile-props.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// отделяем необходимые пропсы для передачи в компонент
|
|
2
|
+
var getListModalMobileProps = function (props) {
|
|
3
|
+
var ModalMobile = props.ModalMobile, dataTestId = props.dataTestId, modalProps = props.modalProps, modalHeaderProps = props.modalHeaderProps, modalFooterProps = props.modalFooterProps, label = props.label, placeholder = props.placeholder, _a = props.isBottomSheet, isBottomSheet = _a === void 0 ? true : _a, _b = props.nativeSelect, nativeSelect = _b === void 0 ? false : _b, onScroll = props.onScroll;
|
|
4
|
+
return {
|
|
5
|
+
ModalMobile: ModalMobile,
|
|
6
|
+
dataTestId: dataTestId,
|
|
7
|
+
modalProps: modalProps,
|
|
8
|
+
modalHeaderProps: modalHeaderProps,
|
|
9
|
+
modalFooterProps: modalFooterProps,
|
|
10
|
+
label: label,
|
|
11
|
+
placeholder: placeholder,
|
|
12
|
+
isBottomSheet: isBottomSheet,
|
|
13
|
+
nativeSelect: nativeSelect,
|
|
14
|
+
onScroll: onScroll,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { getListModalMobileProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { OptionShape } from "../../../../typings";
|
|
3
|
+
import { ListBottomSheetMobileRestProps } from "./types/types";
|
|
4
|
+
type ListMobileProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
menuRef: RefObject<HTMLDivElement>;
|
|
7
|
+
scrollableContainerRef: RefObject<HTMLDivElement>;
|
|
8
|
+
flatOptions: OptionShape[];
|
|
9
|
+
closeMenu: () => void;
|
|
10
|
+
handleEntered: (node: HTMLElement, isAppearing: boolean) => void;
|
|
11
|
+
renderSearch: () => ReactNode;
|
|
12
|
+
renderOptionsList: () => ReactNode;
|
|
13
|
+
} & ListBottomSheetMobileRestProps;
|
|
14
|
+
declare const ListBottomSheetMobile: FC<ListMobileProps>;
|
|
15
|
+
export { ListBottomSheetMobile };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { getDataTestId } from '@alfalab/core-components-shared/esm';
|
|
4
|
+
import { m as mobileStyles } from '../../../../mobile.module-98003396.js';
|
|
5
|
+
|
|
6
|
+
var ListBottomSheetMobile = function (props) {
|
|
7
|
+
var BottomSheet = props.BottomSheet, dataTestId = props.dataTestId, open = props.open, label = props.label, placeholder = props.placeholder, footer = props.footer, swipeable = props.swipeable, showSearch = props.showSearch, bottomSheetProps = props.bottomSheetProps, menuRef = props.menuRef, scrollableContainerRef = props.scrollableContainerRef, onScroll = props.onScroll, flatOptions = props.flatOptions, closeMenu = props.closeMenu, handleEntered = props.handleEntered, renderSearch = props.renderSearch, renderOptionsList = props.renderOptionsList;
|
|
8
|
+
if (BottomSheet) {
|
|
9
|
+
return (React.createElement(BottomSheet, __assign({ dataTestId: getDataTestId(dataTestId, 'bottom-sheet'), open: open, className: mobileStyles.sheet, contentClassName: mobileStyles.sheetContent, containerClassName: mobileStyles.sheetContainer, title: label || placeholder, actionButton: footer, stickyHeader: true, hasCloser: true, swipeable: swipeable, initialHeight: showSearch ? 'full' : 'default' }, bottomSheetProps, { sheetContainerRef: menuRef, scrollableContainerRef: scrollableContainerRef, onClose: function () {
|
|
10
|
+
var _a;
|
|
11
|
+
closeMenu();
|
|
12
|
+
(_a = bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.onClose) === null || _a === void 0 ? void 0 : _a.call(bottomSheetProps);
|
|
13
|
+
}, transitionProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.transitionProps), { onEntered: handleEntered }), bottomAddons: React.createElement(React.Fragment, null,
|
|
14
|
+
renderSearch(),
|
|
15
|
+
flatOptions.length > 0 && (bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.bottomAddons)), containerProps: __assign(__assign({}, bottomSheetProps === null || bottomSheetProps === void 0 ? void 0 : bottomSheetProps.containerProps), { onScroll: onScroll }) }), renderOptionsList()));
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { ListBottomSheetMobile };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { OptionShape } from "../../../../typings";
|
|
3
|
+
import { ListBottomSheetMobileRestProps, ListModalMobileRestProps } from "./types/types";
|
|
4
|
+
type ListMobileProps = {
|
|
5
|
+
baseProps: ListBottomSheetMobileRestProps | ListModalMobileRestProps;
|
|
6
|
+
open: boolean;
|
|
7
|
+
menuRef: RefObject<HTMLDivElement>;
|
|
8
|
+
scrollableContainerRef: RefObject<HTMLDivElement>;
|
|
9
|
+
flatOptions: OptionShape[];
|
|
10
|
+
closeMenu: () => void;
|
|
11
|
+
handleEntered: (node: HTMLElement, isAppearing: boolean) => void;
|
|
12
|
+
renderSearch: () => ReactNode;
|
|
13
|
+
renderOptionsList: () => ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare const ListMobile: FC<ListMobileProps>;
|
|
16
|
+
export { ListMobile };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ListBottomSheetMobile } from './list-bottom-sheet-mobile.js';
|
|
4
|
+
import { ListModalMobile } from './list-modal-mobile.js';
|
|
5
|
+
|
|
6
|
+
var ListMobile = function (props) {
|
|
7
|
+
var baseProps = props.baseProps, restProps = __rest(props, ["baseProps"]);
|
|
8
|
+
var isBottomSheet = baseProps.isBottomSheet, nativeSelect = baseProps.nativeSelect;
|
|
9
|
+
if (isBottomSheet && !nativeSelect) {
|
|
10
|
+
return (React.createElement(ListBottomSheetMobile, __assign({}, baseProps, restProps)));
|
|
11
|
+
}
|
|
12
|
+
if (!isBottomSheet && !nativeSelect) {
|
|
13
|
+
return React.createElement(ListModalMobile, __assign({}, baseProps, restProps));
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { ListMobile };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { OptionShape } from "../../../../typings";
|
|
3
|
+
import { ListModalMobileRestProps } from "./types/types";
|
|
4
|
+
type ListModalMobileProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
menuRef: RefObject<HTMLDivElement>;
|
|
7
|
+
scrollableContainerRef: RefObject<HTMLDivElement>;
|
|
8
|
+
flatOptions: OptionShape[];
|
|
9
|
+
closeMenu: () => void;
|
|
10
|
+
handleEntered: (node: HTMLElement, isAppearing: boolean) => void;
|
|
11
|
+
renderSearch: () => ReactNode;
|
|
12
|
+
renderOptionsList: () => ReactNode;
|
|
13
|
+
} & ListModalMobileRestProps;
|
|
14
|
+
declare const ListModalMobile: FC<ListModalMobileProps>;
|
|
15
|
+
export { ListModalMobile };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __assign, __spreadArray } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import mergeRefs from 'react-merge-refs';
|
|
4
|
+
import cn from 'classnames';
|
|
5
|
+
import { getDataTestId } from '@alfalab/core-components-shared/esm';
|
|
6
|
+
import { m as mobileStyles } from '../../../../mobile.module-98003396.js';
|
|
7
|
+
|
|
8
|
+
var ListModalMobile = function (props) {
|
|
9
|
+
var ModalMobile = props.ModalMobile, dataTestId = props.dataTestId, open = props.open, modalProps = props.modalProps, modalHeaderProps = props.modalHeaderProps, modalFooterProps = props.modalFooterProps, menuRef = props.menuRef, scrollableContainerRef = props.scrollableContainerRef, label = props.label, placeholder = props.placeholder, onScroll = props.onScroll, flatOptions = props.flatOptions, closeMenu = props.closeMenu, handleEntered = props.handleEntered, renderSearch = props.renderSearch, renderOptionsList = props.renderOptionsList;
|
|
10
|
+
if (ModalMobile) {
|
|
11
|
+
return (React.createElement(ModalMobile, __assign({ dataTestId: getDataTestId(dataTestId, 'modal'), open: open, hasCloser: true }, modalProps, { componentRef: menuRef, onClose: function () {
|
|
12
|
+
var _a;
|
|
13
|
+
var args = [];
|
|
14
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
15
|
+
args[_i] = arguments[_i];
|
|
16
|
+
}
|
|
17
|
+
closeMenu();
|
|
18
|
+
(_a = modalProps === null || modalProps === void 0 ? void 0 : modalProps.onClose) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([modalProps], args, false));
|
|
19
|
+
}, contentClassName: cn(mobileStyles.sheetContent, modalProps === null || modalProps === void 0 ? void 0 : modalProps.contentClassName), ref: mergeRefs([
|
|
20
|
+
scrollableContainerRef,
|
|
21
|
+
modalProps === null || modalProps === void 0 ? void 0 : modalProps.ref,
|
|
22
|
+
]), wrapperProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.wrapperProps), { onScroll: onScroll }), transitionProps: __assign(__assign({}, modalProps === null || modalProps === void 0 ? void 0 : modalProps.transitionProps), { onEntered: handleEntered }) }),
|
|
23
|
+
React.createElement(ModalMobile.Header, __assign({ hasCloser: true, sticky: true }, modalHeaderProps, { title: undefined, bottomAddons: React.createElement(React.Fragment, null,
|
|
24
|
+
renderSearch(),
|
|
25
|
+
flatOptions.length > 0 && (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.bottomAddons)) }), (modalHeaderProps === null || modalHeaderProps === void 0 ? void 0 : modalHeaderProps.title) || label || placeholder),
|
|
26
|
+
React.createElement(ModalMobile.Content, { flex: true, className: mobileStyles.modalContent }, renderOptionsList()),
|
|
27
|
+
(modalFooterProps === null || modalFooterProps === void 0 ? void 0 : modalFooterProps.children) && React.createElement(ModalMobile.Footer, __assign({}, modalFooterProps))));
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { ListModalMobile };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { getListBottomSheetMobileProps, getListModalMobileProps } from "../helpers/index";
|
|
2
|
+
type ListBottomSheetMobileRestProps = ReturnType<typeof getListBottomSheetMobileProps>;
|
|
3
|
+
type ListModalMobileRestProps = ReturnType<typeof getListModalMobileProps>;
|
|
4
|
+
export { ListBottomSheetMobileRestProps, ListModalMobileRestProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|