@alfalab/core-components-select 15.2.3 → 16.0.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.desktop.d.ts +3 -16
- package/Component.desktop.js +4 -2
- package/Component.mobile.d.ts +3 -39
- package/Component.mobile.js +23 -10
- package/Component.modal.mobile.d.ts +2 -58
- package/Component.modal.mobile.js +23 -35
- package/Component.responsive.d.ts +3 -17
- package/Component.responsive.js +11 -13
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +5 -5
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +4 -4
- package/components/base-option/Component.js +1 -1
- package/components/base-option/index.css +16 -16
- package/components/base-select/Component.d.ts +17 -2
- package/components/base-select/Component.js +188 -81
- package/components/base-select/index.css +12 -12
- package/components/base-select/index.js +1 -1
- package/{esm/components/base-select-mobile/index.css → components/base-select/mobile.css} +13 -22
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +11 -11
- 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 +15 -17
- package/components/footer/Component.d.ts +12 -0
- package/components/{base-select-mobile/footer → footer}/Component.js +6 -5
- package/{modern/components/base-select-mobile → components}/footer/index.css +6 -6
- package/components/footer/index.d.ts +1 -0
- package/components/{base-select-mobile/footer → footer}/index.js +3 -2
- package/components/index.js +2 -1
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +7 -7
- package/components/option/Component.js +1 -1
- package/components/option/index.css +24 -24
- package/components/options-list/Component.js +7 -3
- package/components/options-list/index.css +11 -11
- package/components/options-list/index.js +2 -1
- package/components/search/Component.d.ts +2 -4
- package/components/search/Component.js +1 -1
- package/components/search/index.css +2 -2
- package/components/virtual-options-list/Component.js +7 -3
- package/components/virtual-options-list/index.css +18 -18
- package/components/virtual-options-list/index.js +2 -1
- package/cssm/Component.desktop.d.ts +3 -16
- package/cssm/Component.desktop.js +5 -2
- package/cssm/Component.mobile.d.ts +3 -39
- package/cssm/Component.mobile.js +27 -13
- package/cssm/Component.modal.mobile.d.ts +2 -58
- package/cssm/Component.modal.mobile.js +28 -39
- package/cssm/Component.responsive.d.ts +3 -17
- package/cssm/Component.responsive.js +13 -15
- package/cssm/components/arrow/index.module.css +2 -2
- package/cssm/components/base-option/index.module.css +3 -3
- package/cssm/components/base-select/Component.d.ts +17 -2
- package/cssm/components/base-select/Component.js +186 -80
- package/cssm/components/base-select/index.js +2 -1
- package/cssm/components/base-select/index.module.css +2 -2
- package/cssm/components/{base-select-mobile/index.module.css → base-select/mobile.module.css} +0 -9
- package/cssm/components/checkmark/index.module.css +1 -1
- package/cssm/components/field/index.module.css +3 -5
- package/cssm/components/footer/Component.d.ts +12 -0
- package/cssm/components/{base-select-mobile/footer → footer}/Component.js +5 -4
- package/cssm/components/footer/index.d.ts +1 -0
- package/cssm/components/{base-select-mobile/footer → footer}/index.js +3 -2
- package/cssm/components/{base-select-mobile/footer → footer}/index.module.css +1 -1
- package/cssm/components/index.js +3 -1
- package/cssm/components/optgroup/index.module.css +1 -1
- package/cssm/components/option/index.module.css +4 -4
- package/cssm/components/options-list/Component.js +6 -2
- package/cssm/components/options-list/index.js +2 -1
- package/cssm/components/options-list/index.module.css +2 -2
- package/cssm/components/search/Component.d.ts +2 -4
- package/cssm/components/virtual-options-list/Component.js +6 -2
- package/cssm/components/virtual-options-list/index.js +2 -1
- package/cssm/components/virtual-options-list/index.module.css +3 -3
- package/cssm/desktop/index.d.ts +2 -0
- package/cssm/desktop/index.js +51 -0
- package/cssm/{hook-244c8d6e.js → hook-2f9ec939.js} +9 -5
- package/{esm/hook-8abfea97.d.ts → cssm/hook-ad89c253.d.ts} +3 -2
- package/cssm/index.d.ts +2 -2
- package/cssm/index.js +10 -9
- package/cssm/mobile/index.d.ts +3 -0
- package/cssm/mobile/index.js +67 -0
- package/cssm/presets/index.d.ts +1 -1
- package/cssm/presets/index.js +3 -2
- package/cssm/presets/useSelectWithApply/hook.js +3 -2
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -2
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +3 -2
- package/cssm/shared/index.d.ts +12 -0
- package/cssm/shared/index.js +87 -0
- package/cssm/typings.d.ts +86 -7
- package/desktop/index.d.ts +2 -0
- package/{desktop.js → desktop/index.js} +16 -14
- package/desktop/package.json +3 -0
- package/esm/Component.desktop.d.ts +3 -16
- package/esm/Component.desktop.js +4 -2
- package/esm/Component.mobile.d.ts +3 -39
- package/esm/Component.mobile.js +22 -9
- package/esm/Component.modal.mobile.d.ts +2 -58
- package/esm/Component.modal.mobile.js +24 -36
- package/esm/Component.responsive.d.ts +3 -17
- package/esm/Component.responsive.js +11 -13
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +5 -5
- 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 +1 -1
- package/esm/components/base-option/index.css +16 -16
- package/esm/components/base-select/Component.d.ts +17 -2
- package/esm/components/base-select/Component.js +190 -83
- package/esm/components/base-select/index.css +12 -12
- package/esm/components/base-select/index.js +1 -1
- package/{components/base-select-mobile/index.css → esm/components/base-select/mobile.css} +13 -22
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +11 -11
- 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 +15 -17
- package/esm/components/footer/Component.d.ts +12 -0
- package/esm/components/{base-select-mobile/footer → footer}/Component.js +6 -5
- package/{components/base-select-mobile → esm/components}/footer/index.css +6 -6
- package/esm/components/footer/index.d.ts +1 -0
- package/esm/components/{base-select-mobile/footer → footer}/index.js +1 -0
- package/esm/components/index.js +2 -1
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +7 -7
- package/esm/components/option/Component.js +1 -1
- package/esm/components/option/index.css +24 -24
- package/esm/components/options-list/Component.js +7 -3
- package/esm/components/options-list/index.css +11 -11
- package/esm/components/options-list/index.js +2 -1
- package/esm/components/search/Component.d.ts +2 -4
- package/esm/components/search/Component.js +1 -1
- package/esm/components/search/index.css +2 -2
- package/esm/components/virtual-options-list/Component.js +7 -3
- package/esm/components/virtual-options-list/index.css +18 -18
- package/esm/components/virtual-options-list/index.js +2 -1
- package/esm/desktop/index.d.ts +2 -0
- package/esm/{desktop.js → desktop/index.js} +16 -14
- package/esm/{hook-e63a15d0.js → hook-8209d0d1.js} +10 -6
- package/{cssm/hook-8abfea97.d.ts → esm/hook-ad89c253.d.ts} +3 -2
- package/esm/index.d.ts +2 -2
- package/esm/index.js +8 -7
- package/esm/mobile/index.d.ts +3 -0
- package/esm/mobile/index.js +44 -0
- package/esm/presets/index.d.ts +1 -1
- package/esm/presets/index.js +3 -2
- package/esm/presets/useSelectWithApply/hook.js +3 -2
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -2
- 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 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +3 -2
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/shared/index.d.ts +12 -0
- package/esm/shared/index.js +42 -0
- package/esm/typings.d.ts +86 -7
- package/{hook-8abfea97.d.ts → hook-ad89c253.d.ts} +3 -2
- package/{hook-74d61833.js → hook-cb17586d.js} +9 -5
- package/index.d.ts +2 -2
- package/index.js +8 -7
- package/mobile/index.d.ts +3 -0
- package/mobile/index.js +53 -0
- package/mobile/package.json +3 -0
- package/modern/Component.desktop.d.ts +3 -16
- package/modern/Component.desktop.js +5 -3
- package/modern/Component.mobile.d.ts +3 -39
- package/modern/Component.mobile.js +29 -13
- package/modern/Component.modal.mobile.d.ts +2 -58
- package/modern/Component.modal.mobile.js +23 -43
- package/modern/Component.responsive.d.ts +3 -17
- package/modern/Component.responsive.js +11 -13
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +5 -5
- 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 +1 -1
- package/modern/components/base-option/index.css +16 -16
- package/modern/components/base-select/Component.d.ts +17 -2
- package/modern/components/base-select/Component.js +179 -72
- package/modern/components/base-select/index.css +12 -12
- package/modern/components/base-select/index.js +1 -1
- package/modern/components/{base-select-mobile/index.css → base-select/mobile.css} +13 -22
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +11 -11
- 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 +15 -17
- package/modern/components/footer/Component.d.ts +12 -0
- package/modern/components/{base-select-mobile/footer → footer}/Component.js +5 -4
- package/{esm/components/base-select-mobile → modern/components}/footer/index.css +6 -6
- package/modern/components/footer/index.d.ts +1 -0
- package/modern/components/{base-select-mobile/footer → footer}/index.js +1 -0
- package/modern/components/index.js +2 -1
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +7 -7
- package/modern/components/option/Component.js +1 -1
- package/modern/components/option/index.css +24 -24
- package/modern/components/options-list/Component.js +5 -3
- package/modern/components/options-list/index.css +11 -11
- package/modern/components/options-list/index.js +2 -1
- package/modern/components/search/Component.d.ts +2 -4
- package/modern/components/search/Component.js +1 -1
- package/modern/components/search/index.css +2 -2
- package/modern/components/virtual-options-list/Component.js +5 -3
- package/modern/components/virtual-options-list/index.css +18 -18
- package/modern/components/virtual-options-list/index.js +2 -1
- package/modern/desktop/index.d.ts +2 -0
- package/modern/{desktop.js → desktop/index.js} +16 -14
- package/modern/{hook-5e1db0b0.js → hook-4a3d365d.js} +7 -3
- package/modern/{hook-8abfea97.d.ts → hook-ad89c253.d.ts} +3 -2
- package/modern/index.d.ts +2 -2
- package/modern/index.js +8 -7
- package/modern/mobile/index.d.ts +3 -0
- package/modern/mobile/index.js +43 -0
- package/modern/presets/index.d.ts +1 -1
- package/modern/presets/index.js +3 -2
- package/modern/presets/useSelectWithApply/hook.js +3 -2
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -2
- 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 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +3 -2
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/shared/index.d.ts +12 -0
- package/modern/shared/index.js +41 -0
- package/modern/typings.d.ts +86 -7
- package/package.json +12 -10
- package/presets/index.d.ts +1 -1
- package/presets/index.js +3 -2
- package/presets/useSelectWithApply/hook.js +3 -2
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -2
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/index.css +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/header/Component.js +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/header/index.css +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +3 -2
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/shared/index.d.ts +12 -0
- package/{shared.js → shared/index.js} +44 -43
- package/shared/package.json +3 -0
- package/src/Component.desktop.tsx +5 -14
- package/src/Component.mobile.tsx +38 -57
- package/src/Component.modal.mobile.tsx +5 -147
- package/src/Component.responsive.tsx +9 -44
- package/src/components/base-select/Component.tsx +380 -156
- package/src/components/base-select/index.module.css +1 -1
- package/src/components/{base-select-mobile/index.module.css → base-select/mobile.module.css} +0 -15
- package/src/components/{base-select-mobile/footer → footer}/Component.tsx +22 -4
- package/src/components/{base-select-mobile/footer → footer}/index.module.css +1 -1
- package/src/components/footer/index.ts +1 -0
- package/src/components/options-list/Component.tsx +6 -2
- package/src/components/virtual-options-list/Component.tsx +6 -2
- package/src/desktop/index.ts +2 -0
- package/src/desktop/package.json +3 -0
- package/src/index.ts +2 -4
- package/src/mobile/index.ts +4 -0
- package/src/mobile/package.json +3 -0
- package/src/presets/useSelectWithApply/hook.tsx +9 -3
- package/src/shared/index.ts +13 -0
- package/src/shared/package.json +3 -0
- package/src/typings.ts +110 -9
- package/src/vars.css +1 -1
- package/typings.d.ts +86 -7
- package/Component-89f0cb07.d.ts +0 -38
- package/Component.mobile-ebda875c.d.ts +0 -6
- package/Component.mobile-f1f15074.d.ts +0 -404
- package/components/base-select-mobile/Component.d.ts +0 -70
- package/components/base-select-mobile/Component.js +0 -296
- package/components/base-select-mobile/footer/Component.d.ts +0 -9
- package/components/base-select-mobile/footer/index.d.ts +0 -1
- package/components/base-select-mobile/index.d.ts +0 -1
- package/components/base-select-mobile/index.js +0 -36
- package/cssm/Component-89f0cb07.d.ts +0 -38
- package/cssm/Component.mobile-ebda875c.d.ts +0 -6
- package/cssm/Component.mobile-f1f15074.d.ts +0 -404
- package/cssm/components/base-select-mobile/Component.d.ts +0 -70
- package/cssm/components/base-select-mobile/Component.js +0 -303
- package/cssm/components/base-select-mobile/footer/Component.d.ts +0 -9
- package/cssm/components/base-select-mobile/footer/index.d.ts +0 -1
- package/cssm/components/base-select-mobile/index.d.ts +0 -1
- package/cssm/components/base-select-mobile/index.js +0 -45
- package/cssm/desktop-69921c40.d.ts +0 -6
- package/cssm/desktop.d.ts +0 -2
- package/cssm/desktop.js +0 -48
- package/cssm/index-ebda875c.d.ts +0 -2
- package/cssm/mobile-96988a65.d.ts +0 -2
- package/cssm/mobile.d.ts +0 -5
- package/cssm/mobile.js +0 -62
- package/cssm/shared.d.ts +0 -5
- package/cssm/shared.js +0 -85
- package/cssm/typings-89f0cb07.d.ts +0 -93
- package/cssm/typings-baf4875b.d.ts +0 -52
- package/desktop-69921c40.d.ts +0 -6
- package/desktop.d.ts +0 -2
- package/esm/Component-89f0cb07.d.ts +0 -38
- package/esm/Component.mobile-ebda875c.d.ts +0 -6
- package/esm/Component.mobile-f1f15074.d.ts +0 -404
- package/esm/components/base-select-mobile/Component.d.ts +0 -70
- package/esm/components/base-select-mobile/Component.js +0 -286
- package/esm/components/base-select-mobile/footer/Component.d.ts +0 -9
- package/esm/components/base-select-mobile/footer/index.d.ts +0 -1
- package/esm/components/base-select-mobile/index.d.ts +0 -1
- package/esm/components/base-select-mobile/index.js +0 -28
- package/esm/desktop-69921c40.d.ts +0 -6
- package/esm/desktop.d.ts +0 -2
- package/esm/index-ebda875c.d.ts +0 -2
- package/esm/mobile-96988a65.d.ts +0 -2
- package/esm/mobile.d.ts +0 -5
- package/esm/mobile.js +0 -40
- package/esm/shared.d.ts +0 -5
- package/esm/shared.js +0 -41
- package/esm/typings-89f0cb07.d.ts +0 -93
- package/esm/typings-baf4875b.d.ts +0 -52
- package/index-ebda875c.d.ts +0 -2
- package/mobile-96988a65.d.ts +0 -2
- package/mobile.d.ts +0 -5
- package/mobile.js +0 -49
- package/modern/Component-89f0cb07.d.ts +0 -38
- package/modern/Component.mobile-ebda875c.d.ts +0 -6
- package/modern/Component.mobile-f1f15074.d.ts +0 -404
- package/modern/components/base-select-mobile/Component.d.ts +0 -70
- package/modern/components/base-select-mobile/Component.js +0 -285
- package/modern/components/base-select-mobile/footer/Component.d.ts +0 -9
- package/modern/components/base-select-mobile/footer/index.d.ts +0 -1
- package/modern/components/base-select-mobile/index.d.ts +0 -1
- package/modern/components/base-select-mobile/index.js +0 -27
- package/modern/desktop-69921c40.d.ts +0 -6
- package/modern/desktop.d.ts +0 -2
- package/modern/index-ebda875c.d.ts +0 -2
- package/modern/mobile-96988a65.d.ts +0 -2
- package/modern/mobile.d.ts +0 -5
- package/modern/mobile.js +0 -39
- package/modern/shared.d.ts +0 -5
- package/modern/shared.js +0 -40
- package/modern/typings-89f0cb07.d.ts +0 -93
- package/modern/typings-baf4875b.d.ts +0 -52
- package/shared.d.ts +0 -5
- package/src/components/base-select-mobile/Component.tsx +0 -572
- package/src/components/base-select-mobile/footer/index.ts +0 -1
- package/src/components/base-select-mobile/index.ts +0 -1
- package/src/desktop.ts +0 -1
- package/src/mobile.ts +0 -5
- package/src/shared.ts +0 -5
- package/typings-89f0cb07.d.ts +0 -93
- package/typings-baf4875b.d.ts +0 -52
- /package/cssm/{hook-244c8d6e.d.ts → hook-2f9ec939.d.ts} +0 -0
- /package/esm/{hook-e63a15d0.d.ts → hook-8209d0d1.d.ts} +0 -0
- /package/{hook-74d61833.d.ts → hook-cb17586d.d.ts} +0 -0
- /package/modern/{hook-5e1db0b0.d.ts → hook-4a3d365d.d.ts} +0 -0
package/esm/typings.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AriaAttributes, FC, FocusEvent, MouseEvent, ReactElement, ReactNode, RefAttributes, SVGProps } from 'react';
|
|
2
|
+
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
3
|
+
import { FormControlProps } from "@alfalab/core-components-form-control";
|
|
2
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
|
+
import { ModalProps } from "@alfalab/core-components-modal";
|
|
6
|
+
import { ModalFooterProps, ModalHeaderProps } from "@alfalab/core-components-modal/shared";
|
|
3
7
|
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
8
|
+
import { UseSelectWithApplyProps } from "./hook-ad89c253";
|
|
4
9
|
type AnyObject = Record<string, any>;
|
|
5
10
|
type OptionShape = {
|
|
6
11
|
/**
|
|
@@ -217,13 +222,14 @@ type BaseSelectProps = {
|
|
|
217
222
|
/**
|
|
218
223
|
* Компонент поиска
|
|
219
224
|
*/
|
|
220
|
-
Search?: FC<SearchProps
|
|
225
|
+
Search?: FC<SearchProps>;
|
|
221
226
|
/**
|
|
222
227
|
* Настройки поиска
|
|
223
228
|
*/
|
|
224
229
|
searchProps?: {
|
|
225
230
|
componentProps?: SearchProps;
|
|
226
231
|
accessor?: (option: OptionShape) => string;
|
|
232
|
+
filterFn?: (optionText: string, search: string) => boolean;
|
|
227
233
|
value?: string;
|
|
228
234
|
onChange?: (value: string) => void;
|
|
229
235
|
};
|
|
@@ -528,10 +534,10 @@ type OptionProps = {
|
|
|
528
534
|
*/
|
|
529
535
|
innerProps: {
|
|
530
536
|
id: string;
|
|
531
|
-
onClick
|
|
532
|
-
onMouseDown
|
|
533
|
-
onMouseMove
|
|
534
|
-
role
|
|
537
|
+
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
538
|
+
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
539
|
+
onMouseMove?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
540
|
+
role?: string;
|
|
535
541
|
} & RefAttributes<HTMLDivElement> & AriaAttributes;
|
|
536
542
|
/**
|
|
537
543
|
* Идентификатор для систем автоматизированного тестирования
|
|
@@ -572,5 +578,78 @@ type CheckmarkProps = {
|
|
|
572
578
|
*/
|
|
573
579
|
icon?: FC<SVGProps<SVGSVGElement>>;
|
|
574
580
|
};
|
|
575
|
-
type SearchProps = InputProps
|
|
576
|
-
|
|
581
|
+
type SearchProps = InputProps & RefAttributes<HTMLInputElement>;
|
|
582
|
+
type SelectFieldProps = Omit<FormControlProps, 'size'> & Record<string, unknown>;
|
|
583
|
+
type AdditionalMobileProps = {
|
|
584
|
+
/**
|
|
585
|
+
* Показывать кнопку 'Сбросить' в футере мобильного компонента
|
|
586
|
+
*/
|
|
587
|
+
showClear?: UseSelectWithApplyProps['showClear'];
|
|
588
|
+
/**
|
|
589
|
+
* Показывать пункт "Выбрать все"
|
|
590
|
+
*/
|
|
591
|
+
showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
|
|
592
|
+
/**
|
|
593
|
+
* Показывать пункт "Выбрать все" в заголовке списка у мобильного компонента
|
|
594
|
+
*/
|
|
595
|
+
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
596
|
+
/**
|
|
597
|
+
* Использовать ли хук useSelectWithApply в мобильном компоненте
|
|
598
|
+
*/
|
|
599
|
+
useWithApplyHook?: boolean;
|
|
600
|
+
};
|
|
601
|
+
type BottomSheetSelectMobileProps = {
|
|
602
|
+
/**
|
|
603
|
+
* Футер
|
|
604
|
+
* @deprecated Используйте bottomSheetProps.actionButton
|
|
605
|
+
*/
|
|
606
|
+
footer?: ReactNode;
|
|
607
|
+
/**
|
|
608
|
+
* Будет ли свайпаться шторка
|
|
609
|
+
* @deprecated Используйте bottomSheetProps.swipeable
|
|
610
|
+
*/
|
|
611
|
+
swipeable?: boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Дополнительные пропсы шторки
|
|
614
|
+
*/
|
|
615
|
+
bottomSheetProps?: Partial<BottomSheetProps>;
|
|
616
|
+
};
|
|
617
|
+
type ModalSelectMobileProps = {
|
|
618
|
+
/**
|
|
619
|
+
* Дополнительные пропсы шапки модалки
|
|
620
|
+
*/
|
|
621
|
+
modalHeaderProps?: Partial<ModalHeaderProps>;
|
|
622
|
+
/**
|
|
623
|
+
* Дополнительные пропсы модалки
|
|
624
|
+
*/
|
|
625
|
+
modalProps?: Partial<ModalProps & RefAttributes<HTMLDivElement>>;
|
|
626
|
+
/**
|
|
627
|
+
* Дополнительные пропсы футера модалки
|
|
628
|
+
*/
|
|
629
|
+
modalFooterProps?: Partial<ModalFooterProps>;
|
|
630
|
+
};
|
|
631
|
+
type ConditionalMobileProps = ({
|
|
632
|
+
isBottomSheet?: true;
|
|
633
|
+
} & BottomSheetSelectMobileProps) | ({
|
|
634
|
+
isBottomSheet: false;
|
|
635
|
+
} & ModalSelectMobileProps);
|
|
636
|
+
type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark'> & AdditionalMobileProps & ModalSelectMobileProps;
|
|
637
|
+
type SelectMobileProps = Omit<BaseSelectProps, 'Checkmark'> & AdditionalMobileProps & ConditionalMobileProps;
|
|
638
|
+
type SelectDesktopProps = Omit<BaseSelectProps, 'fieldProps'> & {
|
|
639
|
+
/**
|
|
640
|
+
* Пропсы, которые будут прокинуты в компонент поля
|
|
641
|
+
*/
|
|
642
|
+
fieldProps?: SelectFieldProps;
|
|
643
|
+
};
|
|
644
|
+
type SelectProps = BaseSelectProps & AdditionalMobileProps & ConditionalMobileProps & {
|
|
645
|
+
/**
|
|
646
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
647
|
+
* @default 1024
|
|
648
|
+
*/
|
|
649
|
+
breakpoint?: number;
|
|
650
|
+
/**
|
|
651
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
652
|
+
*/
|
|
653
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
654
|
+
};
|
|
655
|
+
export { AnyObject, OptionShape, GroupShape, BaseSelectChangePayload, BaseSelectProps, FieldProps, ArrowProps, OptionsListProps, OptgroupProps, OptionProps, CheckmarkProps, SearchProps, SelectFieldProps, AdditionalMobileProps, BottomSheetSelectMobileProps, ModalSelectMobileProps, SelectModalMobileProps, SelectMobileProps, SelectDesktopProps, SelectProps };
|
|
@@ -81,9 +81,10 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
81
81
|
showSearch: boolean | undefined;
|
|
82
82
|
searchProps: {
|
|
83
83
|
value: string;
|
|
84
|
-
onChange:
|
|
85
|
-
componentProps?: import("
|
|
84
|
+
onChange: ((value: string) => void) | undefined;
|
|
85
|
+
componentProps?: import("./typings").SearchProps | undefined;
|
|
86
86
|
accessor?: ((option: OptionShape) => string) | undefined;
|
|
87
|
+
filterFn?: ((optionText: string, search: string) => boolean) | undefined;
|
|
87
88
|
} | undefined;
|
|
88
89
|
};
|
|
89
90
|
export { UseSelectWithApplyProps, SELECT_ALL_KEY, useSelectWithApply };
|
|
@@ -56,12 +56,16 @@ var SELECT_ALL_KEY = 'select_all';
|
|
|
56
56
|
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
57
57
|
function useSelectWithApply(_a) {
|
|
58
58
|
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, showSearch = _a.showSearch, _g = _a.searchProps, searchProps = _g === void 0 ? {} : _g;
|
|
59
|
-
var _h = React.useState(''),
|
|
59
|
+
var _h = React.useState(''), searchState = _h[0], setSearchState = _h[1];
|
|
60
|
+
var _j = typeof (searchProps === null || searchProps === void 0 ? void 0 : searchProps.value) === 'string'
|
|
61
|
+
? [searchProps.value, searchProps.onChange]
|
|
62
|
+
: [searchState, setSearchState], search = _j[0], setSearch = _j[1];
|
|
60
63
|
var accessor = searchProps.accessor || utils.defaultAccessor;
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
var filterFn = searchProps.filterFn || utils.defaultFilterFn;
|
|
65
|
+
var _k = React.useMemo(function () {
|
|
66
|
+
return utils.processOptions(options, selected, showSearch ? function (option) { return filterFn(accessor(option), search); } : undefined);
|
|
67
|
+
}, [filterFn, accessor, options, search, selected, showSearch]), flatOptions = _k.flatOptions, selectedOptions = _k.selectedOptions;
|
|
68
|
+
var _l = React.useState(selectedOptions), selectedDraft = _l[0], setSelectedDraft = _l[1];
|
|
65
69
|
var selectedOptionsRef = React.useRef(selectedOptions);
|
|
66
70
|
var handleApply = function () {
|
|
67
71
|
onChange({
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SelectResponsive as Select
|
|
2
|
-
export {};
|
|
1
|
+
export { SelectResponsive as Select } from "./Component.responsive";
|
|
2
|
+
export type { SelectProps } from "./typings";
|
package/index.js
CHANGED
|
@@ -5,18 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var Component_responsive = require('./Component.responsive.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
|
-
require('@alfalab/
|
|
8
|
+
require('@alfalab/core-components-mq');
|
|
9
9
|
require('./Component.desktop.js');
|
|
10
10
|
require('@alfalab/core-components-form-control/desktop');
|
|
11
|
+
require('@alfalab/core-components-popover');
|
|
11
12
|
require('./components/arrow/Component.js');
|
|
12
13
|
require('classnames');
|
|
13
14
|
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
14
15
|
require('./components/base-select/Component.js');
|
|
15
16
|
require('react-merge-refs');
|
|
16
17
|
require('@juggle/resize-observer');
|
|
18
|
+
require('compute-scroll-into-view');
|
|
17
19
|
require('downshift');
|
|
18
|
-
require('@alfalab/core-components-popover');
|
|
19
20
|
require('@alfalab/core-components-shared');
|
|
21
|
+
require('@alfalab/hooks');
|
|
20
22
|
require('./utils.js');
|
|
21
23
|
require('./components/native-select/Component.js');
|
|
22
24
|
require('./components/field/Component.js');
|
|
@@ -35,16 +37,15 @@ require('./components/search/Component.js');
|
|
|
35
37
|
require('@alfalab/core-components-input');
|
|
36
38
|
require('@alfalab/icons-glyph/MagnifierMIcon');
|
|
37
39
|
require('./Component.mobile.js');
|
|
38
|
-
require('@alfalab/core-components-form-control/mobile');
|
|
39
|
-
require('./components/base-select-mobile/Component.js');
|
|
40
40
|
require('@alfalab/core-components-bottom-sheet');
|
|
41
|
-
require('@alfalab/core-components-
|
|
42
|
-
require('
|
|
41
|
+
require('@alfalab/core-components-form-control/mobile');
|
|
42
|
+
require('@alfalab/core-components-modal/Component.mobile');
|
|
43
|
+
require('./components/footer/Component.js');
|
|
43
44
|
require('@alfalab/core-components-base-modal');
|
|
44
45
|
require('@alfalab/core-components-button/mobile');
|
|
45
46
|
require('./components/virtual-options-list/Component.js');
|
|
46
47
|
require('react-virtual');
|
|
47
|
-
require('./hook-
|
|
48
|
+
require('./hook-cb17586d.js');
|
|
48
49
|
require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
49
50
|
require('@alfalab/core-components-button/desktop');
|
|
50
51
|
require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
package/mobile/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Component_mobile = require('../Component.mobile.js');
|
|
6
|
+
var Component_modal_mobile = require('../Component.modal.mobile.js');
|
|
7
|
+
require('tslib');
|
|
8
|
+
require('react');
|
|
9
|
+
require('@alfalab/core-components-bottom-sheet');
|
|
10
|
+
require('@alfalab/core-components-form-control/mobile');
|
|
11
|
+
require('@alfalab/core-components-modal/Component.mobile');
|
|
12
|
+
require('../components/arrow/Component.js');
|
|
13
|
+
require('classnames');
|
|
14
|
+
require('@alfalab/icons-glyph/ChevronDownMIcon');
|
|
15
|
+
require('../components/base-select/Component.js');
|
|
16
|
+
require('react-merge-refs');
|
|
17
|
+
require('@juggle/resize-observer');
|
|
18
|
+
require('compute-scroll-into-view');
|
|
19
|
+
require('downshift');
|
|
20
|
+
require('@alfalab/core-components-shared');
|
|
21
|
+
require('@alfalab/hooks');
|
|
22
|
+
require('../utils.js');
|
|
23
|
+
require('../components/native-select/Component.js');
|
|
24
|
+
require('../components/field/Component.js');
|
|
25
|
+
require('../components/footer/Component.js');
|
|
26
|
+
require('@alfalab/core-components-base-modal');
|
|
27
|
+
require('@alfalab/core-components-button/mobile');
|
|
28
|
+
require('../components/optgroup/Component.js');
|
|
29
|
+
require('../components/option/Component.js');
|
|
30
|
+
require('../components/checkmark/Component.js');
|
|
31
|
+
require('@alfalab/core-components-badge');
|
|
32
|
+
require('@alfalab/core-components-checkbox');
|
|
33
|
+
require('@alfalab/icons-glyph/CheckmarkCircleMIcon');
|
|
34
|
+
require('@alfalab/icons-glyph/CheckmarkMIcon');
|
|
35
|
+
require('../components/checkmark-mobile/Component.js');
|
|
36
|
+
require('../components/options-list/Component.js');
|
|
37
|
+
require('@alfalab/core-components-mq');
|
|
38
|
+
require('@alfalab/core-components-scrollbar');
|
|
39
|
+
require('../consts.js');
|
|
40
|
+
require('../components/search/Component.js');
|
|
41
|
+
require('@alfalab/core-components-input');
|
|
42
|
+
require('@alfalab/icons-glyph/MagnifierMIcon');
|
|
43
|
+
require('../components/virtual-options-list/Component.js');
|
|
44
|
+
require('react-virtual');
|
|
45
|
+
require('../hook-cb17586d.js');
|
|
46
|
+
require('../presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
47
|
+
require('@alfalab/core-components-button/desktop');
|
|
48
|
+
require('../presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
exports.SelectMobile = Component_mobile.SelectMobile;
|
|
53
|
+
exports.SelectModalMobile = Component_modal_mobile.SelectModalMobile;
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
type FormControlDesktopProps = Omit<BaseFormControlProps, "styles" | "colorStyles">;
|
|
6
|
-
type SelectFieldProps = Omit<FormControlDesktopProps, 'size'> & Record<string, unknown>;
|
|
7
|
-
type SelectDesktopProps = Omit<BaseSelectProps, 'fieldProps'> & {
|
|
8
|
-
/**
|
|
9
|
-
* Пропсы, которые будут прокинуты в компонент поля
|
|
10
|
-
*/
|
|
11
|
-
fieldProps?: SelectFieldProps;
|
|
12
|
-
};
|
|
13
|
-
declare const SelectDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "fieldProps"> & {
|
|
14
|
-
/**
|
|
15
|
-
* Пропсы, которые будут прокинуты в компонент поля
|
|
16
|
-
*/
|
|
17
|
-
fieldProps?: SelectFieldProps | undefined;
|
|
3
|
+
declare const SelectDesktop: React.ForwardRefExoticComponent<Omit<import("./typings").BaseSelectProps, "fieldProps"> & {
|
|
4
|
+
fieldProps?: import("./typings").SelectFieldProps | undefined;
|
|
18
5
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
export {
|
|
6
|
+
export { SelectDesktop };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { FormControlDesktop } from '@alfalab/core-components-form-control/modern/desktop';
|
|
3
|
+
import { Popover } from '@alfalab/core-components-popover/modern';
|
|
3
4
|
import { Arrow } from './components/arrow/Component.js';
|
|
4
5
|
import { BaseSelect } from './components/base-select/Component.js';
|
|
5
6
|
import { Field } from './components/field/Component.js';
|
|
@@ -11,8 +12,8 @@ import 'classnames';
|
|
|
11
12
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
12
13
|
import 'react-merge-refs';
|
|
13
14
|
import '@juggle/resize-observer';
|
|
15
|
+
import 'compute-scroll-into-view';
|
|
14
16
|
import 'downshift';
|
|
15
|
-
import '@alfalab/core-components-popover/modern';
|
|
16
17
|
import '@alfalab/core-components-shared/modern';
|
|
17
18
|
import '@alfalab/hooks';
|
|
18
19
|
import './utils.js';
|
|
@@ -23,14 +24,15 @@ import '@alfalab/core-components-checkbox/modern';
|
|
|
23
24
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
24
25
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
25
26
|
import './components/checkmark-mobile/Component.js';
|
|
27
|
+
import '@alfalab/core-components-mq/modern';
|
|
26
28
|
import '@alfalab/core-components-scrollbar/modern';
|
|
27
29
|
import './consts.js';
|
|
28
30
|
import '@alfalab/core-components-input/modern';
|
|
29
31
|
import '@alfalab/icons-glyph/MagnifierMIcon';
|
|
30
32
|
|
|
31
|
-
const SelectDesktop = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Search: Search$1 = Search, fieldProps = {}, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, Option: Option$1, Field: Field$1, fieldProps: {
|
|
33
|
+
const SelectDesktop = forwardRef(({ Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, OptionsList: OptionsList$1 = OptionsList, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Search: Search$1 = Search, fieldProps = {}, ...restProps }, ref) => (React.createElement(BaseSelect, { ref: ref, view: 'desktop', Option: Option$1, Field: Field$1, fieldProps: {
|
|
32
34
|
FormControlComponent: FormControlDesktop,
|
|
33
35
|
...fieldProps,
|
|
34
|
-
}, Search: Search$1, Optgroup: Optgroup$1, OptionsList: OptionsList$1, Arrow: Arrow$1, ...restProps })));
|
|
36
|
+
}, Search: Search$1, Optgroup: Optgroup$1, OptionsList: OptionsList$1, Arrow: Arrow$1, Popover: Popover, ...restProps })));
|
|
35
37
|
|
|
36
38
|
export { SelectDesktop };
|
|
@@ -1,41 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { BaseSelectProps } from "./typings";
|
|
7
|
-
type AdditionalMobileProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Футер
|
|
10
|
-
* @deprecated Используйте bottomSheetProps.actionButton
|
|
11
|
-
*/
|
|
12
|
-
footer?: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Будет ли свайпаться шторка
|
|
15
|
-
* @deprecated Используйте bottomSheetProps.swipeable
|
|
16
|
-
*/
|
|
17
|
-
swipeable?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Дополнительные пропсы шторки
|
|
20
|
-
*/
|
|
21
|
-
bottomSheetProps?: Partial<BottomSheetProps>;
|
|
22
|
-
/**
|
|
23
|
-
* Показывать кнопку очистки
|
|
24
|
-
*/
|
|
25
|
-
showClear?: UseSelectWithApplyProps['showClear'];
|
|
26
|
-
/**
|
|
27
|
-
* Показывать пункт "Выбрать все"
|
|
28
|
-
*/
|
|
29
|
-
showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
|
|
30
|
-
/**
|
|
31
|
-
* Показывать пункт "Выбрать все" в заголовке списка
|
|
32
|
-
*/
|
|
33
|
-
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
34
|
-
/**
|
|
35
|
-
* Использовать ли хук useSelectWithApply
|
|
36
|
-
*/
|
|
37
|
-
useWithApplyHook?: boolean;
|
|
38
|
-
};
|
|
39
|
-
type SelectMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & AdditionalMobileProps;
|
|
40
|
-
declare const SelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & AdditionalMobileProps & React.RefAttributes<unknown>>;
|
|
41
|
-
export { AdditionalMobileProps, SelectMobileProps, SelectMobile };
|
|
3
|
+
import { SelectMobileProps } from "./typings";
|
|
4
|
+
declare const SelectMobile: React.ForwardRefExoticComponent<SelectMobileProps & React.RefAttributes<unknown>>;
|
|
5
|
+
export { SelectMobile };
|
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
+
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/modern';
|
|
2
3
|
import { FormControlMobile } from '@alfalab/core-components-form-control/modern/mobile';
|
|
4
|
+
import { ModalMobile } from '@alfalab/core-components-modal/modern/Component.mobile';
|
|
3
5
|
import { Arrow } from './components/arrow/Component.js';
|
|
4
|
-
import {
|
|
5
|
-
import { Footer } from './components/base-select-mobile/footer/Component.js';
|
|
6
|
+
import { BaseSelect } from './components/base-select/Component.js';
|
|
6
7
|
import { Field } from './components/field/Component.js';
|
|
8
|
+
import { Footer } from './components/footer/Component.js';
|
|
7
9
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
8
10
|
import { Option } from './components/option/Component.js';
|
|
9
11
|
import { OptionsList } from './components/options-list/Component.js';
|
|
10
12
|
import { Search } from './components/search/Component.js';
|
|
11
13
|
import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
12
|
-
import { u as useSelectWithApply } from './hook-
|
|
14
|
+
import { u as useSelectWithApply } from './hook-4a3d365d.js';
|
|
13
15
|
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
14
16
|
import 'classnames';
|
|
15
17
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
16
18
|
import 'react-merge-refs';
|
|
19
|
+
import '@juggle/resize-observer';
|
|
20
|
+
import 'compute-scroll-into-view';
|
|
17
21
|
import 'downshift';
|
|
18
|
-
import '@alfalab/core-components-bottom-sheet/modern';
|
|
19
|
-
import '@alfalab/core-components-modal/modern/mobile';
|
|
20
22
|
import '@alfalab/core-components-shared/modern';
|
|
23
|
+
import '@alfalab/hooks';
|
|
21
24
|
import './utils.js';
|
|
25
|
+
import './components/native-select/Component.js';
|
|
22
26
|
import '@alfalab/core-components-base-modal/modern';
|
|
23
27
|
import '@alfalab/core-components-button/modern/mobile';
|
|
24
|
-
import '@alfalab/hooks';
|
|
25
28
|
import './components/checkmark/Component.js';
|
|
26
29
|
import '@alfalab/core-components-badge/modern';
|
|
27
30
|
import '@alfalab/core-components-checkbox/modern';
|
|
28
31
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
29
32
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
30
33
|
import './components/checkmark-mobile/Component.js';
|
|
34
|
+
import '@alfalab/core-components-mq/modern';
|
|
31
35
|
import '@alfalab/core-components-scrollbar/modern';
|
|
32
36
|
import './consts.js';
|
|
33
37
|
import '@alfalab/core-components-input/modern';
|
|
@@ -37,9 +41,11 @@ import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js
|
|
|
37
41
|
import '@alfalab/core-components-button/modern/desktop';
|
|
38
42
|
|
|
39
43
|
const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
40
|
-
const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Search: Search$1 = Search, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
44
|
+
const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, Search: Search$1 = Search, selected, isBottomSheet = true, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
41
45
|
? VirtualOptionsList
|
|
42
|
-
: OptionsList, onChange,
|
|
46
|
+
: OptionsList, onChange, showClear = true, showSelectAll, showHeaderWithSelectAll, useWithApplyHook = multiple, showSearch, searchProps, ...restProps }, ref) => {
|
|
47
|
+
const typedRestBottomSheetProps = restProps;
|
|
48
|
+
const typedRestModalProps = restProps;
|
|
43
49
|
const applyProps = useSelectWithApply({
|
|
44
50
|
optionsListProps: {
|
|
45
51
|
...optionsListProps,
|
|
@@ -54,13 +60,23 @@ const SelectMobile = forwardRef(({ autocomplete = false, multiple = false, allow
|
|
|
54
60
|
showClear,
|
|
55
61
|
showSelectAll,
|
|
56
62
|
});
|
|
57
|
-
|
|
63
|
+
const bottomAddons = useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, { ...applyProps.optionsListProps.headerProps, mobile: true }));
|
|
64
|
+
return (React.createElement(BaseSelect, { ref: ref, view: 'mobile', autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: {
|
|
58
65
|
FormControlComponent: FormControlMobile,
|
|
59
66
|
...fieldProps,
|
|
60
|
-
}, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, Search: Search$1, isBottomSheet:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
}, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, Search: Search$1, isBottomSheet: isBottomSheet, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, showSearch: showSearch, searchProps: searchProps, BottomSheet: BottomSheet, ModalMobile: ModalMobile, ...(isBottomSheet
|
|
68
|
+
? {
|
|
69
|
+
bottomSheetProps: {
|
|
70
|
+
bottomAddons,
|
|
71
|
+
...typedRestBottomSheetProps.bottomSheetProps,
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
: {
|
|
75
|
+
modalHeaderProps: {
|
|
76
|
+
bottomAddons,
|
|
77
|
+
...typedRestModalProps.modalHeaderProps,
|
|
78
|
+
},
|
|
79
|
+
}), optionsListProps: optionsListProps, ...restProps, ...(useWithApplyHook && applyProps) }));
|
|
64
80
|
});
|
|
65
81
|
|
|
66
82
|
export { SelectMobile };
|
|
@@ -1,60 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { BaseSelectProps } from "./typings";
|
|
6
|
-
type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
7
|
-
/**
|
|
8
|
-
* Показывать кнопку очистки
|
|
9
|
-
*/
|
|
10
|
-
showClear?: UseSelectWithApplyProps['showClear'];
|
|
11
|
-
/**
|
|
12
|
-
* Показывать пункт "Выбрать все"
|
|
13
|
-
*/
|
|
14
|
-
showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
|
|
15
|
-
/**
|
|
16
|
-
* Дополнительные пропсы шапки модалки
|
|
17
|
-
*/
|
|
18
|
-
modalHeaderProps?: Partial<React.ComponentProps<typeof ModalMobile.Header>>;
|
|
19
|
-
/**
|
|
20
|
-
* Дополнительные пропсы модалки
|
|
21
|
-
*/
|
|
22
|
-
modalProps?: Partial<React.ComponentProps<typeof ModalMobile>>;
|
|
23
|
-
/**
|
|
24
|
-
* Дополнительные пропсы футера модалки
|
|
25
|
-
*/
|
|
26
|
-
modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
|
|
27
|
-
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
28
|
-
/**
|
|
29
|
-
* Использовать ли хук useSelectWithApply
|
|
30
|
-
*/
|
|
31
|
-
useWithApplyHook?: boolean;
|
|
32
|
-
};
|
|
33
|
-
declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
|
|
34
|
-
/**
|
|
35
|
-
* Показывать кнопку очистки
|
|
36
|
-
*/
|
|
37
|
-
showClear?: UseSelectWithApplyProps['showClear'];
|
|
38
|
-
/**
|
|
39
|
-
* Показывать пункт "Выбрать все"
|
|
40
|
-
*/
|
|
41
|
-
showSelectAll?: UseSelectWithApplyProps['showSelectAll'];
|
|
42
|
-
/**
|
|
43
|
-
* Дополнительные пропсы шапки модалки
|
|
44
|
-
*/
|
|
45
|
-
modalHeaderProps?: Partial<import("./Component.mobile-f1f15074").HeaderProps> | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Дополнительные пропсы модалки
|
|
48
|
-
*/
|
|
49
|
-
modalProps?: Partial<import("./typings-baf4875b").ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Дополнительные пропсы футера модалки
|
|
52
|
-
*/
|
|
53
|
-
modalFooterProps?: Partial<import("./Component.mobile-f1f15074").FooterProps> | undefined;
|
|
54
|
-
showHeaderWithSelectAll?: UseSelectWithApplyProps['showHeaderWithSelectAll'];
|
|
55
|
-
/**
|
|
56
|
-
* Использовать ли хук useSelectWithApply
|
|
57
|
-
*/
|
|
58
|
-
useWithApplyHook?: boolean | undefined;
|
|
59
|
-
} & React.RefAttributes<unknown>>;
|
|
60
|
-
export { SelectModalMobileProps, SelectModalMobile };
|
|
3
|
+
declare const SelectModalMobile: React.ForwardRefExoticComponent<Omit<import("./typings").BaseSelectProps, "Checkmark"> & import("./typings").AdditionalMobileProps & import("./typings").ModalSelectMobileProps & React.RefAttributes<unknown>>;
|
|
4
|
+
export { SelectModalMobile };
|
|
@@ -1,66 +1,46 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Optgroup } from './components/optgroup/Component.js';
|
|
8
|
-
import { Option } from './components/option/Component.js';
|
|
9
|
-
import { OptionsList } from './components/options-list/Component.js';
|
|
10
|
-
import { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
11
|
-
import { u as useSelectWithApply } from './hook-5e1db0b0.js';
|
|
12
|
-
import { Header } from './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
2
|
+
import { SelectMobile } from './Component.mobile.js';
|
|
3
|
+
import '@alfalab/core-components-bottom-sheet/modern';
|
|
4
|
+
import '@alfalab/core-components-form-control/modern/mobile';
|
|
5
|
+
import '@alfalab/core-components-modal/modern/Component.mobile';
|
|
6
|
+
import './components/arrow/Component.js';
|
|
13
7
|
import 'classnames';
|
|
14
8
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
9
|
+
import './components/base-select/Component.js';
|
|
15
10
|
import 'react-merge-refs';
|
|
11
|
+
import '@juggle/resize-observer';
|
|
12
|
+
import 'compute-scroll-into-view';
|
|
16
13
|
import 'downshift';
|
|
17
|
-
import '@alfalab/core-components-bottom-sheet/modern';
|
|
18
|
-
import '@alfalab/core-components-modal/modern/mobile';
|
|
19
14
|
import '@alfalab/core-components-shared/modern';
|
|
15
|
+
import '@alfalab/hooks';
|
|
20
16
|
import './utils.js';
|
|
21
|
-
import './components/
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
17
|
+
import './components/native-select/Component.js';
|
|
18
|
+
import './components/field/Component.js';
|
|
19
|
+
import './components/footer/Component.js';
|
|
24
20
|
import '@alfalab/core-components-base-modal/modern';
|
|
25
21
|
import '@alfalab/core-components-button/modern/mobile';
|
|
26
|
-
import '
|
|
22
|
+
import './components/optgroup/Component.js';
|
|
23
|
+
import './components/option/Component.js';
|
|
27
24
|
import './components/checkmark/Component.js';
|
|
28
25
|
import '@alfalab/core-components-badge/modern';
|
|
29
26
|
import '@alfalab/core-components-checkbox/modern';
|
|
30
27
|
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
31
28
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
32
29
|
import './components/checkmark-mobile/Component.js';
|
|
30
|
+
import './components/options-list/Component.js';
|
|
31
|
+
import '@alfalab/core-components-mq/modern';
|
|
33
32
|
import '@alfalab/core-components-scrollbar/modern';
|
|
34
33
|
import './consts.js';
|
|
34
|
+
import './components/search/Component.js';
|
|
35
|
+
import '@alfalab/core-components-input/modern';
|
|
36
|
+
import '@alfalab/icons-glyph/MagnifierMIcon';
|
|
37
|
+
import './components/virtual-options-list/Component.js';
|
|
35
38
|
import 'react-virtual';
|
|
39
|
+
import './hook-4a3d365d.js';
|
|
36
40
|
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
37
41
|
import '@alfalab/core-components-button/modern/desktop';
|
|
42
|
+
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
38
43
|
|
|
39
|
-
const
|
|
40
|
-
const SelectModalMobile = forwardRef(({ autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, defaultOpen = false, open: openProp, size = 'm', optionsSize = 'm', fieldProps = {}, optionProps = {}, optionsListProps = {}, Arrow: Arrow$1 = Arrow, Field: Field$1 = Field, Optgroup: Optgroup$1 = Optgroup, Option: Option$1 = Option, selected, options, OptionsList: OptionsList$1 = options.length > VIRTUAL_OPTIONS_LIST_THRESHOLD
|
|
41
|
-
? VirtualOptionsList
|
|
42
|
-
: OptionsList, onChange, showClear = true, showSelectAll, useWithApplyHook = multiple, modalHeaderProps, showHeaderWithSelectAll, showSearch, searchProps, ...restProps }, ref) => {
|
|
43
|
-
const applyProps = useSelectWithApply({
|
|
44
|
-
optionsListProps: {
|
|
45
|
-
...optionsListProps,
|
|
46
|
-
Footer,
|
|
47
|
-
},
|
|
48
|
-
OptionsList: OptionsList$1,
|
|
49
|
-
selected,
|
|
50
|
-
options,
|
|
51
|
-
onChange,
|
|
52
|
-
showSearch,
|
|
53
|
-
searchProps,
|
|
54
|
-
showClear,
|
|
55
|
-
showSelectAll,
|
|
56
|
-
});
|
|
57
|
-
return (React.createElement(BaseSelectMobile, { ref: ref, autocomplete: autocomplete, multiple: multiple, allowUnselect: allowUnselect, disabled: disabled, closeOnSelect: closeOnSelect, circularNavigation: circularNavigation, defaultOpen: defaultOpen, open: openProp, size: size, optionsSize: optionsSize, fieldProps: {
|
|
58
|
-
FormControlComponent: FormControlMobile,
|
|
59
|
-
...fieldProps,
|
|
60
|
-
}, optionProps: optionProps, Arrow: Arrow$1, Field: Field$1, Optgroup: Optgroup$1, Option: Option$1, isBottomSheet: false, options: options, selected: selected, onChange: onChange, OptionsList: OptionsList$1, optionsListProps: optionsListProps, showSearch: showSearch, searchProps: searchProps, modalHeaderProps: {
|
|
61
|
-
bottomAddons: useWithApplyHook && showHeaderWithSelectAll && (React.createElement(Header, { ...applyProps.optionsListProps.headerProps, mobile: true })),
|
|
62
|
-
...modalHeaderProps,
|
|
63
|
-
}, ...restProps, ...(useWithApplyHook && applyProps) }));
|
|
64
|
-
});
|
|
44
|
+
const SelectModalMobile = forwardRef((props, ref) => (React.createElement(SelectMobile, { ...props, isBottomSheet: false, ref: ref })));
|
|
65
45
|
|
|
66
46
|
export { SelectModalMobile };
|