@true-engineering/true-react-common-ui-kit 4.0.0-alpha5 → 4.0.0-alpha6
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/README.md +53 -0
- package/dist/components/FiltersPane/types.d.ts +15 -5
- package/dist/components/Flag/customFlags/customFlags.d.ts +10 -0
- package/dist/components/Flag/customFlags/index.d.ts +1 -0
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +1 -1
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +5 -4
- package/dist/components/FlexibleTable/constants.d.ts +18 -2
- package/dist/components/FlexibleTable/types.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +2 -2
- package/dist/components/SearchInput/SearchInput.stories.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +5 -3
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.styles.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +112 -78
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +111 -77
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +19 -17
- package/src/components/FiltersPane/types.ts +23 -5
- package/src/components/Flag/Flag.stories.tsx +2 -1
- package/src/components/Flag/Flag.styles.ts +4 -0
- package/src/components/Flag/Flag.tsx +23 -9
- package/src/components/Flag/customFlags/AB.svg +1 -0
- package/src/components/Flag/customFlags/OS.svg +1 -0
- package/src/components/Flag/customFlags/augment.d.ts +1 -0
- package/src/components/Flag/customFlags/customFlags.ts +13 -0
- package/src/components/Flag/customFlags/index.ts +1 -0
- package/src/components/FlexibleTable/FlexibleTable.tsx +1 -0
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +6 -3
- package/src/components/FlexibleTable/constants.ts +6 -3
- package/src/components/FlexibleTable/types.ts +1 -5
- package/src/components/PhoneInput/PhoneInput.stories.tsx +2 -1
- package/src/components/PhoneInput/PhoneInput.tsx +5 -2
- package/src/components/SearchInput/SearchInput.tsx +23 -28
- package/src/components/Select/Select.tsx +11 -2
- package/src/components/Tooltip/Tooltip.styles.ts +2 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/constants/phone-info.ts +20 -33
- package/src/helpers/phone.ts +19 -15
package/README.md
CHANGED
|
@@ -11,6 +11,59 @@
|
|
|
11
11
|
|
|
12
12
|
# Release Notes
|
|
13
13
|
|
|
14
|
+
## 3.49.0
|
|
15
|
+
|
|
16
|
+
### Changes
|
|
17
|
+
|
|
18
|
+
- **FiltersPane**: Добавлен `getSelectedValue` для удобного рендера значения в `custom`-фильтре с `valueViewType: 'multiple'`
|
|
19
|
+
- **FiltersPane**: Добавлен экспорт `ICustomComponentProps` для `CustomComponent` в `ICustomConfigItem`
|
|
20
|
+
- **FiltersPane**: Кастомный фильтр разделён на два типа `ICustomRangeConfigItem` и `ICustomMultipleConfigItem`
|
|
21
|
+
|
|
22
|
+
## 3.48.0
|
|
23
|
+
|
|
24
|
+
### Changes
|
|
25
|
+
|
|
26
|
+
- **FlexibleTable**: Добавлен rowRef
|
|
27
|
+
|
|
28
|
+
## 3.47.0
|
|
29
|
+
|
|
30
|
+
### Changes
|
|
31
|
+
|
|
32
|
+
- **Select**: Добавлен ref в пропсу `searchInput` Select-а
|
|
33
|
+
- **Select**: Добавлен shouldFocusOnMount в пропсу `searchInput` Select-а
|
|
34
|
+
|
|
35
|
+
## 3.46.0
|
|
36
|
+
|
|
37
|
+
### Changes
|
|
38
|
+
|
|
39
|
+
- **SearchInput**: Добавлен forwardRef
|
|
40
|
+
|
|
41
|
+
## 3.45.6
|
|
42
|
+
|
|
43
|
+
- **phone.ts** Изменён алгоритм определения кода страны по номеру телефона
|
|
44
|
+
- **phone-info.ts** Добавлены dialCode для Южной Осетии
|
|
45
|
+
- **phone-info.ts** Актуализированы dialCode для Казахстана
|
|
46
|
+
|
|
47
|
+
## 3.45.5
|
|
48
|
+
|
|
49
|
+
### Changes
|
|
50
|
+
|
|
51
|
+
- **Tooltip**: Добавлен вариант `custom` для `view`
|
|
52
|
+
|
|
53
|
+
## 3.45.4
|
|
54
|
+
|
|
55
|
+
### Changes
|
|
56
|
+
|
|
57
|
+
- **Select**: Убирает лишние вызовы `onBlur` при использовании Popper, если поле не открыто
|
|
58
|
+
|
|
59
|
+
## 3.45.3
|
|
60
|
+
|
|
61
|
+
### Changes
|
|
62
|
+
|
|
63
|
+
- **Flag**: Добавлены флаги для Абхазии и Южной Осетии
|
|
64
|
+
- **PhoneInput**: Добавлены PhoneInfo для Абхазии и Южной осетии.
|
|
65
|
+
- **PhoneInput**: Исправлен баг с невозможностью выбора стран с одинаковыми dialCode
|
|
66
|
+
|
|
14
67
|
## 3.45.2
|
|
15
68
|
|
|
16
69
|
### Changes
|
|
@@ -54,20 +54,30 @@ export type IDateRangeConfigItem<Value> = IConfigItemBasicBase<Value> & {
|
|
|
54
54
|
type: 'dateRange';
|
|
55
55
|
dateFormat?: string;
|
|
56
56
|
} & Omit<IFilterWithPeriodProps, 'value' | 'onChange' | 'setIsOpen'>;
|
|
57
|
-
export
|
|
57
|
+
export interface ICustomComponentProps<Value> {
|
|
58
58
|
value?: Value;
|
|
59
59
|
onChange: (v?: Value) => void;
|
|
60
60
|
onClose?: () => void;
|
|
61
61
|
filter: ICustomConfigItem<Value>;
|
|
62
62
|
localeKey?: IFilterLocaleKey;
|
|
63
63
|
locale?: IPartialFilterLocale;
|
|
64
|
-
}
|
|
65
|
-
export
|
|
66
|
-
|
|
64
|
+
}
|
|
65
|
+
export type CustomComponent<Value> = FC<ICustomComponentProps<Value>>;
|
|
66
|
+
export type ICustomValue<V> = V extends Array<infer T> ? T : never;
|
|
67
|
+
export interface ICustomRangeConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
68
|
+
[key: string & {}]: any;
|
|
69
|
+
type: 'custom';
|
|
70
|
+
component: CustomComponent<Value>;
|
|
71
|
+
valueViewType?: 'range';
|
|
72
|
+
}
|
|
73
|
+
export interface ICustomMultipleConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
74
|
+
[key: string & {}]: any;
|
|
67
75
|
type: 'custom';
|
|
68
76
|
component: CustomComponent<Value>;
|
|
69
|
-
valueViewType?: '
|
|
77
|
+
valueViewType?: 'multiple';
|
|
78
|
+
getSelectedValue?: (v: ICustomValue<Value>) => ReactNode;
|
|
70
79
|
}
|
|
80
|
+
export type ICustomConfigItem<Value> = ICustomRangeConfigItem<Value> | ICustomMultipleConfigItem<Value>;
|
|
71
81
|
export type ConfigItem<Value> = ISelectConfigItem<Value> | IMultiSelectConfigItem<Value> | ICustomConfigItem<Value> | IDateRangeWithoutPeriodConfigItem<Value> | IDateRangeConfigItem<Value> | IIntervalConfigItem<Value> | IBooleanConfigItem<Value>;
|
|
72
82
|
export type ConfigType<Values> = {
|
|
73
83
|
[K in keyof Values]: ConfigItem<Values[K]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './customFlags';
|
|
@@ -3,7 +3,7 @@ import { ICommonProps } from '../../types';
|
|
|
3
3
|
import { IFlexibleTableRowProps } from './components';
|
|
4
4
|
import { ITableRow, IFlexibleTableConfigType, IInfinityScrollConfig, IFlexibleTableRenderMode, IHeaderContent } from './types';
|
|
5
5
|
import { IFlexibleTableStyles } from './FlexibleTable.styles';
|
|
6
|
-
export interface IFlexibleTableProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends ICommonProps<IFlexibleTableStyles>, Pick<IFlexibleTableRowProps<Row, HeaderContent, UniqueField>, 'uniqueField' | 'rowAttributes' | 'isFirstColumnSticky' | 'isExpandableRowComponentInitiallyOpen' | 'expandableRowComponent' | 'onRowClick' | 'onRowHover'> {
|
|
6
|
+
export interface IFlexibleTableProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends ICommonProps<IFlexibleTableStyles>, Pick<IFlexibleTableRowProps<Row, HeaderContent, UniqueField>, 'uniqueField' | 'rowAttributes' | 'isFirstColumnSticky' | 'isExpandableRowComponentInitiallyOpen' | 'expandableRowComponent' | 'onRowClick' | 'onRowHover' | 'rowRef'> {
|
|
7
7
|
content: Row[];
|
|
8
8
|
/** @default 'table' */
|
|
9
9
|
renderMode?: IFlexibleTableRenderMode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode, RefCallback } from 'react';
|
|
2
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
3
3
|
import { ITableRow, IFlexibleTableConfigType, IFlexibleTableRenderMode, IHeaderContent } from '../../types';
|
|
4
4
|
import { IFlexibleTableRowStyles } from './FlexibleTableRow.styles';
|
|
5
|
-
export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends
|
|
5
|
+
export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends ITweakStylesProps<IFlexibleTableRowStyles> {
|
|
6
6
|
item: Row;
|
|
7
7
|
index: number;
|
|
8
8
|
uniqueField?: UniqueField;
|
|
@@ -21,11 +21,12 @@ export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent ext
|
|
|
21
21
|
rowAttributes?: Array<keyof Row>;
|
|
22
22
|
/** @default false */
|
|
23
23
|
isExpandableRowComponentInitiallyOpen?: boolean | ((row: Row, index: number) => boolean);
|
|
24
|
+
rowRef?: RefCallback<HTMLTableRowElement>;
|
|
24
25
|
/** Возвращает React-элемент, который отрисуется под строкой при нажатии на неё */
|
|
25
26
|
expandableRowComponent?: (item: Row, isOpen: boolean, close: () => void) => ReactNode;
|
|
26
27
|
onRowHover?: (id?: Row[UniqueField]) => void;
|
|
27
28
|
onRowClick?: (id: Row[UniqueField]) => void;
|
|
28
29
|
}
|
|
29
|
-
declare function FlexibleTableRowInner<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row>({ item, index, config, columns, uniqueField, renderMode, isActive, isFocusable, isFirstColumnSticky, isLoading, rowAttributes, isExpandableRowComponentInitiallyOpen, tweakStyles, expandableRowComponent, onRowHover, onRowClick, }: IFlexibleTableRowProps<Row, HeaderContent, UniqueField>): JSX.Element;
|
|
30
|
+
declare function FlexibleTableRowInner<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row>({ item, index, config, columns, uniqueField, renderMode, isActive, isFocusable, isFirstColumnSticky, isLoading, rowAttributes, isExpandableRowComponentInitiallyOpen, rowRef, tweakStyles, expandableRowComponent, onRowHover, onRowClick, }: IFlexibleTableRowProps<Row, HeaderContent, UniqueField>): JSX.Element;
|
|
30
31
|
export declare const FlexibleTableRow: typeof FlexibleTableRowInner;
|
|
31
32
|
export {};
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import { IFlexibleTableRenderMode, IFlexibleTableRender } from './types';
|
|
2
1
|
export declare const DEFAULT_DATE_FORMAT = "dd.MM.yyyy";
|
|
3
|
-
export declare const TableRenders:
|
|
2
|
+
export declare const TableRenders: {
|
|
3
|
+
table: {
|
|
4
|
+
Root: "table";
|
|
5
|
+
Head: "thead";
|
|
6
|
+
Body: "tbody";
|
|
7
|
+
Row: "tr";
|
|
8
|
+
Header: "th";
|
|
9
|
+
Cell: "td";
|
|
10
|
+
};
|
|
11
|
+
divs: {
|
|
12
|
+
Root: "div";
|
|
13
|
+
Head: "div";
|
|
14
|
+
Body: "div";
|
|
15
|
+
Row: "div";
|
|
16
|
+
Header: "div";
|
|
17
|
+
Cell: "div";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { IRenderNode } from '../../types';
|
|
3
3
|
export type IFlexibleTableRenderMode = 'table' | 'divs';
|
|
4
|
-
export type
|
|
4
|
+
export type IFlexibleTableRenderElement = 'Root' | 'Head' | 'Body' | 'Row' | 'Header' | 'Cell';
|
|
5
5
|
export type ITableRow = Record<string, any>;
|
|
6
6
|
export type IHeaderContent<T extends ITableRow> = Partial<Record<keyof T, unknown>>;
|
|
7
7
|
export interface ITitleComponentProps<Value> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ICommonProps } from '../../types';
|
|
3
3
|
import { IInputProps } from '../Input';
|
|
4
4
|
import { ISearchInputStyles } from './SearchInput.styles';
|
|
5
5
|
export type ISearchInputProps = Omit<IInputProps, 'type' | 'label' | 'isInvalid' | 'errorMessage' | 'isActive' | 'tweakStyles'> & ICommonProps<ISearchInputStyles>;
|
|
6
|
-
export declare const SearchInput:
|
|
6
|
+
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<IInputProps, "tweakStyles" | "label" | "isInvalid" | "type" | "isActive" | "errorMessage"> & import("../../types").IDataAttributesProps & import("../../types").ITweakStylesProps<ISearchInputStyles> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
declare const _default: {
|
|
2
3
|
title: string;
|
|
3
|
-
component: import("react").
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("..").IInputProps, "tweakStyles" | "label" | "isInvalid" | "type" | "isActive" | "errorMessage"> & import("../..").IDataAttributesProps & import("../..").ITweakStylesProps<import("./SearchInput.styles").ISearchInputStyles> & import("react").RefAttributes<HTMLInputElement>>;
|
|
4
5
|
};
|
|
5
6
|
export default _default;
|
|
6
|
-
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, Omit<import("..").IInputProps, "tweakStyles" | "label" | "isInvalid" | "type" | "isActive" | "errorMessage"> & import("../..").IDataAttributesProps & import("../..").ITweakStylesProps<import("./SearchInput.styles").ISearchInputStyles>>;
|
|
7
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, Omit<import("..").IInputProps, "tweakStyles" | "label" | "isInvalid" | "type" | "isActive" | "errorMessage"> & import("../..").IDataAttributesProps & import("../..").ITweakStylesProps<import("./SearchInput.styles").ISearchInputStyles> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, SyntheticEvent } from 'react';
|
|
1
|
+
import { ReactNode, Ref, SyntheticEvent } from 'react';
|
|
2
2
|
import { ICommonProps, IDropdownWithPopperOptions } from '../../types';
|
|
3
3
|
import { IIcon } from '../Icon';
|
|
4
4
|
import { IInputProps } from '../Input';
|
|
@@ -27,8 +27,10 @@ export interface ISelectProps<Value> extends Omit<IInputProps, 'value' | 'onChan
|
|
|
27
27
|
shouldScrollToList?: boolean;
|
|
28
28
|
isMultiSelect?: false;
|
|
29
29
|
searchInput?: {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/** @default false */
|
|
31
|
+
shouldRenderInList?: boolean;
|
|
32
|
+
ref?: Ref<HTMLInputElement>;
|
|
33
|
+
} & Pick<ISearchInputProps, 'placeholder' | 'shouldFocusOnMount'>;
|
|
32
34
|
isOptionDisabled?: (option: Value) => boolean;
|
|
33
35
|
onChange: (value: Value | undefined, event: IChangeSelectEvent) => void;
|
|
34
36
|
onBlur?: (event: Event | SyntheticEvent) => void;
|
|
@@ -4,7 +4,7 @@ import { ITooltipStyles } from './Tooltip.styles';
|
|
|
4
4
|
export interface ITooltipProps extends ICommonProps<ITooltipStyles> {
|
|
5
5
|
text: ReactNode;
|
|
6
6
|
/** @default 'tooltip' */
|
|
7
|
-
view?: 'tooltip' | 'hint';
|
|
7
|
+
view?: 'tooltip' | 'hint' | 'custom';
|
|
8
8
|
/** @default 'info' */
|
|
9
9
|
type?: 'info' | 'error';
|
|
10
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
|
-
export declare const useStyles: import("../../theme").IUseStyles<"error" | "root" | "tooltip" | "info" | "hint", unknown>;
|
|
2
|
+
export declare const useStyles: import("../../theme").IUseStyles<"error" | "root" | "tooltip" | "custom" | "info" | "hint", unknown>;
|
|
3
3
|
export type ITooltipStyles = ITweakStyles<typeof useStyles>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { createContext, useRef, useEffect, useCallback, useState, useMemo, useContext, createElement, Fragment as Fragment$1, forwardRef, createRef, PureComponent, memo } from "react";
|
|
2
2
|
import { createUseStyles } from "react-jss";
|
|
3
|
-
import { mergeStyles, isNotEmpty, isArrayNotEmpty,
|
|
3
|
+
import { mergeStyles, isNotEmpty, isArrayNotEmpty, isStringEmpty, isString, isStringNotEmpty, isEmpty, mergeRefs, addDataTestId, applyAction, addDataAttributes as addDataAttributes$1, stopPropagation, isReactNodeNotEmpty, addClickHandler, getTestId, getSelectKeyHandler, getArray, createFilter, isFunction as isFunction$1, isObject as isObject$1, getTransition, indexMap, isNumberInteger, hasDuplicates, isArrayEmpty } from "@true-engineering/true-react-platform-helpers";
|
|
4
4
|
import { CSSTransition } from "react-transition-group";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import hexToRgba from "hex-to-rgba";
|
|
@@ -2007,6 +2007,17 @@ var minWidthModifier = {
|
|
|
2007
2007
|
}
|
|
2008
2008
|
};
|
|
2009
2009
|
var phoneInfo = [
|
|
2010
|
+
{
|
|
2011
|
+
countryEn: "Abkhazia",
|
|
2012
|
+
countryRu: "Абхазия",
|
|
2013
|
+
countryCode: "AB",
|
|
2014
|
+
phoneMask: "(999) 999-99-99",
|
|
2015
|
+
dialCode: "7",
|
|
2016
|
+
dialCodePriority: 1,
|
|
2017
|
+
fullCodes: [
|
|
2018
|
+
"7"
|
|
2019
|
+
]
|
|
2020
|
+
},
|
|
2010
2021
|
{
|
|
2011
2022
|
countryEn: "Afghanistan",
|
|
2012
2023
|
countryRu: "Афганистан",
|
|
@@ -3003,39 +3014,10 @@ var phoneInfo = [
|
|
|
3003
3014
|
countryRu: "Казахстан",
|
|
3004
3015
|
countryCode: "KZ",
|
|
3005
3016
|
dialCode: "7",
|
|
3006
|
-
phoneMask: "999 999-99-99",
|
|
3017
|
+
phoneMask: "(999) 999-99-99",
|
|
3007
3018
|
dialCodePriority: 1,
|
|
3008
|
-
areaCodes: [
|
|
3009
|
-
"310",
|
|
3010
|
-
"311",
|
|
3011
|
-
"312",
|
|
3012
|
-
"313",
|
|
3013
|
-
"315",
|
|
3014
|
-
"318",
|
|
3015
|
-
"321",
|
|
3016
|
-
"324",
|
|
3017
|
-
"325",
|
|
3018
|
-
"326",
|
|
3019
|
-
"327",
|
|
3020
|
-
"336",
|
|
3021
|
-
"7172",
|
|
3022
|
-
"73622"
|
|
3023
|
-
],
|
|
3024
3019
|
fullCodes: [
|
|
3025
|
-
"
|
|
3026
|
-
"7311",
|
|
3027
|
-
"7312",
|
|
3028
|
-
"7313",
|
|
3029
|
-
"7315",
|
|
3030
|
-
"7318",
|
|
3031
|
-
"7321",
|
|
3032
|
-
"7324",
|
|
3033
|
-
"7325",
|
|
3034
|
-
"7326",
|
|
3035
|
-
"7327",
|
|
3036
|
-
"7336",
|
|
3037
|
-
"77172",
|
|
3038
|
-
"773622"
|
|
3020
|
+
"7"
|
|
3039
3021
|
]
|
|
3040
3022
|
},
|
|
3041
3023
|
{
|
|
@@ -3804,6 +3786,17 @@ var phoneInfo = [
|
|
|
3804
3786
|
"82"
|
|
3805
3787
|
]
|
|
3806
3788
|
},
|
|
3789
|
+
{
|
|
3790
|
+
countryCode: "OS",
|
|
3791
|
+
countryEn: "South Ossetia",
|
|
3792
|
+
countryRu: "Южная Осетия",
|
|
3793
|
+
phoneMask: "(999) 999-99-99",
|
|
3794
|
+
dialCode: "7",
|
|
3795
|
+
dialCodePriority: 1,
|
|
3796
|
+
fullCodes: [
|
|
3797
|
+
"7"
|
|
3798
|
+
]
|
|
3799
|
+
},
|
|
3807
3800
|
{
|
|
3808
3801
|
countryEn: "South Sudan",
|
|
3809
3802
|
countryRu: "Южный Судан",
|
|
@@ -4761,22 +4754,25 @@ var getFullPhone = function(phone) {
|
|
|
4761
4754
|
return ((_phone_dialCode = phone === null || phone === void 0 ? void 0 : phone.dialCode) !== null && _phone_dialCode !== void 0 ? _phone_dialCode : "") + ((_phone_phoneNumber = phone === null || phone === void 0 ? void 0 : phone.phoneNumber) !== null && _phone_phoneNumber !== void 0 ? _phone_phoneNumber : "");
|
|
4762
4755
|
};
|
|
4763
4756
|
var getCountryCodeFromPhone = function(phoneWithCode) {
|
|
4764
|
-
var
|
|
4765
|
-
|
|
4766
|
-
return
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
}
|
|
4779
|
-
|
|
4757
|
+
var _highestPriorityCountries_at;
|
|
4758
|
+
if (isStringEmpty(phoneWithCode)) {
|
|
4759
|
+
return;
|
|
4760
|
+
}
|
|
4761
|
+
var matchedCountries = phoneInfo.filter(function(info) {
|
|
4762
|
+
return info.fullCodes.some(function(fullCode) {
|
|
4763
|
+
return phoneWithCode.startsWith(fullCode);
|
|
4764
|
+
});
|
|
4765
|
+
});
|
|
4766
|
+
if (matchedCountries.length === 1) {
|
|
4767
|
+
return matchedCountries[0].countryCode;
|
|
4768
|
+
}
|
|
4769
|
+
var highestPriorityCountries = phoneInfo.filter(function(info) {
|
|
4770
|
+
return phoneWithCode.startsWith(info.dialCode);
|
|
4771
|
+
}).sort(function(a, b) {
|
|
4772
|
+
var _a_dialCodePriority, _b_dialCodePriority;
|
|
4773
|
+
return ((_a_dialCodePriority = a.dialCodePriority) !== null && _a_dialCodePriority !== void 0 ? _a_dialCodePriority : 1e3) - ((_b_dialCodePriority = b.dialCodePriority) !== null && _b_dialCodePriority !== void 0 ? _b_dialCodePriority : 1e3);
|
|
4774
|
+
});
|
|
4775
|
+
return (_highestPriorityCountries_at = highestPriorityCountries.at(0)) === null || _highestPriorityCountries_at === void 0 ? void 0 : _highestPriorityCountries_at.countryCode;
|
|
4780
4776
|
};
|
|
4781
4777
|
var getPhoneObjFromString = function(fullPhone, countryCode) {
|
|
4782
4778
|
var _findCountryByCode;
|
|
@@ -10893,7 +10889,7 @@ function _object_without_properties_loose$f(source, excluded) {
|
|
|
10893
10889
|
}
|
|
10894
10890
|
return target;
|
|
10895
10891
|
}
|
|
10896
|
-
var SearchInput = function(_param) {
|
|
10892
|
+
var SearchInput = /* @__PURE__ */ forwardRef(function(_param, ref) {
|
|
10897
10893
|
var _param_isClearable = _param.isClearable, isClearable = _param_isClearable === void 0 ? true : _param_isClearable, placeholder = _param.placeholder, value = _param.value, testId = _param.testId, tweakStyles = _param.tweakStyles;
|
|
10898
10894
|
_param.data;
|
|
10899
10895
|
var props = _object_without_properties$f(_param, [
|
|
@@ -10911,6 +10907,7 @@ var SearchInput = function(_param) {
|
|
|
10911
10907
|
currentComponentName: "SearchInput"
|
|
10912
10908
|
});
|
|
10913
10909
|
return /* @__PURE__ */ jsx(Input, _object_spread$N({
|
|
10910
|
+
ref,
|
|
10914
10911
|
value,
|
|
10915
10912
|
placeholder,
|
|
10916
10913
|
icon: "search",
|
|
@@ -10918,7 +10915,7 @@ var SearchInput = function(_param) {
|
|
|
10918
10915
|
testId: getTestId(testId, "input"),
|
|
10919
10916
|
tweakStyles: tweakInputStyles
|
|
10920
10917
|
}, props));
|
|
10921
|
-
};
|
|
10918
|
+
});
|
|
10922
10919
|
var ScrollIntoViewIfNeededDefaultElementType = "div";
|
|
10923
10920
|
var ScrollIntoViewIfNeededDefaultProps = {
|
|
10924
10921
|
active: true,
|
|
@@ -12022,9 +12019,13 @@ function Select(props) {
|
|
|
12022
12019
|
dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.shouldUsePopper
|
|
12023
12020
|
]);
|
|
12024
12021
|
var handleListClose = useCallback(function(event) {
|
|
12022
|
+
if (!isListOpen) {
|
|
12023
|
+
return;
|
|
12024
|
+
}
|
|
12025
12025
|
closeList();
|
|
12026
12026
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
12027
12027
|
}, [
|
|
12028
|
+
isListOpen,
|
|
12028
12029
|
closeList,
|
|
12029
12030
|
onBlur
|
|
12030
12031
|
]);
|
|
@@ -13592,6 +13593,7 @@ var useStyles$x = createThemedStyles("Tooltip", {
|
|
|
13592
13593
|
color: colors.CLASSIC_WHITE,
|
|
13593
13594
|
letterSpacing: 0.2
|
|
13594
13595
|
},
|
|
13596
|
+
custom: {},
|
|
13595
13597
|
info: {},
|
|
13596
13598
|
error: {
|
|
13597
13599
|
"&$tooltip": {
|
|
@@ -19227,7 +19229,7 @@ function FilterValueView(param) {
|
|
|
19227
19229
|
if (isEmpty(value)) {
|
|
19228
19230
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
19229
19231
|
}
|
|
19230
|
-
if (filter.getSelectedValueView
|
|
19232
|
+
if (isNotEmpty(filter.getSelectedValueView)) {
|
|
19231
19233
|
return /* @__PURE__ */ jsx("span", {
|
|
19232
19234
|
className: classes.text,
|
|
19233
19235
|
children: filter.getSelectedValueView(value)
|
|
@@ -19296,22 +19298,6 @@ function FilterValueView(param) {
|
|
|
19296
19298
|
children: intervals.join(" ")
|
|
19297
19299
|
});
|
|
19298
19300
|
}
|
|
19299
|
-
if (isMultiple) {
|
|
19300
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
19301
|
-
children: Array.isArray(value) && value.length > 0 && /* @__PURE__ */ jsxs(Fragment, {
|
|
19302
|
-
children: [
|
|
19303
|
-
/* @__PURE__ */ jsx("span", {
|
|
19304
|
-
className: classes.text,
|
|
19305
|
-
children: displayValue(value[0])
|
|
19306
|
-
}),
|
|
19307
|
-
/* @__PURE__ */ jsx("span", {
|
|
19308
|
-
className: classes.count,
|
|
19309
|
-
children: value.length > 1 && " (+".concat(value.length - 1, ")")
|
|
19310
|
-
})
|
|
19311
|
-
]
|
|
19312
|
-
})
|
|
19313
|
-
});
|
|
19314
|
-
}
|
|
19315
19301
|
if (isDate) {
|
|
19316
19302
|
var from = value.from, to = value.to, periodType = value.periodType, label = value.label;
|
|
19317
19303
|
var hasFrom = from !== void 0 && from !== null;
|
|
@@ -19342,6 +19328,24 @@ function FilterValueView(param) {
|
|
|
19342
19328
|
children: range.join(" ")
|
|
19343
19329
|
});
|
|
19344
19330
|
}
|
|
19331
|
+
if (isMultiple) {
|
|
19332
|
+
var _filter_getSelectedValue;
|
|
19333
|
+
var convertValue = (_filter_getSelectedValue = filter.getSelectedValue) !== null && _filter_getSelectedValue !== void 0 ? _filter_getSelectedValue : displayValue;
|
|
19334
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
19335
|
+
children: Array.isArray(value) && value.length > 0 && /* @__PURE__ */ jsxs(Fragment, {
|
|
19336
|
+
children: [
|
|
19337
|
+
/* @__PURE__ */ jsx("span", {
|
|
19338
|
+
className: classes.text,
|
|
19339
|
+
children: convertValue(value[0])
|
|
19340
|
+
}),
|
|
19341
|
+
/* @__PURE__ */ jsx("span", {
|
|
19342
|
+
className: classes.count,
|
|
19343
|
+
children: value.length > 1 && " (+".concat(value.length - 1, ")")
|
|
19344
|
+
})
|
|
19345
|
+
]
|
|
19346
|
+
})
|
|
19347
|
+
});
|
|
19348
|
+
}
|
|
19345
19349
|
if (isRange && Array.isArray(value)) {
|
|
19346
19350
|
var rangeValue = value;
|
|
19347
19351
|
var rangeValueFrom = rangeValue[0];
|
|
@@ -25889,8 +25893,24 @@ const Flags = {
|
|
|
25889
25893
|
ZM,
|
|
25890
25894
|
ZW
|
|
25891
25895
|
};
|
|
25896
|
+
const AB = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 341.3"><path fill="#FFF" d="M0 0h512v341.3H0z"/><g fill="#6DA544"><path d="M0 0h512v48.8H0zM0 97.5h512v48.8H0zM0 195h512v48.8H0zM0 292.6h512v48.8H0z"/></g><path fill="#D80027" d="M0 0h256v146.3H0z"/><path fill="#FFF" d="m116.9 114.4-7.5-14.8V69.9L128 59l18.6 10.9v22.3l7.4-7.4 4.2 3-4.2 11.8-14.9 14.8z"/><circle fill="#FFF" cx="82" cy="82.8" r="5.4"/><circle fill="#FFF" cx="90.8" cy="61.7" r="5.4"/><circle fill="#FFF" cx="106.6" cy="46.2" r="5.4"/><circle fill="#FFF" cx="128" cy="40.8" r="5.4"/><circle fill="#FFF" cx="149.4" cy="46.2" r="5.4"/><circle fill="#FFF" cx="165.2" cy="61.7" r="5.4"/><circle fill="#FFF" cx="174" cy="82.8" r="5.4"/></svg>';
|
|
25897
|
+
const OS = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 450 300"><path fill="#FFF" d="M0 0h450v300H0z"/><path fill="red" d="M0 100h450v200H0z"/><path fill="#FFDF00" d="M0 200h450v100H0z"/></svg>';
|
|
25898
|
+
var customFlags = {
|
|
25899
|
+
/**
|
|
25900
|
+
* Абхазия
|
|
25901
|
+
*/
|
|
25902
|
+
AB,
|
|
25903
|
+
/**
|
|
25904
|
+
* Южная осетия
|
|
25905
|
+
*/
|
|
25906
|
+
OS
|
|
25907
|
+
};
|
|
25892
25908
|
var useStyles$l = createThemedStyles("Flag", {
|
|
25893
25909
|
root: {
|
|
25910
|
+
display: "flex",
|
|
25911
|
+
width: "100%",
|
|
25912
|
+
height: "100%",
|
|
25913
|
+
boxSizing: "border-box",
|
|
25894
25914
|
// приходится хардкодить в компоненте, тк либа Flags выдает флаги с 2-3 пиксельным отступом снизу
|
|
25895
25915
|
// если будет нужно, то можно вынести border на уровень пропсов
|
|
25896
25916
|
border: [
|
|
@@ -25910,17 +25930,29 @@ var Flag = function(param) {
|
|
|
25910
25930
|
var classes = useStyles$l({
|
|
25911
25931
|
theme: tweakStyles
|
|
25912
25932
|
});
|
|
25913
|
-
var
|
|
25914
|
-
var
|
|
25933
|
+
var countryFlagKey = countryCode.toUpperCase();
|
|
25934
|
+
var hasFlagInLibrary = hasFlag(countryFlagKey);
|
|
25935
|
+
if (hasFlagInLibrary) {
|
|
25936
|
+
var FlagComponent = Flags[countryFlagKey];
|
|
25915
25937
|
return /* @__PURE__ */ jsx("div", {
|
|
25916
|
-
className: classes.
|
|
25917
|
-
children: /* @__PURE__ */ jsx(
|
|
25918
|
-
type: "minus"
|
|
25919
|
-
})
|
|
25938
|
+
className: classes.root,
|
|
25939
|
+
children: /* @__PURE__ */ jsx(FlagComponent, {})
|
|
25920
25940
|
});
|
|
25921
|
-
}
|
|
25922
|
-
|
|
25923
|
-
|
|
25941
|
+
}
|
|
25942
|
+
var CustomFlag = customFlags[countryFlagKey];
|
|
25943
|
+
if (CustomFlag !== void 0) {
|
|
25944
|
+
return /* @__PURE__ */ jsx("div", {
|
|
25945
|
+
className: classes.root,
|
|
25946
|
+
dangerouslySetInnerHTML: {
|
|
25947
|
+
__html: CustomFlag
|
|
25948
|
+
}
|
|
25949
|
+
});
|
|
25950
|
+
}
|
|
25951
|
+
return /* @__PURE__ */ jsx("div", {
|
|
25952
|
+
className: classes.noFlag,
|
|
25953
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
25954
|
+
type: "minus"
|
|
25955
|
+
})
|
|
25924
25956
|
});
|
|
25925
25957
|
};
|
|
25926
25958
|
var DEFAULT_DATE_FORMAT = "dd.MM.yyyy";
|
|
@@ -26435,7 +26467,7 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
26435
26467
|
return _array_like_to_array$7(o, minLen);
|
|
26436
26468
|
}
|
|
26437
26469
|
function FlexibleTableRowInner(param) {
|
|
26438
|
-
var item = param.item, index = param.index, config = param.config, columns = param.columns, uniqueField = param.uniqueField, renderMode = param.renderMode, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isFocusable = param.isFocusable, isFocusable = _param_isFocusable === void 0 ? false : _param_isFocusable, _param_isFirstColumnSticky = param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, rowAttributes = param.rowAttributes, _param_isExpandableRowComponentInitiallyOpen = param.isExpandableRowComponentInitiallyOpen, isExpandableRowComponentInitiallyOpen = _param_isExpandableRowComponentInitiallyOpen === void 0 ? false : _param_isExpandableRowComponentInitiallyOpen, tweakStyles = param.tweakStyles, expandableRowComponent = param.expandableRowComponent, onRowHover = param.onRowHover, onRowClick = param.onRowClick;
|
|
26470
|
+
var item = param.item, index = param.index, config = param.config, columns = param.columns, uniqueField = param.uniqueField, renderMode = param.renderMode, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isFocusable = param.isFocusable, isFocusable = _param_isFocusable === void 0 ? false : _param_isFocusable, _param_isFirstColumnSticky = param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, rowAttributes = param.rowAttributes, _param_isExpandableRowComponentInitiallyOpen = param.isExpandableRowComponentInitiallyOpen, isExpandableRowComponentInitiallyOpen = _param_isExpandableRowComponentInitiallyOpen === void 0 ? false : _param_isExpandableRowComponentInitiallyOpen, rowRef = param.rowRef, tweakStyles = param.tweakStyles, expandableRowComponent = param.expandableRowComponent, onRowHover = param.onRowHover, onRowClick = param.onRowClick;
|
|
26439
26471
|
var classes = useStyles$h({
|
|
26440
26472
|
theme: tweakStyles
|
|
26441
26473
|
});
|
|
@@ -26512,6 +26544,7 @@ function FlexibleTableRowInner(param) {
|
|
|
26512
26544
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
26513
26545
|
children: [
|
|
26514
26546
|
/* @__PURE__ */ jsx(Table.Row, _object_spread_props$k(_object_spread$l({
|
|
26547
|
+
ref: rowRef,
|
|
26515
26548
|
className: clsx(classes.root, (_obj2 = {}, _define_property$m(_obj2, classes.active, isActive), _define_property$m(_obj2, classes.editable, isEditable), _define_property$m(_obj2, classes.clickable, isClickable), _obj2))
|
|
26516
26549
|
}, !isLoading && {
|
|
26517
26550
|
onClick: handleRowClick,
|
|
@@ -28893,6 +28926,7 @@ var PhoneInput = function(_param) {
|
|
|
28893
28926
|
var _value_countryCode;
|
|
28894
28927
|
return (_value_countryCode = value === null || value === void 0 ? void 0 : value.countryCode) !== null && _value_countryCode !== void 0 ? _value_countryCode : getCountryCodeFromPhone(phoneWithCode);
|
|
28895
28928
|
}, [
|
|
28929
|
+
value.countryCode,
|
|
28896
28930
|
value.dialCode,
|
|
28897
28931
|
value.phoneNumber
|
|
28898
28932
|
]);
|
|
@@ -28923,7 +28957,7 @@ var PhoneInput = function(_param) {
|
|
|
28923
28957
|
var handleSelect = function(newPhoneInfo, event) {
|
|
28924
28958
|
if (newPhoneInfo.countryCode !== countryCode) {
|
|
28925
28959
|
onChange({
|
|
28926
|
-
phoneNumber: "",
|
|
28960
|
+
phoneNumber: newPhoneInfo.dialCode !== value.dialCode ? "" : getPhoneObjFromString(phoneWithCode).phoneNumber,
|
|
28927
28961
|
dialCode: newPhoneInfo.dialCode,
|
|
28928
28962
|
countryCode: newPhoneInfo.countryCode
|
|
28929
28963
|
}, event);
|