@alfalab/core-components-number-input 1.2.3 → 1.2.5
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-72dda473.d.ts +53 -0
- package/Component.desktop-785df74d.d.ts +6 -0
- package/Component.mobile-d7e9f69d.d.ts +6 -0
- package/Component.mobile-ebda875c.d.ts +5 -4
- package/Component.responsive-785df74d.d.ts +26 -0
- package/components/number-input/Component.d.ts +1 -1
- package/cssm/Component-72dda473.d.ts +53 -0
- package/cssm/Component.desktop-785df74d.d.ts +6 -0
- package/cssm/Component.mobile-d7e9f69d.d.ts +6 -0
- package/cssm/Component.mobile-ebda875c.d.ts +5 -4
- package/cssm/Component.responsive-785df74d.d.ts +26 -0
- package/cssm/components/number-input/Component.d.ts +1 -1
- package/cssm/index-3109f463.d.ts +62 -0
- package/cssm/index-72308007.d.ts +54 -0
- package/cssm/index-ebda875c.d.ts +10 -0
- package/esm/Component-72dda473.d.ts +53 -0
- package/esm/Component.desktop-785df74d.d.ts +6 -0
- package/esm/Component.mobile-d7e9f69d.d.ts +6 -0
- package/esm/Component.mobile-ebda875c.d.ts +5 -4
- package/esm/Component.responsive-785df74d.d.ts +26 -0
- package/esm/components/number-input/Component.d.ts +1 -1
- package/esm/index-3109f463.d.ts +62 -0
- package/esm/index-72308007.d.ts +54 -0
- package/esm/index-ebda875c.d.ts +10 -0
- package/index-3109f463.d.ts +62 -0
- package/index-72308007.d.ts +54 -0
- package/index-ebda875c.d.ts +10 -0
- package/modern/Component-72dda473.d.ts +53 -0
- package/modern/Component.desktop-785df74d.d.ts +6 -0
- package/modern/Component.mobile-d7e9f69d.d.ts +6 -0
- package/modern/Component.mobile-ebda875c.d.ts +5 -4
- package/modern/Component.responsive-785df74d.d.ts +26 -0
- package/modern/components/number-input/Component.d.ts +1 -1
- package/modern/index-3109f463.d.ts +62 -0
- package/modern/index-72308007.d.ts +54 -0
- package/modern/index-ebda875c.d.ts +10 -0
- package/package.json +2 -2
- package/cssm/index-1a4fbd11.d.ts +0 -22
- package/esm/index-1a4fbd11.d.ts +0 -22
- package/index-1a4fbd11.d.ts +0 -22
- package/modern/index-1a4fbd11.d.ts +0 -22
- /package/{Component-1a4fbd11.d.ts → Component-72308007.d.ts} +0 -0
- /package/cssm/{Component-1a4fbd11.d.ts → Component-72308007.d.ts} +0 -0
- /package/esm/{Component-1a4fbd11.d.ts → Component-72308007.d.ts} +0 -0
- /package/modern/{Component-1a4fbd11.d.ts → Component-72308007.d.ts} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BackgroundColorType, GraphicColorType } from "./index-72dda473";
|
|
4
|
+
type IconColorType = Extract<GraphicColorType, 'positive' | 'attention' | 'link' | 'negative' | 'tertiary' | 'secondary' | 'primary'>;
|
|
5
|
+
type BadgeProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Вид компонента
|
|
12
|
+
*/
|
|
13
|
+
view: 'icon' | 'count';
|
|
14
|
+
/**
|
|
15
|
+
* Размер компонента (только для view=icon)
|
|
16
|
+
* //deprecated(используйте height для view=count )
|
|
17
|
+
*/
|
|
18
|
+
size?: 's' | 'm' | 'l' | 'xl';
|
|
19
|
+
/**
|
|
20
|
+
* Видимость белой обводки вокруг иконки
|
|
21
|
+
*/
|
|
22
|
+
visibleIconOutline?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Видимость цветной обводки вокруг иконки (только для view=icon)
|
|
25
|
+
*/
|
|
26
|
+
visibleColorOutline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Контент компонента
|
|
29
|
+
*/
|
|
30
|
+
content?: React.ReactElement | number;
|
|
31
|
+
/**
|
|
32
|
+
* Высота компонента, min = 16; max = 48 (только для view=count)
|
|
33
|
+
*/
|
|
34
|
+
height?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Цветовое оформление бейджа при view='count'
|
|
37
|
+
*/
|
|
38
|
+
color?: Extract<BackgroundColorType, 'accent' | 'primary' | 'specialbg-secondary-transparent'>;
|
|
39
|
+
/**
|
|
40
|
+
* Цветовое оформление бейджа при view='icon'
|
|
41
|
+
*/
|
|
42
|
+
iconColor?: IconColorType;
|
|
43
|
+
/**
|
|
44
|
+
* Цвет подложки под иконкой
|
|
45
|
+
*/
|
|
46
|
+
iconUnderlayColor?: Extract<GraphicColorType, 'primary' | 'static-light'>;
|
|
47
|
+
/**
|
|
48
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
49
|
+
*/
|
|
50
|
+
dataTestId?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const Badge: ({ className, size, view, visibleIconOutline, visibleColorOutline, content, height, iconColor, color, iconUnderlayColor, dataTestId, }: BadgeProps) => React.JSX.Element;
|
|
53
|
+
export { IconColorType, BadgeProps, Badge };
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
declare const
|
|
6
|
-
export
|
|
3
|
+
import { BaseInputProps } from "./index-ebda875c";
|
|
4
|
+
type InputMobileProps = Omit<BaseInputProps, 'FormControlComponent' | 'colorStyles'>;
|
|
5
|
+
declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export * from "./Component.mobile-d7e9f69d";
|
|
7
|
+
export { InputMobileProps, InputMobile };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
12
|
+
*/
|
|
13
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
14
|
+
};
|
|
15
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
16
|
+
/**
|
|
17
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
18
|
+
* @default 1024
|
|
19
|
+
*/
|
|
20
|
+
breakpoint?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
23
|
+
*/
|
|
24
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export { FormControlProps, FormControl };
|
|
@@ -39,7 +39,7 @@ type NumberInputProps = Omit<InputProps, 'value' | 'onChange' | 'type'> & {
|
|
|
39
39
|
valueString: string;
|
|
40
40
|
}) => void;
|
|
41
41
|
};
|
|
42
|
-
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "
|
|
42
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "onChange" | "type"> & {
|
|
43
43
|
/**
|
|
44
44
|
* Значение поля ввода
|
|
45
45
|
*/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BackgroundColorType, GraphicColorType } from "./index-72dda473";
|
|
4
|
+
type IconColorType = Extract<GraphicColorType, 'positive' | 'attention' | 'link' | 'negative' | 'tertiary' | 'secondary' | 'primary'>;
|
|
5
|
+
type BadgeProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Вид компонента
|
|
12
|
+
*/
|
|
13
|
+
view: 'icon' | 'count';
|
|
14
|
+
/**
|
|
15
|
+
* Размер компонента (только для view=icon)
|
|
16
|
+
* //deprecated(используйте height для view=count )
|
|
17
|
+
*/
|
|
18
|
+
size?: 's' | 'm' | 'l' | 'xl';
|
|
19
|
+
/**
|
|
20
|
+
* Видимость белой обводки вокруг иконки
|
|
21
|
+
*/
|
|
22
|
+
visibleIconOutline?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Видимость цветной обводки вокруг иконки (только для view=icon)
|
|
25
|
+
*/
|
|
26
|
+
visibleColorOutline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Контент компонента
|
|
29
|
+
*/
|
|
30
|
+
content?: React.ReactElement | number;
|
|
31
|
+
/**
|
|
32
|
+
* Высота компонента, min = 16; max = 48 (только для view=count)
|
|
33
|
+
*/
|
|
34
|
+
height?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Цветовое оформление бейджа при view='count'
|
|
37
|
+
*/
|
|
38
|
+
color?: Extract<BackgroundColorType, 'accent' | 'primary' | 'specialbg-secondary-transparent'>;
|
|
39
|
+
/**
|
|
40
|
+
* Цветовое оформление бейджа при view='icon'
|
|
41
|
+
*/
|
|
42
|
+
iconColor?: IconColorType;
|
|
43
|
+
/**
|
|
44
|
+
* Цвет подложки под иконкой
|
|
45
|
+
*/
|
|
46
|
+
iconUnderlayColor?: Extract<GraphicColorType, 'primary' | 'static-light'>;
|
|
47
|
+
/**
|
|
48
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
49
|
+
*/
|
|
50
|
+
dataTestId?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const Badge: ({ className, size, view, visibleIconOutline, visibleColorOutline, content, height, iconColor, color, iconUnderlayColor, dataTestId, }: BadgeProps) => React.JSX.Element;
|
|
53
|
+
export { IconColorType, BadgeProps, Badge };
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
declare const
|
|
6
|
-
export
|
|
3
|
+
import { BaseInputProps } from "./index-ebda875c";
|
|
4
|
+
type InputMobileProps = Omit<BaseInputProps, 'FormControlComponent' | 'colorStyles'>;
|
|
5
|
+
declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export * from "./Component.mobile-d7e9f69d";
|
|
7
|
+
export { InputMobileProps, InputMobile };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
12
|
+
*/
|
|
13
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
14
|
+
};
|
|
15
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
16
|
+
/**
|
|
17
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
18
|
+
* @default 1024
|
|
19
|
+
*/
|
|
20
|
+
breakpoint?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
23
|
+
*/
|
|
24
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export { FormControlProps, FormControl };
|
|
@@ -39,7 +39,7 @@ type NumberInputProps = Omit<InputProps, 'value' | 'onChange' | 'type'> & {
|
|
|
39
39
|
valueString: string;
|
|
40
40
|
}) => void;
|
|
41
41
|
};
|
|
42
|
-
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "
|
|
42
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "onChange" | "type"> & {
|
|
43
43
|
/**
|
|
44
44
|
* Значение поля ввода
|
|
45
45
|
*/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
type MqProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
5
|
+
*/
|
|
6
|
+
query?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Запрос на поддержку тач-событий
|
|
9
|
+
*/
|
|
10
|
+
touch?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Дочерние элементы.
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Обработчик изменений в совпадении запросов
|
|
17
|
+
*/
|
|
18
|
+
onMatchChange?: (isMatched: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
declare const Mq: FC<MqProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Хук для медиа запросов.
|
|
23
|
+
* @param query media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
24
|
+
* @param defaultValue Значение по-умолчанию.
|
|
25
|
+
*/
|
|
26
|
+
declare const useMatchMedia: (query: string, defaultValue?: boolean | (() => boolean)) => boolean[];
|
|
27
|
+
/**
|
|
28
|
+
* Возвращает MediaQueryList для заданного media-выражения.
|
|
29
|
+
*
|
|
30
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
31
|
+
*/
|
|
32
|
+
declare function getMatchMedia(queryProp: string): MediaQueryList;
|
|
33
|
+
/**
|
|
34
|
+
* Удаляет MediaQueryList.
|
|
35
|
+
*
|
|
36
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
37
|
+
*/
|
|
38
|
+
declare function releaseMatchMedia(queryProp: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Возвращает `true`, если есть поддержка `Pointer Events`
|
|
41
|
+
*/
|
|
42
|
+
declare function isPointerEventsSupported(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Возвращает `true`, если есть поддержка `Touch Events`
|
|
45
|
+
*/
|
|
46
|
+
declare function isTouchSupported(): boolean;
|
|
47
|
+
declare const _exports: {
|
|
48
|
+
"--mobile-xs": string;
|
|
49
|
+
"--mobile-s": string;
|
|
50
|
+
"--mobile-m": string;
|
|
51
|
+
"--mobile-l": string;
|
|
52
|
+
"--mobile": string;
|
|
53
|
+
"--tablet-s": string;
|
|
54
|
+
"--tablet-m": string;
|
|
55
|
+
"--tablet": string;
|
|
56
|
+
"--desktop-s": string;
|
|
57
|
+
"--desktop-m": string;
|
|
58
|
+
"--desktop-l": string;
|
|
59
|
+
"--desktop-xl": string;
|
|
60
|
+
"--desktop": string;
|
|
61
|
+
};
|
|
62
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-72dda473";
|
|
4
|
+
/* eslint-disable no-plusplus, no-param-reassign */
|
|
5
|
+
import { MaskitoPlugin, MaskitoPostprocessor, MaskitoPreprocessor } from "@maskito/core";
|
|
6
|
+
declare const isClient: () => boolean;
|
|
7
|
+
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
8
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
9
|
+
declare function easeInOutQuad(x: number): number;
|
|
10
|
+
declare const easingFns: {
|
|
11
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
12
|
+
};
|
|
13
|
+
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
14
|
+
declare const inputUtils: {
|
|
15
|
+
disableUserInput: typeof disableUserInput;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Возвращает true, если значение равно null или undefined
|
|
19
|
+
*/
|
|
20
|
+
declare function isNil(value: unknown): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Выбор значения между min max границами
|
|
23
|
+
*/
|
|
24
|
+
declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
|
|
25
|
+
declare function noop(): void;
|
|
26
|
+
declare const fnUtils: {
|
|
27
|
+
clamp: typeof clamp;
|
|
28
|
+
noop: typeof noop;
|
|
29
|
+
isNil: typeof isNil;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Запрещает каретке становиться за указанные границы
|
|
33
|
+
*/
|
|
34
|
+
declare function caretGuard(guard: (value: string, selection: readonly [
|
|
35
|
+
from: number,
|
|
36
|
+
to: number
|
|
37
|
+
]) => [
|
|
38
|
+
from: number,
|
|
39
|
+
to: number
|
|
40
|
+
]): MaskitoPlugin;
|
|
41
|
+
/**
|
|
42
|
+
* Запрещает удалять указанный префикс
|
|
43
|
+
*/
|
|
44
|
+
declare function prefixPostprocessor(prefix: string): MaskitoPostprocessor;
|
|
45
|
+
/**
|
|
46
|
+
* Препроцессор необходим для правильной вставки/автокомплита телефонного номера
|
|
47
|
+
*/
|
|
48
|
+
declare function insertionPhonePreprocessor(mask: Array<string | RegExp>, countryCode?: string, clearableCountryCode?: boolean): MaskitoPreprocessor;
|
|
49
|
+
declare const maskUtils: {
|
|
50
|
+
insertionPhonePreprocessor: typeof insertionPhonePreprocessor;
|
|
51
|
+
prefixPostprocessor: typeof prefixPostprocessor;
|
|
52
|
+
caretGuard: typeof caretGuard;
|
|
53
|
+
};
|
|
54
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils, maskUtils };
|
package/cssm/index-ebda875c.d.ts
CHANGED
|
@@ -86,6 +86,14 @@ type BaseFormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
86
86
|
* Дополнительный класс для аддонов
|
|
87
87
|
*/
|
|
88
88
|
addonsClassName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Свойства для обертки левых аддонов
|
|
91
|
+
*/
|
|
92
|
+
leftAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
93
|
+
/**
|
|
94
|
+
* Свойства для обертки правых аддонов
|
|
95
|
+
*/
|
|
96
|
+
rightAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
89
97
|
/**
|
|
90
98
|
* Идентификатор для систем автоматизированного тестирования
|
|
91
99
|
*/
|
|
@@ -125,6 +133,8 @@ declare const BaseFormControl: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
125
133
|
inputWrapperClassName?: string | undefined;
|
|
126
134
|
labelClassName?: string | undefined;
|
|
127
135
|
addonsClassName?: string | undefined;
|
|
136
|
+
leftAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
137
|
+
rightAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
128
138
|
dataTestId?: string | undefined;
|
|
129
139
|
children?: ReactNode;
|
|
130
140
|
styles: {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BackgroundColorType, GraphicColorType } from "./index-72dda473";
|
|
4
|
+
type IconColorType = Extract<GraphicColorType, 'positive' | 'attention' | 'link' | 'negative' | 'tertiary' | 'secondary' | 'primary'>;
|
|
5
|
+
type BadgeProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Вид компонента
|
|
12
|
+
*/
|
|
13
|
+
view: 'icon' | 'count';
|
|
14
|
+
/**
|
|
15
|
+
* Размер компонента (только для view=icon)
|
|
16
|
+
* //deprecated(используйте height для view=count )
|
|
17
|
+
*/
|
|
18
|
+
size?: 's' | 'm' | 'l' | 'xl';
|
|
19
|
+
/**
|
|
20
|
+
* Видимость белой обводки вокруг иконки
|
|
21
|
+
*/
|
|
22
|
+
visibleIconOutline?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Видимость цветной обводки вокруг иконки (только для view=icon)
|
|
25
|
+
*/
|
|
26
|
+
visibleColorOutline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Контент компонента
|
|
29
|
+
*/
|
|
30
|
+
content?: React.ReactElement | number;
|
|
31
|
+
/**
|
|
32
|
+
* Высота компонента, min = 16; max = 48 (только для view=count)
|
|
33
|
+
*/
|
|
34
|
+
height?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Цветовое оформление бейджа при view='count'
|
|
37
|
+
*/
|
|
38
|
+
color?: Extract<BackgroundColorType, 'accent' | 'primary' | 'specialbg-secondary-transparent'>;
|
|
39
|
+
/**
|
|
40
|
+
* Цветовое оформление бейджа при view='icon'
|
|
41
|
+
*/
|
|
42
|
+
iconColor?: IconColorType;
|
|
43
|
+
/**
|
|
44
|
+
* Цвет подложки под иконкой
|
|
45
|
+
*/
|
|
46
|
+
iconUnderlayColor?: Extract<GraphicColorType, 'primary' | 'static-light'>;
|
|
47
|
+
/**
|
|
48
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
49
|
+
*/
|
|
50
|
+
dataTestId?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const Badge: ({ className, size, view, visibleIconOutline, visibleColorOutline, content, height, iconColor, color, iconUnderlayColor, dataTestId, }: BadgeProps) => React.JSX.Element;
|
|
53
|
+
export { IconColorType, BadgeProps, Badge };
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
declare const
|
|
6
|
-
export
|
|
3
|
+
import { BaseInputProps } from "./index-ebda875c";
|
|
4
|
+
type InputMobileProps = Omit<BaseInputProps, 'FormControlComponent' | 'colorStyles'>;
|
|
5
|
+
declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export * from "./Component.mobile-d7e9f69d";
|
|
7
|
+
export { InputMobileProps, InputMobile };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
12
|
+
*/
|
|
13
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
14
|
+
};
|
|
15
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
16
|
+
/**
|
|
17
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
18
|
+
* @default 1024
|
|
19
|
+
*/
|
|
20
|
+
breakpoint?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
23
|
+
*/
|
|
24
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export { FormControlProps, FormControl };
|
|
@@ -39,7 +39,7 @@ type NumberInputProps = Omit<InputProps, 'value' | 'onChange' | 'type'> & {
|
|
|
39
39
|
valueString: string;
|
|
40
40
|
}) => void;
|
|
41
41
|
};
|
|
42
|
-
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "
|
|
42
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "onChange" | "type"> & {
|
|
43
43
|
/**
|
|
44
44
|
* Значение поля ввода
|
|
45
45
|
*/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
type MqProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
5
|
+
*/
|
|
6
|
+
query?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Запрос на поддержку тач-событий
|
|
9
|
+
*/
|
|
10
|
+
touch?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Дочерние элементы.
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Обработчик изменений в совпадении запросов
|
|
17
|
+
*/
|
|
18
|
+
onMatchChange?: (isMatched: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
declare const Mq: FC<MqProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Хук для медиа запросов.
|
|
23
|
+
* @param query media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
24
|
+
* @param defaultValue Значение по-умолчанию.
|
|
25
|
+
*/
|
|
26
|
+
declare const useMatchMedia: (query: string, defaultValue?: boolean | (() => boolean)) => boolean[];
|
|
27
|
+
/**
|
|
28
|
+
* Возвращает MediaQueryList для заданного media-выражения.
|
|
29
|
+
*
|
|
30
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
31
|
+
*/
|
|
32
|
+
declare function getMatchMedia(queryProp: string): MediaQueryList;
|
|
33
|
+
/**
|
|
34
|
+
* Удаляет MediaQueryList.
|
|
35
|
+
*
|
|
36
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
37
|
+
*/
|
|
38
|
+
declare function releaseMatchMedia(queryProp: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Возвращает `true`, если есть поддержка `Pointer Events`
|
|
41
|
+
*/
|
|
42
|
+
declare function isPointerEventsSupported(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Возвращает `true`, если есть поддержка `Touch Events`
|
|
45
|
+
*/
|
|
46
|
+
declare function isTouchSupported(): boolean;
|
|
47
|
+
declare const _exports: {
|
|
48
|
+
"--mobile-xs": string;
|
|
49
|
+
"--mobile-s": string;
|
|
50
|
+
"--mobile-m": string;
|
|
51
|
+
"--mobile-l": string;
|
|
52
|
+
"--mobile": string;
|
|
53
|
+
"--tablet-s": string;
|
|
54
|
+
"--tablet-m": string;
|
|
55
|
+
"--tablet": string;
|
|
56
|
+
"--desktop-s": string;
|
|
57
|
+
"--desktop-m": string;
|
|
58
|
+
"--desktop-l": string;
|
|
59
|
+
"--desktop-xl": string;
|
|
60
|
+
"--desktop": string;
|
|
61
|
+
};
|
|
62
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-72dda473";
|
|
4
|
+
/* eslint-disable no-plusplus, no-param-reassign */
|
|
5
|
+
import { MaskitoPlugin, MaskitoPostprocessor, MaskitoPreprocessor } from "@maskito/core";
|
|
6
|
+
declare const isClient: () => boolean;
|
|
7
|
+
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
8
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
9
|
+
declare function easeInOutQuad(x: number): number;
|
|
10
|
+
declare const easingFns: {
|
|
11
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
12
|
+
};
|
|
13
|
+
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
14
|
+
declare const inputUtils: {
|
|
15
|
+
disableUserInput: typeof disableUserInput;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Возвращает true, если значение равно null или undefined
|
|
19
|
+
*/
|
|
20
|
+
declare function isNil(value: unknown): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Выбор значения между min max границами
|
|
23
|
+
*/
|
|
24
|
+
declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
|
|
25
|
+
declare function noop(): void;
|
|
26
|
+
declare const fnUtils: {
|
|
27
|
+
clamp: typeof clamp;
|
|
28
|
+
noop: typeof noop;
|
|
29
|
+
isNil: typeof isNil;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Запрещает каретке становиться за указанные границы
|
|
33
|
+
*/
|
|
34
|
+
declare function caretGuard(guard: (value: string, selection: readonly [
|
|
35
|
+
from: number,
|
|
36
|
+
to: number
|
|
37
|
+
]) => [
|
|
38
|
+
from: number,
|
|
39
|
+
to: number
|
|
40
|
+
]): MaskitoPlugin;
|
|
41
|
+
/**
|
|
42
|
+
* Запрещает удалять указанный префикс
|
|
43
|
+
*/
|
|
44
|
+
declare function prefixPostprocessor(prefix: string): MaskitoPostprocessor;
|
|
45
|
+
/**
|
|
46
|
+
* Препроцессор необходим для правильной вставки/автокомплита телефонного номера
|
|
47
|
+
*/
|
|
48
|
+
declare function insertionPhonePreprocessor(mask: Array<string | RegExp>, countryCode?: string, clearableCountryCode?: boolean): MaskitoPreprocessor;
|
|
49
|
+
declare const maskUtils: {
|
|
50
|
+
insertionPhonePreprocessor: typeof insertionPhonePreprocessor;
|
|
51
|
+
prefixPostprocessor: typeof prefixPostprocessor;
|
|
52
|
+
caretGuard: typeof caretGuard;
|
|
53
|
+
};
|
|
54
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils, maskUtils };
|
package/esm/index-ebda875c.d.ts
CHANGED
|
@@ -86,6 +86,14 @@ type BaseFormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
86
86
|
* Дополнительный класс для аддонов
|
|
87
87
|
*/
|
|
88
88
|
addonsClassName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Свойства для обертки левых аддонов
|
|
91
|
+
*/
|
|
92
|
+
leftAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
93
|
+
/**
|
|
94
|
+
* Свойства для обертки правых аддонов
|
|
95
|
+
*/
|
|
96
|
+
rightAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
89
97
|
/**
|
|
90
98
|
* Идентификатор для систем автоматизированного тестирования
|
|
91
99
|
*/
|
|
@@ -125,6 +133,8 @@ declare const BaseFormControl: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
125
133
|
inputWrapperClassName?: string | undefined;
|
|
126
134
|
labelClassName?: string | undefined;
|
|
127
135
|
addonsClassName?: string | undefined;
|
|
136
|
+
leftAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
137
|
+
rightAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
128
138
|
dataTestId?: string | undefined;
|
|
129
139
|
children?: ReactNode;
|
|
130
140
|
styles: {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
type MqProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
5
|
+
*/
|
|
6
|
+
query?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Запрос на поддержку тач-событий
|
|
9
|
+
*/
|
|
10
|
+
touch?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Дочерние элементы.
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Обработчик изменений в совпадении запросов
|
|
17
|
+
*/
|
|
18
|
+
onMatchChange?: (isMatched: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
declare const Mq: FC<MqProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Хук для медиа запросов.
|
|
23
|
+
* @param query media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
24
|
+
* @param defaultValue Значение по-умолчанию.
|
|
25
|
+
*/
|
|
26
|
+
declare const useMatchMedia: (query: string, defaultValue?: boolean | (() => boolean)) => boolean[];
|
|
27
|
+
/**
|
|
28
|
+
* Возвращает MediaQueryList для заданного media-выражения.
|
|
29
|
+
*
|
|
30
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
31
|
+
*/
|
|
32
|
+
declare function getMatchMedia(queryProp: string): MediaQueryList;
|
|
33
|
+
/**
|
|
34
|
+
* Удаляет MediaQueryList.
|
|
35
|
+
*
|
|
36
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
37
|
+
*/
|
|
38
|
+
declare function releaseMatchMedia(queryProp: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Возвращает `true`, если есть поддержка `Pointer Events`
|
|
41
|
+
*/
|
|
42
|
+
declare function isPointerEventsSupported(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Возвращает `true`, если есть поддержка `Touch Events`
|
|
45
|
+
*/
|
|
46
|
+
declare function isTouchSupported(): boolean;
|
|
47
|
+
declare const _exports: {
|
|
48
|
+
"--mobile-xs": string;
|
|
49
|
+
"--mobile-s": string;
|
|
50
|
+
"--mobile-m": string;
|
|
51
|
+
"--mobile-l": string;
|
|
52
|
+
"--mobile": string;
|
|
53
|
+
"--tablet-s": string;
|
|
54
|
+
"--tablet-m": string;
|
|
55
|
+
"--tablet": string;
|
|
56
|
+
"--desktop-s": string;
|
|
57
|
+
"--desktop-m": string;
|
|
58
|
+
"--desktop-l": string;
|
|
59
|
+
"--desktop-xl": string;
|
|
60
|
+
"--desktop": string;
|
|
61
|
+
};
|
|
62
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-72dda473";
|
|
4
|
+
/* eslint-disable no-plusplus, no-param-reassign */
|
|
5
|
+
import { MaskitoPlugin, MaskitoPostprocessor, MaskitoPreprocessor } from "@maskito/core";
|
|
6
|
+
declare const isClient: () => boolean;
|
|
7
|
+
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
8
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
9
|
+
declare function easeInOutQuad(x: number): number;
|
|
10
|
+
declare const easingFns: {
|
|
11
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
12
|
+
};
|
|
13
|
+
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
14
|
+
declare const inputUtils: {
|
|
15
|
+
disableUserInput: typeof disableUserInput;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Возвращает true, если значение равно null или undefined
|
|
19
|
+
*/
|
|
20
|
+
declare function isNil(value: unknown): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Выбор значения между min max границами
|
|
23
|
+
*/
|
|
24
|
+
declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
|
|
25
|
+
declare function noop(): void;
|
|
26
|
+
declare const fnUtils: {
|
|
27
|
+
clamp: typeof clamp;
|
|
28
|
+
noop: typeof noop;
|
|
29
|
+
isNil: typeof isNil;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Запрещает каретке становиться за указанные границы
|
|
33
|
+
*/
|
|
34
|
+
declare function caretGuard(guard: (value: string, selection: readonly [
|
|
35
|
+
from: number,
|
|
36
|
+
to: number
|
|
37
|
+
]) => [
|
|
38
|
+
from: number,
|
|
39
|
+
to: number
|
|
40
|
+
]): MaskitoPlugin;
|
|
41
|
+
/**
|
|
42
|
+
* Запрещает удалять указанный префикс
|
|
43
|
+
*/
|
|
44
|
+
declare function prefixPostprocessor(prefix: string): MaskitoPostprocessor;
|
|
45
|
+
/**
|
|
46
|
+
* Препроцессор необходим для правильной вставки/автокомплита телефонного номера
|
|
47
|
+
*/
|
|
48
|
+
declare function insertionPhonePreprocessor(mask: Array<string | RegExp>, countryCode?: string, clearableCountryCode?: boolean): MaskitoPreprocessor;
|
|
49
|
+
declare const maskUtils: {
|
|
50
|
+
insertionPhonePreprocessor: typeof insertionPhonePreprocessor;
|
|
51
|
+
prefixPostprocessor: typeof prefixPostprocessor;
|
|
52
|
+
caretGuard: typeof caretGuard;
|
|
53
|
+
};
|
|
54
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils, maskUtils };
|
package/index-ebda875c.d.ts
CHANGED
|
@@ -86,6 +86,14 @@ type BaseFormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
86
86
|
* Дополнительный класс для аддонов
|
|
87
87
|
*/
|
|
88
88
|
addonsClassName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Свойства для обертки левых аддонов
|
|
91
|
+
*/
|
|
92
|
+
leftAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
93
|
+
/**
|
|
94
|
+
* Свойства для обертки правых аддонов
|
|
95
|
+
*/
|
|
96
|
+
rightAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
89
97
|
/**
|
|
90
98
|
* Идентификатор для систем автоматизированного тестирования
|
|
91
99
|
*/
|
|
@@ -125,6 +133,8 @@ declare const BaseFormControl: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
125
133
|
inputWrapperClassName?: string | undefined;
|
|
126
134
|
labelClassName?: string | undefined;
|
|
127
135
|
addonsClassName?: string | undefined;
|
|
136
|
+
leftAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
137
|
+
rightAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
128
138
|
dataTestId?: string | undefined;
|
|
129
139
|
children?: ReactNode;
|
|
130
140
|
styles: {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BackgroundColorType, GraphicColorType } from "./index-72dda473";
|
|
4
|
+
type IconColorType = Extract<GraphicColorType, 'positive' | 'attention' | 'link' | 'negative' | 'tertiary' | 'secondary' | 'primary'>;
|
|
5
|
+
type BadgeProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Вид компонента
|
|
12
|
+
*/
|
|
13
|
+
view: 'icon' | 'count';
|
|
14
|
+
/**
|
|
15
|
+
* Размер компонента (только для view=icon)
|
|
16
|
+
* //deprecated(используйте height для view=count )
|
|
17
|
+
*/
|
|
18
|
+
size?: 's' | 'm' | 'l' | 'xl';
|
|
19
|
+
/**
|
|
20
|
+
* Видимость белой обводки вокруг иконки
|
|
21
|
+
*/
|
|
22
|
+
visibleIconOutline?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Видимость цветной обводки вокруг иконки (только для view=icon)
|
|
25
|
+
*/
|
|
26
|
+
visibleColorOutline?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Контент компонента
|
|
29
|
+
*/
|
|
30
|
+
content?: React.ReactElement | number;
|
|
31
|
+
/**
|
|
32
|
+
* Высота компонента, min = 16; max = 48 (только для view=count)
|
|
33
|
+
*/
|
|
34
|
+
height?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Цветовое оформление бейджа при view='count'
|
|
37
|
+
*/
|
|
38
|
+
color?: Extract<BackgroundColorType, 'accent' | 'primary' | 'specialbg-secondary-transparent'>;
|
|
39
|
+
/**
|
|
40
|
+
* Цветовое оформление бейджа при view='icon'
|
|
41
|
+
*/
|
|
42
|
+
iconColor?: IconColorType;
|
|
43
|
+
/**
|
|
44
|
+
* Цвет подложки под иконкой
|
|
45
|
+
*/
|
|
46
|
+
iconUnderlayColor?: Extract<GraphicColorType, 'primary' | 'static-light'>;
|
|
47
|
+
/**
|
|
48
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
49
|
+
*/
|
|
50
|
+
dataTestId?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const Badge: ({ className, size, view, visibleIconOutline, visibleColorOutline, content, height, iconColor, color, iconUnderlayColor, dataTestId, }: BadgeProps) => React.JSX.Element;
|
|
53
|
+
export { IconColorType, BadgeProps, Badge };
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type
|
|
5
|
-
declare const
|
|
6
|
-
export
|
|
3
|
+
import { BaseInputProps } from "./index-ebda875c";
|
|
4
|
+
type InputMobileProps = Omit<BaseInputProps, 'FormControlComponent' | 'colorStyles'>;
|
|
5
|
+
declare const InputMobile: React.ForwardRefExoticComponent<InputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
export * from "./Component.mobile-d7e9f69d";
|
|
7
|
+
export { InputMobileProps, InputMobile };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BaseFormControlProps } from "./index-ebda875c";
|
|
4
|
+
type FormControlProps = Omit<BaseFormControlProps, 'styles' | 'colorStyles'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
7
|
+
* @default 1024
|
|
8
|
+
*/
|
|
9
|
+
breakpoint?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
12
|
+
*/
|
|
13
|
+
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
14
|
+
};
|
|
15
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<BaseFormControlProps, "styles" | "colorStyles"> & {
|
|
16
|
+
/**
|
|
17
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
18
|
+
* @default 1024
|
|
19
|
+
*/
|
|
20
|
+
breakpoint?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Значение по-умолчанию для хука useMatchMedia
|
|
23
|
+
*/
|
|
24
|
+
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export { FormControlProps, FormControl };
|
|
@@ -39,7 +39,7 @@ type NumberInputProps = Omit<InputProps, 'value' | 'onChange' | 'type'> & {
|
|
|
39
39
|
valueString: string;
|
|
40
40
|
}) => void;
|
|
41
41
|
};
|
|
42
|
-
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "
|
|
42
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "onChange" | "type"> & {
|
|
43
43
|
/**
|
|
44
44
|
* Значение поля ввода
|
|
45
45
|
*/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
type MqProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
5
|
+
*/
|
|
6
|
+
query?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Запрос на поддержку тач-событий
|
|
9
|
+
*/
|
|
10
|
+
touch?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Дочерние элементы.
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Обработчик изменений в совпадении запросов
|
|
17
|
+
*/
|
|
18
|
+
onMatchChange?: (isMatched: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
declare const Mq: FC<MqProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Хук для медиа запросов.
|
|
23
|
+
* @param query media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
24
|
+
* @param defaultValue Значение по-умолчанию.
|
|
25
|
+
*/
|
|
26
|
+
declare const useMatchMedia: (query: string, defaultValue?: boolean | (() => boolean)) => boolean[];
|
|
27
|
+
/**
|
|
28
|
+
* Возвращает MediaQueryList для заданного media-выражения.
|
|
29
|
+
*
|
|
30
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
31
|
+
*/
|
|
32
|
+
declare function getMatchMedia(queryProp: string): MediaQueryList;
|
|
33
|
+
/**
|
|
34
|
+
* Удаляет MediaQueryList.
|
|
35
|
+
*
|
|
36
|
+
* @param queryProp media выражение или кастомный запрос из `mq.json`, например `--mobile`.
|
|
37
|
+
*/
|
|
38
|
+
declare function releaseMatchMedia(queryProp: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Возвращает `true`, если есть поддержка `Pointer Events`
|
|
41
|
+
*/
|
|
42
|
+
declare function isPointerEventsSupported(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Возвращает `true`, если есть поддержка `Touch Events`
|
|
45
|
+
*/
|
|
46
|
+
declare function isTouchSupported(): boolean;
|
|
47
|
+
declare const _exports: {
|
|
48
|
+
"--mobile-xs": string;
|
|
49
|
+
"--mobile-s": string;
|
|
50
|
+
"--mobile-m": string;
|
|
51
|
+
"--mobile-l": string;
|
|
52
|
+
"--mobile": string;
|
|
53
|
+
"--tablet-s": string;
|
|
54
|
+
"--tablet-m": string;
|
|
55
|
+
"--tablet": string;
|
|
56
|
+
"--desktop-s": string;
|
|
57
|
+
"--desktop-m": string;
|
|
58
|
+
"--desktop-l": string;
|
|
59
|
+
"--desktop-xl": string;
|
|
60
|
+
"--desktop": string;
|
|
61
|
+
};
|
|
62
|
+
export { _exports as default, MqProps, Mq, useMatchMedia, getMatchMedia, releaseMatchMedia, isPointerEventsSupported, isTouchSupported };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { PaddingType } from "./index-72dda473";
|
|
4
|
+
/* eslint-disable no-plusplus, no-param-reassign */
|
|
5
|
+
import { MaskitoPlugin, MaskitoPostprocessor, MaskitoPreprocessor } from "@maskito/core";
|
|
6
|
+
declare const isClient: () => boolean;
|
|
7
|
+
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
8
|
+
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
9
|
+
declare function easeInOutQuad(x: number): number;
|
|
10
|
+
declare const easingFns: {
|
|
11
|
+
easeInOutQuad: typeof easeInOutQuad;
|
|
12
|
+
};
|
|
13
|
+
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
14
|
+
declare const inputUtils: {
|
|
15
|
+
disableUserInput: typeof disableUserInput;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Возвращает true, если значение равно null или undefined
|
|
19
|
+
*/
|
|
20
|
+
declare function isNil(value: unknown): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Выбор значения между min max границами
|
|
23
|
+
*/
|
|
24
|
+
declare function clamp<T extends Date | number>(value: T, min: T, max: T): T;
|
|
25
|
+
declare function noop(): void;
|
|
26
|
+
declare const fnUtils: {
|
|
27
|
+
clamp: typeof clamp;
|
|
28
|
+
noop: typeof noop;
|
|
29
|
+
isNil: typeof isNil;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Запрещает каретке становиться за указанные границы
|
|
33
|
+
*/
|
|
34
|
+
declare function caretGuard(guard: (value: string, selection: readonly [
|
|
35
|
+
from: number,
|
|
36
|
+
to: number
|
|
37
|
+
]) => [
|
|
38
|
+
from: number,
|
|
39
|
+
to: number
|
|
40
|
+
]): MaskitoPlugin;
|
|
41
|
+
/**
|
|
42
|
+
* Запрещает удалять указанный префикс
|
|
43
|
+
*/
|
|
44
|
+
declare function prefixPostprocessor(prefix: string): MaskitoPostprocessor;
|
|
45
|
+
/**
|
|
46
|
+
* Препроцессор необходим для правильной вставки/автокомплита телефонного номера
|
|
47
|
+
*/
|
|
48
|
+
declare function insertionPhonePreprocessor(mask: Array<string | RegExp>, countryCode?: string, clearableCountryCode?: boolean): MaskitoPreprocessor;
|
|
49
|
+
declare const maskUtils: {
|
|
50
|
+
insertionPhonePreprocessor: typeof insertionPhonePreprocessor;
|
|
51
|
+
prefixPostprocessor: typeof prefixPostprocessor;
|
|
52
|
+
caretGuard: typeof caretGuard;
|
|
53
|
+
};
|
|
54
|
+
export { isClient, getDataTestId, createPaddingStyle, easingFns, inputUtils, fnUtils, maskUtils };
|
|
@@ -86,6 +86,14 @@ type BaseFormControlProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
86
86
|
* Дополнительный класс для аддонов
|
|
87
87
|
*/
|
|
88
88
|
addonsClassName?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Свойства для обертки левых аддонов
|
|
91
|
+
*/
|
|
92
|
+
leftAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
93
|
+
/**
|
|
94
|
+
* Свойства для обертки правых аддонов
|
|
95
|
+
*/
|
|
96
|
+
rightAddonsProps?: HTMLAttributes<HTMLDivElement>;
|
|
89
97
|
/**
|
|
90
98
|
* Идентификатор для систем автоматизированного тестирования
|
|
91
99
|
*/
|
|
@@ -125,6 +133,8 @@ declare const BaseFormControl: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
125
133
|
inputWrapperClassName?: string | undefined;
|
|
126
134
|
labelClassName?: string | undefined;
|
|
127
135
|
addonsClassName?: string | undefined;
|
|
136
|
+
leftAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
137
|
+
rightAddonsProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
128
138
|
dataTestId?: string | undefined;
|
|
129
139
|
children?: ReactNode;
|
|
130
140
|
styles: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-number-input",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@alfalab/core-components-input": "^12.
|
|
17
|
+
"@alfalab/core-components-input": "^12.2.0",
|
|
18
18
|
"react-merge-refs": "^1.1.0",
|
|
19
19
|
"tslib": "^2.4.0"
|
|
20
20
|
}
|
package/cssm/index-1a4fbd11.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { PaddingType } from "./index-72dda473";
|
|
4
|
-
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
5
|
-
declare const isClient: () => boolean;
|
|
6
|
-
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
7
|
-
declare function easeInOutQuad(x: number): number;
|
|
8
|
-
declare const easingFns: {
|
|
9
|
-
easeInOutQuad: typeof easeInOutQuad;
|
|
10
|
-
};
|
|
11
|
-
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
12
|
-
declare const inputUtils: {
|
|
13
|
-
disableUserInput: typeof disableUserInput;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Возвращает true, если значение равно null или undefined
|
|
17
|
-
*/
|
|
18
|
-
declare function isNil(value: unknown): boolean;
|
|
19
|
-
declare const fnUtils: {
|
|
20
|
-
isNil: typeof isNil;
|
|
21
|
-
};
|
|
22
|
-
export { createPaddingStyle, isClient, getDataTestId, easingFns, inputUtils, fnUtils };
|
package/esm/index-1a4fbd11.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { PaddingType } from "./index-72dda473";
|
|
4
|
-
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
5
|
-
declare const isClient: () => boolean;
|
|
6
|
-
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
7
|
-
declare function easeInOutQuad(x: number): number;
|
|
8
|
-
declare const easingFns: {
|
|
9
|
-
easeInOutQuad: typeof easeInOutQuad;
|
|
10
|
-
};
|
|
11
|
-
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
12
|
-
declare const inputUtils: {
|
|
13
|
-
disableUserInput: typeof disableUserInput;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Возвращает true, если значение равно null или undefined
|
|
17
|
-
*/
|
|
18
|
-
declare function isNil(value: unknown): boolean;
|
|
19
|
-
declare const fnUtils: {
|
|
20
|
-
isNil: typeof isNil;
|
|
21
|
-
};
|
|
22
|
-
export { createPaddingStyle, isClient, getDataTestId, easingFns, inputUtils, fnUtils };
|
package/index-1a4fbd11.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { PaddingType } from "./index-72dda473";
|
|
4
|
-
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
5
|
-
declare const isClient: () => boolean;
|
|
6
|
-
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
7
|
-
declare function easeInOutQuad(x: number): number;
|
|
8
|
-
declare const easingFns: {
|
|
9
|
-
easeInOutQuad: typeof easeInOutQuad;
|
|
10
|
-
};
|
|
11
|
-
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
12
|
-
declare const inputUtils: {
|
|
13
|
-
disableUserInput: typeof disableUserInput;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Возвращает true, если значение равно null или undefined
|
|
17
|
-
*/
|
|
18
|
-
declare function isNil(value: unknown): boolean;
|
|
19
|
-
declare const fnUtils: {
|
|
20
|
-
isNil: typeof isNil;
|
|
21
|
-
};
|
|
22
|
-
export { createPaddingStyle, isClient, getDataTestId, easingFns, inputUtils, fnUtils };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { PaddingType } from "./index-72dda473";
|
|
4
|
-
declare function createPaddingStyle(padding?: PaddingType): undefined | React.CSSProperties;
|
|
5
|
-
declare const isClient: () => boolean;
|
|
6
|
-
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
7
|
-
declare function easeInOutQuad(x: number): number;
|
|
8
|
-
declare const easingFns: {
|
|
9
|
-
easeInOutQuad: typeof easeInOutQuad;
|
|
10
|
-
};
|
|
11
|
-
declare function disableUserInput<T>(disabled: boolean | undefined, event: React.KeyboardEvent<T>): void;
|
|
12
|
-
declare const inputUtils: {
|
|
13
|
-
disableUserInput: typeof disableUserInput;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Возвращает true, если значение равно null или undefined
|
|
17
|
-
*/
|
|
18
|
-
declare function isNil(value: unknown): boolean;
|
|
19
|
-
declare const fnUtils: {
|
|
20
|
-
isNil: typeof isNil;
|
|
21
|
-
};
|
|
22
|
-
export { createPaddingStyle, isClient, getDataTestId, easingFns, inputUtils, fnUtils };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|