denwa-react-shared 1.0.1 → 1.0.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/dist/denwa-react-shared.cjs.js +441 -0
- package/dist/denwa-react-shared.css +1 -0
- package/dist/denwa-react-shared.es.js +63662 -0
- package/dist/denwa-react-shared.umd.js +441 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/session/index.d.ts +1 -0
- package/dist/entities/session/model/index.d.ts +2 -0
- package/dist/entities/session/model/session.store.d.ts +2 -0
- package/dist/entities/session/model/types.d.ts +27 -0
- package/dist/index.d.ts +6 -0
- package/dist/shared/constants/index.d.ts +3 -0
- package/dist/shared/constants/storage.d.ts +7 -0
- package/dist/shared/constants/theme.d.ts +24 -0
- package/dist/shared/constants/variables.d.ts +16 -0
- package/dist/shared/lib/form.d.ts +60 -0
- package/dist/shared/lib/hooks/index.d.ts +1 -0
- package/dist/shared/lib/hooks/use-view-port.d.ts +24 -0
- package/dist/shared/lib/images.d.ts +45 -0
- package/dist/shared/lib/index.d.ts +5 -0
- package/dist/shared/lib/messages/context.d.ts +2 -0
- package/dist/shared/lib/messages/index.d.ts +2 -0
- package/dist/shared/lib/messages/provider.d.ts +3 -0
- package/dist/shared/lib/messages/types.d.ts +8 -0
- package/dist/shared/lib/messages/use-message.d.ts +1 -0
- package/dist/shared/lib/storage.d.ts +10 -0
- package/dist/shared/schemas/index.d.ts +137 -0
- package/dist/shared/types/index.d.ts +148 -0
- package/dist/shared/ui/container/index.d.ts +3 -0
- package/dist/shared/ui/container/types.d.ts +4 -0
- package/dist/shared/ui/date-picker/index.d.ts +3 -0
- package/dist/shared/ui/date-picker/types.d.ts +6 -0
- package/dist/shared/ui/drawer-form/index.d.ts +3 -0
- package/dist/shared/ui/drawer-form/types.d.ts +18 -0
- package/dist/shared/ui/image/index.d.ts +3 -0
- package/dist/shared/ui/image-upload/data.d.ts +4 -0
- package/dist/shared/ui/image-upload/index.d.ts +3 -0
- package/dist/shared/ui/image-upload/item.d.ts +3 -0
- package/dist/shared/ui/image-upload/schema.d.ts +14 -0
- package/dist/shared/ui/image-upload/types.d.ts +50 -0
- package/dist/shared/ui/image-upload/upload-button.d.ts +1 -0
- package/dist/shared/ui/index.d.ts +11 -0
- package/dist/shared/ui/input/index.d.ts +6 -0
- package/dist/shared/ui/input-number/index.d.ts +3 -0
- package/dist/shared/ui/layout-card/index.d.ts +2 -0
- package/dist/shared/ui/material-map/index.d.ts +3 -0
- package/dist/shared/ui/material-map/types.d.ts +7 -0
- package/dist/shared/ui/readonly-input/index.d.ts +3 -0
- package/dist/shared/ui/readonly-input/types.d.ts +3 -0
- package/dist/shared/ui/search-input/index.d.ts +3 -0
- package/dist/shared/ui/search-input/types.d.ts +15 -0
- package/dist/shared/ui/spin/index.d.ts +3 -0
- package/dist/shared/ui/spin/types.d.ts +4 -0
- package/dist/shared/ui/text-editor/data.d.ts +16 -0
- package/dist/shared/ui/text-editor/element.d.ts +4 -0
- package/dist/shared/ui/text-editor/index.d.ts +1 -0
- package/dist/shared/ui/text-editor/lib.d.ts +67 -0
- package/dist/shared/ui/text-editor/link-button.d.ts +1 -0
- package/dist/shared/ui/text-editor/link-component.d.ts +3 -0
- package/dist/shared/ui/text-editor/remove-link-button.d.ts +1 -0
- package/dist/shared/ui/text-editor/text-editor.d.ts +12 -0
- package/dist/shared/ui/text-editor/toolbar.d.ts +1 -0
- package/dist/shared/ui/text-editor/types.d.ts +30 -0
- package/package.json +86 -86
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './session';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './model';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UseNavigateResult } from '@tanstack/react-router';
|
|
2
|
+
import { Session } from '../../../shared/types';
|
|
3
|
+
export type SessionStore = {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isFirstLoadCompleted: boolean;
|
|
6
|
+
currentSession: Session | undefined;
|
|
7
|
+
loadSession: ({ domain, ROLE_PRIORITY, navigate, refresh, }: LoadSession) => Promise<Session | undefined>;
|
|
8
|
+
setCurrentSession: ({ domain, session, isRemember }: SetCurrentSession) => void;
|
|
9
|
+
removeSession: (navigate: UseNavigateResult<string>) => void;
|
|
10
|
+
};
|
|
11
|
+
interface LoadSession {
|
|
12
|
+
domain: string;
|
|
13
|
+
ROLE_PRIORITY: Record<string, number>;
|
|
14
|
+
navigate: UseNavigateResult<string>;
|
|
15
|
+
refresh: () => {
|
|
16
|
+
status: number;
|
|
17
|
+
data: {
|
|
18
|
+
data: Session;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface SetCurrentSession {
|
|
23
|
+
domain: string;
|
|
24
|
+
session: Session;
|
|
25
|
+
isRemember: boolean;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const THEME: {
|
|
2
|
+
VIEW_PORT: {
|
|
3
|
+
EXTRA_SMALL: number;
|
|
4
|
+
SMALL: number;
|
|
5
|
+
MOBILE: number;
|
|
6
|
+
MEDIUM: number;
|
|
7
|
+
EXTRA_MEDIUM: number;
|
|
8
|
+
TABLET: number;
|
|
9
|
+
LAPTOP: number;
|
|
10
|
+
LAPTOP_BIG: number;
|
|
11
|
+
BIG: number;
|
|
12
|
+
VERY_BIG: number;
|
|
13
|
+
};
|
|
14
|
+
OFFSET: {
|
|
15
|
+
1: number;
|
|
16
|
+
2: number;
|
|
17
|
+
3: number;
|
|
18
|
+
4: number;
|
|
19
|
+
5: number;
|
|
20
|
+
6: number;
|
|
21
|
+
7: number;
|
|
22
|
+
8: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const TIME: {
|
|
2
|
+
milliseconds: {
|
|
3
|
+
milliseconds500: number;
|
|
4
|
+
sesonds1: number;
|
|
5
|
+
sesonds2: number;
|
|
6
|
+
sesonds5: number;
|
|
7
|
+
minutes1: number;
|
|
8
|
+
};
|
|
9
|
+
seconds: {
|
|
10
|
+
seconds1: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const VALIDATION_VALUE: {
|
|
14
|
+
minPasswordLength: number;
|
|
15
|
+
maxPasswordLength: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { FileType, IAllImages, IFormImage, IServerImageForm, ITempImages, IUploadImage, IUploadStore } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Преобразует value у инпута в поле маски телефона
|
|
4
|
+
* @param eventValue - исходное значение инпута
|
|
5
|
+
* @response Возвращает либо обработанную строку, либо пустую строку
|
|
6
|
+
* @example
|
|
7
|
+
* 79881234567 -> +79881234567
|
|
8
|
+
* 89881234567 -> +79881234567
|
|
9
|
+
* 19881234567 -> +19881234567
|
|
10
|
+
*/
|
|
11
|
+
export declare const convertPhoneMask: (eventValue: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* @description Форматирует номер телефона из интернационального в обычный
|
|
14
|
+
* @param {string} phone - Номер телефона
|
|
15
|
+
* @return {string} Возвращает либо пустую строку, либо отформатированный номер телефона
|
|
16
|
+
* @example
|
|
17
|
+
* const phone = formatPhone(+7 988 505 42 19)
|
|
18
|
+
* phone === "+79885054219"
|
|
19
|
+
*/
|
|
20
|
+
export declare const formatPhoneToNumber: (phone: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* @description Конвертация файла в base64
|
|
23
|
+
* @param {FileType} parameter - Файл
|
|
24
|
+
* @return {string} Возвращает строку base64
|
|
25
|
+
*/
|
|
26
|
+
export declare const fileToBase64: (file: FileType) => Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* @description Создать upload store для zustand
|
|
29
|
+
* @return {IUploadStore} Возвращает структуру store
|
|
30
|
+
*/
|
|
31
|
+
export declare const createUploadStore: (set: {
|
|
32
|
+
(partial: IUploadStore | Partial<IUploadStore> | ((state: IUploadStore) => IUploadStore | Partial<IUploadStore>), replace?: false): void;
|
|
33
|
+
(state: IUploadStore | ((state: IUploadStore) => IUploadStore), replace: true): void;
|
|
34
|
+
}) => IUploadStore;
|
|
35
|
+
/**
|
|
36
|
+
* @description Переводит массив с данными в объект для select
|
|
37
|
+
* @param {object[]} array - Исходный массив
|
|
38
|
+
* @param {string} label - Название ключа с данными для label
|
|
39
|
+
* @param {string} value - Название ключа с данными для label
|
|
40
|
+
*/
|
|
41
|
+
export declare const objectArrayToOptions: (array: object[], label: string, value: string) => {
|
|
42
|
+
label: string;
|
|
43
|
+
value: string;
|
|
44
|
+
}[];
|
|
45
|
+
export declare const prepareImagesToSubmit: ({ newImages, serverImages, imagesOrder, imagesData, limit, }: {
|
|
46
|
+
newImages: IFormImage[];
|
|
47
|
+
serverImages: IServerImageForm[];
|
|
48
|
+
imagesOrder: string[];
|
|
49
|
+
imagesData: IUploadImage[];
|
|
50
|
+
limit?: number;
|
|
51
|
+
}) => {
|
|
52
|
+
tempImages: ITempImages[];
|
|
53
|
+
allImages: IAllImages[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @description Проверка валидности url
|
|
57
|
+
* @param {string} string - строка
|
|
58
|
+
* @return {boolean}
|
|
59
|
+
*/
|
|
60
|
+
export declare const isUrl: (string: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-view-port';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const useLaptopBigViewPort: () => {
|
|
2
|
+
isLaptopBigMinWidth: boolean;
|
|
3
|
+
isLaptopBigMaxWidth: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const useLaptopViewPort: () => {
|
|
6
|
+
isLaptopMinWidth: boolean;
|
|
7
|
+
isLaptopMaxWidth: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const useTabletViewPort: () => {
|
|
10
|
+
isTabletMinWidth: boolean;
|
|
11
|
+
isTabletMaxWidth: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const useExtraMediumViewPort: () => {
|
|
14
|
+
isExtraMediumMinWidth: boolean;
|
|
15
|
+
isExtraMediumMaxWidth: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const useMobileViewPort: () => {
|
|
18
|
+
isMobileMinWidth: boolean;
|
|
19
|
+
isMobileMaxWidth: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const useSmallViewPort: () => {
|
|
22
|
+
isSmallMinWidth: boolean;
|
|
23
|
+
isSmallMaxWidth: boolean;
|
|
24
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { GetErrorType, IResultImage, IServerImage, IServerImageForm, IUploadImage } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Создает url картинки
|
|
4
|
+
* @param {string} name - название картинки
|
|
5
|
+
* @param {string} extension - расширение картинки
|
|
6
|
+
* @param {string} entityId - id сущности
|
|
7
|
+
* @param {string} bucketName - название бакета картинки
|
|
8
|
+
* @param {string} prefixe - префикс файла
|
|
9
|
+
* @param {string} uploadUrl - url бакета
|
|
10
|
+
* @param bucketFolder - enum с папкой бакета
|
|
11
|
+
* @response Возвращает url
|
|
12
|
+
*/
|
|
13
|
+
export declare const getUploadImageUrl: <T>({ name, extension, entityId, prefixe, bucketFolder, uploadUrl, }: {
|
|
14
|
+
name: string;
|
|
15
|
+
extension: string;
|
|
16
|
+
entityId: string;
|
|
17
|
+
prefixe: string;
|
|
18
|
+
uploadUrl: string;
|
|
19
|
+
bucketFolder: T;
|
|
20
|
+
}) => string;
|
|
21
|
+
/**
|
|
22
|
+
* @description Проверяет валидность объекта картинки по схеме
|
|
23
|
+
* @param {object} object - объект с информацией о картинке
|
|
24
|
+
* @response Возвращает true/false
|
|
25
|
+
*/
|
|
26
|
+
export declare const checkCorrectImageObject: (object: IServerImage, getError: GetErrorType) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description Сортирует массив картинок по порядку из примера
|
|
29
|
+
* @param {array} array - объект с картинками
|
|
30
|
+
* @param {string[]} reference - массив в порядком uid
|
|
31
|
+
* @response Возвращает отсортированный массив картинок
|
|
32
|
+
*/
|
|
33
|
+
export declare const sortImagesArrayByReference: (array: IResultImage[], reference: string[]) => IResultImage[];
|
|
34
|
+
/**
|
|
35
|
+
* @description Преобразует фотографии с сервера в формат для работы с формой
|
|
36
|
+
* @param {string | undefined | null} images - json stringify строка с информацией
|
|
37
|
+
* @param bucketFolder - название папки в бакете
|
|
38
|
+
* @param uploadUrl - Ссылка на бакет
|
|
39
|
+
* @response Возвращает массив с подготовленными картинками
|
|
40
|
+
*/
|
|
41
|
+
export declare const prepareServerImages: <T>(images: string | undefined | null, bucketFolder: T, uploadUrl: string, getError: GetErrorType) => {
|
|
42
|
+
serverImages: IServerImageForm[];
|
|
43
|
+
uploadImages: IUploadImage[];
|
|
44
|
+
};
|
|
45
|
+
export declare const getImagePrefix: (prefixes: string[], type: "original" | "0.25hd" | "0.5hd" | "1hd" | "2hd" | "4hd") => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMessage: () => import('./types').MessageContextProps;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GetErrorType } from '../types';
|
|
2
|
+
export declare const getCookie: (name: string) => string | null;
|
|
3
|
+
export declare const setCookie: (name: string, value: string, options?: any) => void;
|
|
4
|
+
export declare const deleteCookie: (name: string) => void;
|
|
5
|
+
export declare const getTokenInCookie: ({ baseURL, domain, isRefresh, getError, }: {
|
|
6
|
+
baseURL: string;
|
|
7
|
+
domain: string;
|
|
8
|
+
isRefresh?: boolean;
|
|
9
|
+
getError: GetErrorType;
|
|
10
|
+
}) => Promise<string>;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const responseSchema: z.ZodObject<{
|
|
3
|
+
statusCode: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
messages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
6
|
+
data: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
7
|
+
error: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
8
|
+
statusCode: z.ZodNumber;
|
|
9
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
messages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
statusCode: number;
|
|
13
|
+
message?: string | null | undefined;
|
|
14
|
+
messages?: string[] | null | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
statusCode: number;
|
|
17
|
+
message?: string | null | undefined;
|
|
18
|
+
messages?: string[] | null | undefined;
|
|
19
|
+
}>>>;
|
|
20
|
+
response: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
data?: any;
|
|
23
|
+
error?: {
|
|
24
|
+
statusCode: number;
|
|
25
|
+
message?: string | null | undefined;
|
|
26
|
+
messages?: string[] | null | undefined;
|
|
27
|
+
} | null | undefined;
|
|
28
|
+
message?: string | null | undefined;
|
|
29
|
+
statusCode?: number | undefined;
|
|
30
|
+
messages?: string[] | null | undefined;
|
|
31
|
+
response?: any;
|
|
32
|
+
}, {
|
|
33
|
+
data?: any;
|
|
34
|
+
error?: {
|
|
35
|
+
statusCode: number;
|
|
36
|
+
message?: string | null | undefined;
|
|
37
|
+
messages?: string[] | null | undefined;
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
message?: string | null | undefined;
|
|
40
|
+
statusCode?: number | undefined;
|
|
41
|
+
messages?: string[] | null | undefined;
|
|
42
|
+
response?: any;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const sessionCookieSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
profileId: z.ZodString;
|
|
47
|
+
phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
48
|
+
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
49
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
50
|
+
surname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
51
|
+
roles: z.ZodArray<z.ZodString, "many">;
|
|
52
|
+
maxRolePriority: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
53
|
+
isAllDomains: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
54
|
+
domains: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
55
|
+
tokens: z.ZodObject<{
|
|
56
|
+
accessToken: z.ZodObject<{
|
|
57
|
+
token: z.ZodString;
|
|
58
|
+
exp: z.ZodNumber;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
token: string;
|
|
61
|
+
exp: number;
|
|
62
|
+
}, {
|
|
63
|
+
token: string;
|
|
64
|
+
exp: number;
|
|
65
|
+
}>;
|
|
66
|
+
refreshToken: z.ZodObject<{
|
|
67
|
+
token: z.ZodString;
|
|
68
|
+
exp: z.ZodNumber;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
token: string;
|
|
71
|
+
exp: number;
|
|
72
|
+
}, {
|
|
73
|
+
token: string;
|
|
74
|
+
exp: number;
|
|
75
|
+
}>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
accessToken: {
|
|
78
|
+
token: string;
|
|
79
|
+
exp: number;
|
|
80
|
+
};
|
|
81
|
+
refreshToken: {
|
|
82
|
+
token: string;
|
|
83
|
+
exp: number;
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
accessToken: {
|
|
87
|
+
token: string;
|
|
88
|
+
exp: number;
|
|
89
|
+
};
|
|
90
|
+
refreshToken: {
|
|
91
|
+
token: string;
|
|
92
|
+
exp: number;
|
|
93
|
+
};
|
|
94
|
+
}>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
id: string;
|
|
97
|
+
profileId: string;
|
|
98
|
+
roles: string[];
|
|
99
|
+
tokens: {
|
|
100
|
+
accessToken: {
|
|
101
|
+
token: string;
|
|
102
|
+
exp: number;
|
|
103
|
+
};
|
|
104
|
+
refreshToken: {
|
|
105
|
+
token: string;
|
|
106
|
+
exp: number;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
name?: string | null | undefined;
|
|
110
|
+
phone?: string | null | undefined;
|
|
111
|
+
email?: string | null | undefined;
|
|
112
|
+
surname?: string | null | undefined;
|
|
113
|
+
maxRolePriority?: number | null | undefined;
|
|
114
|
+
isAllDomains?: boolean | null | undefined;
|
|
115
|
+
domains?: string[] | null | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
id: string;
|
|
118
|
+
profileId: string;
|
|
119
|
+
roles: string[];
|
|
120
|
+
tokens: {
|
|
121
|
+
accessToken: {
|
|
122
|
+
token: string;
|
|
123
|
+
exp: number;
|
|
124
|
+
};
|
|
125
|
+
refreshToken: {
|
|
126
|
+
token: string;
|
|
127
|
+
exp: number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
name?: string | null | undefined;
|
|
131
|
+
phone?: string | null | undefined;
|
|
132
|
+
email?: string | null | undefined;
|
|
133
|
+
surname?: string | null | undefined;
|
|
134
|
+
maxRolePriority?: number | null | undefined;
|
|
135
|
+
isAllDomains?: boolean | null | undefined;
|
|
136
|
+
domains?: string[] | null | undefined;
|
|
137
|
+
}>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { GetProp, UploadProps } from 'antd';
|
|
2
|
+
export type OptionType = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
};
|
|
6
|
+
export interface IPaginate {
|
|
7
|
+
page: number | null;
|
|
8
|
+
pages: number | null;
|
|
9
|
+
previous?: number | null;
|
|
10
|
+
next?: number | null;
|
|
11
|
+
count: number | null;
|
|
12
|
+
limit: number | null;
|
|
13
|
+
}
|
|
14
|
+
export type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
|
|
15
|
+
export interface Session {
|
|
16
|
+
id: string;
|
|
17
|
+
profileId: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
surname?: string;
|
|
22
|
+
roles: string[];
|
|
23
|
+
maxRolePriority: number | undefined;
|
|
24
|
+
isAllDomains?: boolean;
|
|
25
|
+
domains?: string[];
|
|
26
|
+
tokens?: {
|
|
27
|
+
accessToken: {
|
|
28
|
+
token: string;
|
|
29
|
+
exp: number;
|
|
30
|
+
};
|
|
31
|
+
refreshToken: {
|
|
32
|
+
token: string;
|
|
33
|
+
exp: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface IServerImage {
|
|
38
|
+
altRU?: string;
|
|
39
|
+
altEN?: string;
|
|
40
|
+
altAR?: string;
|
|
41
|
+
name: string;
|
|
42
|
+
originalFileExtension: string;
|
|
43
|
+
entityId: string;
|
|
44
|
+
fullPathExample: string;
|
|
45
|
+
prefixes: string[];
|
|
46
|
+
fileExtensions: string[];
|
|
47
|
+
}
|
|
48
|
+
export interface IFormImage {
|
|
49
|
+
tempName: string;
|
|
50
|
+
uid: string;
|
|
51
|
+
}
|
|
52
|
+
export interface ITempImages {
|
|
53
|
+
tempName: string;
|
|
54
|
+
altRU?: string;
|
|
55
|
+
altEN?: string;
|
|
56
|
+
altAR?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IAllImages {
|
|
59
|
+
name: string | null;
|
|
60
|
+
tempName: string | null;
|
|
61
|
+
altRU?: string | null;
|
|
62
|
+
altEN?: string | null;
|
|
63
|
+
altAR?: string | null;
|
|
64
|
+
}
|
|
65
|
+
export interface IServerImageForm {
|
|
66
|
+
uid: string | undefined;
|
|
67
|
+
url: string | undefined;
|
|
68
|
+
altRU?: string | null;
|
|
69
|
+
altEN?: string | null;
|
|
70
|
+
altAR?: string | null;
|
|
71
|
+
}
|
|
72
|
+
export interface IResultImage {
|
|
73
|
+
tempName?: string;
|
|
74
|
+
uid?: string;
|
|
75
|
+
url?: string;
|
|
76
|
+
altRU?: string | null;
|
|
77
|
+
altEN?: string | null;
|
|
78
|
+
altAR?: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface IAllImages {
|
|
81
|
+
name: string | null;
|
|
82
|
+
tempName: string | null;
|
|
83
|
+
altRU?: string | null;
|
|
84
|
+
altEN?: string | null;
|
|
85
|
+
altAR?: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface IUploadImage {
|
|
88
|
+
uid: string;
|
|
89
|
+
name: string;
|
|
90
|
+
altRU?: string;
|
|
91
|
+
altEN?: string;
|
|
92
|
+
altAR?: string;
|
|
93
|
+
isError?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare enum Languages {
|
|
96
|
+
'russian' = "ru",
|
|
97
|
+
'english' = "en",
|
|
98
|
+
'arabic' = "ar"
|
|
99
|
+
}
|
|
100
|
+
export type LanguagesTypes = 'ru' | 'en' | 'ar';
|
|
101
|
+
export declare enum MonthsNumber {
|
|
102
|
+
January = 1,
|
|
103
|
+
February = 2,
|
|
104
|
+
March = 3,
|
|
105
|
+
April = 4,
|
|
106
|
+
May = 5,
|
|
107
|
+
June = 6,
|
|
108
|
+
July = 7,
|
|
109
|
+
August = 8,
|
|
110
|
+
September = 9,
|
|
111
|
+
October = 10,
|
|
112
|
+
November = 11,
|
|
113
|
+
December = 12
|
|
114
|
+
}
|
|
115
|
+
export type NoUndefinedRangeValueType<DateType> = [start: DateType | null, end: DateType | null];
|
|
116
|
+
export type RangeValueType<DateType> = [
|
|
117
|
+
start: DateType | null | undefined,
|
|
118
|
+
end: DateType | null | undefined
|
|
119
|
+
];
|
|
120
|
+
export interface AdminDrawerFormProps<T> {
|
|
121
|
+
id?: string;
|
|
122
|
+
action?: T;
|
|
123
|
+
onClose?: () => void;
|
|
124
|
+
onRefetch?: () => void;
|
|
125
|
+
}
|
|
126
|
+
export interface IUploadStore {
|
|
127
|
+
images: IUploadImage[];
|
|
128
|
+
updatedImages: IUploadImage[];
|
|
129
|
+
onUpdateData: (data: IUploadImage) => void;
|
|
130
|
+
onSetData: (data: IUploadImage[]) => void;
|
|
131
|
+
onDeleteImage: (uid: string) => void;
|
|
132
|
+
onAllDelete: () => void;
|
|
133
|
+
}
|
|
134
|
+
export interface IImageFile {
|
|
135
|
+
imageName: string;
|
|
136
|
+
originalFileExtension: string;
|
|
137
|
+
entityId: string;
|
|
138
|
+
fullPathExample: string;
|
|
139
|
+
prefixes: string[];
|
|
140
|
+
fileExtensions: string[];
|
|
141
|
+
}
|
|
142
|
+
export type GetErrorType = ({ error, message }: {
|
|
143
|
+
error?: unknown;
|
|
144
|
+
message?: string;
|
|
145
|
+
}) => void;
|
|
146
|
+
export type ToUnion<T extends Record<string, string | number>> = keyof {
|
|
147
|
+
[Prop in keyof T as `${T[Prop]}`]: Prop;
|
|
148
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FormProps } from 'antd';
|
|
2
|
+
import { ButtonHTMLType } from 'antd/lib/button';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { LanguagesTypes, OptionType } from '../../types';
|
|
5
|
+
export interface BaseDrawerFormProps extends FormProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
languagesData?: OptionType[];
|
|
8
|
+
submitButtonText?: string;
|
|
9
|
+
submitHtmlType?: ButtonHTMLType;
|
|
10
|
+
isVisibleSubmit?: boolean;
|
|
11
|
+
isVisibleLanguage?: boolean;
|
|
12
|
+
isVisibleLanguageButton?: boolean;
|
|
13
|
+
isSubmitting?: boolean;
|
|
14
|
+
isTranslateComplete?: boolean;
|
|
15
|
+
onSubmitClick?: () => void;
|
|
16
|
+
onTranslateAllClick?: () => void;
|
|
17
|
+
onChangeLang?: (value: LanguagesTypes) => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const useUploadItemSchema: () => z.ZodObject<{
|
|
3
|
+
altRU: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
4
|
+
altEN: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
5
|
+
altAR: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
altRU?: string | undefined;
|
|
8
|
+
altEN?: string | undefined;
|
|
9
|
+
altAR?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
altRU?: string | undefined;
|
|
12
|
+
altEN?: string | undefined;
|
|
13
|
+
altAR?: string | undefined;
|
|
14
|
+
}>;
|