@boarteam/boar-pack-common-frontend 2.3.0 → 2.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boarteam/boar-pack-common-frontend",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Common frontend package for Boar Pack",
|
|
5
5
|
"repository": "git@github.com:boarteam/boar-pack.git",
|
|
6
6
|
"author": "Andrew Balakirev <balakirev.andrey@gmail.com>",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"scripts": {
|
|
47
47
|
"yalc:push": "yalc push"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "a1da0e1cce86e1e5c0a4604242ee0033ff2cba17"
|
|
50
50
|
}
|
|
@@ -12,6 +12,7 @@ const DescriptionsCreateModal = <Entity extends Record<string | symbol, any>>({
|
|
|
12
12
|
data,
|
|
13
13
|
onClose,
|
|
14
14
|
onSubmit,
|
|
15
|
+
modalProps,
|
|
15
16
|
...rest
|
|
16
17
|
}: TDescriptionsCreateModalProps<Entity>) => {
|
|
17
18
|
const sections = columnsToDescriptionItemProps(columns, 'General');
|
|
@@ -38,6 +39,7 @@ const DescriptionsCreateModal = <Entity extends Record<string | symbol, any>>({
|
|
|
38
39
|
footer={[
|
|
39
40
|
<Button key='submit' type="primary" onClick={async () => form.validateFields().then(onSubmit)}>Create</Button>
|
|
40
41
|
]}
|
|
42
|
+
{...modalProps}
|
|
41
43
|
>
|
|
42
44
|
{sections.map((section, index) => (
|
|
43
45
|
<ProDescriptions<Entity>
|
|
@@ -3,6 +3,7 @@ import { ActionType } from "@ant-design/pro-table";
|
|
|
3
3
|
import { RowEditableConfig } from "@ant-design/pro-utils";
|
|
4
4
|
import { QueryJoin } from "@nestjsx/crud-request";
|
|
5
5
|
import { ProColumns, ProDescriptionsProps } from "@ant-design/pro-components";
|
|
6
|
+
import { ModalProps } from "antd";
|
|
6
7
|
|
|
7
8
|
export type TGetOneParams = {
|
|
8
9
|
/**
|
|
@@ -46,4 +47,5 @@ export type TDescriptionsCreateModalProps<Entity> = Omit<ProDescriptionsProps<En
|
|
|
46
47
|
data: Partial<Entity> | undefined,
|
|
47
48
|
onSubmit: (data: Entity) => Promise<void>,
|
|
48
49
|
onClose: () => void,
|
|
50
|
+
modalProps: ModalProps,
|
|
49
51
|
}
|
|
@@ -69,6 +69,7 @@ const Table = <Entity extends Record<string | symbol, any>,
|
|
|
69
69
|
toolBarRender,
|
|
70
70
|
params,
|
|
71
71
|
popupDataState,
|
|
72
|
+
popupProps,
|
|
72
73
|
...rest
|
|
73
74
|
}: TTableProps<Entity,
|
|
74
75
|
CreateDto,
|
|
@@ -254,6 +255,7 @@ const Table = <Entity extends Record<string | symbol, any>,
|
|
|
254
255
|
}
|
|
255
256
|
},
|
|
256
257
|
async onDelete(id, row) {
|
|
258
|
+
if (isRecordNew(row)) return;
|
|
257
259
|
await onDelete({ ...row, ...pathParams });
|
|
258
260
|
},
|
|
259
261
|
deletePopconfirmMessage: intl.formatMessage({ id: 'table.deletePopconfirmMessage' }),
|
|
@@ -392,6 +394,7 @@ const Table = <Entity extends Record<string | symbol, any>,
|
|
|
392
394
|
}}
|
|
393
395
|
idColumnName={idColumnName}
|
|
394
396
|
columns={columns ?? []}
|
|
397
|
+
{...popupProps}
|
|
395
398
|
/>
|
|
396
399
|
{contextHolder}
|
|
397
400
|
</>);
|
|
@@ -5,6 +5,7 @@ import { Operators } from "./tableTools";
|
|
|
5
5
|
import { TColumnsSet } from "./useColumnsSets";
|
|
6
6
|
import { ColumnStateType } from "@ant-design/pro-table/es/typing";
|
|
7
7
|
import { RowEditableConfig } from "@ant-design/pro-utils";
|
|
8
|
+
import { TDescriptionsCreateModalProps } from "../Descriptions";
|
|
8
9
|
|
|
9
10
|
export type IWithId = {
|
|
10
11
|
id: string | number,
|
|
@@ -99,6 +100,7 @@ interface BaseProps<Entity,
|
|
|
99
100
|
columnsState?: ColumnStateType;
|
|
100
101
|
columnsSetSelect?: () => React.ReactNode;
|
|
101
102
|
popupDataState?: [Partial<Entity>, React.Dispatch<React.SetStateAction<Partial<Entity>>>]
|
|
103
|
+
popupProps?: TDescriptionsCreateModalProps<Entity>;
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
interface EditableProps<Entity, CreateDto, UpdateDto, TPathParams = {}> {
|