@alfalab/core-components-input-autocomplete 10.0.0 → 10.0.2
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/{cssm/Component-89a3cf4c.d.ts → Component-50136800.d.ts} +1 -1
- package/Component-5e1b8383.d.ts +70 -3
- package/Component-63dec22f.d.ts +166 -10
- package/{Component-425c8522.d.ts → Component-72dda473.d.ts} +1 -1
- package/{Component-e81c389f.d.ts → Component-c76d6398.d.ts} +1 -1
- package/Component-ebda875c.d.ts +8 -265
- package/Component.mobile-ebda875c.d.ts +6 -0
- package/Component.mobile-f1f15074.d.ts +1 -1
- package/Component.mobile.d.ts +4 -5
- package/Component.mobile.js +1 -1
- package/{mobile-45dc17c6.d.ts → Component.modal.mobile-5e1b8383.d.ts} +27 -14
- package/Component.modal.mobile.d.ts +2 -2
- package/Component.modal.mobile.js +1 -1
- package/Component.responsive.d.ts +2 -3
- package/Component.responsive.js +1 -1
- package/autocomplete-field/Component.js +1 -1
- package/autocomplete-field/index.css +2 -2
- package/autocomplete-mobile-field/Component.d.ts +6 -2
- package/autocomplete-mobile-field/Component.js +1 -1
- package/autocomplete-mobile-field/index.css +8 -8
- package/{esm/component-89a3cf4c.d.ts → component-50136800.d.ts} +1 -1
- package/{modern/Component-89a3cf4c.d.ts → cssm/Component-50136800.d.ts} +1 -1
- package/cssm/Component-5e1b8383.d.ts +1 -1
- package/cssm/Component-72dda473.d.ts +53 -0
- package/cssm/{Component-e81c389f.d.ts → Component-c76d6398.d.ts} +1 -1
- package/cssm/Component.mobile-f1f15074.d.ts +1 -1
- package/cssm/Component.mobile.d.ts +3 -4
- package/cssm/Component.modal.mobile-5e1b8383.d.ts +1 -1
- package/cssm/Component.responsive.d.ts +1 -2
- package/cssm/autocomplete-mobile-field/Component.d.ts +6 -2
- package/{modern/component-89a3cf4c.d.ts → cssm/component-50136800.d.ts} +1 -1
- package/cssm/index-50136800.d.ts +11 -0
- package/{esm/index-425c8522.d.ts → cssm/index-72dda473.d.ts} +7 -1
- package/cssm/index-c76d6398.d.ts +2 -0
- package/cssm/index-f12ee135.d.ts +1 -1
- package/cssm/types-d9f9bbcc.d.ts +2 -2
- package/esm/{Component-89a3cf4c.d.ts → Component-50136800.d.ts} +1 -1
- package/esm/Component-5e1b8383.d.ts +1 -1
- package/esm/Component-72dda473.d.ts +53 -0
- package/esm/{Component-e81c389f.d.ts → Component-c76d6398.d.ts} +1 -1
- package/esm/Component.mobile-f1f15074.d.ts +1 -1
- package/esm/Component.mobile.d.ts +3 -4
- package/esm/Component.mobile.js +1 -1
- package/esm/Component.modal.mobile-5e1b8383.d.ts +1 -1
- package/esm/Component.modal.mobile.js +1 -1
- package/esm/Component.responsive.d.ts +1 -2
- package/esm/Component.responsive.js +1 -1
- package/esm/autocomplete-field/Component.js +1 -1
- package/esm/autocomplete-field/index.css +2 -2
- package/esm/autocomplete-mobile-field/Component.d.ts +6 -2
- package/esm/autocomplete-mobile-field/Component.js +1 -1
- package/esm/autocomplete-mobile-field/index.css +8 -8
- package/{cssm/component-89a3cf4c.d.ts → esm/component-50136800.d.ts} +1 -1
- package/esm/index-50136800.d.ts +11 -0
- package/{cssm/index-425c8522.d.ts → esm/index-72dda473.d.ts} +7 -1
- package/esm/index-c76d6398.d.ts +2 -0
- package/esm/index-f12ee135.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/mobile.css +4 -4
- package/esm/mobile.js +1 -1
- package/esm/{mobile.module-ed5594fa.js → mobile.module-bb0cbc57.js} +1 -1
- package/esm/types-d9f9bbcc.d.ts +2 -2
- package/hook-9ea9e32c.d.ts +4 -4
- package/index-50136800.d.ts +11 -0
- package/{index-425c8522.d.ts → index-72dda473.d.ts} +7 -1
- package/index-bdb4c6b9.d.ts +2 -172
- package/index-c76d6398.d.ts +2 -0
- package/index-ebda875c.d.ts +115 -11
- package/index-f12ee135.d.ts +3 -307
- package/index.js +1 -1
- package/mobile-06ffd24b.d.ts +5 -0
- package/mobile-96988a65.d.ts +2 -5
- package/mobile.css +4 -4
- package/mobile.js +1 -1
- package/{mobile.module-4fb8c86a.js → mobile.module-00dfdfed.js} +1 -1
- package/modern/Component-50136800.d.ts +6 -0
- package/modern/Component-5e1b8383.d.ts +1 -1
- package/modern/Component-72dda473.d.ts +53 -0
- package/modern/{Component-e81c389f.d.ts → Component-c76d6398.d.ts} +1 -1
- package/modern/Component.mobile-f1f15074.d.ts +1 -1
- package/modern/Component.mobile.d.ts +3 -4
- package/modern/Component.mobile.js +1 -1
- package/modern/Component.modal.mobile-5e1b8383.d.ts +1 -1
- package/modern/Component.modal.mobile.js +1 -1
- package/modern/Component.responsive.d.ts +1 -2
- package/modern/Component.responsive.js +1 -1
- package/modern/autocomplete-field/Component.js +1 -1
- package/modern/autocomplete-field/index.css +2 -2
- package/modern/autocomplete-mobile-field/Component.d.ts +6 -2
- package/modern/autocomplete-mobile-field/Component.js +1 -1
- package/modern/autocomplete-mobile-field/index.css +8 -8
- package/modern/component-50136800.d.ts +44 -0
- package/modern/index-50136800.d.ts +11 -0
- package/modern/{index-425c8522.d.ts → index-72dda473.d.ts} +7 -1
- package/modern/index-c76d6398.d.ts +2 -0
- package/modern/index-f12ee135.d.ts +1 -1
- package/modern/index.js +1 -1
- package/modern/mobile.css +4 -4
- package/modern/mobile.js +1 -1
- package/modern/{mobile.module-a255d4ec.js → mobile.module-ca98f569.js} +1 -1
- package/modern/types-d9f9bbcc.d.ts +2 -2
- package/package.json +4 -4
- package/shared-4cd3936b.d.ts +88 -3
- package/src/Component.mobile.tsx +2 -2
- package/src/Component.responsive.tsx +0 -2
- package/src/autocomplete-mobile-field/Component.tsx +6 -3
- package/types-d9f9bbcc.d.ts +259 -0
- package/utils-1574ad8b.d.ts +29 -0
- package/utils-49cc3c24.d.ts +8 -0
- package/Component-89a3cf4c.d.ts +0 -6
- package/Component-96988a65.d.ts +0 -9
- package/Component-aed0af6e.d.ts +0 -11
- package/Component-f12ee135.d.ts +0 -72
- package/cssm/index-89a3cf4c.d.ts +0 -3
- package/cssm/index-e81c389f.d.ts +0 -3
- package/esm/index-89a3cf4c.d.ts +0 -3
- package/esm/index-e81c389f.d.ts +0 -3
- package/hook-ebda875c.d.ts +0 -48
- package/index-89a3cf4c.d.ts +0 -3
- package/index-e81c389f.d.ts +0 -3
- package/modern/index-89a3cf4c.d.ts +0 -3
- package/modern/index-e81c389f.d.ts +0 -3
- /package/{Component.mobile-f12ee135.d.ts → Component.mobile-06ffd24b.d.ts} +0 -0
- /package/cssm/{types-ebda875c.d.ts → types-83e2bd9e.d.ts} +0 -0
- /package/esm/{types-ebda875c.d.ts → types-83e2bd9e.d.ts} +0 -0
- /package/modern/{types-ebda875c.d.ts → types-83e2bd9e.d.ts} +0 -0
- /package/{types-ebda875c.d.ts → types-83e2bd9e.d.ts} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC, ReactNode, RefObject } from "react";
|
|
4
|
+
import { NavigationBarProps } from "./index-c76d6398";
|
|
5
|
+
import { SwipeableHandlers } from "react-swipeable";
|
|
6
|
+
import { BackdropProps } from "./index-ebda875c";
|
|
7
|
+
import { BottomSheetProps } from "./types-d9f9bbcc";
|
|
8
|
+
type FooterProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Контент футера
|
|
11
|
+
*/
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Фиксирует футер
|
|
15
|
+
*/
|
|
16
|
+
sticky?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Дополнительный класс
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
declare const Footer: FC<FooterProps>;
|
|
23
|
+
type HeaderProps = Omit<NavigationBarProps, "view" | "size"> & {
|
|
24
|
+
headerRef: RefObject<HTMLDivElement>;
|
|
25
|
+
headerOffset: number;
|
|
26
|
+
};
|
|
27
|
+
declare const Header: FC<HeaderProps>;
|
|
28
|
+
type SwipeableBackdropProps = BackdropProps & {
|
|
29
|
+
/**
|
|
30
|
+
* Прозрачность бэкдропа
|
|
31
|
+
*/
|
|
32
|
+
opacity?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Обработчики свайпа
|
|
35
|
+
*/
|
|
36
|
+
handlers?: SwipeableHandlers;
|
|
37
|
+
/**
|
|
38
|
+
* Время анимации opacity
|
|
39
|
+
*/
|
|
40
|
+
opacityTimeout?: number;
|
|
41
|
+
};
|
|
42
|
+
declare const SwipeableBackdrop: FC<SwipeableBackdropProps>;
|
|
43
|
+
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export { FooterProps, Footer, HeaderProps, Header, SwipeableBackdropProps, SwipeableBackdrop, BottomSheet };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-72dda473";
|
|
4
|
+
declare const isClient: () => boolean;
|
|
5
|
+
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
6
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
7
|
+
declare function easeInOutQuad(x: number): number;
|
|
8
|
+
declare const easingFns: {
|
|
9
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
10
|
+
};
|
|
11
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns };
|
|
@@ -3,4 +3,10 @@ type BorderColorType = 'accent' | 'key' | 'key-inverted' | 'link' | 'primary' |
|
|
|
3
3
|
type GraphicColorType = 'accent' | 'link' | 'attention' | 'positive' | 'negative' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'static-light' | 'static-accent' | 'static-dark';
|
|
4
4
|
type ShadowType = 'shadow-xs' | 'shadow-s' | 'shadow-m' | 'shadow-l' | 'shadow-xl' | 'shadow-xs-hard' | 'shadow-s-hard' | 'shadow-m-hard' | 'shadow-l-hard' | 'shadow-xl-hard' | 'shadow-xs-up' | 'shadow-s-up' | 'shadow-m-up' | 'shadow-l-up' | 'shadow-xl-up' | 'shadow-xs-hard-up' | 'shadow-s-hard-up' | 'shadow-m-hard-up' | 'shadow-l-hard-up' | 'shadow-xl-hard-up';
|
|
5
5
|
type GapType = '3xs' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl';
|
|
6
|
-
|
|
6
|
+
type PaddingType = number | string | {
|
|
7
|
+
top?: number;
|
|
8
|
+
right?: number;
|
|
9
|
+
bottom?: number;
|
|
10
|
+
left?: number;
|
|
11
|
+
};
|
|
12
|
+
export { BackgroundColorType, BorderColorType, GraphicColorType, ShadowType, GapType, PaddingType };
|
package/modern/index.js
CHANGED
|
@@ -14,4 +14,4 @@ import '@alfalab/core-components-input/modern';
|
|
|
14
14
|
import '@alfalab/core-components-select/modern/mobile';
|
|
15
15
|
import './autocomplete-mobile-field/Component.js';
|
|
16
16
|
import '@alfalab/core-components-form-control/modern/mobile';
|
|
17
|
-
import './mobile.module-
|
|
17
|
+
import './mobile.module-ca98f569.js';
|
package/modern/mobile.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 11qxi */
|
|
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,11 +16,11 @@
|
|
|
16
16
|
--gap-m: 16px;
|
|
17
17
|
} :root {
|
|
18
18
|
} :root {
|
|
19
|
-
} .input-
|
|
19
|
+
} .input-autocomplete__bottomAddonInput_10by6 {
|
|
20
20
|
padding: 0 var(--gap-xs) var(--gap-xs);
|
|
21
21
|
box-sizing: border-box;
|
|
22
|
-
} .input-
|
|
22
|
+
} .input-autocomplete__footer_10by6 {
|
|
23
23
|
display: flex
|
|
24
|
-
} .input-
|
|
24
|
+
} .input-autocomplete__footer_10by6 > button + button {
|
|
25
25
|
margin-left: var(--gap-m);
|
|
26
26
|
}
|
package/modern/mobile.js
CHANGED
|
@@ -10,4 +10,4 @@ import '@alfalab/core-components-select/modern/mobile';
|
|
|
10
10
|
import './autocomplete-mobile-field/Component.js';
|
|
11
11
|
import '@alfalab/core-components-form-control/modern/mobile';
|
|
12
12
|
import '@alfalab/hooks';
|
|
13
|
-
import './mobile.module-
|
|
13
|
+
import './mobile.module-ca98f569.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const styles = {"bottomAddonInput":"input-
|
|
1
|
+
const styles = {"bottomAddonInput":"input-autocomplete__bottomAddonInput_10by6","footer":"input-autocomplete__footer_10by6"};
|
|
2
2
|
require('./mobile.css')
|
|
3
3
|
|
|
4
4
|
export { styles as s };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
3
3
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
4
4
|
import { BaseModalProps } from "./index-bdb4c6b9";
|
|
5
|
-
import { NavigationBarProps } from "./index-
|
|
6
|
-
import { BackgroundColorType } from "./index-
|
|
5
|
+
import { NavigationBarProps } from "./index-c76d6398";
|
|
6
|
+
import { BackgroundColorType } from "./index-72dda473";
|
|
7
7
|
type BottomSheetTitleAlign = 'center' | 'left';
|
|
8
8
|
type BottomSheetProps = {
|
|
9
9
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-input-autocomplete",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@alfalab/core-components-button": "^9.0.
|
|
37
|
+
"@alfalab/core-components-button": "^9.0.2",
|
|
38
38
|
"@alfalab/core-components-form-control": "^10.0.0",
|
|
39
|
-
"@alfalab/core-components-input": "^12.0.
|
|
40
|
-
"@alfalab/core-components-select": "^15.0.
|
|
39
|
+
"@alfalab/core-components-input": "^12.0.2",
|
|
40
|
+
"@alfalab/core-components-select": "^15.0.2",
|
|
41
41
|
"@alfalab/hooks": "^1.13.0",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"lodash.throttle": "^4.1.1",
|
package/shared-4cd3936b.d.ts
CHANGED
|
@@ -1,8 +1,93 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { BaseSelectProps, OptionProps, OptionShape } from "./typings-5e1b8383";
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6
|
+
type useSelectWithLoadingProps = {
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
visibleOptions?: BaseSelectProps["visibleOptions"];
|
|
9
|
+
Option?: React.FC<OptionProps>;
|
|
10
|
+
};
|
|
11
|
+
declare function useSelectWithLoading({ loading, visibleOptions, Option }: useSelectWithLoadingProps): {
|
|
12
|
+
Option: (props: OptionProps) => React.JSX.Element;
|
|
13
|
+
options: OptionShape[];
|
|
14
|
+
} | null;
|
|
15
|
+
type OptionsFetcherResponse = {
|
|
16
|
+
options: OptionShape[];
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
};
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
|
+
type useLazyLoadingProps = {
|
|
21
|
+
/** Количество элементов на "странице" */
|
|
22
|
+
limit?: number;
|
|
23
|
+
/** Начальный номер "страницы" */
|
|
24
|
+
initialOffset?: number;
|
|
25
|
+
/** Скелетон загружаемых элементов */
|
|
26
|
+
skeleton?: React.ReactNode;
|
|
27
|
+
/** Компонент пункта меню */
|
|
28
|
+
Option?: React.FC<OptionProps>;
|
|
29
|
+
/**
|
|
30
|
+
* Функция-загрузчик опций.
|
|
31
|
+
* @param offset - текущая страница
|
|
32
|
+
* @param limit - количество элементов на странице
|
|
33
|
+
* @param queryString - строчные данные, пробрасываемые для поиска из кастомного инпута, расположенного в заголовке OptionsList
|
|
34
|
+
* @returns Promise<{
|
|
35
|
+
* options - список опций следующей "страницы". Они аппендятся к предыдущим
|
|
36
|
+
* hasMore - указывает, есть ли еще незагруженные элементы (в случае false перестает загружать "следующую страницу")
|
|
37
|
+
* }>
|
|
38
|
+
*/
|
|
39
|
+
optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
|
|
40
|
+
};
|
|
41
|
+
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, Option }: useLazyLoadingProps): {
|
|
42
|
+
optionsProps: {
|
|
43
|
+
Option: (props: OptionProps) => React.JSX.Element;
|
|
44
|
+
options: OptionShape[];
|
|
45
|
+
optionsListProps: {
|
|
46
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
47
|
+
inputProps: {
|
|
48
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
49
|
+
value: string;
|
|
50
|
+
}) => void;
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
onOpen: (payload: {
|
|
55
|
+
open?: boolean;
|
|
56
|
+
}) => void;
|
|
57
|
+
};
|
|
58
|
+
reset: () => void;
|
|
59
|
+
};
|
|
60
|
+
type SkeletonProps = {
|
|
61
|
+
/**
|
|
62
|
+
* Флаг, явно задающий состояние, при котором контент закрывается прелоадером
|
|
63
|
+
*/
|
|
64
|
+
visible?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Флаг явного включения анимации скелета
|
|
67
|
+
*/
|
|
68
|
+
animate?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Дополнительный класс
|
|
71
|
+
*/
|
|
72
|
+
className?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Дополнительные инлайн стили
|
|
75
|
+
*/
|
|
76
|
+
style?: React.CSSProperties;
|
|
77
|
+
/**
|
|
78
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
79
|
+
*/
|
|
80
|
+
dataTestId?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Дочерние элементы.
|
|
83
|
+
*/
|
|
84
|
+
children?: ReactNode;
|
|
85
|
+
};
|
|
86
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
1
87
|
export * from "./index-ebda875c";
|
|
2
|
-
export * from "./Component-89a3cf4c";
|
|
3
88
|
export * from "./Component-5e1b8383";
|
|
4
|
-
export
|
|
89
|
+
export { useSelectWithLoading, useLazyLoading, SkeletonProps, Skeleton };
|
|
5
90
|
export * from "./hook-9ea9e32c";
|
|
6
91
|
export * from "./typings-5e1b8383";
|
|
7
92
|
export * from "./utils-5e1b8383";
|
|
8
|
-
export type { AdditionalMobileProps } from "./Component.mobile-
|
|
93
|
+
export type { AdditionalMobileProps } from "./Component.mobile-06ffd24b";
|
package/src/Component.mobile.tsx
CHANGED
|
@@ -3,11 +3,11 @@ import mergeRefs from 'react-merge-refs';
|
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import throttle from 'lodash.throttle';
|
|
5
5
|
|
|
6
|
-
import { BottomSheetProps } from '@alfalab/core-components-bottom-sheet';
|
|
7
6
|
import { ButtonMobile, ButtonMobileProps } from '@alfalab/core-components-button/mobile';
|
|
8
7
|
import { Input as CoreInput } from '@alfalab/core-components-input';
|
|
9
8
|
import { SelectMobile, SelectMobileProps } from '@alfalab/core-components-select/mobile';
|
|
10
9
|
import type {
|
|
10
|
+
AdditionalMobileProps,
|
|
11
11
|
BaseSelectChangePayload,
|
|
12
12
|
BaseSelectProps,
|
|
13
13
|
} from '@alfalab/core-components-select/shared';
|
|
@@ -53,7 +53,7 @@ export type InputAutocompleteMobileProps = Omit<
|
|
|
53
53
|
/**
|
|
54
54
|
* Дополнительные пропсы компонента BottomSheet
|
|
55
55
|
*/
|
|
56
|
-
bottomSheetProps?:
|
|
56
|
+
bottomSheetProps?: AdditionalMobileProps['bottomSheetProps'];
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Дополнительные пропсы на слот под заголовком компонента BottomSheet
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
-
import { BottomSheetProps } from '@alfalab/core-components-bottom-sheet';
|
|
5
3
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
4
|
import { ButtonMobileProps } from '@alfalab/core-components-button/mobile';
|
|
7
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -5,15 +5,18 @@ import {
|
|
|
5
5
|
FormControlMobile,
|
|
6
6
|
FormControlMobileProps,
|
|
7
7
|
} from '@alfalab/core-components-form-control/mobile';
|
|
8
|
-
import { InputAutocompleteProps } from '@alfalab/core-components-input-autocomplete';
|
|
9
8
|
import type { FieldProps as BaseFieldProps } from '@alfalab/core-components-select/shared';
|
|
10
9
|
import { useFocus } from '@alfalab/hooks';
|
|
11
10
|
|
|
12
11
|
import styles from './index.module.css';
|
|
13
12
|
|
|
14
13
|
export type AutocompleteMobileFieldProps = FormControlMobileProps &
|
|
15
|
-
Omit<BaseFieldProps, 'selected' | 'multiple' | 'success'> &
|
|
16
|
-
|
|
14
|
+
Omit<BaseFieldProps, 'selected' | 'multiple' | 'success'> & {
|
|
15
|
+
/**
|
|
16
|
+
* Значение поля ввода
|
|
17
|
+
*/
|
|
18
|
+
value?: string;
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
export const AutocompleteMobileField = ({
|
|
19
22
|
size = 'm',
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/// <reference types="react-transition-group" />
|
|
2
|
+
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
3
|
+
import { TransitionProps } from 'react-transition-group/Transition';
|
|
4
|
+
import { BaseModalProps } from "./index-bdb4c6b9";
|
|
5
|
+
import { NavigationBarProps } from "./index-c76d6398";
|
|
6
|
+
import { BackgroundColorType } from "./index-72dda473";
|
|
7
|
+
type BottomSheetTitleAlign = 'center' | 'left';
|
|
8
|
+
type BottomSheetProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Контент
|
|
11
|
+
*/
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Управление видимостью
|
|
15
|
+
*/
|
|
16
|
+
open: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Заголовок
|
|
19
|
+
*/
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Размер заголовка
|
|
23
|
+
*/
|
|
24
|
+
titleSize?: NavigationBarProps['titleSize'];
|
|
25
|
+
/**
|
|
26
|
+
* Подзаголовок.
|
|
27
|
+
*/
|
|
28
|
+
subtitle?: NavigationBarProps['subtitle'];
|
|
29
|
+
/**
|
|
30
|
+
* Кнопка действия (обычно, это кнопка закрытия)
|
|
31
|
+
*/
|
|
32
|
+
actionButton?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Нода, компонент или функция возвращающая их
|
|
35
|
+
*
|
|
36
|
+
* Контейнер к которому будут добавляться порталы
|
|
37
|
+
*/
|
|
38
|
+
container?: BaseModalProps['container'];
|
|
39
|
+
/**
|
|
40
|
+
* Рендерить ли в контейнер через портал.
|
|
41
|
+
*/
|
|
42
|
+
usePortal?: BaseModalProps['usePortal'];
|
|
43
|
+
/**
|
|
44
|
+
* Дополнительный класс
|
|
45
|
+
*/
|
|
46
|
+
className?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Дополнительный класс
|
|
49
|
+
*/
|
|
50
|
+
contentClassName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Дополнительные пропсы на контейнер.
|
|
53
|
+
*/
|
|
54
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Дополнительный класс
|
|
57
|
+
*/
|
|
58
|
+
containerClassName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Цвет фона
|
|
61
|
+
*/
|
|
62
|
+
backgroundColor?: Extract<BackgroundColorType, 'primary' | 'secondary'>;
|
|
63
|
+
/**
|
|
64
|
+
* Дополнительный класс шапки
|
|
65
|
+
*/
|
|
66
|
+
headerClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Дополнительный класс футера
|
|
69
|
+
*/
|
|
70
|
+
footerClassName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Дополнительный класс для аддонов
|
|
73
|
+
*/
|
|
74
|
+
addonClassName?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Дополнительный класс для компонента крестика
|
|
77
|
+
*/
|
|
78
|
+
closerClassName?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Дополнительный класс для компонента стрелки назад
|
|
81
|
+
*/
|
|
82
|
+
backerClassName?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Дополнительный класс для компонента модального окна
|
|
85
|
+
*/
|
|
86
|
+
modalClassName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Дополнительный класс для обертки модального окна
|
|
89
|
+
*/
|
|
90
|
+
modalWrapperClassName?: string;
|
|
91
|
+
/**
|
|
92
|
+
* TransitionProps, прокидываются в компонент CSSTransitionProps.
|
|
93
|
+
*/
|
|
94
|
+
transitionProps?: Partial<TransitionProps>;
|
|
95
|
+
/**
|
|
96
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
97
|
+
*/
|
|
98
|
+
dataTestId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* z-index компонента
|
|
101
|
+
*/
|
|
102
|
+
zIndex?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Будет ли свайпаться шторка
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
swipeable?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Будет ли свайпаться контент
|
|
110
|
+
*/
|
|
111
|
+
swipeableContent?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Порог свайпа
|
|
114
|
+
*/
|
|
115
|
+
swipeThreshold?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Слот слева
|
|
118
|
+
*/
|
|
119
|
+
leftAddons?: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* Слот справа
|
|
122
|
+
*/
|
|
123
|
+
rightAddons?: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* Слот снизу
|
|
126
|
+
*/
|
|
127
|
+
bottomAddons?: ReactNode;
|
|
128
|
+
/**
|
|
129
|
+
* Наличие компонента крестика
|
|
130
|
+
*/
|
|
131
|
+
hasCloser?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Наличие компонента стрелки назад
|
|
134
|
+
*/
|
|
135
|
+
hasBacker?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Выравнивание заголовка
|
|
138
|
+
*/
|
|
139
|
+
titleAlign?: BottomSheetTitleAlign;
|
|
140
|
+
/**
|
|
141
|
+
* Фиксирует шапку
|
|
142
|
+
*/
|
|
143
|
+
stickyHeader?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Фиксирует футер
|
|
146
|
+
*/
|
|
147
|
+
stickyFooter?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Высота шторки
|
|
150
|
+
*/
|
|
151
|
+
initialHeight?: 'default' | 'full';
|
|
152
|
+
/**
|
|
153
|
+
* Будет ли виден оверлэй
|
|
154
|
+
*/
|
|
155
|
+
hideOverlay?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Будет ли видна шапка
|
|
158
|
+
*/
|
|
159
|
+
hideHeader?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Будет ли обрезан заголовок
|
|
162
|
+
*/
|
|
163
|
+
trimTitle?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Запретить закрытие шторки кликом на оверлэй
|
|
166
|
+
*/
|
|
167
|
+
disableOverlayClick?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Отключает блокировку скролла при открытии модального окна
|
|
170
|
+
*/
|
|
171
|
+
disableBlockingScroll?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Отключает ловушку фокуса
|
|
174
|
+
*/
|
|
175
|
+
disableFocusLock?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
|
|
178
|
+
* Не анимировать шторку при изменении размера вьюпорта
|
|
179
|
+
*/
|
|
180
|
+
ignoreScreenChange?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Свойства для Бэкдропа
|
|
183
|
+
*/
|
|
184
|
+
backdropProps?: BaseModalProps['backdropProps'];
|
|
185
|
+
/**
|
|
186
|
+
* Реф на контейнер, в котором происходит скролл
|
|
187
|
+
*/
|
|
188
|
+
scrollableContainerRef?: RefObject<HTMLElement>;
|
|
189
|
+
/**
|
|
190
|
+
* Реф для управления компонентом.
|
|
191
|
+
*/
|
|
192
|
+
bottomSheetInstanceRef?: RefObject<{
|
|
193
|
+
scrollToArea: (idx: number) => void;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Реф на контейнер, в котором находится шторка
|
|
197
|
+
*/
|
|
198
|
+
sheetContainerRef?: RefObject<HTMLElement>;
|
|
199
|
+
/**
|
|
200
|
+
* Магнитные области видимой высоты шторки.
|
|
201
|
+
* Можно использовать значения в пикселях - 10(число), либо в процентах - 10%(строка).
|
|
202
|
+
* По-умолчанию -[0, window.innerHeight - '24px']
|
|
203
|
+
* массив должен состоять минимум из 2 элементов
|
|
204
|
+
*/
|
|
205
|
+
magneticAreas?: Array<number | string>;
|
|
206
|
+
/**
|
|
207
|
+
* Индекс точки из magneticAreas, к которому нужно примагнититься при первом открытии шторки.
|
|
208
|
+
*/
|
|
209
|
+
initialActiveAreaIndex?: number;
|
|
210
|
+
/**
|
|
211
|
+
* Отключает скролл контентной области.
|
|
212
|
+
*/
|
|
213
|
+
scrollLocked?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Скрыть скроллбар внутри шторки
|
|
216
|
+
*/
|
|
217
|
+
hideScrollbar?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Верхний отступ шторки, если она открыта на максимальную высоту
|
|
220
|
+
*/
|
|
221
|
+
headerOffset?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Содержимое bottom-sheet всегда в DOM
|
|
224
|
+
*/
|
|
225
|
+
keepMounted?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Отключает автоматический перевод фокуса на bottom-sheet при открытии
|
|
228
|
+
*/
|
|
229
|
+
disableAutoFocus?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Отключает восстановление фокуса на предыдущем элементе после закрытия bottom-sheet
|
|
232
|
+
*/
|
|
233
|
+
disableRestoreFocus?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Отключает вызов `onClose` при нажатии Escape
|
|
236
|
+
*/
|
|
237
|
+
disableEscapeKeyDown?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Обработчик закрытия
|
|
240
|
+
*/
|
|
241
|
+
onClose: () => void;
|
|
242
|
+
/**
|
|
243
|
+
* Обработчик нажатия на стрелку назад
|
|
244
|
+
*/
|
|
245
|
+
onBack?: () => void;
|
|
246
|
+
/**
|
|
247
|
+
* Вызывается в начале анимации притягивания к одной из `magneticAreas`
|
|
248
|
+
*/
|
|
249
|
+
onMagnetize?: (index: number) => void;
|
|
250
|
+
/**
|
|
251
|
+
* Вызывается после окончания анимации притягивания
|
|
252
|
+
*/
|
|
253
|
+
onMagnetizeEnd?: () => void;
|
|
254
|
+
/**
|
|
255
|
+
* Вызывается при изменении положения шторки
|
|
256
|
+
*/
|
|
257
|
+
onOffsetChange?: (offset: number, percent: number) => void;
|
|
258
|
+
};
|
|
259
|
+
export { BottomSheetTitleAlign, BottomSheetProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type SavedStyle = {
|
|
2
|
+
value: string;
|
|
3
|
+
key: string;
|
|
4
|
+
el: HTMLElement;
|
|
5
|
+
};
|
|
6
|
+
type RestoreStyle = {
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
modals: number;
|
|
9
|
+
styles: SavedStyle[];
|
|
10
|
+
};
|
|
11
|
+
declare class ModalStore {
|
|
12
|
+
private readonly restoreStyles;
|
|
13
|
+
constructor();
|
|
14
|
+
getRestoreStyles: () => RestoreStyle[];
|
|
15
|
+
}
|
|
16
|
+
declare const getModalStore: () => ModalStore;
|
|
17
|
+
declare class GlobalStore {
|
|
18
|
+
private readonly modalStore;
|
|
19
|
+
constructor();
|
|
20
|
+
getModalStore: () => ModalStore;
|
|
21
|
+
}
|
|
22
|
+
declare function isScrolledToTop(target: HTMLElement): boolean;
|
|
23
|
+
declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
24
|
+
declare function hasScrollbar(target: HTMLElement): boolean;
|
|
25
|
+
declare const getScrollbarSize: () => number;
|
|
26
|
+
declare const restoreContainerStyles: (container: HTMLElement) => void;
|
|
27
|
+
declare const handleContainer: (container?: HTMLElement) => void;
|
|
28
|
+
export type { SavedStyle };
|
|
29
|
+
export { getModalStore, GlobalStore, isScrolledToTop, isScrolledToBottom, hasScrollbar, getScrollbarSize, restoreContainerStyles, handleContainer };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const TIMEOUT = 500;
|
|
2
|
+
declare const SWIPE_VELOCITY = 0.4;
|
|
3
|
+
declare const MARKER_HEIGHT = 24;
|
|
4
|
+
declare const CLOSE_OFFSET = 0.2;
|
|
5
|
+
declare const SCROLL_OFFSET = 1;
|
|
6
|
+
declare const HEADER_OFFSET = 24;
|
|
7
|
+
declare const convertPercentToNumber: (value: string | number, fullHeight: number, headerOffset?: number) => number;
|
|
8
|
+
export { TIMEOUT, SWIPE_VELOCITY, MARKER_HEIGHT, CLOSE_OFFSET, SCROLL_OFFSET, HEADER_OFFSET, convertPercentToNumber };
|
package/Component-89a3cf4c.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { BaseSelectProps } from "./typings-5e1b8383";
|
|
4
|
-
declare const BaseSelect: React.ForwardRefExoticComponent<BaseSelectProps & React.RefAttributes<unknown>>;
|
|
5
|
-
export * from "./Component-5e1b8383";
|
|
6
|
-
export { BaseSelect };
|
package/Component-96988a65.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type FooterProps = {
|
|
4
|
-
handleClear?: () => void;
|
|
5
|
-
handleApply?: () => void;
|
|
6
|
-
showClear?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare const Footer: ({ handleApply, handleClear, showClear }: FooterProps) => React.JSX.Element;
|
|
9
|
-
export { FooterProps, Footer };
|
package/Component-aed0af6e.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { CheckboxProps } from "./index-ebda875c";
|
|
4
|
-
type HeaderProps = {
|
|
5
|
-
checked?: boolean;
|
|
6
|
-
indeterminate?: boolean;
|
|
7
|
-
onChange?: CheckboxProps['onChange'];
|
|
8
|
-
mobile?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare const Header: React.FC<HeaderProps>;
|
|
11
|
-
export { HeaderProps, Header };
|