@alfalab/core-components-select 14.3.4 → 15.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 +19 -0
- package/{Component.js → Component.desktop.js} +6 -6
- package/Component.mobile-ebda875c.d.ts +6 -0
- package/Component.mobile-f1f15074.d.ts +387 -0
- package/Component.mobile.d.ts +41 -0
- package/Component.mobile.js +62 -0
- package/Component.modal.mobile.d.ts +60 -0
- package/Component.modal.mobile.js +62 -0
- package/Component.responsive.d.ts +1 -1
- package/Component.responsive.js +26 -25
- package/components/arrow/Component.d.ts +2 -1
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-checkmark/Component.d.ts +2 -1
- 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 +13 -13
- package/components/base-select/Component.js +6 -6
- package/components/base-select/index.css +8 -8
- package/components/base-select/index.js +1 -1
- package/components/base-select-mobile/Component.d.ts +3 -3
- package/components/base-select-mobile/Component.js +13 -9
- package/components/base-select-mobile/footer/Component.d.ts +2 -1
- package/components/base-select-mobile/footer/Component.js +4 -4
- package/components/base-select-mobile/footer/index.css +5 -5
- package/components/base-select-mobile/footer/index.js +1 -1
- package/components/base-select-mobile/index.css +13 -11
- package/components/base-select-mobile/index.js +1 -2
- package/components/checkmark/Component.d.ts +2 -1
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +10 -10
- package/components/checkmark-mobile/Component.d.ts +2 -1
- package/components/checkmark-mobile/Component.js +1 -1
- package/components/checkmark-mobile/index.css +6 -6
- package/components/field/Component.d.ts +9 -1
- package/components/field/Component.js +19 -16
- package/components/field/index.css +38 -11
- package/components/field/index.js +0 -1
- package/components/index.d.ts +0 -2
- package/components/index.js +4 -19
- package/components/optgroup/Component.d.ts +2 -1
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +1 -1
- package/components/option/index.css +20 -20
- package/components/options-list/Component.js +1 -1
- package/components/options-list/index.css +9 -9
- package/components/virtual-options-list/Component.js +1 -1
- package/components/virtual-options-list/index.css +15 -15
- package/cssm/Component.desktop.d.ts +19 -0
- package/cssm/{Component.js → Component.desktop.js} +6 -6
- package/cssm/Component.mobile-ebda875c.d.ts +6 -0
- package/cssm/Component.mobile-f1f15074.d.ts +387 -0
- package/cssm/Component.mobile.d.ts +41 -0
- package/cssm/Component.mobile.js +74 -0
- package/cssm/Component.modal.mobile.d.ts +60 -0
- package/cssm/Component.modal.mobile.js +74 -0
- package/cssm/Component.responsive.d.ts +1 -1
- package/cssm/Component.responsive.js +30 -33
- package/cssm/components/arrow/Component.d.ts +2 -1
- package/cssm/components/base-checkmark/Component.d.ts +2 -1
- package/cssm/components/base-select/Component.js +5 -5
- package/cssm/components/base-select/index.js +1 -1
- package/cssm/components/base-select-mobile/Component.d.ts +3 -3
- package/cssm/components/base-select-mobile/Component.js +12 -8
- package/cssm/components/base-select-mobile/footer/Component.d.ts +2 -1
- package/cssm/components/base-select-mobile/footer/Component.js +3 -3
- package/cssm/components/base-select-mobile/footer/index.js +1 -1
- package/cssm/components/base-select-mobile/index.js +1 -2
- package/cssm/components/base-select-mobile/index.module.css +4 -2
- package/cssm/components/checkmark/Component.d.ts +2 -1
- package/cssm/components/checkmark-mobile/Component.d.ts +2 -1
- package/cssm/components/field/Component.d.ts +9 -1
- package/cssm/components/field/Component.js +18 -15
- package/cssm/components/field/index.js +0 -1
- package/cssm/components/field/index.module.css +31 -4
- package/cssm/components/index.d.ts +0 -2
- package/cssm/components/index.js +7 -28
- package/cssm/components/optgroup/Component.d.ts +2 -1
- package/cssm/desktop-63dec22f.d.ts +6 -0
- package/cssm/desktop.d.ts +2 -0
- package/cssm/desktop.js +44 -0
- package/cssm/hook-97e6e688.d.ts +16 -0
- package/cssm/hook-97e6e688.js +110 -0
- package/{esm/hook-b4e70cb0.d.ts → cssm/hook-9ea9e32c.d.ts} +9 -7
- package/cssm/index-ebda875c.d.ts +20 -60
- package/cssm/index.d.ts +2 -5
- package/cssm/index.js +34 -61
- package/cssm/mobile-96988a65.d.ts +2 -0
- package/cssm/mobile.d.ts +5 -4
- package/cssm/mobile.js +15 -24
- package/cssm/presets/index.d.ts +1 -1
- package/cssm/presets/index.js +8 -36
- package/cssm/presets/useLazyLoading/hook.d.ts +1 -1
- package/cssm/presets/useLazyLoading/hook.js +900 -4
- package/cssm/presets/useSelectWithApply/hook.js +9 -48
- package/cssm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -42
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +3 -3
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/cssm/presets/useSelectWithApply/options-list-with-apply/index.js +10 -49
- package/cssm/presets/useSelectWithLoading/hook.d.ts +1 -1
- package/cssm/shared.d.ts +5 -0
- package/cssm/shared.js +77 -0
- package/cssm/typings-9211a437.d.ts +95 -0
- package/cssm/typings-baf4875b.d.ts +52 -0
- package/desktop-63dec22f.d.ts +6 -0
- package/desktop.d.ts +2 -0
- package/{responsive.js → desktop.js} +5 -19
- package/esm/Component.desktop.d.ts +19 -0
- package/esm/{Component.js → Component.desktop.js} +6 -6
- package/esm/Component.mobile-ebda875c.d.ts +6 -0
- package/esm/Component.mobile-f1f15074.d.ts +387 -0
- package/esm/Component.mobile.d.ts +41 -0
- package/esm/Component.mobile.js +54 -0
- package/esm/Component.modal.mobile.d.ts +60 -0
- package/esm/Component.modal.mobile.js +54 -0
- package/esm/Component.responsive.d.ts +1 -1
- package/esm/Component.responsive.js +26 -25
- package/esm/components/arrow/Component.d.ts +2 -1
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-checkmark/Component.d.ts +2 -1
- 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 +13 -13
- package/esm/components/base-select/Component.js +2 -2
- package/esm/components/base-select/index.css +8 -8
- package/esm/components/base-select/index.js +1 -1
- package/esm/components/base-select-mobile/Component.d.ts +3 -3
- package/esm/components/base-select-mobile/Component.js +9 -5
- package/esm/components/base-select-mobile/footer/Component.d.ts +2 -1
- package/esm/components/base-select-mobile/footer/Component.js +4 -4
- package/esm/components/base-select-mobile/footer/index.css +5 -5
- package/esm/components/base-select-mobile/footer/index.js +1 -1
- package/esm/components/base-select-mobile/index.css +13 -11
- package/esm/components/base-select-mobile/index.js +1 -2
- package/esm/components/checkmark/Component.d.ts +2 -1
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +10 -10
- package/esm/components/checkmark-mobile/Component.d.ts +2 -1
- package/esm/components/checkmark-mobile/Component.js +1 -1
- package/esm/components/checkmark-mobile/index.css +6 -6
- package/esm/components/field/Component.d.ts +9 -1
- package/esm/components/field/Component.js +19 -16
- package/esm/components/field/index.css +38 -11
- package/esm/components/field/index.js +0 -1
- package/esm/components/index.d.ts +0 -2
- package/esm/components/index.js +4 -17
- package/esm/components/optgroup/Component.d.ts +2 -1
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +1 -1
- package/esm/components/option/index.css +20 -20
- package/esm/components/options-list/Component.js +1 -1
- package/esm/components/options-list/index.css +9 -9
- package/esm/components/virtual-options-list/Component.js +1 -1
- package/esm/components/virtual-options-list/index.css +15 -15
- package/esm/desktop-63dec22f.d.ts +6 -0
- package/esm/desktop.d.ts +2 -0
- package/esm/{responsive.js → desktop.js} +4 -18
- package/esm/hook-326a5cea.d.ts +16 -0
- package/esm/hook-326a5cea.js +102 -0
- package/{cssm/hook-b4e70cb0.d.ts → esm/hook-9ea9e32c.d.ts} +9 -7
- package/esm/index-ebda875c.d.ts +20 -60
- package/esm/index.d.ts +2 -5
- package/esm/index.js +27 -29
- package/esm/mobile-96988a65.d.ts +2 -0
- package/esm/mobile.d.ts +5 -4
- package/esm/mobile.js +12 -16
- package/esm/presets/index.d.ts +1 -1
- package/esm/presets/index.js +6 -25
- package/esm/presets/useLazyLoading/hook.d.ts +1 -1
- package/esm/presets/useLazyLoading/hook.js +899 -4
- package/esm/presets/useSelectWithApply/hook.js +7 -33
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -28
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -4
- 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 +8 -34
- package/esm/presets/useSelectWithLoading/hook.d.ts +1 -1
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/shared.d.ts +5 -0
- package/esm/shared.js +37 -0
- package/esm/typings-9211a437.d.ts +95 -0
- package/esm/typings-baf4875b.d.ts +52 -0
- package/hook-6e94be9c.d.ts +16 -0
- package/hook-6e94be9c.js +110 -0
- package/{hook-b4e70cb0.d.ts → hook-9ea9e32c.d.ts} +9 -7
- package/index-ebda875c.d.ts +20 -60
- package/index.d.ts +2 -5
- package/index.js +28 -51
- package/mobile-96988a65.d.ts +2 -0
- package/mobile.d.ts +5 -4
- package/mobile.js +14 -18
- package/modern/Component.desktop.d.ts +19 -0
- package/modern/{Component.js → Component.desktop.js} +7 -4
- package/modern/Component.mobile-ebda875c.d.ts +6 -0
- package/modern/Component.mobile-f1f15074.d.ts +387 -0
- package/modern/Component.mobile.d.ts +41 -0
- package/modern/Component.mobile.js +61 -0
- package/modern/Component.modal.mobile.d.ts +60 -0
- package/modern/Component.modal.mobile.js +61 -0
- package/modern/Component.responsive.d.ts +1 -1
- package/modern/Component.responsive.js +26 -25
- package/modern/components/arrow/Component.d.ts +2 -1
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-checkmark/Component.d.ts +2 -1
- 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 +13 -13
- package/modern/components/base-select/Component.js +2 -2
- package/modern/components/base-select/index.css +8 -8
- package/modern/components/base-select/index.js +1 -1
- package/modern/components/base-select-mobile/Component.d.ts +3 -3
- package/modern/components/base-select-mobile/Component.js +9 -5
- package/modern/components/base-select-mobile/footer/Component.d.ts +2 -1
- package/modern/components/base-select-mobile/footer/Component.js +4 -4
- package/modern/components/base-select-mobile/footer/index.css +5 -5
- package/modern/components/base-select-mobile/footer/index.js +1 -1
- package/modern/components/base-select-mobile/index.css +13 -11
- package/modern/components/base-select-mobile/index.js +1 -2
- package/modern/components/checkmark/Component.d.ts +2 -1
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +10 -10
- package/modern/components/checkmark-mobile/Component.d.ts +2 -1
- package/modern/components/checkmark-mobile/Component.js +1 -1
- package/modern/components/checkmark-mobile/index.css +6 -6
- package/modern/components/field/Component.d.ts +9 -1
- package/modern/components/field/Component.js +17 -14
- package/modern/components/field/index.css +38 -11
- package/modern/components/field/index.js +0 -1
- package/modern/components/index.d.ts +0 -2
- package/modern/components/index.js +4 -17
- package/modern/components/optgroup/Component.d.ts +2 -1
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +1 -1
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +9 -9
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +15 -15
- package/modern/desktop-63dec22f.d.ts +6 -0
- package/modern/desktop.d.ts +2 -0
- package/modern/{responsive.js → desktop.js} +4 -18
- package/modern/{hook-b4e70cb0.d.ts → hook-9ea9e32c.d.ts} +9 -7
- package/modern/hook-e0fd0350.d.ts +16 -0
- package/modern/{Component-ecb2a41a.js → hook-e0fd0350.js} +3 -66
- package/modern/index-ebda875c.d.ts +20 -60
- package/modern/index.d.ts +2 -5
- package/modern/index.js +27 -29
- package/modern/mobile-96988a65.d.ts +2 -0
- package/modern/mobile.d.ts +5 -4
- package/modern/mobile.js +12 -16
- package/modern/presets/index.d.ts +1 -1
- package/modern/presets/index.js +6 -25
- package/modern/presets/useLazyLoading/hook.d.ts +1 -1
- package/modern/presets/useLazyLoading/hook.js +899 -4
- package/modern/presets/useSelectWithApply/hook.js +7 -33
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -28
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -4
- 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 +8 -34
- package/modern/presets/useSelectWithLoading/hook.d.ts +1 -1
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/shared.d.ts +5 -0
- package/modern/shared.js +36 -0
- package/modern/typings-9211a437.d.ts +95 -0
- package/modern/typings-baf4875b.d.ts +52 -0
- package/package.json +37 -12
- package/presets/index.d.ts +1 -1
- package/presets/index.js +6 -25
- package/presets/useLazyLoading/hook.d.ts +1 -1
- package/presets/useLazyLoading/hook.js +899 -4
- package/presets/useSelectWithApply/hook.js +7 -33
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +2 -28
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.d.ts +2 -1
- package/presets/useSelectWithApply/options-list-with-apply/footer/Component.js +4 -4
- 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 +8 -34
- package/presets/useSelectWithLoading/hook.d.ts +1 -1
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/shared.d.ts +5 -0
- package/shared.js +63 -0
- package/src/Component.desktop.tsx +52 -0
- package/src/Component.mobile.tsx +149 -0
- package/src/Component.modal.mobile.tsx +144 -0
- package/src/Component.responsive.tsx +59 -0
- package/src/components/arrow/Component.tsx +12 -0
- package/src/components/arrow/index.module.css +15 -0
- package/src/components/arrow/index.ts +1 -0
- package/src/components/base-checkmark/Component.tsx +33 -0
- package/src/components/base-checkmark/index.module.css +18 -0
- package/src/components/base-checkmark/index.ts +1 -0
- package/src/components/base-option/Component.tsx +57 -0
- package/src/components/base-option/index.module.css +67 -0
- package/src/components/base-option/index.ts +1 -0
- package/src/components/base-select/Component.tsx +478 -0
- package/src/components/base-select/index.module.css +68 -0
- package/src/components/base-select/index.ts +1 -0
- package/src/components/base-select-mobile/Component.tsx +486 -0
- package/src/components/base-select-mobile/footer/Component.tsx +46 -0
- package/src/components/base-select-mobile/footer/index.module.css +23 -0
- package/src/components/base-select-mobile/footer/index.ts +1 -0
- package/src/components/base-select-mobile/index.module.css +48 -0
- package/src/components/base-select-mobile/index.ts +1 -0
- package/src/components/checkmark/Component.tsx +56 -0
- package/src/components/checkmark/index.module.css +48 -0
- package/src/components/checkmark/index.ts +1 -0
- package/src/components/checkmark-mobile/Component.tsx +18 -0
- package/src/components/checkmark-mobile/index.module.css +28 -0
- package/src/components/checkmark-mobile/index.ts +1 -0
- package/src/components/field/Component.tsx +110 -0
- package/src/components/field/index.module.css +60 -0
- package/src/components/field/index.ts +1 -0
- package/src/components/index.ts +8 -0
- package/src/components/native-select/Component.tsx +60 -0
- package/src/components/native-select/index.ts +1 -0
- package/src/components/optgroup/Component.tsx +15 -0
- package/src/components/optgroup/index.module.css +30 -0
- package/src/components/optgroup/index.ts +1 -0
- package/src/components/option/Component.tsx +65 -0
- package/src/components/option/index.module.css +108 -0
- package/src/components/option/index.ts +1 -0
- package/src/components/options-list/Component.tsx +140 -0
- package/src/components/options-list/index.module.css +40 -0
- package/src/components/options-list/index.ts +1 -0
- package/src/components/virtual-options-list/Component.tsx +217 -0
- package/src/components/virtual-options-list/index.module.css +76 -0
- package/src/components/virtual-options-list/index.ts +1 -0
- package/src/consts.ts +1 -0
- package/src/desktop.ts +1 -0
- package/src/index.ts +4 -0
- package/src/mobile.ts +5 -0
- package/src/presets/index.ts +3 -0
- package/src/presets/useLazyLoading/hook.tsx +309 -0
- package/src/presets/useSelectWithApply/hook.tsx +154 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/Component.tsx +106 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/footer/Component.tsx +37 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/footer/index.module.css +11 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/header/Component.tsx +26 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/header/index.module.css +9 -0
- package/src/presets/useSelectWithApply/options-list-with-apply/index.ts +1 -0
- package/src/presets/useSelectWithLoading/hook.tsx +40 -0
- package/src/shared.ts +5 -0
- package/src/typings.ts +691 -0
- package/src/utils.ts +154 -0
- package/src/vars.css +57 -0
- package/typings-9211a437.d.ts +95 -0
- package/typings-baf4875b.d.ts +52 -0
- package/Component-01f08370.d.ts +0 -108
- package/Component-01f08370.js +0 -165
- package/Component-3885b0d7.d.ts +0 -169
- package/Component.d.ts +0 -104
- package/Component.mobile-b2c0420d.d.ts +0 -93
- package/components/select-mobile/Component.d.ts +0 -0
- package/components/select-mobile/Component.js +0 -49
- package/components/select-mobile/index.d.ts +0 -1
- package/components/select-mobile/index.js +0 -49
- package/components/select-modal-mobile/Component.d.ts +0 -0
- package/components/select-modal-mobile/Component.js +0 -49
- package/components/select-modal-mobile/index.d.ts +0 -1
- package/components/select-modal-mobile/index.js +0 -49
- package/cssm/Component-3885b0d7.d.ts +0 -169
- package/cssm/Component-4727d474.d.ts +0 -108
- package/cssm/Component-4727d474.js +0 -175
- package/cssm/Component.d.ts +0 -104
- package/cssm/Component.mobile-b2c0420d.d.ts +0 -93
- package/cssm/components/select-mobile/Component.d.ts +0 -0
- package/cssm/components/select-mobile/Component.js +0 -66
- package/cssm/components/select-mobile/index.d.ts +0 -1
- package/cssm/components/select-mobile/index.js +0 -66
- package/cssm/components/select-modal-mobile/Component.d.ts +0 -0
- package/cssm/components/select-modal-mobile/Component.js +0 -66
- package/cssm/components/select-modal-mobile/index.d.ts +0 -1
- package/cssm/components/select-modal-mobile/index.js +0 -66
- package/cssm/getDataTestId-5c876d98.d.ts +0 -2
- package/cssm/getDataTestId-5c876d98.js +0 -8
- package/cssm/index-3885b0d7.d.ts +0 -3
- package/cssm/intersection-observer-9ec5cf59.d.ts +0 -1
- package/cssm/intersection-observer-9ec5cf59.js +0 -893
- package/cssm/responsive.d.ts +0 -2
- package/cssm/responsive.js +0 -67
- package/cssm/types-ebda875c.d.ts +0 -113
- package/esm/Component-3885b0d7.d.ts +0 -169
- package/esm/Component-5e2bc757.d.ts +0 -108
- package/esm/Component-5e2bc757.js +0 -155
- package/esm/Component.d.ts +0 -104
- package/esm/Component.mobile-b2c0420d.d.ts +0 -93
- package/esm/components/select-mobile/Component.d.ts +0 -0
- package/esm/components/select-mobile/Component.js +0 -41
- package/esm/components/select-mobile/index.d.ts +0 -1
- package/esm/components/select-mobile/index.js +0 -41
- package/esm/components/select-modal-mobile/Component.d.ts +0 -0
- package/esm/components/select-modal-mobile/Component.js +0 -41
- package/esm/components/select-modal-mobile/index.d.ts +0 -1
- package/esm/components/select-modal-mobile/index.js +0 -41
- package/esm/getDataTestId-fc7d4653.d.ts +0 -2
- package/esm/getDataTestId-fc7d4653.js +0 -6
- package/esm/index-3885b0d7.d.ts +0 -3
- package/esm/intersection-observer-6768cbd0.d.ts +0 -1
- package/esm/intersection-observer-6768cbd0.js +0 -891
- package/esm/presets/useLazyLoading/index.css +0 -8
- package/esm/responsive.d.ts +0 -2
- package/esm/types-ebda875c.d.ts +0 -113
- package/getDataTestId-18fbdb35.d.ts +0 -2
- package/getDataTestId-18fbdb35.js +0 -8
- package/index-3885b0d7.d.ts +0 -3
- package/intersection-observer-0413a170.d.ts +0 -1
- package/intersection-observer-0413a170.js +0 -893
- package/modern/Component-3885b0d7.d.ts +0 -169
- package/modern/Component-ecb2a41a.d.ts +0 -108
- package/modern/Component.d.ts +0 -104
- package/modern/Component.mobile-b2c0420d.d.ts +0 -93
- package/modern/components/select-mobile/Component.d.ts +0 -0
- package/modern/components/select-mobile/Component.js +0 -40
- package/modern/components/select-mobile/index.d.ts +0 -1
- package/modern/components/select-mobile/index.js +0 -40
- package/modern/components/select-modal-mobile/Component.d.ts +0 -0
- package/modern/components/select-modal-mobile/Component.js +0 -40
- package/modern/components/select-modal-mobile/index.d.ts +0 -1
- package/modern/components/select-modal-mobile/index.js +0 -40
- package/modern/getDataTestId-6120c308.d.ts +0 -2
- package/modern/getDataTestId-6120c308.js +0 -6
- package/modern/index-3885b0d7.d.ts +0 -3
- package/modern/intersection-observer-6768cbd0.d.ts +0 -1
- package/modern/intersection-observer-6768cbd0.js +0 -891
- package/modern/presets/useLazyLoading/index.css +0 -8
- package/modern/responsive.d.ts +0 -2
- package/modern/types-ebda875c.d.ts +0 -113
- package/presets/useLazyLoading/index.css +0 -8
- package/responsive.d.ts +0 -2
- package/types-ebda875c.d.ts +0 -113
- /package/{cssm/presets/useLazyLoading → src/presets/useSelectWithLoading}/index.module.css +0 -0
|
@@ -1,41 +1,15 @@
|
|
|
1
1
|
import 'tslib';
|
|
2
2
|
import 'react';
|
|
3
|
-
import '../../Component.js';
|
|
4
|
-
import 'classnames';
|
|
5
|
-
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
6
|
-
import '../../components/base-select/Component.js';
|
|
7
|
-
export { b as SELECT_ALL_KEY, u as useSelectWithApply } from '../../Component-5e2bc757.js';
|
|
8
|
-
import '@alfalab/core-components-form-control/esm';
|
|
9
|
-
import '@alfalab/hooks';
|
|
10
3
|
import '../../utils.js';
|
|
11
|
-
|
|
12
|
-
import '@alfalab/core-components-checkbox/esm';
|
|
13
|
-
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
14
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
4
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from '../../hook-326a5cea.js';
|
|
15
5
|
import '../../components/options-list/Component.js';
|
|
16
|
-
import '../../components/virtual-options-list/Component.js';
|
|
17
|
-
import '@alfalab/core-components-skeleton/esm';
|
|
18
|
-
import '../../intersection-observer-6768cbd0.js';
|
|
19
|
-
import '../../components/arrow/Component.js';
|
|
20
|
-
import '../../components/field/Component.js';
|
|
21
|
-
import '../../components/optgroup/Component.js';
|
|
22
|
-
import '../../components/option/Component.js';
|
|
23
|
-
import '../../components/checkmark/Component.js';
|
|
24
|
-
import '../../components/checkmark-mobile/Component.js';
|
|
25
6
|
import 'react-merge-refs';
|
|
26
|
-
import '
|
|
27
|
-
import 'downshift';
|
|
28
|
-
import '@alfalab/core-components-popover/esm';
|
|
29
|
-
import '../../getDataTestId-fc7d4653.js';
|
|
30
|
-
import '../../components/native-select/Component.js';
|
|
7
|
+
import 'classnames';
|
|
31
8
|
import '@alfalab/core-components-scrollbar/esm';
|
|
9
|
+
import '@alfalab/hooks';
|
|
32
10
|
import '../../consts.js';
|
|
33
|
-
import '
|
|
34
|
-
import '../../components/base-select-mobile/Component.js';
|
|
35
|
-
import '@alfalab/core-components-bottom-sheet/esm';
|
|
36
|
-
import '@alfalab/core-components-modal/esm/mobile';
|
|
37
|
-
import '../../components/base-select-mobile/footer/Component.js';
|
|
38
|
-
import '@alfalab/core-components-base-modal/esm';
|
|
39
|
-
import '@alfalab/core-components-button/esm';
|
|
11
|
+
import '../../components/optgroup/Component.js';
|
|
40
12
|
import './options-list-with-apply/footer/Component.js';
|
|
41
|
-
import '
|
|
13
|
+
import '@alfalab/core-components-button/esm/desktop';
|
|
14
|
+
import './options-list-with-apply/header/Component.js';
|
|
15
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
@@ -2,7 +2,7 @@ import 'tslib';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../../components/options-list/Component.js';
|
|
4
4
|
import '../../../consts.js';
|
|
5
|
-
export { O as OptionsListWithApply } from '../../../
|
|
5
|
+
export { O as OptionsListWithApply } from '../../../hook-326a5cea.js';
|
|
6
6
|
import './footer/Component.js';
|
|
7
7
|
import './header/Component.js';
|
|
8
8
|
import 'react-merge-refs';
|
|
@@ -11,31 +11,5 @@ import '@alfalab/core-components-scrollbar/esm';
|
|
|
11
11
|
import '@alfalab/hooks';
|
|
12
12
|
import '../../../utils.js';
|
|
13
13
|
import '../../../components/optgroup/Component.js';
|
|
14
|
-
import '
|
|
15
|
-
import '../../../components/arrow/Component.js';
|
|
16
|
-
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
17
|
-
import '../../../components/base-select/Component.js';
|
|
18
|
-
import '@juggle/resize-observer';
|
|
19
|
-
import 'downshift';
|
|
20
|
-
import '@alfalab/core-components-popover/esm';
|
|
21
|
-
import '../../../getDataTestId-fc7d4653.js';
|
|
22
|
-
import '../../../components/native-select/Component.js';
|
|
23
|
-
import '../../../components/field/Component.js';
|
|
24
|
-
import '@alfalab/core-components-form-control/esm';
|
|
25
|
-
import '../../../components/option/Component.js';
|
|
26
|
-
import '../../../components/checkmark/Component.js';
|
|
27
|
-
import '@alfalab/core-components-badge/esm';
|
|
14
|
+
import '@alfalab/core-components-button/esm/desktop';
|
|
28
15
|
import '@alfalab/core-components-checkbox/esm';
|
|
29
|
-
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
30
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
31
|
-
import '../../../components/checkmark-mobile/Component.js';
|
|
32
|
-
import '../../../components/base-select-mobile/Component.js';
|
|
33
|
-
import '@alfalab/core-components-bottom-sheet/esm';
|
|
34
|
-
import '@alfalab/core-components-modal/esm/mobile';
|
|
35
|
-
import '../../../components/base-select-mobile/footer/Component.js';
|
|
36
|
-
import '@alfalab/core-components-base-modal/esm';
|
|
37
|
-
import '@alfalab/core-components-button/esm';
|
|
38
|
-
import '../../../components/virtual-options-list/Component.js';
|
|
39
|
-
import 'react-virtual';
|
|
40
|
-
import '@alfalab/core-components-skeleton/esm';
|
|
41
|
-
import '../../../intersection-observer-6768cbd0.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { OptionShape } from "../../../../typings";
|
|
3
4
|
type FooterProps = {
|
|
4
5
|
handleClear?: () => void;
|
|
@@ -6,5 +7,5 @@ type FooterProps = {
|
|
|
6
7
|
showClear?: boolean;
|
|
7
8
|
selectedDraft?: OptionShape[];
|
|
8
9
|
};
|
|
9
|
-
declare const Footer: ({ handleApply, handleClear, showClear, selectedDraft, }: FooterProps) => JSX.Element;
|
|
10
|
+
declare const Footer: ({ handleApply, handleClear, showClear, selectedDraft, }: FooterProps) => React.JSX.Element;
|
|
10
11
|
export { FooterProps, Footer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonDesktop } from '@alfalab/core-components-button/esm/desktop';
|
|
3
3
|
|
|
4
|
-
var styles = {"footer":"
|
|
4
|
+
var styles = {"footer":"select__footer_1qxo7"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
var Footer = function (_a) {
|
|
@@ -9,8 +9,8 @@ var Footer = function (_a) {
|
|
|
9
9
|
return (React.createElement("div", {
|
|
10
10
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
11
11
|
tabIndex: 0, className: styles.footer },
|
|
12
|
-
React.createElement(
|
|
13
|
-
showClear && selectedDraft.length > 0 && (React.createElement(
|
|
12
|
+
React.createElement(ButtonDesktop, { size: 'xxs', view: 'primary', onClick: handleApply }, "\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C"),
|
|
13
|
+
showClear && selectedDraft.length > 0 && (React.createElement(ButtonDesktop, { size: 'xxs', view: 'secondary', onClick: handleClear }, "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C"))));
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { Footer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1gkfz */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff; /* 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 */
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
--gap-s: 12px;
|
|
18
18
|
} :root {
|
|
19
19
|
} :root {
|
|
20
|
-
} .
|
|
20
|
+
} .select__footer_1qxo7 {
|
|
21
21
|
background-color: var(--color-light-bg-primary);
|
|
22
22
|
padding: var(--gap-s);
|
|
23
23
|
outline: none
|
|
24
|
-
} .
|
|
24
|
+
} .select__footer_1qxo7 > * + * {
|
|
25
25
|
margin-left: var(--gap-xs);
|
|
26
26
|
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/esm';
|
|
4
4
|
|
|
5
|
-
var styles = {"desktop":"
|
|
5
|
+
var styles = {"desktop":"select__desktop_12ysm","mobile":"select__mobile_12ysm"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Header = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: h8ahs */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
4
4
|
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
--gap-s: 12px;
|
|
17
17
|
} :root {
|
|
18
18
|
} :root {
|
|
19
|
-
} .
|
|
19
|
+
} .select__desktop_12ysm {
|
|
20
20
|
padding: var(--gap-s);
|
|
21
|
-
} .
|
|
21
|
+
} .select__mobile_12ysm {
|
|
22
22
|
padding: var(--gap-s) var(--gap-xs);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../../
|
|
1
|
+
export * from "../../../hook-326a5cea";
|
|
@@ -1,41 +1,15 @@
|
|
|
1
|
-
export { O as OptionsListWithApply } from '../../../
|
|
1
|
+
export { O as OptionsListWithApply } from '../../../hook-326a5cea.js';
|
|
2
2
|
import 'tslib';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../../../Component.js';
|
|
5
|
-
import '../../../components/arrow/Component.js';
|
|
6
|
-
import 'classnames';
|
|
7
|
-
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
8
|
-
import '../../../components/base-select/Component.js';
|
|
9
|
-
import 'react-merge-refs';
|
|
10
|
-
import '@juggle/resize-observer';
|
|
11
|
-
import 'downshift';
|
|
12
|
-
import '@alfalab/core-components-popover/esm';
|
|
13
|
-
import '@alfalab/hooks';
|
|
14
|
-
import '../../../getDataTestId-fc7d4653.js';
|
|
15
4
|
import '../../../utils.js';
|
|
16
|
-
import '../../../components/native-select/Component.js';
|
|
17
|
-
import '../../../components/field/Component.js';
|
|
18
|
-
import '@alfalab/core-components-form-control/esm';
|
|
19
|
-
import '../../../components/optgroup/Component.js';
|
|
20
|
-
import '../../../components/option/Component.js';
|
|
21
|
-
import '../../../components/checkmark/Component.js';
|
|
22
|
-
import '@alfalab/core-components-badge/esm';
|
|
23
|
-
import '@alfalab/core-components-checkbox/esm';
|
|
24
|
-
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
25
|
-
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
26
|
-
import '../../../components/checkmark-mobile/Component.js';
|
|
27
5
|
import '../../../components/options-list/Component.js';
|
|
6
|
+
import 'react-merge-refs';
|
|
7
|
+
import 'classnames';
|
|
28
8
|
import '@alfalab/core-components-scrollbar/esm';
|
|
9
|
+
import '@alfalab/hooks';
|
|
29
10
|
import '../../../consts.js';
|
|
30
|
-
import '
|
|
31
|
-
import '../../../components/base-select-mobile/Component.js';
|
|
32
|
-
import '@alfalab/core-components-bottom-sheet/esm';
|
|
33
|
-
import '@alfalab/core-components-modal/esm/mobile';
|
|
34
|
-
import '../../../components/base-select-mobile/footer/Component.js';
|
|
35
|
-
import '@alfalab/core-components-base-modal/esm';
|
|
36
|
-
import '@alfalab/core-components-button/esm';
|
|
37
|
-
import '../../../components/virtual-options-list/Component.js';
|
|
38
|
-
import 'react-virtual';
|
|
39
|
-
import '@alfalab/core-components-skeleton/esm';
|
|
40
|
-
import '../../../intersection-observer-6768cbd0.js';
|
|
11
|
+
import '../../../components/optgroup/Component.js';
|
|
41
12
|
import './footer/Component.js';
|
|
13
|
+
import '@alfalab/core-components-button/esm/desktop';
|
|
14
|
+
import './header/Component.js';
|
|
15
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
@@ -7,7 +7,7 @@ type useSelectWithLoadingProps = {
|
|
|
7
7
|
Option?: React.FC<OptionProps>;
|
|
8
8
|
};
|
|
9
9
|
declare function useSelectWithLoading({ loading, visibleOptions, Option, }: useSelectWithLoadingProps): {
|
|
10
|
-
Option: (props: OptionProps) => JSX.Element;
|
|
10
|
+
Option: (props: OptionProps) => React.JSX.Element;
|
|
11
11
|
options: OptionShape[];
|
|
12
12
|
} | null;
|
|
13
13
|
export { useSelectWithLoading };
|
|
@@ -10,7 +10,7 @@ import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
|
10
10
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
11
11
|
import '../../components/checkmark-mobile/Component.js';
|
|
12
12
|
|
|
13
|
-
var styles = {"skeleton":"
|
|
13
|
+
var styles = {"skeleton":"select__skeleton_1xtgg"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
function useSelectWithLoading(_a) {
|
package/esm/shared.d.ts
ADDED
package/esm/shared.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { Arrow } from './components/arrow/Component.js';
|
|
2
|
+
export { BaseSelect } from './components/base-select/Component.js';
|
|
3
|
+
export { Field } from './components/field/Component.js';
|
|
4
|
+
export { Optgroup } from './components/optgroup/Component.js';
|
|
5
|
+
export { Option } from './components/option/Component.js';
|
|
6
|
+
export { OptionsList } from './components/options-list/Component.js';
|
|
7
|
+
export { VirtualOptionsList } from './components/virtual-options-list/Component.js';
|
|
8
|
+
export { BaseOption } from './components/base-option/Component.js';
|
|
9
|
+
export { useSelectWithLoading } from './presets/useSelectWithLoading/hook.js';
|
|
10
|
+
export { useLazyLoading } from './presets/useLazyLoading/hook.js';
|
|
11
|
+
export { S as SELECT_ALL_KEY, u as useSelectWithApply } from './hook-326a5cea.js';
|
|
12
|
+
export { isGroup, isOptionShape, joinOptions, lastIndexOf, processOptions, usePrevious, useVisibleOptions } from './utils.js';
|
|
13
|
+
import 'react';
|
|
14
|
+
import 'classnames';
|
|
15
|
+
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
16
|
+
import 'tslib';
|
|
17
|
+
import 'react-merge-refs';
|
|
18
|
+
import '@juggle/resize-observer';
|
|
19
|
+
import 'downshift';
|
|
20
|
+
import '@alfalab/core-components-popover/esm';
|
|
21
|
+
import '@alfalab/core-components-shared/esm';
|
|
22
|
+
import '@alfalab/hooks';
|
|
23
|
+
import './components/native-select/Component.js';
|
|
24
|
+
import './components/checkmark/Component.js';
|
|
25
|
+
import '@alfalab/core-components-badge/esm';
|
|
26
|
+
import '@alfalab/core-components-checkbox/esm';
|
|
27
|
+
import '@alfalab/icons-glyph/CheckmarkCircleMIcon';
|
|
28
|
+
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
29
|
+
import './components/checkmark-mobile/Component.js';
|
|
30
|
+
import '@alfalab/core-components-scrollbar/esm';
|
|
31
|
+
import './consts.js';
|
|
32
|
+
import 'react-virtual';
|
|
33
|
+
import './components/base-checkmark/Component.js';
|
|
34
|
+
import '@alfalab/core-components-skeleton/esm';
|
|
35
|
+
import './presets/useSelectWithApply/options-list-with-apply/footer/Component.js';
|
|
36
|
+
import '@alfalab/core-components-button/esm/desktop';
|
|
37
|
+
import './presets/useSelectWithApply/options-list-with-apply/header/Component.js';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ElementType, ReactNode } from 'react';
|
|
2
|
+
type StyleColors = {
|
|
3
|
+
default: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
inverted: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type ComponentProps = {
|
|
11
|
+
/**
|
|
12
|
+
* Тип кнопки
|
|
13
|
+
* @default secondary
|
|
14
|
+
*/
|
|
15
|
+
view?: 'accent' | 'primary' | 'secondary' | 'tertiary' | 'outlined' | 'filled' | 'transparent' | 'link' | 'ghost';
|
|
16
|
+
/**
|
|
17
|
+
* Слот слева
|
|
18
|
+
*/
|
|
19
|
+
leftAddons?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Слот справа
|
|
22
|
+
*/
|
|
23
|
+
rightAddons?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Размер компонента
|
|
26
|
+
* @default m
|
|
27
|
+
*/
|
|
28
|
+
size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
29
|
+
/**
|
|
30
|
+
* Растягивает компонент на ширину контейнера
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
block?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Дополнительный класс
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Дополнительный класс для спиннера
|
|
40
|
+
*/
|
|
41
|
+
spinnerClassName?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Выводит ссылку в виде кнопки
|
|
44
|
+
*/
|
|
45
|
+
href?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Позволяет использовать кастомный компонент для кнопки (например Link из роутера)
|
|
48
|
+
*/
|
|
49
|
+
Component?: ElementType;
|
|
50
|
+
/**
|
|
51
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
52
|
+
*/
|
|
53
|
+
dataTestId?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Показать лоадер
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
loading?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Не переносить текст кнопки на новую строку
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
nowrap?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Набор цветов для компонента
|
|
66
|
+
*/
|
|
67
|
+
colors?: 'default' | 'inverted';
|
|
68
|
+
/**
|
|
69
|
+
* Дочерние элементы.
|
|
70
|
+
*/
|
|
71
|
+
children?: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Основные стили компонента.
|
|
74
|
+
*/
|
|
75
|
+
styles: {
|
|
76
|
+
[key: string]: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Стили компонента для default и inverted режима.
|
|
80
|
+
*/
|
|
81
|
+
colorStylesMap: StyleColors;
|
|
82
|
+
};
|
|
83
|
+
type AnchorBaseButtonProps = ComponentProps & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
84
|
+
type NativeBaseButtonProps = ComponentProps & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
85
|
+
type BaseButtonProps = Partial<AnchorBaseButtonProps | NativeBaseButtonProps>;
|
|
86
|
+
type AnchorButtonProps = Omit<BaseButtonProps, 'styles' | 'colorStylesMap'> & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
87
|
+
type NativeButtonProps = Omit<BaseButtonProps, 'styles' | 'colorStylesMap'> & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
88
|
+
type ButtonProps = Partial<AnchorButtonProps | NativeButtonProps> & {
|
|
89
|
+
/**
|
|
90
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
91
|
+
* @default 1024
|
|
92
|
+
*/
|
|
93
|
+
breakpoint?: number;
|
|
94
|
+
};
|
|
95
|
+
export { StyleColors, ComponentProps, AnchorBaseButtonProps, NativeBaseButtonProps, BaseButtonProps, AnchorButtonProps, NativeButtonProps, ButtonProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
3
|
+
type ModalDesktopProps = BaseModalProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Ширина модального окна
|
|
6
|
+
* @default "m"
|
|
7
|
+
*/
|
|
8
|
+
size?: 's' | 'm' | 'l' | 'xl' | 'fullscreen';
|
|
9
|
+
/**
|
|
10
|
+
* Растягивает модальное окно на весь экран
|
|
11
|
+
* @deprecated Используйте размер fullscreen
|
|
12
|
+
*/
|
|
13
|
+
fullscreen?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Фиксирует позицию модального окна после открытия,
|
|
16
|
+
* предотвращая скачки, если контент внутри будет меняться
|
|
17
|
+
*/
|
|
18
|
+
fixedPosition?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Управление наличием закрывающего крестика
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
hasCloser?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type ModalMobileProps = Omit<ModalDesktopProps, 'size' | 'fixedPosition' | 'fullscreen'>;
|
|
26
|
+
type ModalResponsiveProps = ModalDesktopProps & {
|
|
27
|
+
/**
|
|
28
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
29
|
+
* @default 1024
|
|
30
|
+
*/
|
|
31
|
+
breakpoint?: number;
|
|
32
|
+
};
|
|
33
|
+
type View = 'desktop' | 'mobile';
|
|
34
|
+
type TResponsiveModalContext = {
|
|
35
|
+
view: View;
|
|
36
|
+
size: NonNullable<ModalDesktopProps['size']>;
|
|
37
|
+
};
|
|
38
|
+
type ContentProps = {
|
|
39
|
+
/**
|
|
40
|
+
* Контент
|
|
41
|
+
*/
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Дополнительный класс
|
|
45
|
+
*/
|
|
46
|
+
className?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Растягивает контент на всю высоту
|
|
49
|
+
*/
|
|
50
|
+
flex?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export { ModalDesktopProps, ModalMobileProps, ModalResponsiveProps, View, TResponsiveModalContext, ContentProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { OptionShape, OptionsListProps } from "./typings";
|
|
4
|
+
import { FooterProps } from "./presets/useSelectWithApply/options-list-with-apply/footer/Component";
|
|
5
|
+
import { HeaderProps } from "./presets/useSelectWithApply/options-list-with-apply/header/Component";
|
|
6
|
+
declare const OptionsListWithApply: React.ForwardRefExoticComponent<OptionsListProps & {
|
|
7
|
+
showClear?: boolean | undefined;
|
|
8
|
+
onClose?: (() => void) | undefined;
|
|
9
|
+
selectedDraft?: OptionShape[] | undefined;
|
|
10
|
+
OptionsList?: React.FC<OptionsListProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
11
|
+
Footer?: React.FC<FooterProps> | undefined;
|
|
12
|
+
Header?: React.FC<HeaderProps> | undefined;
|
|
13
|
+
headerProps?: HeaderProps | undefined;
|
|
14
|
+
showHeaderWithSelectAll?: boolean | undefined;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { OptionsListWithApply };
|
package/hook-6e94be9c.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var utils = require('./utils.js');
|
|
6
|
+
var components_optionsList_Component = require('./components/options-list/Component.js');
|
|
7
|
+
var consts = require('./consts.js');
|
|
8
|
+
var presets_useSelectWithApply_optionsListWithApply_footer_Component = require('./presets/useSelectWithApply/options-list-with-apply/footer/Component.js');
|
|
9
|
+
var presets_useSelectWithApply_optionsListWithApply_header_Component = require('./presets/useSelectWithApply/options-list-with-apply/header/Component.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
|
|
15
|
+
var OptionsListWithApply = React.forwardRef(function (_a, ref) {
|
|
16
|
+
var toggleMenu = _a.toggleMenu, defaultGetOptionProps = _a.getOptionProps, _b = _a.showClear, showClear = _b === void 0 ? true : _b, showHeaderWithSelectAll = _a.showHeaderWithSelectAll, _c = _a.selectedDraft, selectedDraft = _c === void 0 ? [] : _c, _d = _a.flatOptions, flatOptions = _d === void 0 ? [] : _d, _e = _a.OptionsList, OptionsList = _e === void 0 ? components_optionsList_Component.OptionsList : _e, _f = _a.onApply, onApply = _f === void 0 ? function () { return null; } : _f, _g = _a.onClear, onClear = _g === void 0 ? function () { return null; } : _g, _h = _a.onClose, onClose = _h === void 0 ? function () { return null; } : _h, _j = _a.visibleOptions, visibleOptions = _j === void 0 ? consts.DEFAULT_VISIBLE_OPTIONS : _j, _k = _a.Footer, Footer = _k === void 0 ? presets_useSelectWithApply_optionsListWithApply_footer_Component.Footer : _k, _l = _a.Header, Header = _l === void 0 ? presets_useSelectWithApply_optionsListWithApply_header_Component.Header : _l, headerProps = _a.headerProps, restProps = tslib.__rest(_a, ["toggleMenu", "getOptionProps", "showClear", "showHeaderWithSelectAll", "selectedDraft", "flatOptions", "OptionsList", "onApply", "onClear", "onClose", "visibleOptions", "Footer", "Header", "headerProps"]);
|
|
17
|
+
var getOptionProps = React.useCallback(function (option, index) {
|
|
18
|
+
var optionProps = defaultGetOptionProps(option, index);
|
|
19
|
+
var selected = option.key === SELECT_ALL_KEY
|
|
20
|
+
? selectedDraft.length === flatOptions.length - 1
|
|
21
|
+
: selectedDraft.includes(option);
|
|
22
|
+
return tslib.__assign(tslib.__assign({}, optionProps), { selected: selected });
|
|
23
|
+
}, [defaultGetOptionProps, flatOptions.length, selectedDraft]);
|
|
24
|
+
var handleApply = React.useCallback(function () {
|
|
25
|
+
onApply();
|
|
26
|
+
toggleMenu();
|
|
27
|
+
}, [onApply, toggleMenu]);
|
|
28
|
+
var handleClear = React.useCallback(function () {
|
|
29
|
+
onClear();
|
|
30
|
+
toggleMenu();
|
|
31
|
+
}, [onClear, toggleMenu]);
|
|
32
|
+
React.useEffect(function () {
|
|
33
|
+
var activeElement = document.activeElement;
|
|
34
|
+
return function () {
|
|
35
|
+
onClose();
|
|
36
|
+
if (activeElement) {
|
|
37
|
+
activeElement.focus();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
}, []);
|
|
42
|
+
return (React__default.default.createElement(OptionsList, tslib.__assign({}, restProps, { ref: ref, visibleOptions: visibleOptions, toggleMenu: toggleMenu, flatOptions: flatOptions, getOptionProps: getOptionProps, onApply: handleApply, onClear: handleClear, header: showHeaderWithSelectAll ? React__default.default.createElement(Header, tslib.__assign({}, headerProps)) : undefined, footer: React__default.default.createElement(Footer, { handleApply: handleApply, handleClear: handleClear, showClear: showClear, selectedDraft: selectedDraft }) })));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
var SELECT_ALL_KEY = 'select_all';
|
|
46
|
+
var selectAllOption = { key: SELECT_ALL_KEY, content: 'Выбрать все' };
|
|
47
|
+
function useSelectWithApply(_a) {
|
|
48
|
+
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;
|
|
49
|
+
var _g = React.useMemo(function () { return utils.processOptions(options, selected); }, [options, selected]), flatOptions = _g.flatOptions, selectedOptions = _g.selectedOptions;
|
|
50
|
+
var _h = React.useState(selectedOptions), selectedDraft = _h[0], setSelectedDraft = _h[1];
|
|
51
|
+
var selectedOptionsRef = React.useRef(selectedOptions);
|
|
52
|
+
var handleApply = function () {
|
|
53
|
+
onChange({
|
|
54
|
+
selected: selectedDraft[0],
|
|
55
|
+
selectedMultiple: selectedDraft,
|
|
56
|
+
initiator: null,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
var handleClear = function () {
|
|
60
|
+
setSelectedDraft([]);
|
|
61
|
+
onChange({
|
|
62
|
+
selected: null,
|
|
63
|
+
selectedMultiple: [],
|
|
64
|
+
initiator: null,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
var handleToggleAll = function () {
|
|
68
|
+
setSelectedDraft(flatOptions.length === selectedDraft.length ? [] : flatOptions);
|
|
69
|
+
};
|
|
70
|
+
var handleChange = function (_a) {
|
|
71
|
+
var initiator = _a.initiator, restArgs = tslib.__rest(_a, ["initiator"]);
|
|
72
|
+
if (!initiator) {
|
|
73
|
+
onChange(tslib.__assign({ initiator: null }, restArgs));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
var initiatorSelected = selectedDraft.includes(initiator) ||
|
|
77
|
+
(initiator.key === SELECT_ALL_KEY && selectedDraft.length === flatOptions.length);
|
|
78
|
+
if (initiator.key === SELECT_ALL_KEY) {
|
|
79
|
+
setSelectedDraft(initiatorSelected ? [] : flatOptions);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
setSelectedDraft(initiatorSelected
|
|
83
|
+
? selectedDraft.filter(function (o) { return o !== initiator; })
|
|
84
|
+
: selectedDraft.concat(initiator));
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var handleClose = function () { return setSelectedDraft(selectedOptionsRef.current); };
|
|
88
|
+
React.useEffect(function () {
|
|
89
|
+
setSelectedDraft(selectedOptions);
|
|
90
|
+
selectedOptionsRef.current = selectedOptions;
|
|
91
|
+
}, [selectedOptions]);
|
|
92
|
+
var memoizedOptions = React.useMemo(function () { return (showSelectAll ? tslib.__spreadArray([selectAllOption], options, true) : options); }, [options, showSelectAll]);
|
|
93
|
+
return {
|
|
94
|
+
OptionsList: OptionsListWithApply,
|
|
95
|
+
optionsListProps: tslib.__assign(tslib.__assign({}, optionsListProps), { OptionsList: OptionsList, showClear: showClear, onClear: handleClear, onApply: handleApply, onClose: handleClose, selectedDraft: selectedDraft, showHeaderWithSelectAll: showHeaderWithSelectAll, headerProps: {
|
|
96
|
+
indeterminate: !!selectedDraft.length && selectedDraft.length < flatOptions.length,
|
|
97
|
+
checked: selectedDraft.length === flatOptions.length,
|
|
98
|
+
onChange: handleToggleAll,
|
|
99
|
+
} }),
|
|
100
|
+
allowUnselect: true,
|
|
101
|
+
multiple: true,
|
|
102
|
+
options: memoizedOptions,
|
|
103
|
+
onChange: handleChange,
|
|
104
|
+
selected: selected,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
exports.OptionsListWithApply = OptionsListWithApply;
|
|
109
|
+
exports.SELECT_ALL_KEY = SELECT_ALL_KEY;
|
|
110
|
+
exports.useSelectWithApply = useSelectWithApply;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseSelectProps, OptionShape } from "./
|
|
2
|
+
import { BaseSelectProps, OptionShape } from "./typings";
|
|
3
3
|
type UseSelectWithApplyProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Список выбранных пунктов
|
|
@@ -36,18 +36,20 @@ type UseSelectWithApplyProps = {
|
|
|
36
36
|
};
|
|
37
37
|
declare const SELECT_ALL_KEY = "select_all";
|
|
38
38
|
declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, showHeaderWithSelectAll, }: UseSelectWithApplyProps): {
|
|
39
|
-
OptionsList: import("react").ForwardRefExoticComponent<import("./
|
|
39
|
+
OptionsList: import("react").ForwardRefExoticComponent<import("./typings").OptionsListProps & {
|
|
40
40
|
showClear?: boolean | undefined;
|
|
41
41
|
onClose?: (() => void) | undefined;
|
|
42
42
|
selectedDraft?: OptionShape[] | undefined;
|
|
43
|
-
OptionsList?: import("react").FC<import("./
|
|
43
|
+
OptionsList?: import("react").FC<import("./typings").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
44
44
|
Footer?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/footer/Component").FooterProps> | undefined;
|
|
45
45
|
Header?: import("react").FC<import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps> | undefined;
|
|
46
|
-
headerProps?: import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps | undefined;
|
|
46
|
+
headerProps?: import("./presets/useSelectWithApply/options-list-with-apply/header/Component").HeaderProps | undefined; /**
|
|
47
|
+
* Показывать кнопку очистки
|
|
48
|
+
*/
|
|
47
49
|
showHeaderWithSelectAll?: boolean | undefined;
|
|
48
50
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
51
|
optionsListProps: {
|
|
50
|
-
OptionsList: import("react").FC<import("./
|
|
52
|
+
OptionsList: import("react").FC<import("./typings").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
51
53
|
showClear: boolean;
|
|
52
54
|
onClear: () => void;
|
|
53
55
|
onApply: () => void;
|
|
@@ -62,11 +64,11 @@ declare function useSelectWithApply({ options, selected, onChange, OptionsList,
|
|
|
62
64
|
};
|
|
63
65
|
allowUnselect: boolean;
|
|
64
66
|
multiple: boolean;
|
|
65
|
-
options: (OptionShape | import("./
|
|
67
|
+
options: (OptionShape | import("./typings").GroupShape | {
|
|
66
68
|
key: string;
|
|
67
69
|
content: string;
|
|
68
70
|
})[];
|
|
69
|
-
onChange: (payload: import("./
|
|
71
|
+
onChange: (payload: import("./typings").BaseSelectChangePayload) => void;
|
|
70
72
|
selected: string | OptionShape | (string | OptionShape)[] | null | undefined;
|
|
71
73
|
};
|
|
72
74
|
export { UseSelectWithApplyProps, SELECT_ALL_KEY, useSelectWithApply };
|