profinansy-ui-lib 3.2.62 → 3.2.64
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/dist/api/initial.d.ts +1 -1
- package/dist/api/notifications/notifications.api.d.ts +9 -0
- package/dist/api/notifications/notifications.typed.d.ts +17 -0
- package/dist/components/blocks/header/components/HeaderRight/HeaderRight.d.ts +3 -1
- package/dist/components/blocks/header/components/Notification/Notification.d.ts +3 -1
- package/dist/components/blocks/header/components/Notification/Notification.styled.d.ts +4 -0
- package/dist/components/blocks/header/hooks/useGetNotificationsCount.d.ts +4 -0
- package/dist/components/blocks/search/components/UserRequests/UserRequests.styled.d.ts +1 -0
- package/dist/components/uikit/Table/Table.d.ts +2 -0
- package/dist/components/uikit/Table/Table.stories.d.ts +8 -0
- package/dist/components/uikit/Table/Table.styled.d.ts +5 -0
- package/dist/components/uikit/Table/Table.typed.d.ts +79 -0
- package/dist/components/uikit/Table/components/MockData.d.ts +24 -0
- package/dist/components/uikit/Table/components/TBody/TBody.d.ts +2 -0
- package/dist/components/uikit/Table/components/TBody/TBody.styled.d.ts +16 -0
- package/dist/components/uikit/Table/components/THead/THead.d.ts +3 -0
- package/dist/components/uikit/Table/components/THead/THead.styled.d.ts +32 -0
- package/dist/components/uikit/Table/hooks/useDragging.d.ts +2 -0
- package/dist/components/uikit/Table/hooks/useHorizontalScroll.d.ts +6 -0
- package/dist/components/uikit/Table/hooks/useLastRow.d.ts +3 -0
- package/dist/components/uikit/Table/hooks/useSort.d.ts +7 -0
- package/dist/components/uikit/Table/index.d.ts +1 -0
- package/dist/components/uikit/Table/utils.d.ts +5 -0
- package/dist/constants/common.d.ts +12 -0
- package/dist/constants/instrumentsTypes.d.ts +9 -0
- package/dist/firebase.d.ts +4 -0
- package/dist/index.js +44 -23
- package/dist/index.js.LICENSE.txt +85 -0
- package/package.json +2 -1
package/dist/api/initial.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IApiSettings } from './api';
|
|
2
|
-
type TMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
2
|
+
export type TMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
3
3
|
type TBody = Record<string, unknown>;
|
|
4
4
|
export declare const apiHelper: (url: string, method: TMethod, settings: IApiSettings, body?: TBody) => Promise<any>;
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IApiSettings } from '../api';
|
|
2
|
+
import { INotification } from './notifications.typed';
|
|
3
|
+
export declare const notificationsApi: {
|
|
4
|
+
getNotificationsHistory: (apiSettings: IApiSettings) => Promise<{
|
|
5
|
+
data: INotification[];
|
|
6
|
+
next_notification_id: number;
|
|
7
|
+
new_count: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface INotification {
|
|
2
|
+
body: string;
|
|
3
|
+
data: {
|
|
4
|
+
instrument_id: number;
|
|
5
|
+
};
|
|
6
|
+
date: number;
|
|
7
|
+
deeplink_msg: string;
|
|
8
|
+
deeplink: string;
|
|
9
|
+
group_name: string;
|
|
10
|
+
group_title: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
id: number;
|
|
13
|
+
is_read: boolean;
|
|
14
|
+
title: string;
|
|
15
|
+
type_name: string;
|
|
16
|
+
type_title: string;
|
|
17
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IUser, UserRole } from '../../../../../common.types';
|
|
2
|
+
import { IApiSettings } from '../../../../../api/api';
|
|
2
3
|
interface IProps {
|
|
3
4
|
user: IUser;
|
|
4
5
|
hostname: string;
|
|
@@ -9,6 +10,7 @@ interface IProps {
|
|
|
9
10
|
handleRouteChange: (val: string) => void;
|
|
10
11
|
setBurgerOpened: (val: boolean) => void;
|
|
11
12
|
onLogout: () => void;
|
|
13
|
+
apiSettings: IApiSettings;
|
|
12
14
|
}
|
|
13
|
-
declare const HeaderRight: ({ user, hostname, userRole, isProfinansy, isPossibleTrial, trial, handleRouteChange, setBurgerOpened, onLogout }: IProps) => JSX.Element;
|
|
15
|
+
declare const HeaderRight: ({ user, hostname, userRole, isProfinansy, isPossibleTrial, trial, handleRouteChange, setBurgerOpened, onLogout, apiSettings }: IProps) => JSX.Element;
|
|
14
16
|
export { HeaderRight };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { UserRole } from '../../../../../common.types';
|
|
2
|
+
import { IApiSettings } from '../../../../../api/api';
|
|
2
3
|
interface IProps {
|
|
3
4
|
hostname: string;
|
|
4
5
|
handleRouteChange: (val: string) => void;
|
|
5
6
|
userRole: UserRole;
|
|
7
|
+
apiSettings: IApiSettings;
|
|
6
8
|
}
|
|
7
|
-
declare const Notification: ({ hostname, handleRouteChange, userRole }: IProps) => JSX.Element;
|
|
9
|
+
declare const Notification: ({ hostname, handleRouteChange, userRole, apiSettings }: IProps) => JSX.Element;
|
|
8
10
|
export { Notification };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const NotificationsCount: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
+
notificationsCount: number;
|
|
4
|
+
}, never>;
|
|
1
5
|
export declare const NotificationButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
2
6
|
isActive: boolean;
|
|
3
7
|
}, never>;
|
|
@@ -17,6 +17,7 @@ export declare const Description: import("styled-components").StyledComponent<im
|
|
|
17
17
|
export declare const Logo: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
|
|
18
18
|
export declare const Symbol: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
19
|
export declare const TickerLine: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
+
export declare const Border: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
21
|
export declare const Dot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
22
|
export declare const ShowMore: import("styled-components").StyledComponent<({ type, mode, size, text, style, onClick, className, iconLeft, iconRight, disabled }: import("../../../../uikit/TextButton/TextButton.typed").ITextButton) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
22
23
|
export declare const Flag: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ITable } from './Table.typed';
|
|
2
|
+
export declare function Table<TItem>({ columns, tCellRenderer, RowWrapper, RowWrapperExpand, data, tableHeight, hints, rowHeight, stickyFirstColumn, stickyLastColumn, stickyHeader, isDraggable, customSort, onScrollEndReach }: ITable<TItem>): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
|
+
tableHeight: number;
|
|
3
|
+
isDraggable: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const Table: import("styled-components").StyledComponent<"table", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ITable<TItem> {
|
|
3
|
+
/** колонки для таблицы **/
|
|
4
|
+
columns: IColumnTable[];
|
|
5
|
+
/** данные для таблицы **/
|
|
6
|
+
data: TItem[];
|
|
7
|
+
/** Высота таблицы **/
|
|
8
|
+
tableHeight?: number;
|
|
9
|
+
/** Высота строки **/
|
|
10
|
+
rowHeight?: number;
|
|
11
|
+
/** Скролить ли таблицу горизонтально зажав мышку **/
|
|
12
|
+
isDraggable?: boolean;
|
|
13
|
+
/** Закрепить первую колонку **/
|
|
14
|
+
stickyFirstColumn?: boolean;
|
|
15
|
+
/** Закрепить последнюю колонку **/
|
|
16
|
+
stickyLastColumn?: boolean;
|
|
17
|
+
/** Закрепить шапку **/
|
|
18
|
+
stickyHeader?: boolean;
|
|
19
|
+
/** Функция, которая вызывается при полном пролистывании таблицы **/
|
|
20
|
+
onScrollEndReach?: () => void;
|
|
21
|
+
/** обертка для отрисовки строк таблицы. **/
|
|
22
|
+
RowWrapper?: React.ElementType;
|
|
23
|
+
/** обертка для отрисовки расширяемой строки таблицы. **/
|
|
24
|
+
RowWrapperExpand?: React.ElementType;
|
|
25
|
+
/** Объект с подсказками. Нужно, чтобы понимать, откуда вообще тянуть подсказки **/
|
|
26
|
+
hints?: Record<string, string[]>;
|
|
27
|
+
/** Добавление своей сортировки таблицы **/
|
|
28
|
+
customSort?: {
|
|
29
|
+
onSort: (key: string, method?: string) => void;
|
|
30
|
+
activeSortField?: string;
|
|
31
|
+
activeSortDirection?: 'ASC' | 'DESC';
|
|
32
|
+
};
|
|
33
|
+
/** функция для отрисовки ячейки таблицы. **/
|
|
34
|
+
tCellRenderer?: (cellData: {
|
|
35
|
+
rowData: TItem;
|
|
36
|
+
columnKey: string;
|
|
37
|
+
index: number;
|
|
38
|
+
isLastRow: boolean;
|
|
39
|
+
isLastCell: boolean;
|
|
40
|
+
cellRowIndex: number;
|
|
41
|
+
}) => JSX.Element;
|
|
42
|
+
}
|
|
43
|
+
export interface IBody<TItem> {
|
|
44
|
+
columns: IColumnTable[];
|
|
45
|
+
data: TItem[];
|
|
46
|
+
rowHeight?: number;
|
|
47
|
+
RowWrapper?: ITable<TItem>['RowWrapper'];
|
|
48
|
+
RowWrapperExpand?: ITable<TItem>['RowWrapperExpand'];
|
|
49
|
+
tCellRenderer: ITable<TItem>['tCellRenderer'];
|
|
50
|
+
isScrolled: boolean;
|
|
51
|
+
isScrolledEnd: boolean;
|
|
52
|
+
stickyFirstColumn: boolean;
|
|
53
|
+
stickyLastColumn: boolean;
|
|
54
|
+
onScrollEndReach: ITable<TItem>['onScrollEndReach'];
|
|
55
|
+
}
|
|
56
|
+
export interface IHead {
|
|
57
|
+
columns: IColumnTable[];
|
|
58
|
+
isScrolled: boolean;
|
|
59
|
+
isScrolledEnd: boolean;
|
|
60
|
+
stickyFirstColumn: boolean;
|
|
61
|
+
stickyLastColumn: boolean;
|
|
62
|
+
stickyHeader: boolean;
|
|
63
|
+
activeSortField: string;
|
|
64
|
+
triangleRotated: boolean;
|
|
65
|
+
hints: Record<string, string[]>;
|
|
66
|
+
handleSort: (field: string) => void;
|
|
67
|
+
}
|
|
68
|
+
export interface IColumnTable {
|
|
69
|
+
title: string;
|
|
70
|
+
key: string;
|
|
71
|
+
hint?: string;
|
|
72
|
+
sort?: boolean;
|
|
73
|
+
maxWidth?: string;
|
|
74
|
+
alignment?: 'left' | 'right' | 'center';
|
|
75
|
+
}
|
|
76
|
+
export interface ITableSort {
|
|
77
|
+
field: string;
|
|
78
|
+
order: 'ASC' | 'DESC';
|
|
79
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IColumnTable } from '../Table.typed';
|
|
2
|
+
export declare const MOCK_DATA_1: ({
|
|
3
|
+
id: number;
|
|
4
|
+
yearProfit: string;
|
|
5
|
+
ThreeYearsProfit: string;
|
|
6
|
+
FiveYearsProfit: string;
|
|
7
|
+
TenYearsProfit: string;
|
|
8
|
+
AllTimeProfit: string;
|
|
9
|
+
fieldTitle: string;
|
|
10
|
+
targetScroll?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
id: number;
|
|
13
|
+
yearProfit: string;
|
|
14
|
+
ThreeYearsProfit: string;
|
|
15
|
+
FiveYearsProfit: string;
|
|
16
|
+
TenYearsProfit: string;
|
|
17
|
+
AllTimeProfit: string;
|
|
18
|
+
targetScroll: boolean;
|
|
19
|
+
fieldTitle: string;
|
|
20
|
+
})[];
|
|
21
|
+
export declare const Hints: {
|
|
22
|
+
hint_1: string[];
|
|
23
|
+
};
|
|
24
|
+
export declare const COLUMNS: IColumnTable[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IColumnTable } from '../../Table.typed';
|
|
2
|
+
export declare const TBody: import("styled-components").StyledComponent<"tbody", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const TD: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {
|
|
4
|
+
maxWidth?: string;
|
|
5
|
+
isScrolled: boolean;
|
|
6
|
+
isScrolledEnd: boolean;
|
|
7
|
+
stickyFirstColumn: boolean;
|
|
8
|
+
stickyLastColumn: boolean;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const TR: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
|
|
11
|
+
withoutBorder: boolean;
|
|
12
|
+
}, never>;
|
|
13
|
+
export declare const ExpandTR: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
+
export declare const TDItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
15
|
+
alignment: IColumnTable['alignment'];
|
|
16
|
+
}, never>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TTheme } from '../../../../../theme/theme.typed';
|
|
2
|
+
import { IColumnTable } from '../../Table.typed';
|
|
3
|
+
export declare const getTriangle: (isHover: boolean, triangleRotated: boolean, theme: TTheme) => {
|
|
4
|
+
readonly position: "absolute";
|
|
5
|
+
readonly bottom: 0 | -5;
|
|
6
|
+
readonly left: "50%";
|
|
7
|
+
readonly transform: "translateX(-50%) rotate(180deg)" | "translateX(-50%) rotate(0deg)";
|
|
8
|
+
readonly content: "\"\"";
|
|
9
|
+
readonly width: 0;
|
|
10
|
+
readonly height: 0;
|
|
11
|
+
readonly borderLeft: "5px solid transparent";
|
|
12
|
+
readonly borderRight: "5px solid transparent";
|
|
13
|
+
readonly borderBottom: `5px solid ${string}`;
|
|
14
|
+
};
|
|
15
|
+
export declare const THead: import("styled-components").StyledComponent<"thead", import("styled-components").DefaultTheme, {
|
|
16
|
+
stickyHeader: boolean;
|
|
17
|
+
}, never>;
|
|
18
|
+
export declare const Sort: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
triangleRotated: boolean;
|
|
21
|
+
}, never>;
|
|
22
|
+
export declare const TH: import("styled-components").StyledComponent<"th", import("styled-components").DefaultTheme, {
|
|
23
|
+
triangleRotated: boolean;
|
|
24
|
+
stickyFirstColumn: boolean;
|
|
25
|
+
stickyLastColumn: boolean;
|
|
26
|
+
isScrolled: boolean;
|
|
27
|
+
isScrolledEnd: boolean;
|
|
28
|
+
isSort: boolean;
|
|
29
|
+
}, never>;
|
|
30
|
+
export declare const THItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
31
|
+
alignment: IColumnTable['alignment'];
|
|
32
|
+
}, never>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
export declare const useHorizontalScroll: (tableContainerRef: MutableRefObject<HTMLElement>, stickyFirstColumn: boolean, stickyLastColumn: boolean) => {
|
|
3
|
+
tableContainerRef: MutableRefObject<HTMLElement>;
|
|
4
|
+
isScrolled: boolean;
|
|
5
|
+
isScrolledEnd: boolean;
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITable } from '../Table.typed';
|
|
2
|
+
export declare function useSort<TItem>(data: ITable<TItem>['data'], customSort: ITable<TItem>['customSort']): {
|
|
3
|
+
sortedData: TItem[];
|
|
4
|
+
activeSortField: string;
|
|
5
|
+
triangleRotated: boolean;
|
|
6
|
+
handleSort: (field: string) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './Table';
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { TMethod } from '../api/initial';
|
|
1
2
|
export declare const HEIGHT_HEADER = 64;
|
|
2
3
|
export declare const TABLET_WIDTH = 960;
|
|
3
4
|
export declare const MOBILE_WIDTH = 600;
|
|
5
|
+
export declare const REQUEST_METHOD: Record<TMethod, TMethod>;
|
|
6
|
+
export declare const firebaseConfig: {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
authDomain: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
storageBucket: string;
|
|
11
|
+
messagingSenderId: string;
|
|
12
|
+
appId: string;
|
|
13
|
+
measurementId: string;
|
|
14
|
+
vapidKey: string;
|
|
15
|
+
};
|