denwa-react-shared 1.0.18 → 1.0.19
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 +96 -95
- package/dist/denwa-react-shared.es.js +11388 -10896
- package/dist/denwa-react-shared.umd.js +97 -96
- package/dist/shared/lib/hooks/index.d.ts +1 -0
- package/dist/shared/lib/hooks/use-fetch-table-data.d.ts +62 -0
- package/dist/shared/schemas/index.d.ts +2 -2
- package/dist/shared/ui/admin-table/index.d.ts +2 -0
- package/dist/shared/ui/admin-table/table-head-skeleton.d.ts +1 -0
- package/dist/shared/ui/admin-table/table-head.d.ts +3 -0
- package/dist/shared/ui/admin-table/table-search.d.ts +3 -0
- package/dist/shared/ui/admin-table/types.d.ts +98 -0
- package/dist/shared/ui/base-table/index.d.ts +3 -0
- package/dist/shared/ui/base-table/types.d.ts +19 -0
- package/dist/shared/ui/date-picker/index.d.ts +9 -1
- package/dist/shared/ui/text-editor/lib.d.ts +2 -2
- package/package.json +2 -1
- package/dist/shared/ui/date-picker/types.d.ts +0 -9
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SearchRadioType, SearchType } from '../../ui/admin-table/types';
|
|
2
|
+
export interface TableFitersSortFields {
|
|
3
|
+
key: string;
|
|
4
|
+
field: string;
|
|
5
|
+
order: 'asc' | 'desc';
|
|
6
|
+
}
|
|
7
|
+
export interface TableFitersFields {
|
|
8
|
+
key: 'priority';
|
|
9
|
+
field: 'priorityFrom';
|
|
10
|
+
}
|
|
11
|
+
export interface UseFetchTableDataProps {
|
|
12
|
+
sortFields: TableFitersSortFields[];
|
|
13
|
+
numberFilters: TableFitersFields[];
|
|
14
|
+
radioFilters: TableFitersFields[];
|
|
15
|
+
dateFilters: TableFitersFields[];
|
|
16
|
+
multiselectFilters: TableFitersFields[];
|
|
17
|
+
searchFields: string[];
|
|
18
|
+
textSearchFields: string[];
|
|
19
|
+
radioSearchFields: string[];
|
|
20
|
+
dateSearchFields: string[];
|
|
21
|
+
numberSearchFields: string[];
|
|
22
|
+
multiselectSearchFields: string[];
|
|
23
|
+
defaultSearchSelect?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const useFetchTableData: ({ defaultSearchSelect, sortFields, radioFilters, dateFilters, multiselectFilters, numberFilters, searchFields, textSearchFields, radioSearchFields, dateSearchFields, numberSearchFields, multiselectSearchFields, }: UseFetchTableDataProps) => {
|
|
26
|
+
order: string;
|
|
27
|
+
sort: {
|
|
28
|
+
field: string;
|
|
29
|
+
order: string;
|
|
30
|
+
};
|
|
31
|
+
limit: number;
|
|
32
|
+
page: number;
|
|
33
|
+
filter: {
|
|
34
|
+
priorityFrom: number;
|
|
35
|
+
} | {
|
|
36
|
+
priorityFrom: boolean;
|
|
37
|
+
} | {
|
|
38
|
+
priorityFrom: Date;
|
|
39
|
+
} | {
|
|
40
|
+
priorityFrom: string[];
|
|
41
|
+
} | {
|
|
42
|
+
priorityFrom?: undefined;
|
|
43
|
+
};
|
|
44
|
+
searchValue: {
|
|
45
|
+
[x: string]: string;
|
|
46
|
+
};
|
|
47
|
+
searchSelect: string;
|
|
48
|
+
searchType: SearchType;
|
|
49
|
+
textSearchValue: string;
|
|
50
|
+
multiselectSearchValue: string[];
|
|
51
|
+
numberSearchValue: number;
|
|
52
|
+
dateSearchValue: Date | undefined;
|
|
53
|
+
onChangeSearch: (value: string) => void;
|
|
54
|
+
onChangeTextSearch: (text: string) => void;
|
|
55
|
+
onChangeOrder: (value: string) => void;
|
|
56
|
+
onSetPaginate: (value: number, pageSize: number) => void;
|
|
57
|
+
onShowSizeChange: (_current: number, size: number) => void;
|
|
58
|
+
onChangeRadioSearch: (value: SearchRadioType) => void;
|
|
59
|
+
onChangeDateSearch: (value: Date | null) => void;
|
|
60
|
+
onChangeNumberSearch: (value: number) => void;
|
|
61
|
+
onChangeMultiselectSearch: (value: string[]) => void;
|
|
62
|
+
};
|
|
@@ -107,8 +107,8 @@ export declare const sessionCookieSchema: z.ZodObject<{
|
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
109
|
name?: string | null | undefined;
|
|
110
|
-
phone?: string | null | undefined;
|
|
111
110
|
email?: string | null | undefined;
|
|
111
|
+
phone?: string | null | undefined;
|
|
112
112
|
surname?: string | null | undefined;
|
|
113
113
|
maxRolePriority?: number | null | undefined;
|
|
114
114
|
isAllDomains?: boolean | null | undefined;
|
|
@@ -128,8 +128,8 @@ export declare const sessionCookieSchema: z.ZodObject<{
|
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
130
|
name?: string | null | undefined;
|
|
131
|
-
phone?: string | null | undefined;
|
|
132
131
|
email?: string | null | undefined;
|
|
132
|
+
phone?: string | null | undefined;
|
|
133
133
|
surname?: string | null | undefined;
|
|
134
134
|
maxRolePriority?: number | null | undefined;
|
|
135
135
|
isAllDomains?: boolean | null | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AdminTableProps } from './types';
|
|
2
|
+
export declare const AdminTable: <T extends string>({ drawerContent, sortTooltipText, updateDataText, refreshText, createText, createNewElementText, viewText, actionsText, editText, tableData, columns, order, orderOptions, searchProps, serverPagination, fetchedDataLoading, createButtonTooltip, readAction, createAction, updateAction, deleteText, deleteErrorText, drawerTitle, drawerSize, modalTitle, scrollWidth, isCanRead, isCanCreate, isCanUpdate, isCanDelete, isExpandable, isHiddenCreate, isHiddenUpdate, isFixedActions, onGetError, onChangeOrder, onRefetch, onSetPaginate, onDelete, onShowSizeChange, }: AdminTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableHeadSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ColumnsType } from 'antd/es/table';
|
|
3
|
+
import { PaginationProps } from 'antd';
|
|
4
|
+
import { AdminDrawerFormProps, IPaginate, OptionType } from '../../types';
|
|
5
|
+
import { BaseDatePickerProps } from '../date-picker';
|
|
6
|
+
export interface AdminTableProps<T extends string> {
|
|
7
|
+
drawerContent: ReactElement<AdminDrawerFormProps<T>>;
|
|
8
|
+
sortTooltipText: string;
|
|
9
|
+
updateDataText: string;
|
|
10
|
+
refreshText: string;
|
|
11
|
+
createText: string;
|
|
12
|
+
createNewElementText: string;
|
|
13
|
+
viewText: string;
|
|
14
|
+
actionsText: string;
|
|
15
|
+
editText: string;
|
|
16
|
+
tableData: object[];
|
|
17
|
+
columns: ColumnsType;
|
|
18
|
+
order: string;
|
|
19
|
+
orderOptions: OptionType[];
|
|
20
|
+
searchProps: TableSearchProps;
|
|
21
|
+
serverPagination: IPaginate | undefined;
|
|
22
|
+
fetchedDataLoading: boolean;
|
|
23
|
+
readAction: T;
|
|
24
|
+
createAction: T;
|
|
25
|
+
updateAction: T;
|
|
26
|
+
deleteText: string;
|
|
27
|
+
deleteErrorText: string;
|
|
28
|
+
createButtonTooltip: string;
|
|
29
|
+
drawerTitle: string;
|
|
30
|
+
modalTitle: string;
|
|
31
|
+
drawerSize?: 'default' | 'large';
|
|
32
|
+
scrollWidth?: number;
|
|
33
|
+
isCanRead: boolean;
|
|
34
|
+
isCanCreate: boolean;
|
|
35
|
+
isCanUpdate: boolean;
|
|
36
|
+
isCanDelete: boolean;
|
|
37
|
+
isFixedActions?: boolean;
|
|
38
|
+
isExpandable?: boolean;
|
|
39
|
+
isHiddenCreate?: boolean;
|
|
40
|
+
isHiddenUpdate?: boolean;
|
|
41
|
+
onGetError: ({ error, message }: {
|
|
42
|
+
error?: unknown;
|
|
43
|
+
message?: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
onRefetch: () => void;
|
|
46
|
+
onChangeOrder: (value: string) => void;
|
|
47
|
+
onSetPaginate: (value: number, pageSize: number) => void;
|
|
48
|
+
onDelete?: (id: string) => void;
|
|
49
|
+
onShowSizeChange: PaginationProps['onShowSizeChange'];
|
|
50
|
+
}
|
|
51
|
+
export interface IRecordListItem {
|
|
52
|
+
id: string;
|
|
53
|
+
text: string;
|
|
54
|
+
}
|
|
55
|
+
export interface TableSearchProps {
|
|
56
|
+
datePickerComponent: ReactElement<Omit<BaseDatePickerProps, 'configLocale'>>;
|
|
57
|
+
searchText: string;
|
|
58
|
+
noDateText: string;
|
|
59
|
+
emptyText: string;
|
|
60
|
+
searchSelect: string;
|
|
61
|
+
radioOptions: ISearchCheckboxOption[];
|
|
62
|
+
searchOptions: OptionType[];
|
|
63
|
+
searchType: SearchType;
|
|
64
|
+
textSearchValue?: string;
|
|
65
|
+
dateSearchValue?: Date;
|
|
66
|
+
numberSearchValue?: number;
|
|
67
|
+
multiselectSearchValue?: string[];
|
|
68
|
+
multiselectOptions?: OptionType[];
|
|
69
|
+
onChangeSearch: (value: string) => void;
|
|
70
|
+
onChangeTextSearch?: (text: string) => void;
|
|
71
|
+
onChangeRadioSearch?: (value: SearchRadioType) => void;
|
|
72
|
+
onChangeDateSearch?: (value: Date | null) => void;
|
|
73
|
+
onChangeNumberSearch?: (value: number) => void;
|
|
74
|
+
onChangeMultiselectSearch?: (value: string[]) => void;
|
|
75
|
+
}
|
|
76
|
+
export interface TableHeadProps {
|
|
77
|
+
sortTooltipText: string;
|
|
78
|
+
updateDataText: string;
|
|
79
|
+
refreshText: string;
|
|
80
|
+
createText: string;
|
|
81
|
+
createNewElementText: string;
|
|
82
|
+
order: string;
|
|
83
|
+
orderOptions: OptionType[];
|
|
84
|
+
searchProps: TableSearchProps;
|
|
85
|
+
createButtonTooltip?: string;
|
|
86
|
+
isCanCreate: boolean;
|
|
87
|
+
isHiddenCreate?: boolean;
|
|
88
|
+
onCreate: () => void;
|
|
89
|
+
onChangeOrder: (value: string) => void;
|
|
90
|
+
onRefetch?: () => void;
|
|
91
|
+
}
|
|
92
|
+
export declare const searchRadioDefaultValue = "all";
|
|
93
|
+
export type SearchRadioType = 'all' | 'yes' | 'no';
|
|
94
|
+
export interface ISearchCheckboxOption {
|
|
95
|
+
label: string;
|
|
96
|
+
value: SearchRadioType;
|
|
97
|
+
}
|
|
98
|
+
export type SearchType = 'text' | 'radio' | 'date' | 'number' | 'multiselect';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PaginationProps, TableProps } from 'antd';
|
|
2
|
+
import { IPaginate } from '../../types';
|
|
3
|
+
export interface BaseTableProps extends TableProps {
|
|
4
|
+
viewText: string;
|
|
5
|
+
actionsText: string;
|
|
6
|
+
editText: string;
|
|
7
|
+
deleteText: string;
|
|
8
|
+
serverPagination?: IPaginate;
|
|
9
|
+
isCanRead: boolean;
|
|
10
|
+
isCanUpdate: boolean;
|
|
11
|
+
isCanDelete: boolean;
|
|
12
|
+
isHiddenUpdate?: boolean;
|
|
13
|
+
isFixedActions?: boolean;
|
|
14
|
+
onView: (id: string) => void;
|
|
15
|
+
onDropdownClick: (id: string) => void;
|
|
16
|
+
onEdit: () => void;
|
|
17
|
+
onDelete?: () => void;
|
|
18
|
+
onShowSizeChange: PaginationProps['onShowSizeChange'];
|
|
19
|
+
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DatePickerProps } from 'antd';
|
|
3
|
+
import { Locale } from 'antd/es/locale';
|
|
4
|
+
export interface BaseDatePickerProps extends DatePickerProps {
|
|
5
|
+
noDateText: string;
|
|
6
|
+
configLocale: Locale;
|
|
7
|
+
currentValue: Date | string;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
onChangeDate: (date: Date | null) => void;
|
|
10
|
+
}
|
|
3
11
|
export declare const BaseDatePicker: FC<BaseDatePickerProps>;
|
|
@@ -7,14 +7,14 @@ import { ReactEditor } from 'slate-react';
|
|
|
7
7
|
* @param blockType - тип блока
|
|
8
8
|
* @returns тип кнопки primary или default
|
|
9
9
|
*/
|
|
10
|
-
export declare const isBlockActive: (editor: BaseEditor & ReactEditor, format: string, blockType?: "type" | "align") => "
|
|
10
|
+
export declare const isBlockActive: (editor: BaseEditor & ReactEditor, format: string, blockType?: "type" | "align") => "default" | "primary";
|
|
11
11
|
/**
|
|
12
12
|
* @description Активна ли кнопка маркировки
|
|
13
13
|
* @param editor - slate editor
|
|
14
14
|
* @param format - тип параметра
|
|
15
15
|
* @returns тип кнопки primary или default
|
|
16
16
|
*/
|
|
17
|
-
export declare const isMarkActive: (editor: BaseEditor & ReactEditor, format: string) => "
|
|
17
|
+
export declare const isMarkActive: (editor: BaseEditor & ReactEditor, format: string) => "default" | "primary";
|
|
18
18
|
/**
|
|
19
19
|
* @description Смена маркировки
|
|
20
20
|
* @param editor - slate editor
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "denwa-react-shared",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.19",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Denwa",
|
|
7
7
|
"main": "dist/denwa-react-shared.umd.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dayjs": "^1.11.13",
|
|
45
45
|
"is-hotkey": "^0.2.0",
|
|
46
46
|
"libphonenumber-js": "^1.12.9",
|
|
47
|
+
"nuqs": "^2.4.3",
|
|
47
48
|
"react": "^19.1.0",
|
|
48
49
|
"react-dom": "^19.1.0",
|
|
49
50
|
"react-hook-form": "^7.57.0",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DatePickerProps } from 'antd';
|
|
2
|
-
import { Locale } from 'antd/es/locale';
|
|
3
|
-
export interface BaseDatePickerProps extends DatePickerProps {
|
|
4
|
-
noDateText: string;
|
|
5
|
-
configLocale: Locale;
|
|
6
|
-
currentValue: Date | string;
|
|
7
|
-
readOnly?: boolean;
|
|
8
|
-
onChangeDate: (date: Date | null) => void;
|
|
9
|
-
}
|