@alfalab/core-components-picker-button 10.3.29 → 11.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-5e1b8383.d.ts +72 -0
- package/Component-63dec22f.d.ts +167 -0
- package/Component-89a3cf4c.d.ts +6 -0
- package/Component-bdb4c6b9.d.ts +12 -0
- package/Component-e81c389f.d.ts +5 -0
- package/Component-ebda875c.d.ts +12 -0
- package/Component.desktop-785df74d.d.ts +6 -0
- package/{Component.d.ts → Component.desktop.d.ts} +4 -5
- package/Component.desktop.js +47 -0
- package/Component.mobile-06ffd24b.d.ts +41 -0
- package/Component.mobile-d7e9f69d.d.ts +6 -0
- package/Component.mobile-ebda875c.d.ts +6 -0
- package/Component.mobile-f1f15074.d.ts +34 -0
- package/Component.mobile.d.ts +16 -4
- package/Component.mobile.js +6 -4
- package/Component.modal.mobile-5e1b8383.d.ts +60 -0
- package/Component.responsive-3109f463.d.ts +26 -0
- package/Component.responsive.d.ts +6 -6
- package/Component.responsive.js +4 -3
- package/Context-bdb4c6b9.d.ts +4 -0
- package/ResponsiveContext-baf4875b.d.ts +5 -0
- package/component-89a3cf4c.d.ts +44 -0
- package/consts-f777ba1a.d.ts +2 -0
- package/cssm/Component-5e1b8383.d.ts +72 -0
- package/cssm/Component-63dec22f.d.ts +167 -0
- package/cssm/Component-89a3cf4c.d.ts +6 -0
- package/cssm/Component-bdb4c6b9.d.ts +12 -0
- package/cssm/Component-e81c389f.d.ts +5 -0
- package/cssm/Component-ebda875c.d.ts +12 -0
- package/cssm/Component.desktop-785df74d.d.ts +6 -0
- package/{modern/Component.d.ts → cssm/Component.desktop.d.ts} +4 -5
- package/cssm/{Component.js → Component.desktop.js} +5 -4
- package/cssm/Component.mobile-06ffd24b.d.ts +41 -0
- package/cssm/Component.mobile-d7e9f69d.d.ts +6 -0
- package/cssm/Component.mobile-ebda875c.d.ts +6 -0
- package/cssm/Component.mobile-f1f15074.d.ts +34 -0
- package/cssm/Component.mobile.d.ts +16 -4
- package/cssm/Component.mobile.js +6 -4
- package/cssm/Component.modal.mobile-5e1b8383.d.ts +60 -0
- package/cssm/Component.responsive-3109f463.d.ts +26 -0
- package/cssm/Component.responsive.d.ts +6 -6
- package/cssm/Component.responsive.js +4 -3
- package/cssm/Context-bdb4c6b9.d.ts +4 -0
- package/cssm/ResponsiveContext-baf4875b.d.ts +5 -0
- package/cssm/component-89a3cf4c.d.ts +44 -0
- package/cssm/consts-f777ba1a.d.ts +2 -0
- package/cssm/desktop-63dec22f.d.ts +6 -0
- package/cssm/desktop.d.ts +2 -1
- package/cssm/desktop.js +3 -3
- package/cssm/field/Component.d.ts +3 -2
- package/cssm/hook-9ea9e32c.d.ts +75 -0
- package/cssm/index-136acbb1.d.ts +28 -0
- package/cssm/index-3109f463.d.ts +62 -0
- package/cssm/index-425c8522.d.ts +6 -0
- package/cssm/index-89a3cf4c.d.ts +3 -0
- package/cssm/index-bdb4c6b9.d.ts +2 -0
- package/cssm/index-c44170fe.d.ts +160 -0
- package/cssm/index-e81c389f.d.ts +3 -0
- package/cssm/index-ebda875c.d.ts +81 -0
- package/cssm/index-f12ee135.d.ts +3 -0
- package/cssm/index.d.ts +2 -4
- package/cssm/index.js +8 -8
- package/cssm/mobile-96988a65.d.ts +2 -0
- package/cssm/mobile.d.ts +1 -1
- package/cssm/mobile.js +2 -1
- package/cssm/option/Component.d.ts +5 -4
- package/cssm/option/Component.js +2 -2
- package/cssm/option/index.js +1 -1
- package/cssm/shared-4cd3936b.d.ts +93 -0
- package/cssm/shared.d.ts +2 -0
- package/cssm/shared.js +13 -0
- package/cssm/types-425c8522.d.ts +259 -0
- package/cssm/types-ebda875c.d.ts +113 -0
- package/cssm/types.d.ts +3 -0
- package/cssm/types.js +2 -0
- package/cssm/typings-5e1b8383.d.ts +4 -459
- package/cssm/typings-9211a437.d.ts +95 -0
- package/cssm/typings-bdb4c6b9.d.ts +52 -0
- package/cssm/utils/index.d.ts +1 -1
- package/cssm/utils-1574ad8b.d.ts +29 -0
- package/cssm/utils-49cc3c24.d.ts +8 -0
- package/cssm/utils-5e1b8383.d.ts +38 -0
- package/desktop-63dec22f.d.ts +6 -0
- package/desktop.d.ts +2 -1
- package/desktop.js +3 -3
- package/esm/Component-5e1b8383.d.ts +72 -0
- package/esm/Component-63dec22f.d.ts +167 -0
- package/esm/Component-89a3cf4c.d.ts +6 -0
- package/esm/Component-bdb4c6b9.d.ts +12 -0
- package/esm/Component-e81c389f.d.ts +5 -0
- package/esm/Component-ebda875c.d.ts +12 -0
- package/esm/Component.desktop-785df74d.d.ts +6 -0
- package/{cssm/Component.d.ts → esm/Component.desktop.d.ts} +4 -5
- package/esm/{Component.js → Component.desktop.js} +5 -4
- package/esm/Component.mobile-06ffd24b.d.ts +41 -0
- package/esm/Component.mobile-d7e9f69d.d.ts +6 -0
- package/esm/Component.mobile-ebda875c.d.ts +6 -0
- package/esm/Component.mobile-f1f15074.d.ts +34 -0
- package/esm/Component.mobile.d.ts +16 -4
- package/esm/Component.mobile.js +6 -4
- package/esm/Component.modal.mobile-5e1b8383.d.ts +60 -0
- package/esm/Component.responsive-3109f463.d.ts +26 -0
- package/esm/Component.responsive.d.ts +6 -6
- package/esm/Component.responsive.js +4 -3
- package/esm/Context-bdb4c6b9.d.ts +4 -0
- package/esm/ResponsiveContext-baf4875b.d.ts +5 -0
- package/esm/component-89a3cf4c.d.ts +44 -0
- package/esm/consts-f777ba1a.d.ts +2 -0
- package/esm/desktop-63dec22f.d.ts +6 -0
- package/esm/desktop.d.ts +2 -1
- package/esm/desktop.js +2 -2
- package/esm/field/Component.d.ts +3 -2
- package/esm/field/Component.js +1 -1
- package/esm/field/index.css +5 -5
- package/esm/hook-9ea9e32c.d.ts +75 -0
- package/esm/index-136acbb1.d.ts +28 -0
- package/esm/index-3109f463.d.ts +62 -0
- package/esm/index-425c8522.d.ts +6 -0
- package/esm/index-89a3cf4c.d.ts +3 -0
- package/esm/index-bdb4c6b9.d.ts +2 -0
- package/esm/index-c44170fe.d.ts +160 -0
- package/esm/index-e81c389f.d.ts +3 -0
- package/esm/index-ebda875c.d.ts +81 -0
- package/esm/index-f12ee135.d.ts +3 -0
- package/esm/index.css +5 -5
- package/esm/index.d.ts +2 -4
- package/esm/index.js +6 -5
- package/esm/mobile-96988a65.d.ts +2 -0
- package/esm/mobile.d.ts +1 -1
- package/esm/mobile.js +2 -1
- package/esm/option/Component.d.ts +5 -4
- package/esm/option/Component.js +2 -2
- package/esm/option/index.css +4 -4
- package/esm/option/index.js +1 -1
- package/esm/shared-4cd3936b.d.ts +93 -0
- package/esm/shared.d.ts +2 -0
- package/esm/shared.js +5 -0
- package/esm/types-425c8522.d.ts +259 -0
- package/esm/types-ebda875c.d.ts +113 -0
- package/esm/types.d.ts +3 -0
- package/esm/types.js +1 -0
- package/esm/typings-5e1b8383.d.ts +4 -459
- package/esm/typings-9211a437.d.ts +95 -0
- package/esm/typings-bdb4c6b9.d.ts +52 -0
- package/esm/utils/index.d.ts +1 -1
- package/esm/utils-1574ad8b.d.ts +29 -0
- package/esm/utils-49cc3c24.d.ts +8 -0
- package/esm/utils-5e1b8383.d.ts +38 -0
- package/field/Component.d.ts +3 -2
- package/field/Component.js +1 -1
- package/field/index.css +5 -5
- package/hook-9ea9e32c.d.ts +75 -0
- package/index-136acbb1.d.ts +28 -0
- package/index-3109f463.d.ts +62 -0
- package/index-425c8522.d.ts +6 -0
- package/index-89a3cf4c.d.ts +3 -0
- package/index-bdb4c6b9.d.ts +2 -0
- package/index-c44170fe.d.ts +160 -0
- package/index-e81c389f.d.ts +3 -0
- package/index-ebda875c.d.ts +81 -0
- package/index-f12ee135.d.ts +3 -0
- package/index.css +5 -5
- package/index.d.ts +2 -4
- package/index.js +6 -6
- package/mobile-96988a65.d.ts +2 -0
- package/mobile.d.ts +1 -1
- package/mobile.js +2 -1
- package/modern/Component-5e1b8383.d.ts +72 -0
- package/modern/Component-63dec22f.d.ts +167 -0
- package/modern/Component-89a3cf4c.d.ts +6 -0
- package/modern/Component-bdb4c6b9.d.ts +12 -0
- package/modern/Component-e81c389f.d.ts +5 -0
- package/modern/Component-ebda875c.d.ts +12 -0
- package/modern/Component.desktop-785df74d.d.ts +6 -0
- package/{esm/Component.d.ts → modern/Component.desktop.d.ts} +4 -5
- package/modern/{Component.js → Component.desktop.js} +5 -4
- package/modern/Component.mobile-06ffd24b.d.ts +41 -0
- package/modern/Component.mobile-d7e9f69d.d.ts +6 -0
- package/modern/Component.mobile-ebda875c.d.ts +6 -0
- package/modern/Component.mobile-f1f15074.d.ts +34 -0
- package/modern/Component.mobile.d.ts +16 -4
- package/modern/Component.mobile.js +6 -4
- package/modern/Component.modal.mobile-5e1b8383.d.ts +60 -0
- package/modern/Component.responsive-3109f463.d.ts +26 -0
- package/modern/Component.responsive.d.ts +6 -6
- package/modern/Component.responsive.js +4 -3
- package/modern/Context-bdb4c6b9.d.ts +4 -0
- package/modern/ResponsiveContext-baf4875b.d.ts +5 -0
- package/modern/component-89a3cf4c.d.ts +44 -0
- package/modern/consts-f777ba1a.d.ts +2 -0
- package/modern/desktop-63dec22f.d.ts +6 -0
- package/modern/desktop.d.ts +2 -1
- package/modern/desktop.js +2 -2
- package/modern/field/Component.d.ts +3 -2
- package/modern/field/Component.js +1 -1
- package/modern/field/index.css +5 -5
- package/modern/hook-9ea9e32c.d.ts +75 -0
- package/modern/index-136acbb1.d.ts +28 -0
- package/modern/index-3109f463.d.ts +62 -0
- package/modern/index-425c8522.d.ts +6 -0
- package/modern/index-89a3cf4c.d.ts +3 -0
- package/modern/index-bdb4c6b9.d.ts +2 -0
- package/modern/index-c44170fe.d.ts +160 -0
- package/modern/index-e81c389f.d.ts +3 -0
- package/modern/index-ebda875c.d.ts +81 -0
- package/modern/index-f12ee135.d.ts +3 -0
- package/modern/index.css +5 -5
- package/modern/index.d.ts +2 -4
- package/modern/index.js +6 -5
- package/modern/mobile-96988a65.d.ts +2 -0
- package/modern/mobile.d.ts +1 -1
- package/modern/mobile.js +2 -1
- package/modern/option/Component.d.ts +5 -4
- package/modern/option/Component.js +2 -2
- package/modern/option/index.css +4 -4
- package/modern/option/index.js +1 -1
- package/modern/shared-4cd3936b.d.ts +93 -0
- package/modern/shared.d.ts +2 -0
- package/modern/shared.js +5 -0
- package/modern/types-425c8522.d.ts +259 -0
- package/modern/types-ebda875c.d.ts +113 -0
- package/modern/types.d.ts +3 -0
- package/modern/types.js +1 -0
- package/modern/typings-5e1b8383.d.ts +4 -459
- package/modern/typings-9211a437.d.ts +95 -0
- package/modern/typings-bdb4c6b9.d.ts +52 -0
- package/modern/utils/index.d.ts +1 -1
- package/modern/utils-1574ad8b.d.ts +29 -0
- package/modern/utils-49cc3c24.d.ts +8 -0
- package/modern/utils-5e1b8383.d.ts +38 -0
- package/option/Component.d.ts +5 -4
- package/option/Component.js +3 -3
- package/option/index.css +4 -4
- package/option/index.js +1 -1
- package/package.json +27 -3
- package/shared-4cd3936b.d.ts +93 -0
- package/shared.d.ts +2 -0
- package/shared.js +13 -0
- package/src/Component.desktop.tsx +122 -0
- package/src/Component.mobile.tsx +83 -0
- package/src/Component.responsive.tsx +61 -0
- package/src/desktop.ts +1 -0
- package/src/field/Component.tsx +86 -0
- package/src/field/index.module.css +18 -0
- package/src/field/index.ts +1 -0
- package/src/index.module.css +22 -0
- package/src/index.ts +4 -0
- package/src/mobile.ts +1 -0
- package/src/option/Component.tsx +30 -0
- package/src/option/index.module.css +17 -0
- package/src/option/index.ts +1 -0
- package/src/shared.ts +2 -0
- package/src/types.ts +3 -0
- package/src/utils/index.ts +19 -0
- package/types-425c8522.d.ts +259 -0
- package/types-ebda875c.d.ts +113 -0
- package/types.d.ts +3 -0
- package/types.js +2 -0
- package/typings-5e1b8383.d.ts +4 -459
- package/typings-9211a437.d.ts +95 -0
- package/typings-bdb4c6b9.d.ts +52 -0
- package/utils/index.d.ts +1 -1
- package/utils-1574ad8b.d.ts +29 -0
- package/utils-49cc3c24.d.ts +8 -0
- package/utils-5e1b8383.d.ts +38 -0
- package/Component.js +0 -46
- package/cssm/responsive.d.ts +0 -2
- package/cssm/responsive.js +0 -27
- package/esm/responsive.d.ts +0 -2
- package/esm/responsive.js +0 -16
- package/modern/responsive.d.ts +0 -2
- package/modern/responsive.js +0 -15
- package/responsive.d.ts +0 -2
- package/responsive.js +0 -24
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { BaseSelectProps, GroupShape, OptionShape } from "./typings-5e1b8383";
|
|
3
|
+
declare const isGroup: (item: OptionShape | GroupShape) => item is GroupShape;
|
|
4
|
+
declare const isOptionShape: (item: OptionShape | string | null) => item is OptionShape;
|
|
5
|
+
declare const joinOptions: ({ selected, selectedMultiple, }: {
|
|
6
|
+
selected?: OptionShape | undefined;
|
|
7
|
+
selectedMultiple?: OptionShape[] | undefined;
|
|
8
|
+
}) => ReactNode[] | null;
|
|
9
|
+
declare function processOptions(options: BaseSelectProps['options'], selected?: BaseSelectProps['selected']): {
|
|
10
|
+
flatOptions: OptionShape[];
|
|
11
|
+
selectedOptions: OptionShape[];
|
|
12
|
+
};
|
|
13
|
+
type useVisibleOptionsArgs = {
|
|
14
|
+
/**
|
|
15
|
+
* Количество видимых пунктов
|
|
16
|
+
*/
|
|
17
|
+
visibleOptions: number;
|
|
18
|
+
/**
|
|
19
|
+
* Реф на контейнер с пунтами меню
|
|
20
|
+
*/
|
|
21
|
+
listRef: RefObject<HTMLElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Реф на контейнер, которому нужно установить высоту
|
|
24
|
+
*/
|
|
25
|
+
styleTargetRef?: RefObject<HTMLElement>;
|
|
26
|
+
/**
|
|
27
|
+
* Флаг открытия меню
|
|
28
|
+
*/
|
|
29
|
+
open?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Позволяет вызвать пересчет высоты
|
|
32
|
+
*/
|
|
33
|
+
invalidate?: unknown;
|
|
34
|
+
};
|
|
35
|
+
declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, }: useVisibleOptionsArgs): void;
|
|
36
|
+
declare function usePrevious<T>(value: T): T | undefined;
|
|
37
|
+
declare const lastIndexOf: <T>(array: T[], predicate: (item: T) => boolean) => number;
|
|
38
|
+
export { isGroup, isOptionShape, joinOptions, processOptions, useVisibleOptions, usePrevious, lastIndexOf };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AnchorButtonProps, NativeButtonProps } from "./typings-9211a437";
|
|
4
|
+
type ButtonDesktopProps = Partial<AnchorButtonProps | NativeButtonProps>;
|
|
5
|
+
declare const ButtonDesktop: React.ForwardRefExoticComponent<ButtonDesktopProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
6
|
+
export { ButtonDesktopProps, ButtonDesktop };
|
package/desktop.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { PickerButtonDesktop, PickerButtonDesktopProps } from "./Component.desktop";
|
|
2
|
+
export {};
|
package/desktop.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var Component_desktop = require('./Component.desktop.js');
|
|
6
6
|
require('tslib');
|
|
7
7
|
require('react');
|
|
8
8
|
require('classnames');
|
|
9
|
-
require('@alfalab/core-components-select');
|
|
9
|
+
require('@alfalab/core-components-select/shared');
|
|
10
10
|
require('./field/Component.js');
|
|
11
11
|
require('@alfalab/core-components-button');
|
|
12
12
|
require('./utils/index.js');
|
|
@@ -18,4 +18,4 @@ require('./option/Component.js');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
exports.PickerButtonDesktop =
|
|
21
|
+
exports.PickerButtonDesktop = Component_desktop.PickerButtonDesktop;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { BottomSheetProps } from "./index-f12ee135";
|
|
5
|
+
import { BaseSelectProps } from "./typings-5e1b8383";
|
|
6
|
+
type SelectMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Футер
|
|
9
|
+
* @deprecated Используйте bottomSheetProps.actionButton
|
|
10
|
+
*/
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Будет ли свайпаться шторка
|
|
14
|
+
* @deprecated Используйте bottomSheetProps.swipeable
|
|
15
|
+
*/
|
|
16
|
+
swipeable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Отображать в BottomSheet
|
|
19
|
+
*/
|
|
20
|
+
isBottomSheet?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Дополнительные пропсы шторки
|
|
23
|
+
*/
|
|
24
|
+
bottomSheetProps?: Partial<BottomSheetProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Дополнительные пропсы модалки
|
|
27
|
+
*/
|
|
28
|
+
modalProps?: Partial<React.ComponentProps<typeof ModalMobile>>;
|
|
29
|
+
/**
|
|
30
|
+
* Дополнительные пропсы шапки модалки
|
|
31
|
+
*/
|
|
32
|
+
modalHeaderProps?: Partial<React.ComponentProps<typeof ModalMobile.Header>>;
|
|
33
|
+
/**
|
|
34
|
+
* Дополнительные пропсы футера модалки
|
|
35
|
+
*/
|
|
36
|
+
modalFooterProps?: Partial<React.ComponentProps<typeof ModalMobile.Footer>>;
|
|
37
|
+
};
|
|
38
|
+
declare const BaseSelectMobile: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "onScroll" | "Checkmark"> & {
|
|
39
|
+
/**
|
|
40
|
+
* Футер
|
|
41
|
+
* @deprecated Используйте bottomSheetProps.actionButton
|
|
42
|
+
*/
|
|
43
|
+
footer?: ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Будет ли свайпаться шторка
|
|
46
|
+
* @deprecated Используйте bottomSheetProps.swipeable
|
|
47
|
+
*/
|
|
48
|
+
swipeable?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Отображать в BottomSheet
|
|
51
|
+
*/
|
|
52
|
+
isBottomSheet?: boolean | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Дополнительные пропсы шторки
|
|
55
|
+
*/
|
|
56
|
+
bottomSheetProps?: Partial<BottomSheetProps> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Дополнительные пропсы модалки
|
|
59
|
+
*/
|
|
60
|
+
modalProps?: Partial<ModalMobileProps & React.RefAttributes<HTMLDivElement>> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Дополнительные пропсы шапки модалки
|
|
63
|
+
*/
|
|
64
|
+
modalHeaderProps?: Partial<import("./Component-e81c389f").HeaderProps> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Дополнительные пропсы футера модалки
|
|
67
|
+
*/
|
|
68
|
+
modalFooterProps?: Partial<import("./Component.mobile-f1f15074").FooterProps> | undefined;
|
|
69
|
+
} & React.RefAttributes<unknown>>;
|
|
70
|
+
export * from "./Component.mobile-f1f15074";
|
|
71
|
+
export { ModalMobileProps } from "./typings-bdb4c6b9";
|
|
72
|
+
export { SelectMobileProps, BaseSelectMobile };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ForwardRefExoticComponent, RefAttributes, HTMLAttributes } from "react";
|
|
4
|
+
declare const colors: readonly [
|
|
5
|
+
"tertiary",
|
|
6
|
+
"disabled",
|
|
7
|
+
"accent",
|
|
8
|
+
"primary",
|
|
9
|
+
"attention",
|
|
10
|
+
"positive",
|
|
11
|
+
"secondary",
|
|
12
|
+
"tertiary-inverted",
|
|
13
|
+
"primary-inverted",
|
|
14
|
+
"secondary-inverted",
|
|
15
|
+
"link",
|
|
16
|
+
"negative",
|
|
17
|
+
"static-primary-light",
|
|
18
|
+
"static-secondary-light",
|
|
19
|
+
"static-tertiary-light",
|
|
20
|
+
"static-primary-dark",
|
|
21
|
+
"static-secondary-dark",
|
|
22
|
+
"static-tertiary-dark",
|
|
23
|
+
"static-accent"
|
|
24
|
+
];
|
|
25
|
+
type Color = (typeof colors)[number];
|
|
26
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
27
|
+
type NativeProps = HTMLAttributes<HTMLSpanElement>;
|
|
28
|
+
type TextBaseProps = {
|
|
29
|
+
/**
|
|
30
|
+
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/tokens-assets-типографика--docs)
|
|
31
|
+
*/
|
|
32
|
+
view?: "primary-large" | "primary-medium" | "primary-small" | "secondary-large" | "secondary-medium" | "secondary-small" | "component" | "caps";
|
|
33
|
+
/**
|
|
34
|
+
* Цвет текста
|
|
35
|
+
*/
|
|
36
|
+
color?: Color;
|
|
37
|
+
/**
|
|
38
|
+
* Толщина шрифта
|
|
39
|
+
*/
|
|
40
|
+
weight?: "regular" | "medium" | "bold";
|
|
41
|
+
/**
|
|
42
|
+
* Делает цифры моноширинными
|
|
43
|
+
*/
|
|
44
|
+
monospaceNumbers?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* HTML тег
|
|
47
|
+
*/
|
|
48
|
+
tag?: "span" | "div";
|
|
49
|
+
/**
|
|
50
|
+
* Css-класс для стилизации (native prop)
|
|
51
|
+
*/
|
|
52
|
+
className?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Id компонента для тестов
|
|
55
|
+
*/
|
|
56
|
+
dataTestId?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Контент (native prop)
|
|
59
|
+
*/
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Добавляет отступы к тэгу 'p'
|
|
63
|
+
*/
|
|
64
|
+
defaultMargins?: never;
|
|
65
|
+
/**
|
|
66
|
+
* Количество строк (не поддерживает IE)
|
|
67
|
+
*/
|
|
68
|
+
rowLimit?: 1 | 2 | 3;
|
|
69
|
+
};
|
|
70
|
+
type TextPTagProps = Omit<TextBaseProps, "tag" | "defaultMargins"> & {
|
|
71
|
+
tag?: "p";
|
|
72
|
+
defaultMargins?: boolean;
|
|
73
|
+
};
|
|
74
|
+
type TextProps = Omit<NativeProps, "color"> & (TextBaseProps | TextPTagProps);
|
|
75
|
+
type NativeProps$0 = HTMLAttributes<HTMLHeadingElement>;
|
|
76
|
+
type TitleProps = Omit<NativeProps$0, "color"> & {
|
|
77
|
+
/**
|
|
78
|
+
* HTML тег
|
|
79
|
+
*/
|
|
80
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
81
|
+
/**
|
|
82
|
+
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
|
|
83
|
+
*/
|
|
84
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
85
|
+
/**
|
|
86
|
+
* Цвет текста
|
|
87
|
+
*/
|
|
88
|
+
color?: Color;
|
|
89
|
+
/**
|
|
90
|
+
* Толщина шрифта
|
|
91
|
+
*/
|
|
92
|
+
weight?: "regular" | "medium" | "bold";
|
|
93
|
+
/**
|
|
94
|
+
* Шрифт текста
|
|
95
|
+
*/
|
|
96
|
+
font?: "styrene" | "system";
|
|
97
|
+
/**
|
|
98
|
+
* Добавляет отступы
|
|
99
|
+
*/
|
|
100
|
+
defaultMargins?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Css-класс для стилизации (native prop)
|
|
103
|
+
*/
|
|
104
|
+
className?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Id компонента для тестов
|
|
107
|
+
*/
|
|
108
|
+
dataTestId?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Контент (native prop)
|
|
111
|
+
*/
|
|
112
|
+
children?: React.ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* Количество строк (не поддерживает IE)
|
|
115
|
+
*/
|
|
116
|
+
rowLimit?: 1 | 2 | 3;
|
|
117
|
+
};
|
|
118
|
+
type TitleMobileProps = Omit<TitleProps, "defaultMargins">;
|
|
119
|
+
declare const Typography: {
|
|
120
|
+
Title: FC<TitleProps>;
|
|
121
|
+
Text: ForwardRefExoticComponent<TextProps & RefAttributes<TextElementType>>;
|
|
122
|
+
TitleResponsive: FC<TitleProps>;
|
|
123
|
+
TitleMobile: FC<TitleMobileProps>;
|
|
124
|
+
};
|
|
125
|
+
declare const typographyPresets: {
|
|
126
|
+
mobile: {
|
|
127
|
+
list: {
|
|
128
|
+
text: {
|
|
129
|
+
primary: {
|
|
130
|
+
tag: string;
|
|
131
|
+
view: string;
|
|
132
|
+
};
|
|
133
|
+
secondary: {
|
|
134
|
+
tag: string;
|
|
135
|
+
color: string;
|
|
136
|
+
view: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
declare const TitleResponsive: FC<TitleProps>;
|
|
143
|
+
interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
144
|
+
/**
|
|
145
|
+
* Текст после иконки
|
|
146
|
+
*/
|
|
147
|
+
text?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Дополнительный класс
|
|
150
|
+
*/
|
|
151
|
+
className?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Вид компонента
|
|
154
|
+
*/
|
|
155
|
+
view: 'mobile' | 'desktop';
|
|
156
|
+
/**
|
|
157
|
+
* Прозрачность текста
|
|
158
|
+
*/
|
|
159
|
+
textOpacity?: number;
|
|
160
|
+
/**
|
|
161
|
+
* Обработчик клика
|
|
162
|
+
*/
|
|
163
|
+
onClick?: () => void;
|
|
164
|
+
}
|
|
165
|
+
declare const BackArrowAddon: React.FC<BackArrowAddonProps>;
|
|
166
|
+
export { Typography, typographyPresets, TitleResponsive, BackArrowAddonProps, BackArrowAddon };
|
|
167
|
+
export type { TitleProps, TextProps, Color };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NavigationBarProps } from "./types-ebda875c";
|
|
4
|
+
declare const NavigationBar: React.ForwardRefExoticComponent<NavigationBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export * from "./Component-63dec22f";
|
|
6
|
+
export { NavigationBar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View } from "./typings-bdb4c6b9";
|
|
4
|
+
declare const Modal: React.ForwardRefExoticComponent<import("./index-bdb4c6b9").BaseModalProps & {
|
|
5
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen" | undefined;
|
|
6
|
+
fullscreen?: boolean | undefined;
|
|
7
|
+
fixedPosition?: boolean | undefined;
|
|
8
|
+
hasCloser?: boolean | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
view: View;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { Modal };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react-transition-group" />
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { CheckboxProps } from "./index-ebda875c";
|
|
5
|
+
type HeaderProps = {
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
onChange?: CheckboxProps['onChange'];
|
|
9
|
+
mobile?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const Header: React.FC<HeaderProps>;
|
|
12
|
+
export { HeaderProps, Header };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlDesktopProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
|
|
5
|
+
declare const FormControlDesktop: React.ForwardRefExoticComponent<FormControlDesktopProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FormControlDesktopProps, FormControlDesktop };
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FC, SVGProps } from "react";
|
|
4
4
|
import { ButtonProps } from "@alfalab/core-components-button";
|
|
5
|
-
import { BaseSelectProps } from "
|
|
6
|
-
|
|
7
|
-
type PickerButtonVariant = 'default' | 'compact';
|
|
5
|
+
import { BaseSelectProps } from "./shared-4cd3936b";
|
|
6
|
+
import { PickerButtonSize, PickerButtonVariant } from "./types";
|
|
8
7
|
type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' | 'autocomplete' | 'size' | 'onFocus' | 'selected' | 'closeOnSelect' | 'multiple' | 'hint' | 'allowUnselect' | 'options'> & Pick<ButtonProps, 'view' | 'loading' | 'leftAddons' | 'rightAddons'> & {
|
|
9
8
|
options: Array<BaseSelectProps['options'][0] & {
|
|
10
9
|
/**
|
|
@@ -26,7 +25,7 @@ type PickerButtonDesktopProps = Omit<BaseSelectProps, 'placeholder' | 'Arrow' |
|
|
|
26
25
|
*/
|
|
27
26
|
showArrow?: boolean;
|
|
28
27
|
};
|
|
29
|
-
declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "
|
|
28
|
+
declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "size" | "placeholder" | "onFocus" | "selected" | "multiple" | "hint" | "options" | "autocomplete" | "allowUnselect" | "closeOnSelect" | "Arrow"> & Pick<ButtonProps, "view" | "leftAddons" | "rightAddons" | "loading"> & {
|
|
30
29
|
options: Array<BaseSelectProps['options'][0] & {
|
|
31
30
|
/**
|
|
32
31
|
* Иконка, отображающаяся слева от текстового представления пункта
|
|
@@ -47,4 +46,4 @@ declare const PickerButtonDesktop: React.ForwardRefExoticComponent<Omit<BaseSele
|
|
|
47
46
|
*/
|
|
48
47
|
showArrow?: boolean | undefined;
|
|
49
48
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
50
|
-
export {
|
|
49
|
+
export { PickerButtonDesktopProps, PickerButtonDesktop };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
-
import { BaseSelect, OptionsList, Optgroup } from '@alfalab/core-components-select/esm';
|
|
4
|
+
import { BaseSelect, OptionsList, Optgroup } from '@alfalab/core-components-select/esm/shared';
|
|
5
5
|
import { Field } from './field/Component.js';
|
|
6
6
|
import { Option } from './option/Component.js';
|
|
7
7
|
import '@alfalab/core-components-button/esm';
|
|
@@ -11,7 +11,7 @@ import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
|
11
11
|
import '@alfalab/icons-glyph/MoreMIcon';
|
|
12
12
|
import '@alfalab/icons-glyph/MoreSIcon';
|
|
13
13
|
|
|
14
|
-
var styles = {"container":"picker-
|
|
14
|
+
var styles = {"container":"picker-button__container_1dqr7","optionsPopover":"picker-button__optionsPopover_1dqr7","sideGap":"picker-button__sideGap_1dqr7","option":"picker-button__option_1dqr7"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var SIDE_POSITIONS = ['right', 'right-start', 'right-end', 'left', 'left-start', 'left-end'];
|
|
@@ -19,7 +19,7 @@ var PickerButtonDesktop = forwardRef(function (_a, ref) {
|
|
|
19
19
|
var _b;
|
|
20
20
|
var _c = _a.OptionsList, OptionsList$1 = _c === void 0 ? OptionsList : _c, _d = _a.Optgroup, Optgroup$1 = _d === void 0 ? Optgroup : _d, _e = _a.Option, Option$1 = _e === void 0 ? Option : _e, view = _a.view, loading = _a.loading, _f = _a.size, size = _f === void 0 ? 'm' : _f, _g = _a.variant, variant = _g === void 0 ? 'default' : _g, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, popperClassName = _a.popperClassName, optionClassName = _a.optionClassName, showArrow = _a.showArrow, _h = _a.Field, Field$1 = _h === void 0 ? Field : _h, _j = _a.fieldProps, fieldProps = _j === void 0 ? {} : _j, restProps = __rest(_a, ["OptionsList", "Optgroup", "Option", "view", "loading", "size", "variant", "className", "leftAddons", "rightAddons", "popperClassName", "optionClassName", "showArrow", "Field", "fieldProps"]);
|
|
21
21
|
var isSideGap = !!restProps.popoverPosition && SIDE_POSITIONS.includes(restProps.popoverPosition);
|
|
22
|
-
var
|
|
22
|
+
var fieldDefaultProps = {
|
|
23
23
|
view: view,
|
|
24
24
|
loading: loading,
|
|
25
25
|
/** size у select, button несовместимы */
|
|
@@ -28,8 +28,9 @@ var PickerButtonDesktop = forwardRef(function (_a, ref) {
|
|
|
28
28
|
leftAddons: leftAddons,
|
|
29
29
|
rightAddons: rightAddons,
|
|
30
30
|
showArrow: showArrow,
|
|
31
|
+
breakpoint: 1,
|
|
31
32
|
};
|
|
32
|
-
return (React.createElement(BaseSelect, __assign({}, restProps, { optionProps: { Checkmark: null }, ref: ref, Option: Option$1, Field: Field$1, size: size === 'm' ? 'm' : 's', fieldProps: __assign(__assign({},
|
|
33
|
+
return (React.createElement(BaseSelect, __assign({}, restProps, { optionProps: { Checkmark: null }, ref: ref, Option: Option$1, Field: Field$1, size: size === 'm' ? 'm' : 's', fieldProps: __assign(__assign({}, fieldDefaultProps), fieldProps), Optgroup: Optgroup$1, OptionsList: OptionsList$1, className: cn(styles.container, className), popperClassName: cn('cc-picker-button', styles.optionsPopover, popperClassName, (_b = {},
|
|
33
34
|
_b[styles.sideGap] = isSideGap,
|
|
34
35
|
_b)), optionClassName: cn(styles.option, optionClassName), selected: [], closeOnSelect: true })));
|
|
35
36
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { BottomSheetProps } from "./index-f12ee135";
|
|
5
|
+
import { UseSelectWithApplyProps } from "./hook-9ea9e32c";
|
|
6
|
+
import { BaseSelectProps } from "./typings-5e1b8383";
|
|
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 };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlMobileProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'>;
|
|
5
|
+
declare const FormControlMobile: React.ForwardRefExoticComponent<FormControlMobileProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { FormControlMobileProps, FormControlMobile };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AnchorButtonProps, NativeButtonProps } from "./typings-9211a437";
|
|
4
|
+
type ButtonMobileProps = Partial<AnchorButtonProps | NativeButtonProps>;
|
|
5
|
+
declare const ButtonMobile: React.ForwardRefExoticComponent<ButtonMobileProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
6
|
+
export { ButtonMobileProps, ButtonMobile };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactNode } from "react";
|
|
4
|
+
import { ContentProps, ModalMobileProps } from "./typings-bdb4c6b9";
|
|
5
|
+
declare const Content: FC<ContentProps>;
|
|
6
|
+
type FooterProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Контент футера
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Дополнительный класс
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Фиксирует футер
|
|
17
|
+
*/
|
|
18
|
+
sticky?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Выравнивание элементов футера
|
|
21
|
+
*/
|
|
22
|
+
layout?: "start" | "center" | "space-between" | "column";
|
|
23
|
+
/**
|
|
24
|
+
* Отступы между элементами футера
|
|
25
|
+
*/
|
|
26
|
+
gap?: 16 | 24 | 32;
|
|
27
|
+
};
|
|
28
|
+
declare const Footer: FC<FooterProps>;
|
|
29
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
30
|
+
Content: React.FC<import("./typings-bdb4c6b9").ContentProps>;
|
|
31
|
+
Header: React.FC<import("./Component-e81c389f").HeaderProps>;
|
|
32
|
+
Footer: React.FC<FooterProps>;
|
|
33
|
+
};
|
|
34
|
+
export { Content, FooterProps, Footer, ModalMobile };
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { AdditionalMobileProps } from "
|
|
4
|
-
import { PickerButtonDesktopProps } from "./
|
|
5
|
-
type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps
|
|
6
|
-
|
|
3
|
+
import { AdditionalMobileProps } from "./shared-4cd3936b";
|
|
4
|
+
import { PickerButtonDesktopProps } from "./desktop";
|
|
5
|
+
type PickerButtonMobileProps = Omit<PickerButtonDesktopProps, 'OptionsList' | 'Checkmark' | 'onScroll'> & AdditionalMobileProps & {
|
|
6
|
+
/**
|
|
7
|
+
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
8
|
+
* @default 1024
|
|
9
|
+
*/
|
|
10
|
+
breakpoint?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const PickerButtonMobile: React.ForwardRefExoticComponent<Omit<PickerButtonDesktopProps, "onScroll" | "OptionsList" | "Checkmark"> & AdditionalMobileProps & {
|
|
13
|
+
/**
|
|
14
|
+
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
15
|
+
* @default 1024
|
|
16
|
+
*/
|
|
17
|
+
breakpoint?: number | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
7
19
|
export { PickerButtonMobileProps, PickerButtonMobile };
|
package/esm/Component.mobile.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
-
import { SelectMobile
|
|
3
|
+
import { SelectMobile } from '@alfalab/core-components-select/esm/mobile';
|
|
4
|
+
import { Optgroup } from '@alfalab/core-components-select/esm/shared';
|
|
4
5
|
import { Field } from './field/Component.js';
|
|
5
6
|
import { Option } from './option/Component.js';
|
|
6
7
|
import 'classnames';
|
|
@@ -12,8 +13,8 @@ import '@alfalab/icons-glyph/MoreMIcon';
|
|
|
12
13
|
import '@alfalab/icons-glyph/MoreSIcon';
|
|
13
14
|
|
|
14
15
|
var PickerButtonMobile = forwardRef(function (_a, ref) {
|
|
15
|
-
var options = _a.options, label = _a.label, _b = _a.Option, Option$1 = _b === void 0 ? Option : _b, _c = _a.Optgroup, Optgroup$1 = _c === void 0 ? Optgroup : _c, view = _a.view, loading = _a.loading, _d = _a.variant, variant = _d === void 0 ? 'default' : _d, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, size = _a.size, bottomSheetProps = _a.bottomSheetProps, showArrow = _a.showArrow, _e = _a.Field, Field$1 = _e === void 0 ? Field : _e, _f = _a.fieldProps, fieldProps = _f === void 0 ? {} : _f, restProps = __rest(_a, ["options", "label", "Option", "Optgroup", "view", "loading", "variant", "leftAddons", "rightAddons", "size", "bottomSheetProps", "showArrow", "Field", "fieldProps"]);
|
|
16
|
-
var
|
|
16
|
+
var options = _a.options, label = _a.label, _b = _a.Option, Option$1 = _b === void 0 ? Option : _b, _c = _a.Optgroup, Optgroup$1 = _c === void 0 ? Optgroup : _c, view = _a.view, loading = _a.loading, _d = _a.variant, variant = _d === void 0 ? 'default' : _d, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, size = _a.size, bottomSheetProps = _a.bottomSheetProps, showArrow = _a.showArrow, _e = _a.Field, Field$1 = _e === void 0 ? Field : _e, _f = _a.fieldProps, fieldProps = _f === void 0 ? {} : _f, _g = _a.breakpoint, breakpoint = _g === void 0 ? 1024 : _g, restProps = __rest(_a, ["options", "label", "Option", "Optgroup", "view", "loading", "variant", "leftAddons", "rightAddons", "size", "bottomSheetProps", "showArrow", "Field", "fieldProps", "breakpoint"]);
|
|
17
|
+
var fieldDefaultProps = {
|
|
17
18
|
view: view,
|
|
18
19
|
loading: loading,
|
|
19
20
|
/** size у select, button несовместимы */
|
|
@@ -22,8 +23,9 @@ var PickerButtonMobile = forwardRef(function (_a, ref) {
|
|
|
22
23
|
leftAddons: leftAddons,
|
|
23
24
|
rightAddons: rightAddons,
|
|
24
25
|
showArrow: showArrow,
|
|
26
|
+
breakpoint: breakpoint,
|
|
25
27
|
};
|
|
26
|
-
return (React.createElement(SelectMobile, __assign({}, restProps, { label: label, Option: Option$1, bottomSheetProps: __assign({ title: label, stickyHeader: true }, bottomSheetProps), Field: Field$1, Optgroup: Optgroup$1, size: size === 'm' ? 'm' : 's', closeOnSelect: true, fieldProps: __assign(__assign({},
|
|
28
|
+
return (React.createElement(SelectMobile, __assign({}, restProps, { label: label, Option: Option$1, bottomSheetProps: __assign({ title: label, stickyHeader: true }, bottomSheetProps), Field: Field$1, Optgroup: Optgroup$1, size: size === 'm' ? 'm' : 's', closeOnSelect: true, fieldProps: __assign(__assign({}, fieldDefaultProps), fieldProps), ref: ref, options: options, selected: [] })));
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
export { PickerButtonMobile };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ModalMobile } from "./Component.mobile-f1f15074";
|
|
4
|
+
import { UseSelectWithApplyProps } from "./hook-9ea9e32c";
|
|
5
|
+
import { BaseSelectProps } from "./typings-5e1b8383";
|
|
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-e81c389f").HeaderProps> | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Дополнительные пропсы модалки
|
|
48
|
+
*/
|
|
49
|
+
modalProps?: Partial<import("./typings-bdb4c6b9").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 };
|