@alfalab/core-components-international-phone-input 2.3.0 → 2.3.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/Component.responsive.d.ts +4 -4
- package/component-03d088c4.d.ts +2 -2
- package/component-8bdd19d3.d.ts +123 -0
- package/components/base-international-phone-input/Component.d.ts +2 -2
- package/components/base-international-phone-input/Component.js +1 -1
- package/components/base-international-phone-input/index.css +2 -2
- package/components/country-select/Component.js +1 -1
- package/components/country-select/index.css +8 -8
- package/components/flag-icon/component.js +1 -1
- package/components/flag-icon/index.css +3 -3
- package/components/select-field/component.js +1 -1
- package/components/select-field/index.css +9 -9
- package/cssm/index-03d088c4.d.ts +1 -1
- package/cssm/index-281accb7.d.ts +1 -1
- package/{esm/utils-1132e887.d.ts → cssm/utils-34f6b81b.d.ts} +2 -1
- package/esm/components/base-international-phone-input/Component.js +1 -1
- package/esm/components/base-international-phone-input/index.css +2 -2
- package/esm/components/country-select/Component.js +1 -1
- package/esm/components/country-select/index.css +8 -8
- package/esm/components/flag-icon/component.js +1 -1
- package/esm/components/flag-icon/index.css +3 -3
- package/esm/components/select-field/component.js +1 -1
- package/esm/components/select-field/index.css +9 -9
- package/esm/index-03d088c4.d.ts +1 -1
- package/esm/index-281accb7.d.ts +1 -1
- package/{modern/utils-1132e887.d.ts → esm/utils-34f6b81b.d.ts} +2 -1
- package/index-03d088c4.d.ts +3 -3
- package/index-281accb7.d.ts +3 -3
- package/modern/components/base-international-phone-input/Component.js +1 -1
- package/modern/components/base-international-phone-input/index.css +2 -2
- package/modern/components/country-select/Component.js +1 -1
- package/modern/components/country-select/index.css +8 -8
- package/modern/components/flag-icon/component.js +1 -1
- package/modern/components/flag-icon/index.css +3 -3
- package/modern/components/select-field/component.js +1 -1
- package/modern/components/select-field/index.css +9 -9
- package/modern/index-03d088c4.d.ts +1 -1
- package/modern/index-281accb7.d.ts +1 -1
- package/{cssm/utils-1132e887.d.ts → modern/utils-34f6b81b.d.ts} +2 -1
- package/moderncssm/index-03d088c4.d.ts +1 -1
- package/moderncssm/index-281accb7.d.ts +1 -1
- package/moderncssm/{utils-1132e887.d.ts → utils-34f6b81b.d.ts} +2 -1
- package/package.json +3 -3
- package/typings-7d83ec1e.d.ts +1 -1
- package/utils-34f6b81b.d.ts +82 -0
- package/moderncssm/component-eb15729d.d.ts +0 -123
- package/utils-1132e887.d.ts +0 -81
- /package/{component-eb15729d.d.ts → cssm/component-8bdd19d3.d.ts} +0 -0
- /package/{cssm/component-eb15729d.d.ts → esm/component-8bdd19d3.d.ts} +0 -0
- /package/{esm/component-eb15729d.d.ts → modern/component-8bdd19d3.d.ts} +0 -0
- /package/{modern/component-eb15729d.d.ts → moderncssm/component-8bdd19d3.d.ts} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { BaseSelectProps, GroupShape, OptionShape, OptionsListProps } from "./typings-7d83ec1e";
|
|
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'], filterFn?: (option: OptionShape | GroupShape) => boolean, filterGroup?: boolean): {
|
|
10
|
+
filteredOptions: (OptionShape | GroupShape)[];
|
|
11
|
+
flatOptions: OptionShape[];
|
|
12
|
+
selectedOptions: OptionShape[];
|
|
13
|
+
};
|
|
14
|
+
type useVisibleOptionsArgs = {
|
|
15
|
+
/**
|
|
16
|
+
* Количество видимых пунктов
|
|
17
|
+
*/
|
|
18
|
+
visibleOptions: number;
|
|
19
|
+
/**
|
|
20
|
+
* Реф на контейнер с пунтами меню
|
|
21
|
+
*/
|
|
22
|
+
listRef: RefObject<HTMLElement>;
|
|
23
|
+
/**
|
|
24
|
+
* Реф на контейнер, которому нужно установить высоту
|
|
25
|
+
*/
|
|
26
|
+
styleTargetRef?: RefObject<HTMLElement>;
|
|
27
|
+
/**
|
|
28
|
+
* Флаг открытия меню
|
|
29
|
+
*/
|
|
30
|
+
open?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Позволяет вызвать пересчет высоты
|
|
33
|
+
*/
|
|
34
|
+
invalidate?: unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Список вариантов выбора
|
|
37
|
+
*/
|
|
38
|
+
options?: Array<OptionShape | GroupShape>;
|
|
39
|
+
/**
|
|
40
|
+
* Максимальный размер варианта выбора
|
|
41
|
+
*/
|
|
42
|
+
size?: Extract<OptionsListProps['size'], number>;
|
|
43
|
+
/**
|
|
44
|
+
* Учитывать действительное число вариантов выбора
|
|
45
|
+
*/
|
|
46
|
+
actualOptionsCount?: boolean;
|
|
47
|
+
};
|
|
48
|
+
declare function useVirtualVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): void;
|
|
49
|
+
declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): boolean;
|
|
50
|
+
declare function defaultFilterFn(optionText: string, search: string): boolean;
|
|
51
|
+
declare function defaultGroupAccessor(option: GroupShape): string | undefined;
|
|
52
|
+
declare function defaultAccessor(option: OptionShape): string;
|
|
53
|
+
declare function usePrevious<T>(value: T): T | undefined;
|
|
54
|
+
declare const lastIndexOf: <T>(array: T[], predicate: (item: T) => boolean) => number;
|
|
55
|
+
declare function getSelectTestIds(dataTestId: string): {
|
|
56
|
+
select: string;
|
|
57
|
+
option: string;
|
|
58
|
+
optionsList: string;
|
|
59
|
+
clearButton: string;
|
|
60
|
+
applyButton: string;
|
|
61
|
+
field: string;
|
|
62
|
+
fieldFormControl: string;
|
|
63
|
+
fieldLeftAddons: string;
|
|
64
|
+
fieldRightAddons: string;
|
|
65
|
+
fieldError: string;
|
|
66
|
+
fieldHint: string;
|
|
67
|
+
fieldClearIcon: string;
|
|
68
|
+
searchInput: string;
|
|
69
|
+
searchFormControl: string;
|
|
70
|
+
searchInner: string;
|
|
71
|
+
searchLeftAddons: string;
|
|
72
|
+
searchRightAddons: string;
|
|
73
|
+
searchError: string;
|
|
74
|
+
searchHint: string;
|
|
75
|
+
bottomSheet: string;
|
|
76
|
+
bottomSheetHeader: string;
|
|
77
|
+
bottomSheetContent: string;
|
|
78
|
+
modal: string;
|
|
79
|
+
modalHeader: string;
|
|
80
|
+
modalContent: string;
|
|
81
|
+
};
|
|
82
|
+
export { isGroup, isOptionShape, joinOptions, processOptions, useVirtualVisibleOptions, useVisibleOptions, defaultFilterFn, defaultGroupAccessor, defaultAccessor, usePrevious, lastIndexOf, getSelectTestIds };
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { HTMLAttributes } from "react";
|
|
4
|
-
import { Color } from "./colors-facf1d2a";
|
|
5
|
-
import { TextSkeletonProps } from "./types-1328ead9";
|
|
6
|
-
declare function getDefaultWeight(font: "styrene" | "system", platform: "mobile" | "desktop"): "medium" | "bold" | "semibold";
|
|
7
|
-
type NativeProps = HTMLAttributes<HTMLHeadingElement>;
|
|
8
|
-
type TitleProps = Omit<NativeProps, 'color'> & {
|
|
9
|
-
/**
|
|
10
|
-
* HTML тег
|
|
11
|
-
*/
|
|
12
|
-
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
|
13
|
-
/**
|
|
14
|
-
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
|
|
15
|
-
*/
|
|
16
|
-
view?: 'xlarge' | 'large' | 'medium' | 'small' | 'xsmall';
|
|
17
|
-
/**
|
|
18
|
-
* Цвет текста
|
|
19
|
-
*/
|
|
20
|
-
color?: Color;
|
|
21
|
-
/**
|
|
22
|
-
* Толщина шрифта
|
|
23
|
-
*/
|
|
24
|
-
weight?: 'regular' | 'medium' | 'bold' | 'semibold';
|
|
25
|
-
/**
|
|
26
|
-
* Шрифт текста
|
|
27
|
-
*/
|
|
28
|
-
font?: 'styrene' | 'system';
|
|
29
|
-
/**
|
|
30
|
-
* Добавляет отступы
|
|
31
|
-
*/
|
|
32
|
-
defaultMargins?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Css-класс для стилизации (native prop)
|
|
35
|
-
*/
|
|
36
|
-
className?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Id компонента для тестов
|
|
39
|
-
*/
|
|
40
|
-
dataTestId?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Контент (native prop)
|
|
43
|
-
*/
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
/**
|
|
46
|
-
* Количество строк
|
|
47
|
-
*/
|
|
48
|
-
rowLimit?: 1 | 2 | 3;
|
|
49
|
-
/**
|
|
50
|
-
* Показать скелетон
|
|
51
|
-
*/
|
|
52
|
-
showSkeleton?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Пропы для скелетона
|
|
55
|
-
*/
|
|
56
|
-
skeletonProps?: TextSkeletonProps;
|
|
57
|
-
/**
|
|
58
|
-
* Значение по-умолчанию для хука useMatchMedia
|
|
59
|
-
*/
|
|
60
|
-
defaultMatchMediaValue?: boolean | (() => boolean);
|
|
61
|
-
};
|
|
62
|
-
type PrivateProps = {
|
|
63
|
-
styles: {
|
|
64
|
-
[key: string]: string;
|
|
65
|
-
};
|
|
66
|
-
platform: 'mobile' | 'desktop';
|
|
67
|
-
};
|
|
68
|
-
type TitleElementType = HTMLHeadingElement | HTMLDivElement;
|
|
69
|
-
declare const TitleBase: React.ForwardRefExoticComponent<Omit<NativeProps, "color"> & {
|
|
70
|
-
/**
|
|
71
|
-
* HTML тег
|
|
72
|
-
*/
|
|
73
|
-
tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
|
74
|
-
/**
|
|
75
|
-
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
|
|
76
|
-
*/
|
|
77
|
-
view?: "small" | "medium" | "large" | "xlarge" | "xsmall" | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* Цвет текста
|
|
80
|
-
*/
|
|
81
|
-
color?: "link" | "accent" | "primary" | "primary-inverted" | "secondary" | "secondary-inverted" | "tertiary" | "tertiary-inverted" | "attention" | "positive" | "negative" | "static-accent" | "disabled" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* Толщина шрифта
|
|
84
|
-
*/
|
|
85
|
-
weight?: "bold" | "medium" | "regular" | "semibold" | undefined;
|
|
86
|
-
/**
|
|
87
|
-
* Шрифт текста
|
|
88
|
-
*/
|
|
89
|
-
font?: "styrene" | "system" | undefined;
|
|
90
|
-
/**
|
|
91
|
-
* Добавляет отступы
|
|
92
|
-
*/
|
|
93
|
-
defaultMargins?: boolean | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Css-класс для стилизации (native prop)
|
|
96
|
-
*/
|
|
97
|
-
className?: string | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Id компонента для тестов
|
|
100
|
-
*/
|
|
101
|
-
dataTestId?: string | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* Контент (native prop)
|
|
104
|
-
*/
|
|
105
|
-
children?: React.ReactNode;
|
|
106
|
-
/**
|
|
107
|
-
* Количество строк
|
|
108
|
-
*/
|
|
109
|
-
rowLimit?: 1 | 2 | 3 | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Показать скелетон
|
|
112
|
-
*/
|
|
113
|
-
showSkeleton?: boolean | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* Пропы для скелетона
|
|
116
|
-
*/
|
|
117
|
-
skeletonProps?: TextSkeletonProps | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Значение по-умолчанию для хука useMatchMedia
|
|
120
|
-
*/
|
|
121
|
-
defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
|
|
122
|
-
} & PrivateProps & React.RefAttributes<TitleElementType>>;
|
|
123
|
-
export { getDefaultWeight, TitleProps, TitleBase };
|
package/utils-1132e887.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ReactNode, RefObject } from 'react';
|
|
2
|
-
import { BaseSelectProps, GroupShape, OptionShape, OptionsListProps } from "./typings-7d83ec1e";
|
|
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'], filterFn?: (option: OptionShape | GroupShape) => boolean, filterGroup?: boolean): {
|
|
10
|
-
filteredOptions: (OptionShape | GroupShape)[];
|
|
11
|
-
flatOptions: OptionShape[];
|
|
12
|
-
selectedOptions: OptionShape[];
|
|
13
|
-
};
|
|
14
|
-
type useVisibleOptionsArgs = {
|
|
15
|
-
/**
|
|
16
|
-
* Количество видимых пунктов
|
|
17
|
-
*/
|
|
18
|
-
visibleOptions: number;
|
|
19
|
-
/**
|
|
20
|
-
* Реф на контейнер с пунтами меню
|
|
21
|
-
*/
|
|
22
|
-
listRef: RefObject<HTMLElement>;
|
|
23
|
-
/**
|
|
24
|
-
* Реф на контейнер, которому нужно установить высоту
|
|
25
|
-
*/
|
|
26
|
-
styleTargetRef?: RefObject<HTMLElement>;
|
|
27
|
-
/**
|
|
28
|
-
* Флаг открытия меню
|
|
29
|
-
*/
|
|
30
|
-
open?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Позволяет вызвать пересчет высоты
|
|
33
|
-
*/
|
|
34
|
-
invalidate?: unknown;
|
|
35
|
-
/**
|
|
36
|
-
* Список вариантов выбора
|
|
37
|
-
*/
|
|
38
|
-
options?: Array<OptionShape | GroupShape>;
|
|
39
|
-
/**
|
|
40
|
-
* Максимальный размер варианта выбора
|
|
41
|
-
*/
|
|
42
|
-
size?: Extract<OptionsListProps['size'], number>;
|
|
43
|
-
/**
|
|
44
|
-
* Учитывать действительное число вариантов выбора
|
|
45
|
-
*/
|
|
46
|
-
actualOptionsCount?: boolean;
|
|
47
|
-
};
|
|
48
|
-
declare function useVisibleOptions({ visibleOptions, listRef, styleTargetRef, open, invalidate, options, size, actualOptionsCount, }: useVisibleOptionsArgs): boolean;
|
|
49
|
-
declare function defaultFilterFn(optionText: string, search: string): boolean;
|
|
50
|
-
declare function defaultGroupAccessor(option: GroupShape): string | undefined;
|
|
51
|
-
declare function defaultAccessor(option: OptionShape): string;
|
|
52
|
-
declare function usePrevious<T>(value: T): T | undefined;
|
|
53
|
-
declare const lastIndexOf: <T>(array: T[], predicate: (item: T) => boolean) => number;
|
|
54
|
-
declare function getSelectTestIds(dataTestId: string): {
|
|
55
|
-
select: string;
|
|
56
|
-
option: string;
|
|
57
|
-
optionsList: string;
|
|
58
|
-
clearButton: string;
|
|
59
|
-
applyButton: string;
|
|
60
|
-
field: string;
|
|
61
|
-
fieldFormControl: string;
|
|
62
|
-
fieldLeftAddons: string;
|
|
63
|
-
fieldRightAddons: string;
|
|
64
|
-
fieldError: string;
|
|
65
|
-
fieldHint: string;
|
|
66
|
-
fieldClearIcon: string;
|
|
67
|
-
searchInput: string;
|
|
68
|
-
searchFormControl: string;
|
|
69
|
-
searchInner: string;
|
|
70
|
-
searchLeftAddons: string;
|
|
71
|
-
searchRightAddons: string;
|
|
72
|
-
searchError: string;
|
|
73
|
-
searchHint: string;
|
|
74
|
-
bottomSheet: string;
|
|
75
|
-
bottomSheetHeader: string;
|
|
76
|
-
bottomSheetContent: string;
|
|
77
|
-
modal: string;
|
|
78
|
-
modalHeader: string;
|
|
79
|
-
modalContent: string;
|
|
80
|
-
};
|
|
81
|
-
export { isGroup, isOptionShape, joinOptions, processOptions, useVisibleOptions, defaultFilterFn, defaultGroupAccessor, defaultAccessor, usePrevious, lastIndexOf, getSelectTestIds };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|