epn-ui
Version:
Дизайн система кабинета ВМ
1,881 lines (1,598 loc) • 49.8 kB
TypeScript
import * as React from 'react';
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { HTMLProps } from 'react';
import { UploadFile, UploadChangeParam } from 'antd/lib/upload/interface';
import * as CSS from 'csstype';
import {
AlertProps,
EmptyProps,
ListProps,
SelectProps,
CheckboxProps,
DropDownProps,
SpaceProps,
TabsProps,
ColProps,
RowProps,
TreeProps,
CollapseProps,
LayoutProps,
PopoverProps,
} from 'antd';
import { LabeledValue } from 'antd/lib/select';
import type { ListItemTypeProps } from 'antd/es/list/Item';
import { ArgsProps } from 'antd/lib/notification';
import { ISkeletonProps } from './src/components';
export interface Radio {
label: string;
value: string;
id: number | string;
}
export interface Column {
title: string;
dataKey: string;
sortName?: string;
maxWidth?: number;
minWidth?: number;
textAlign?: string;
tooltip?: string;
circleBgClass?: string;
isVisible?: boolean;
}
export interface SortParam {
sortField: string;
direction: 'asc' | 'desc';
}
export interface TotalParam {
word: string;
data: { [value: string]: string | number | React.ReactNode };
}
export interface LoadParam {
buttonText: string;
hasNextPage: boolean;
onLoadMoreRows: (event: React.MouseEvent<HTMLButtonElement>) => void;
}
export interface EmptyParam {
buttonText: string;
message: string;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
href?: string;
}
export interface ErrorParam {
message?: string;
requestId: string;
}
export interface ButtonProps {
children?: React.ReactNode;
icon?: IconDefinition;
id?: string;
iconPosition?: '' | 'left' | 'right';
type?:
| ''
| 'primary'
| 'ghost'
| 'blue'
| 'red'
| 'black'
| 'ghost-secondary'
| 'ghost-blue'
| 'transparent';
size?: 'default' | 'small' | 'medium' | 'large';
className?: string;
responsive?: '' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
disabled?: boolean;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
to?: string;
submit?: boolean;
loading?: boolean;
form?: string;
title?: string;
style?: CSS.Properties;
}
export interface LegacyCheckboxProps {
id?: string;
name?: string;
className?: string;
checked?: boolean;
disabled?: boolean;
label?: React.ReactElement | string;
onChange?: (state: boolean) => void;
onBlur?: (event: React.FocusEventHandler<HTMLButtonElement>) => void;
}
export interface ErrorProps {
inputValue?: string;
}
interface CommonComboboxProps<T> {
className?: string;
items?: T[];
placeholder?: string;
onChange?: (item: T) => void;
isLoading?: boolean;
optionProps?: React.HTMLProps<HTMLDivElement>;
itemValueProperty?: string;
itemKeyProperty?: string;
id?: string | null;
SearchError?: (props: ErrorProps) => React.ReactElement;
}
export interface ComboboxProps<T> extends CommonComboboxProps<T> {
hasToggleButton?: boolean;
isLoading?: boolean;
Option?: React.ReactNode;
value?: T;
hasAddNewItem?: boolean;
onInputChange?: (value: string) => void;
label?: string | null;
errorMessage?: string | React.ReactNode;
isValidNewOption?: (inputValue) => boolean;
needPortal?: boolean;
createOptionTemplate?: string;
isSearchable?: boolean;
required?: boolean;
onScrollMenu?: (e: React.SyntheticEvent) => void;
disabled?: boolean;
initialIsOpen?: boolean;
type?: 'primary' | 'dashed';
}
export interface MultipleComboboxProps<T> extends CommonComboboxProps<T> {
value?: T[];
}
export interface TreeComboboxProps<T> {
value?: (string | number)[];
id?: string;
label?: string;
disabled?: boolean;
required?: boolean;
items: T[];
placeholder: string;
className?: string;
itemValueProperty?: string;
itemKeyProperty?: string;
itemParentProperty?: string;
onChange: (checked: string[]) => void;
isLoading?: boolean;
SearchError?: (props: ErrorProps) => React.ReactElement;
isExpanded?: boolean;
selectAllLabel?: string;
allCheckedInitial?: boolean;
errorMessage?: string | React.ReactNode;
}
export interface ContainerProps {
children: React.ReactNode;
}
export interface ICopyInputProps {
id: string;
className?: string;
value?: string;
onCompleted?: (data: string) => void;
/**
* @deprecated use value
*/
link?: string;
/**
* @deprecated use value
*/
onComplete?: (data: string) => void;
}
export interface DropdownItem {
key: string;
value: string | React.ReactElement;
disabled?: boolean;
childrens?: DropdownItem[];
}
export interface IDropdownProps
extends Pick<
DropDownProps,
| 'destroyPopupOnHide'
| 'getPopupContainer'
| 'disabled'
| 'overlay'
| 'overlayClassName'
| 'overlayStyle'
| 'placement'
| 'onVisibleChange'
| 'className'
> {
trigger?: 'click' | 'hover';
items?: DropdownItem[];
/**
* Будет удалено в следующей мажорной версии
* @deprecated
*/
onChange?: (item: DropdownItem) => void;
}
export interface InputProps extends HTMLProps<HTMLInputElement> {
icon?: IconDefinition;
id?: string;
name?: string;
value?: number | string;
type?: string;
theme?: 'primary' | 'gray';
placeholder?: string;
label?: string;
readonly?: boolean;
multiline?: boolean;
hasError?: boolean;
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
onIconClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
iconId?: string;
required?: boolean;
maxLength?: number;
className?: string;
inputClasses?: string | null;
iconClasses?: string | null;
disabled?: boolean;
}
export interface ItemsSliderProps {
title: string;
children: React.ReactNode[] | React.ReactNode;
}
export interface IBaseLoaderProps {
id?: string;
className?: string;
wrapperClassName?: string;
delay?: number;
loading?: boolean;
tip?: React.ReactNode;
/**
* Удалить после релизной версии
*/
supportLegacy?: boolean;
}
export interface LogoProps {
type?: 'red' | 'white';
}
export interface ModalProps {
className?: string;
children?: React.ReactElement;
size?: 'lg' | 'md' | 'sm' | 'xs';
isOpen?: boolean;
onClose?: () => void;
title?: React.ReactElement;
hasCloseButton?: boolean;
hasLightOverlay?: boolean;
id?: string;
}
export interface ModalConfirmCodeProps {
id: string;
onClose: (event: React.MouseEvent<HTMLButtonElement>) => void;
onConfirm: (event: React.MouseEvent<HTMLButtonElement>) => void;
onReCall: (event: React.MouseEvent<HTMLButtonElement>) => void;
onSendSms: (event: React.MouseEvent<HTMLButtonElement>) => void;
title: string;
modalText: string;
codeReceivingType: 'call' | 'sms';
codeError?: string;
startTimer?: boolean;
timerSeconds?: number;
}
export interface NoticeProps {
id: string;
className?: string;
children: React.ReactNode;
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
type?: 'primary' | 'withError' | 'withStripe';
}
export interface FavouriteOptionItem {
key: string | number;
value?: string;
isFavourite?: boolean;
date?: string;
}
export interface DefaultOptionProps {
isActive?: boolean;
className?: string;
itemToString?: (item: object) => string;
isSelected?: boolean;
item: object;
}
export interface FavouriteOptionProps {
isActive?: boolean;
className?: string;
itemToString?: (item: FavouriteOptionItem) => string;
isSelected?: boolean;
onAddItemToFavourite?: (item: FavouriteOptionItem) => void;
item: FavouriteOptionItem;
}
export interface OptionWithSelectedItemProps {
isActive?: boolean;
className?: string;
itemToString?: (item: object) => string | number;
isSelected?: bolean;
item: object;
}
export interface RadioGroupProps {
className?: string;
items: Radio[];
onChange: (value: string) => void;
selectedValue?: string;
}
export interface IBaseSelectProps
extends Pick<
SelectProps<string | string[] | number | number[] | LabeledValue | LabeledValue[]>,
| 'options'
| 'filterOption'
| 'showSearch'
| 'disabled'
| 'defaultValue'
| 'mode'
| 'value'
| 'onChange'
| 'onBlur'
| 'onFocus'
| 'onClear'
| 'onPopupScroll'
| 'onSearch'
| 'onSelect'
| 'maxTagCount'
| 'placeholder'
| 'className'
| 'dropdownClassName'
| 'fieldNames'
| 'optionLabelProp'
| 'loading'
| 'notFoundContent'
| 'onInputKeyDown'
| 'style'
| 'defaultOpen'
> {
customOption?: React.ReactNode;
}
export interface SwitchProps {
className?: string;
enabled?: boolean;
onChange?: (state: boolean) => void;
}
export interface TableProps {
id?: string;
className?: string;
data: { id: string | number; [key: string]: unknown }[];
columns: Column[];
sortParams?: SortParam;
totalParams?: TotalParam;
loadMoreParams?: LoadParam;
isLoading?: boolean;
emptyParams?: EmptyParam;
errorParams?: ErrorParam;
rowHeight?: number;
maxTableHeightClasses?: string;
onHeadCellClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
}
export interface TabProps<T> {
className?: string;
item?: T;
itemToString?: (item: T) => string;
isSelected?: boolean;
onSelect?: () => void;
}
export interface TabsProps<T> {
className?: string;
children?: React.ReactElement<TabProps<T>>[];
}
export interface TimerProps {
id: string;
seconds: number;
onComplete?: () => void;
}
export interface ToggleButtonProps {
id?: string;
className?: string;
icon?: IconDefinition;
label?: string;
checked?: boolean;
disabled?: boolean;
onChange: (state: boolean) => void;
}
export interface TooltipProps {
id: string;
children?: React.ReactNode;
place?: 'top' | 'right' | 'bottom' | 'left';
type?: 'success' | 'warning' | 'error' | 'info' | 'light';
}
export interface SearchErrorProps {
id?: string;
message?: string;
}
export interface EpnUIConfigProps {
children: React.ReactNode;
locale?: 'ru' | 'en';
}
export interface IDateCell {
date: string;
link?: string;
}
export interface IDateTimeCell {
date: string;
}
export enum Currency {
USD = 'USD',
RUB = 'RUB',
EUR = 'EUR',
GBP = 'GBP',
}
export interface ICurrencyCell {
currency: Currency;
amount?: string | number;
}
export enum Status {
completed = 'completed',
waiting = 'waiting',
rejected = 'rejected',
pending = 'pending',
}
export interface IStatusCell {
status: Status;
dateTime?: string;
}
export interface IFileCell {
title: string;
link: string;
}
export interface IFilesCell {
files: IFileCell[];
}
export interface ILinkCell {
id: string;
description: string;
link: string;
}
export interface ITextWithTooltipIcon {
id: string;
text: string;
tooltip: string;
}
export interface ITableComponent extends React.FunctionComponent<TableProps> {
DateCell: (props: IDateCell) => React.ReactElement;
DateTimeCell: (props: IDateTimeCell) => React.ReactElement;
CurrencyCell: (props: ICurrencyCell) => React.ReactElement;
StatusCell: (props: IStatusCell) => React.ReactElement;
FilesCell: (props: IFilesCell) => React.ReactElement;
LinkCell: (props: ILinkCell) => React.ReactElement;
TextWithTooltipIcon: (props: ITextWithTooltipIcon) => React.ReactElement;
}
export interface PlaceholderProps {
className?: string;
}
export interface CollapseItemProps {
title: string | React.ReactElement;
body: string | React.ReactElement;
key: string | number;
}
export interface IBaseCollapseProps {
/**
* Список элементов
*/
items: CollapseItemProps[];
/**
* Ключ активного элемента, по умолчанию
*/
defaultActiveKey?: CollapseProps['defaultActiveKey'];
/**
* Если установить true то активен может быть только один элемент
*/
accordion?: CollapseProps['accordion'];
/**
* Открывать первый элемент, по умолчанию
*/
expandFirstItem?: boolean;
/**
* Дополнительный класс
*/
className?: CollapseProps['className'];
/**
* Пользовательские стили
*/
style?: CollapseProps['style'];
/**
* Тема компонента
*/
theme?: 'grey' | 'default' | undefined;
/**
* Callback изменения активного элемента
*/
onChange?: CollapseProps['onChange'];
}
export interface UploadCustomRequest<T> {
onProgress?: (event: { percent: number }) => void;
onError?: (event: Error, body?: T) => void;
onSuccess?: (body: T, xhr?: XMLHttpRequest) => void;
data: T;
filename: string;
file: File;
withCredentials: boolean;
action: string;
headers: { [key: string]: string };
}
interface UploadCommonProps {
children?: ReactNode;
accept?: string;
maxCount?: number;
multiple?: boolean;
fileListDir?: 'vertical' | 'horizontal';
action?: string;
onChange?: (info: UploadChangeParam) => void;
customRequest?: (options: UploadCustomRequest) => Promise<void>;
}
type UploadRenderProps =
| {
showUploadList?: true;
renderItem: (
originNode: ReactNode,
file: UploadFile,
fileList: UploadFile[],
actions: {
download: () => void;
preview: () => void;
remove: () => void;
},
) => ReactNode;
}
| {
showUploadList?: false;
renderItem?: (
originNode: ReactNode,
file: UploadFile,
fileList: UploadFile[],
actions: {
download: () => void;
preview: () => void;
remove: () => void;
},
) => ReactNode;
};
type UploadProps = UploadCommonProps & UploadRenderProps;
export interface IBaseEmptyProps extends EmptyProps {
showImage?: boolean;
}
export interface IBaseDialogProps {
// Обратно совместимые параметры с Modal
className?: string;
children: React.ReactNode;
size?: 'lg' | 'md' | 'sm' | 'xs';
isOpen: boolean;
onClose: () => void;
title: React.ReactNode;
hasCloseButton?: boolean;
hasLightOverlay?: boolean;
id: string;
// Новые параметры
afterClose?: () => void;
}
export interface IBaseListProps<T>
extends Pick<
ListProps<T>,
| 'className'
| 'dataSource'
| 'renderItem'
| 'loadMore'
| 'rowKey'
| 'size'
| 'bordered'
| 'grid'
> {
customEmpty?: React.ReactNode;
separator?: boolean;
loading?: boolean;
loadMoreClassName?: string;
}
export interface IDatePickerProps {
className?: string;
disabled?: boolean;
defaultValue?: DayFormat;
value?: DayFormat;
disabledValue?: [DayFormat, DayFormat];
format?: string;
placeholder?: string;
allowClear?: boolean | undefined;
inputReadOnly?: boolean | undefined;
status?: 'danger' | 'warning';
theme?: 'default';
onChange?: (date: DayFormat, dateString: string) => void;
}
export interface IDatePickerRangeProps {
className?: string;
disabled?: [boolean, boolean];
defaultValue?: [DayFormat, DayFormat];
value?: [DayFormat, DayFormat];
disabledValue?: [DayFormat, DayFormat];
format?: string | string[];
placeholder?: [string, string];
allowClear?: boolean | undefined;
inputReadOnly?: boolean | undefined;
status?: 'danger' | 'warning';
theme?: 'default';
onChange?: (dates: [DayFormat, DayFormat], datesString: [string, string]) => void;
onCalendarChange?: (
dates: [DayFormat, DayFormat],
datesString: [string, string],
info: RangeInfo,
) => void;
}
export interface IAlertProps
extends Pick<
AlertProps,
'type' | 'message' | 'onClose' | 'closable' | 'className' | 'action' | 'afterClose'
> {
id: string;
background?: ReactNode;
backgroundStyle?: React.CSSProperties;
}
export interface IConfirmCodeInputProps {
length?: number;
value?: string;
autoFocus?: boolean;
readonly?: boolean;
onChange?: (data: string) => void;
onCompleted?: (data: string) => void;
}
export interface IBaseCheckboxProps {
/**
* Автоматическая установка фокуса на компонент
*/
autoFocus?: CheckboxProps['autoFocus'];
/**
* Отмечен или нет
*/
checked?: CheckboxProps['checked'];
/**
* Отмечен по умолчанию
*/
defaultChecked?: CheckboxProps['defaultChecked'];
/**
* Disabled состояние
*/
disabled?: CheckboxProps['disabled'];
/**
* Промежуточное состояние
*/
indeterminate?: CheckboxProps['indeterminate'];
/**
* Дополнительный класс
*/
className?: CheckboxProps['className'];
/**
* Пользовательские стили
*/
style?: CheckboxProps['style'];
/**
* Лейбл
*/
children?: CheckboxProps['children'];
/**
* Уникальный идентификатор
*/
id?: CheckboxProps['id'];
/**
* Callback изменения состояния
*/
onChange?: CheckboxProps['onChange'];
/**
* Для обратной совместимости, используйте children
* @deprecated
*/
label?: string | ReactElement;
/**
* Для обратной совместимости, используйте defaultChecked
* @deprecated
*/
defaultValue?: boolean;
}
export interface ICountdownProps {
id?: string;
className?: string;
animate?: boolean;
seconds: number;
renderer?: (data: { minutes: string; seconds: string; completed: boolean }) => ReactElement;
onCompleted?: () => void;
/**
* Для обратной совместимости с компонентом Timer
* @deprecated use onCompleted
*/
onComplete?: () => void;
}
export interface IBaseSpaceProps {
/**
* Выравнивание
*/
align?: SpaceProps['align'];
/**
* Нправление
*/
direction?: SpaceProps['direction'];
/**
* Расстояние
*/
size?: SpaceProps['size'];
/**
* Разделитесь
*/
split?: SpaceProps['split'];
/**
* Auto wrap при использовани горизонтального направления
*/
wrap?: SpaceProps['wrap'];
/**
* Пользовательские стили
*/
style?: SpaceProps['style'];
/**
* Дополнительный класс
*/
className?: SpaceProps['className'];
}
export interface INavigationTabsProps {
/**
* Ключ текущей активной панели
*/
activeKey?: TabsProps['activeKey'];
/**
* Анимация смены вкладок. Работает только с tabPosition="top"
*/
animated?: TabsProps['animated'];
/**
* Выровнить вкладки по центру
*/
centered?: TabsProps['centered'];
/**
* Активный ключ по умолчанию, если не задан activeKey
*/
defaultActiveKey?: TabsProps['defaultActiveKey'];
// moreIcon?: TabsProps['moreIcon'];
/**
* Размер шрифта панели вкладок
*/
size?: TabsProps['size'];
/**
* Дополнительный контент по краяем панели вкладок
*/
tabBarExtraContent?: TabsProps['tabBarExtraContent'];
/**
* Расстояние между табами панели вкладок
*/
tabBarGutter?: TabsProps['tabBarGutter'];
/**
* Пользовательский стиль панели вкладко
*/
tabBarStyle?: TabsProps['tabBarStyle'];
/**
* Позиция панели вкладок
*/
tabPosition?: TabsProps['tabPosition'];
/**
* Уничтожать активную панели при изменении вкладки
*/
destroyInactiveTabPane?: TabsProps['destroyInactiveTabPane'];
/**
* Обязательно передать только TabPane
*/
children: React.ReactNode;
/**
* Пользовательские стили
*/
style?: TabsProps['style'];
/**
* Дополнительный класс
*/
className?: TabsProps['className'];
/**
* Замена рендера панели вкладок
*/
renderTabBar?: TabsProps['renderTabBar'];
/**
* Callback после изменения активной вкладки
*/
onChange?: TabsProps['onChange'];
/**
* Callback клика на вкладку
*/
onTabClick?: TabsProps['onTabClick'];
/**
* Callback прокрутки панели вкладок
*/
onTabScroll?: TabsProps['onTabScroll'];
}
export interface ITableProProps<T> {
/**
* Массив объектов для отображения колонок
*/
columns?: IEpnColumnItem<T>[];
/**
* Массив объектов для отображения в таблице
*/
dataSource: TableProps<T>['dataSource'];
/**
* Свойства rowSelection
*/
rowSelection?: TableProps<object>['rowSelection'];
/**
* Дополнительный класс
*/
className?: TableProps<T>['className'];
/**
* Пользовательские стили
*/
style?: TableProps<T>['style'];
/**
* Кастомный компонент отображающие состояние empty.
*/
empty?: ReactNode;
/**
* Отображение состояние загрузки
*/
loading?: TableProps<T>['loading'];
/**
* Отображать блок с подсчетом "всего"
*/
summary?: boolean | Record<string, unknown>;
/**
* Отображение кнопки "Загрузить еще"
*/
loadMore?: ReactNode;
/**
* Указать уникальное поля для данных
*/
rowKey?: TableProps<object>['rowKey'];
/**
* Можно ли прокручивать таблицу
*/
scroll?: TableProps<T>['scroll'];
/**
* Заполнять пустые значения таблицы
*/
fillEmptyData?: string;
/**
* Callback отдающий информацию о том какие колонки отфильтрованы или отсортированы и их значения.
*/
onFilterChange?: (params: IEpnFilterItem[]) => void;
/**
* Изменения в таблице, такие как сортировка, фильтрация
*/
onChange?: TableProps<T>['onChange'];
}
export interface IBaseAvatarProps {
/**
* Альтернативный текст описывающий изображение
*/
alt?: AvatarProps['alt'];
/**
* Буквенное расстояние
*/
gap?: AvatarProps['gap'];
/**
* Пользовательская иконка
*/
icon?: AvatarProps['icon'];
/**
* Размер аватара
*/
size?: AvatarProps['size'];
/**
* Адрес изображения для аватара
*/
src?: AvatarProps['src'];
/**
* Список изображения для аватара, с разными разрешениями
*/
srcSet?: AvatarProps['srcSet'];
/**
* Разрешено ли перетаскивать изображение
*/
draggable?: AvatarProps['draggable'];
/**
* Настройки CORS атрибута
*/
crossOrigin?: AvatarProps['crossOrigin'];
/**
* Дополнительный класс
*/
className?: AvatarProps['className'];
/**
* Пользовательские стили
*/
style?: AvatarProps['style'];
/**
* Текст или буквы, вместо изображения
*/
children?: AvatarProps['children'];
/**
* Callback вызывающийся на ошибку загрузки изображения
*/
onError?: AvatarProps['onError'];
}
export interface ITreeSelectProps {
/**
* Массив данных для отображения
*/
treeData?: TreeSelectProps['treeData'];
/**
* Выбранное значенеи
*/
value?: TreeSelectProps['value'];
/**
* Значение по умолчанию
*/
defaultValue?: TreeSelectProps['defaultValue'];
/**
* Подсказка, когда нет выбранного значения
*/
placeholder?: TreeSelectProps['placeholder'];
/**
* Отображать кнопку удаления выбранного значения
*/
allowClear?: TreeSelectProps['allowClear'];
/**
* Отображать линии между узлами
*/
treeLine?: TreeSelectProps['treeLine'];
/**
* Раскрыть все node
*/
treeDefaultExpandAll?: TreeSelectProps['treeDefaultExpandAll'];
/**
* Показать или скрыт выпадающий список
*/
open?: TreeSelectProps['open'];
/**
* Disabled состояние
*/
disabled?: TreeSelectProps['disabled'];
/**
* Состояние загрузки
*/
loading?: TreeSelectProps['loading'];
/**
* Кастомизация сообщения, когда список пуст
*/
notFoundContent?: TreeSelectProps['notFoundContent'];
/**
* Кастомизация имен «label», «value» и «children»
*/
fieldNames?: TreeSelectProps['fieldNames'];
/**
* Дополнительный класс
*/
className?: TreeSelectProps['className'];
/**
* Пользовательские стили
*/
style?: TreeSelectProps['style'];
/**
* Статус валидации
*/
status?: TreeSelectProps['status'];
/**
* Уникальный индетификатор элемента
*/
id?: string;
/**
* Пользовательские стили выпадающего списка
*/
dropdownStyle?: TreeSelectProps['dropdownStyle'];
/**
* Дополнительный класс выпадающего списка
*/
dropdownClassName?: TreeSelectProps['dropdownClassName'];
/**
* Отображать checkbox
*/
treeCheckable?: TreeSelectProps['treeCheckable'];
/**
* Способ отображения выбранного элемента в поле, когда установлен treeCheckable.
* По умолчанию: просто показывать дочерние узлы.
* TreeSelect.SHOW_ALL: показать все отмеченные узлы дерева (включая родительский узел дерева).
* TreeSelect.SHOW_PARENT: показать отмеченные узлы дерева (просто показать родительский узел дерева)
*/
showCheckedStrategy?: TreeSelectProps['showCheckedStrategy'];
/**
* Передайте TreeSelect.TreeNode в случае если вам не подходит передача данных через treeData
*/
children?: ReactNode;
/**
* Нужно ли фильтровать узлы дерева по входному значению. Значение treeNodeFilterProp используется для фильтрации по умолчанию.
*/
filterTreeNode?: TreeSelectProps['filterTreeNode'];
/**
* Будет использоваться для фильтрации, если filterTreeNode возвращает true
*/
treeNodeFilterProp?: TreeSelectProps['treeNodeFilterProp'];
/**
* Максимальное кол-во тегов
*/
maxTagCount?: TreeSelectProps['maxTagCount'];
/**
* Поддержка множественного выбора
*/
multiple?: TreeSelectProps['multiple'];
/**
* С какой стороны будет открыт выдпающий список
*/
placement?: TreeSelectProps['placement'];
/**
* Нужна ли одникаовая ширина для выпадающего списка и поля выбора
*/
dropdownMatchSelectWidth?: TreeSelectProps['dropdownMatchSelectWidth'];
/**
* Нужен ли поиск
*/
showSearch?: TreeSelectProps['showSearch'];
/**
* Текущие значение поиска, работает вместе с «onSearch»
*/
searchValue?: TreeSelectProps['searchValue'];
/**
* Кастомная логика открытия дочерних элементов «false», «click» и «doubleClick»
*/
treeExpandAction?: TreeSelectProps['treeExpandAction'];
/**
* Загруженные узлы дерева, работает только с «loadData»
*/
treeLoadedKeys?: TreeSelectProps['treeLoadedKeys'];
/**
* Показывает значок перед заголовком TreeNode. Нет стиля по умолчанию; вы должны установить для него собственный стиль, если установлено значение true
*/
treeIcon?: TreeSelectProps['treeIcon'];
/**
* Асинхронная загрузка данных
*/
loadData?: TreeSelectProps['loadData'];
/**
* Управление тем где будет отрисован селектор
*/
getPopupContainer?: TreeSelectProps['getPopupContainer'];
/**
* Callback открытия выпадающего списка
*/
onDropdownVisibleChange?: TreeSelectProps['onDropdownVisibleChange'];
/**
* Callback выбора элемента
*/
onSelect?: TreeSelectProps['onSelect'];
/**
* Callback открытия дочерних узлов
*/
onTreeExpand?: TreeSelectProps['onTreeExpand'];
/**
* Callback вызывается когда изменяется значение поля поиска
*/
onSearch?: TreeSelectProps['onSearch'];
/**
* Callback изменения выбранного значения
*/
onChange?: TreeSelectProps['onChange'];
}
export interface ITooltipProProps {
/**
* Текст отображающийся в подсказке
*/
title: TooltipProps['title'];
/**
* Положение подсказки, относительно элемента
*/
placement?: TooltipProps['placement'];
/**
* Отцентровать стрелку относительно центра элемента
*/
arrowPointAtCenter?: TooltipProps['arrowPointAtCenter'];
/**
* Отображать подсказку по умолчанию
*/
defaultVisible?: TooltipProps['defaultVisible'];
/**
* Событие показа подсказки
*/
trigger?: TooltipProps['trigger'];
/**
* Внешнее управление отображением подсказки
*/
visible?: TooltipProps['visible'];
/**
* Уничтожать подсказку после ее скрытия
*/
destroyTooltipOnHide?: TooltipProps['destroyTooltipOnHide'];
/**
* Дополнительный класс
*/
overlayClassName?: TooltipProps['overlayClassName'];
/**
* Пользовательские стили
*/
style?: TooltipProps['style'];
/**
* Цвета фона подсказки
*/
type?: 'success' | 'warning' | 'error' | 'info' | 'light' | 'dark';
/**
* DOM контейнер подсказки
*/
getPopupContainer?: TooltipProps['getPopupContainer'];
/**
* Callback изменения отображения подсказки
*/
onVisibleChange?: TooltipProps['onVisibleChange'];
}
export interface IBaseRadioProps {
/**
* Уникальный идентификатор
*/
id?: RadioProps['id'];
/**
* Имя компонента
*/
name?: RadioProps['name'];
/**
* Автоматическая установка фокуса на компонент
*/
autoFocus?: RadioProps['autoFocus'];
/**
* Состояние выбора
*/
checked?: RadioProps['checked'];
/**
* Состояние выбора по умолчанию
*/
defaultChecked?: RadioProps['defaultChecked'];
/**
* Disabled состояние
*/
disabled?: RadioProps['disabled'];
/**
* Значение для определения является компонент выбранным
*/
value?: RadioProps['value'];
/**
* Дополнительный класс
*/
className?: RadioProps['className'];
/**
* Пользовательские стили
*/
style?: RadioProps['style'];
/**
* Лейбл компонента
*/
children?: RadioProps['children'];
/**
* Callback выбора элемента
*/
onChange?: RadioProps['onChange'];
}
export interface IBaseBadgeProps {
/**
* Кастомный цвет бейджа
*/
color?: BadgeProps['color'];
/**
* Число отображаемое в бейдже
*/
count?: BadgeProps['count'];
/**
* Красная точка
*/
dot?: BadgeProps['dot'];
/**
* Смещение бейджа относительно базового положения
*/
offset?: BadgeProps['offset'];
/**
* Максимальное число для отображения
*/
overflowCount?: BadgeProps['overflowCount'];
/**
* Показывать 0 в бейдже
*/
showZero?: BadgeProps['showZero'];
/**
* Размер бейджа с числом
*/
size?: BadgeProps['size'];
/**
* Пресеты цветов бейджа
*/
status?: BadgeProps['status'];
/**
* Отображение текста в месте со статусом
*/
text?: BadgeProps['text'];
/**
* Отображение текст при наведении на бейдж
*/
title?: BadgeProps['title'];
/**
* Дополнительный класс
*/
className?: BadgeProps['className'];
/**
* Пользовательские стили
*/
style?: BadgeProps['style'];
}
export interface IGridProps {
/**
* Дополнительный класс
*/
className?: string;
/**
* Пользовательские стили
*/
style?: CSSProperties;
/**
* Отступ между столбцами
*/
gutter?: RowProps['gutter'];
/**
* Перенос столбца на новую строку
*/
wrap?: RowProps['wrap'];
/**
* Вертикальное выравнивание столбцов внутри грида
*/
align?: RowProps['align'];
/**
* Горизонтальное выравнивание столбцов внутри грида
*/
justify?: RowProps['justify'];
}
export interface ItemProps {
/**
* Дополнительный класс
*/
className?: string;
/**
* Пользовательские стили
*/
style?: CSSProperties;
/**
* Количество занимаемых столбцов
*/
span?: ColProps['span'];
/**
* Количество занимаемых столбцов на разрешение > 576px
*/
xs?: ColProps['xs'];
/**
* Количество занимаемых столбцов на разрешение > 768px
*/
sm?: ColProps['sm'];
/**
* Количество занимаемых столбцов на разрешение > 992px
*/
md?: ColProps['md'];
/**
* Количество занимаемых столбцов на разрешение > 1200px
*/
lg?: ColProps['lg'];
/**
* Количество занимаемых столбцов на разрешение > 1600px
*/
xl?: ColProps['xl'];
}
export interface ITreeProps {
/**
* Дополнительный класс
*/
className?: string;
/**
* Пользовательские стили
*/
style?: CSSProperties;
/**
* Массив элементов
*/
treeData?: TreeProps['treeData'];
/**
* Чекбокс перед элементами
*/
checkable?: TreeProps['checkable'];
/**
* Массив выбранных элементов
*/
checkedKeys?: TreeProps['checkedKeys'];
/**
* Массив выбранных элементов для первого рендера
*/
defaultCheckedKeys?: TreeProps['defaultCheckedKeys'];
/**
* Disabled состояние кнопки
*/
disabled?: TreeProps['disabled'];
/**
* Обработчик события check
*/
onCheck?: TreeProps['onCheck'];
/**
* Обработчик события expand (открытие дочерних элементов)
*/
onExpand?: TreeProps['onExpand'];
/**
* Раскрывать ли все узлы дерева по умолчанию
*/
defaultExpandAll?: TreeProps['defaultExpandAll'];
/**
* Кастомная структура для treeData
*/
fieldNames?: TreeProps['fieldNames'];
/**
* Функция для выделения конкретной ноды
*/
filterTreeNode?: TreeProps['filterTreeNode'];
}
export interface ILayoutProps {
/**
* Дополнительный класс
*/
className?: LayoutProps['className'];
/**
* Пользовательские стили
*/
style?: LayoutProps['style'];
/**
* Содержит ли layout Sider
*/
hasSider?: LayoutProps['hasSider'];
/**
* Содержимое
*/
children?: LayoutProps['children'];
}
export interface IPopoverProps {
/**
* Заголовок выпадающего списка
*/
title?: PopoverProps['title'];
/**
* Контент выпадающего списка
*/
content: PopoverProps['content'];
/**
* Дополнительный класс
*/
className?: PopoverProps['className'];
/**
* Пользовательские стили
*/
style?: PopoverProps['style'];
/**
* Пользовательские стили выпадающего списка
*/
overlayStyle?: PopoverProps['overlayStyle'];
/**
* Пользовательские стили контента
*/
overlayInnerStyle?: PopoverProps['overlayInnerStyle'];
/**
* Положение подсказки, относительно элемента
*/
placement?: PopoverProps['placement'];
/**
* Отображать или нет стрелку
*/
arrow?: boolean;
/**
* Отцентровать стрелку относительно центра элемента
*/
arrowPointAtCenter?: PopoverProps['arrowPointAtCenter'];
/**
* Отображать подсказку по умолчанию
*/
defaultVisible?: PopoverProps['defaultVisible'];
/**
* Событие показа подсказки
*/
trigger?: PopoverProps['trigger'];
/**
* Внешнее управление отображением подсказки
*/
visible?: PopoverProps['visible'];
/**
* Уничтожать подсказку после ее скрытия
*/
destroyTooltipOnHide?: PopoverProps['destroyTooltipOnHide'];
/**
* Дополнительный класс
*/
overlayClassName?: PopoverProps['overlayClassName'];
/**
* Элемент для тригера открытия выпадающего списка
*/
children?: PopoverProps['children'];
/**
* DOM контейнер подсказки
*/
getPopupContainer?: PopoverProps['getPopupContainer'];
/**
* Callback изменения отображения подсказки
*/
onVisibleChange?: PopoverProps['onVisibleChange'];
}
export interface IDropdownProProps {
/**
* Дополнительный класс
*/
className?: DropDownProps['className'];
/**
* Пользовательские стили выпадающего списка
*/
overlayStyle?: DropDownProps['overlayStyle'];
/**
* Дополнительный класс выпадающего списка
*/
overlayClassName?: DropDownProps['overlayClassName'];
/**
* Нужно ли отрисовывать стрелку у выпадающего списка
*/
arrow?: DropDownProps['arrow'];
/**
* Автоматическая фокусировка на меню, после открытия
*/
autoFocus?: DropDownProps['autoFocus'];
/**
* Disabled состояние
*/
disabled?: DropDownProps['disabled'];
/**
* Удалить выпадающий список после его скрытия
*/
destroyPopupOnHide?: DropDownProps['destroyPopupOnHide'];
/**
* Положение выпадающего списка относительно элемента тригера
*/
placement?: DropDownProps['placement'];
/**
* Событие на которое будет отображен выпадающий списо
*/
trigger?: DropDownProps['trigger'];
/**
* Управление видимостью выпадающего списка
*/
visible?: DropDownProps['visible'];
/**
* Элементы меню выпадающего списка
*/
overlay: DropDownProps['overlay'];
/**
* Элемент для тригера открытия выпадающего списка
*/
children: DropDownProps['children'];
/**
* Управление тем где будет отрисован выпадающий список
*/
getPopupContainer?: DropDownProps['getPopupContainer'];
/**
* Callback будет вызван, когда будет изменено состояния отображения выпадающего списка
*/
onVisibleChange?: DropDownProps['onVisibleChange'];
}
export interface IMenuItem {
key: ItemKey;
label: string;
icon?: React.ReactNode;
children?: IMenuItem[];
}
export interface IMenuProps {
/**
* Дополнительный класс
*/
className?: string;
/**
* Массив элементов
*/
items: IMenuItem[];
/**
* Ключ выбранного элемента
*/
selectedKeys: ItemKey;
/**
* Событие клика по элементу
*/
onClick: (item: IMenuItem) => void;
}
export declare const Button: React.FunctionComponent<ButtonProps>;
/**
* @deprecated use CheckboxInput
*/
export declare const Checkbox: React.FunctionComponent<LegacyCheckboxProps>;
/**
* @deprecated use Select
*/
export declare const Combobox: <T>(props: ComboboxProps<T>) => React.ReactElement;
/**
* @deprecated use Select
*/
export declare const MultipleCombobox: <T>(props: MultipleComboboxProps<T>) => React.ReactElement;
/**
* @deprecated use TreeSelect
*/
export declare const TreeCombobox: <T>(props: TreeComboboxProps<T>) => React.ReactElement;
export declare const Container: React.FunctionComponent<ContainerProps>;
export declare const CopyInput: React.FunctionComponent<ICopyInputProps>;
export declare const Select: React.FunctionComponent<IBaseSelectProps>;
export declare const TreeSelect: React.FunctionComponent<ITreeSelectProps>;
/**
* @deprecated use InputText
*/
export declare const Input: React.FunctionComponent<InputProps>;
export declare const ItemsSlider: React.FunctionComponent<ItemsSliderProps>;
export declare const Loader: React.FunctionComponent<IBaseLoaderProps>;
export declare const Logo: React.FunctionComponent<LogoProps>;
/**
* @deprecated use Dialog
*/
export declare const Modal: React.FunctionComponent<ModalProps>;
/**
* @deprecated use Dialog and ConfirmCodeInput
*/
export declare const ModalConfirmCode: React.FunctionComponent<ModalConfirmCodeProps>;
/**
* @deprecated use Alert
*/
export declare const Notice: React.FunctionComponent<NoticeProps>;
/**
* @deprecated use Select
*/
export declare const DefaultOption: React.FunctionComponent<DefaultOptionProps>;
/**
* @deprecated use Select
*/
export declare const FavouriteOption: React.FunctionComponent<FavouriteOptionProps>;
/**
* @deprecated use Select
*/
export declare const OptionWithSelectedItem: React.FunctionComponent<OptionWithSelectedItemProps>;
/**
* @deprecated use Radio
*/
export declare const RadioGroup: React.FunctionComponent<RadioGroupProps>;
export declare const Dropdown: React.FunctionComponent<IDropdownProps>;
export declare const Switch: React.FunctionComponent<SwitchProps>;
/**
* @deprecated use TablePro
*/
export declare const Table: ITableComponent;
export declare const Tab: <T>(props: TabProps<T>) => React.ReactElement;
/**
* @deprecated use NavigationTabs
*/
export declare const Tabs: <T>(props: TabsProps<T>) => React.ReactElement;
/**
* @deprecated use Countdown
*/
export declare const Timer: React.FunctionComponent<TimerProps>;
export declare const ToggleButton: React.FunctionComponent<ToggleButtonProps>;
export declare const Tooltip: React.FunctionComponent<TooltipProps>;
/**
* @deprecated use Skeleton
*/
export declare const Placeholder: React.FunctionComponent<PlaceholderProps>;
/**
* @deprecated
*/
export declare const SearchError: React.FunctionComponent<SearchErrorProps>;
export declare const EpnUIConfig: React.FunctionComponent<EpnUIConfigProps>;
export declare const Collapse: React.FunctionComponent<IBaseCollapseProps>;
export declare const Upload: React.FunctionComponent<UploadProps>;
export declare const Dialog: React.FunctionComponent<IBaseDialogProps>;
export declare const Empty: React.FunctionComponent<IBaseEmptyProps>;
export declare const DatePicker: React.FunctionComponent<IDatePickerProps>;
export declare const DatePickerRange: React.FunctionComponent<IDatePickerRangeProps>;
export declare const Alert: React.FunctionComponent<IAlertProps>;
export declare const ConfirmCodeInput: React.FunctionComponent<IConfirmCodeInputProps>;
export declare const CheckboxInput: React.FunctionComponent<IBaseCheckboxProps>;
export declare const Radio: React.FunctionComponent<IBaseRadioProps>;
export declare const Countdown: React.FunctionComponent<ICountdownProps>;
export declare const Space: React.FunctionComponent<IBaseSpaceProps>;
export declare const NavigationTabs: React.FunctionComponent<INavigationTabsProps>;
declare function TablePro<T>(props: ITableProProps<T>): JSX.Element;
export declare const Avatar: React.FunctionComponent<IBaseAvatarProps>;
export declare const TooltipPro: React.FunctionComponent<ITooltipProProps>;
export declare const Badge: React.FunctionComponent<IBaseBadgeProps>;
declare function List<T>(props: IBaseListProps<T>): JSX.Element;
export declare namespace List {
const Item: ListItemTypeProps;
}
export declare const Tree: React.FunctionComponent<ITreeProps>;
export declare const notification: (args: ArgsProps) => void;
export declare const Grid: React.FunctionComponent<IGridProps>;
export declare const Popover: React.FunctionComponent<IPopoverProps>;
export declare const Layout: React.FunctionComponent<ILayoutProps>;
export declare const DropdownPro: React.FunctionComponent<IDropdownProProps>;
export declare const Menu: React.FunctionComponent<IMenuProps>;
export declare const Skeleton: React.FunctionComponent<ISkeletonProps>;