wargerm 0.7.92 → 0.7.94
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.
@@ -1,9 +1,23 @@
|
|
1
1
|
import React, { MutableRefObject } from 'react';
|
2
2
|
import { FormInstance } from 'antd';
|
3
|
+
import { WFormProps } from '../WForm';
|
3
4
|
export interface IFormInstance extends MutableRefObject<FormInstance> {
|
4
5
|
handleSubmit?: () => void;
|
5
6
|
resetFields?: () => void;
|
6
|
-
setFieldsValue?: (record
|
7
|
+
setFieldsValue?: (record?: Record<string, any>) => void;
|
7
8
|
}
|
8
|
-
|
9
|
+
interface IProps extends WFormProps {
|
10
|
+
open: boolean;
|
11
|
+
setOpen: (value: any) => void;
|
12
|
+
modalFormOpend?: (value: any) => void;
|
13
|
+
submitMethod?: (value: any, done: () => void) => Promise<void>;
|
14
|
+
onSubmitSuccess?: () => Promise<void>;
|
15
|
+
record?: Record<string, any>;
|
16
|
+
formItemChild?: () => React.ReactNode;
|
17
|
+
onCancel?: () => void;
|
18
|
+
modalHeaderSlot?: React.ReactNode;
|
19
|
+
modalFooterSlot?: React.ReactNode;
|
20
|
+
formProps?: Omit<WFormProps, 'columns'>;
|
21
|
+
}
|
22
|
+
declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
|
9
23
|
export default _default;
|
@@ -1,3 +1,55 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
1
|
+
import React, { MutableRefObject } from 'react';
|
2
|
+
import { ReactNode } from 'react';
|
3
|
+
import { ProTableProps } from '@ant-design/pro-table';
|
4
|
+
import { ColumnProps, Isearch } from '../WForm';
|
5
|
+
type CustomType = {
|
6
|
+
type: 'custom';
|
7
|
+
title: ReactNode;
|
8
|
+
icon: ReactNode;
|
9
|
+
key: string;
|
10
|
+
fetchInfo?: (record?: Record<string, any>) => Promise<any>;
|
11
|
+
actionMethod?: (values: Record<string, any>, done: () => void, record?: Record<string, any>) => Promise<any>;
|
12
|
+
};
|
13
|
+
type ItableAction = {
|
14
|
+
type: 'edit' | 'view' | 'delete' | 'extraAction';
|
15
|
+
formItemChild?: (record: Record<string, any>, actionRef: MutableRefObject<any>, index: number) => ReactNode;
|
16
|
+
actionMethod?: (values: Record<string, any>, done: () => void, record?: Record<string, any>) => Promise<any>;
|
17
|
+
fetchInfo?: (record?: Record<string, any>) => Promise<any>;
|
18
|
+
actionRender?: (record: Record<string, any>, actionRef: MutableRefObject<any>, onOk: () => void, index: number) => ReactNode;
|
19
|
+
};
|
20
|
+
interface ItableBar {
|
21
|
+
type: 'add' | 'extraAction';
|
22
|
+
actionMethod?: (values: Record<string, any>, done: () => void) => Promise<any>;
|
23
|
+
render?: (record: Record<string, any>) => ReactNode;
|
24
|
+
actionRender?: (record: Record<string, any>, onOk?: () => void) => ReactNode;
|
25
|
+
}
|
26
|
+
interface ItableBarCustom {
|
27
|
+
type: 'custom';
|
28
|
+
title: ReactNode;
|
29
|
+
icon: ReactNode;
|
30
|
+
key: string;
|
31
|
+
actionMethod?: (values: Record<string, any>, done: () => void) => Promise<any>;
|
32
|
+
}
|
33
|
+
interface IoptionColumnConfig extends ColumnProps {
|
34
|
+
showMoreNum?: number;
|
35
|
+
}
|
36
|
+
interface ITableCard extends Omit<ProTableProps<Record<string, any>[], Record<string, any>>, 'columns'> {
|
37
|
+
columns: ColumnProps[];
|
38
|
+
modalFormSearch?: Isearch;
|
39
|
+
search?: Isearch;
|
40
|
+
modalConfig?: Record<string, any>;
|
41
|
+
searchFormConfig?: Record<string, any>;
|
42
|
+
optionColumnConfig?: IoptionColumnConfig;
|
43
|
+
request?: (params: Record<string, any>) => Promise<any>;
|
44
|
+
tableAction?: Array<ItableAction | CustomType>;
|
45
|
+
filterAction?: (record: Record<string, any>, item: Record<string, any>) => boolean;
|
46
|
+
renderTableBar?: Array<ItableBar | ItableBarCustom>;
|
47
|
+
renderTableBarDeps?: any;
|
48
|
+
extraColumns?: Array<any>;
|
49
|
+
onFormChange?: (changedValues: Record<string, any>, allValues: Record<string, any>, form: any) => void;
|
50
|
+
noBordered?: boolean;
|
51
|
+
searchTableSlot?: ReactNode;
|
52
|
+
showIndex?: boolean;
|
53
|
+
}
|
54
|
+
declare const _default: React.ForwardRefExoticComponent<ITableCard & React.RefAttributes<any>>;
|
3
55
|
export default _default;
|
package/dist/index.esm.js
CHANGED
@@ -6944,7 +6944,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6944
6944
|
setFormIntance(form);
|
6945
6945
|
};
|
6946
6946
|
useEffect(function () {
|
6947
|
-
if (formIntance) {
|
6947
|
+
if (formIntance && record) {
|
6948
6948
|
setFieldsValue(record);
|
6949
6949
|
}
|
6950
6950
|
}, [open, record, formIntance]);
|
@@ -7589,7 +7589,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7589
7589
|
var _item$renderColumn3;
|
7590
7590
|
return (item === null || item === void 0 ? void 0 : (_item$renderColumn3 = item.renderColumn) === null || _item$renderColumn3 === void 0 ? void 0 : _item$renderColumn3.call(item, item, modalFormConfig)) || item;
|
7591
7591
|
})
|
7592
|
-
}, searchFormConfig || {}))), searchTableSlot && searchTableSlot, columns &&
|
7592
|
+
}, searchFormConfig || {}))), searchTableSlot && searchTableSlot, columns && ( /*#__PURE__*/React.createElement(ProTable, _objectSpread2(_objectSpread2({
|
7593
7593
|
actionRef: actionRef,
|
7594
7594
|
rowKey: "id",
|
7595
7595
|
bordered: !noBordered,
|
package/dist/index.js
CHANGED
@@ -6987,7 +6987,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6987
6987
|
setFormIntance(form);
|
6988
6988
|
};
|
6989
6989
|
React.useEffect(function () {
|
6990
|
-
if (formIntance) {
|
6990
|
+
if (formIntance && record) {
|
6991
6991
|
setFieldsValue(record);
|
6992
6992
|
}
|
6993
6993
|
}, [open, record, formIntance]);
|
@@ -7632,7 +7632,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7632
7632
|
var _item$renderColumn3;
|
7633
7633
|
return (item === null || item === void 0 ? void 0 : (_item$renderColumn3 = item.renderColumn) === null || _item$renderColumn3 === void 0 ? void 0 : _item$renderColumn3.call(item, item, modalFormConfig)) || item;
|
7634
7634
|
})
|
7635
|
-
}, searchFormConfig || {}))), searchTableSlot && searchTableSlot, columns &&
|
7635
|
+
}, searchFormConfig || {}))), searchTableSlot && searchTableSlot, columns && ( /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2(_objectSpread2({
|
7636
7636
|
actionRef: actionRef,
|
7637
7637
|
rowKey: "id",
|
7638
7638
|
bordered: !noBordered,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"private": false,
|
3
3
|
"name": "wargerm",
|
4
|
-
"version": "0.7.
|
4
|
+
"version": "0.7.94",
|
5
5
|
"scripts": {
|
6
6
|
"dev": "dumi dev",
|
7
7
|
"docs:build": "dumi build",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"dependencies": {
|
49
49
|
"@ant-design/pro-table": "^3.13.11",
|
50
50
|
"animate.css": "^4.1.1",
|
51
|
-
"antd": "5.12.
|
51
|
+
"antd": "5.12.8",
|
52
52
|
"echarts": "^5.2.2",
|
53
53
|
"echarts-for-react": "^3.0.2",
|
54
54
|
"hls.js": "^1.4.12",
|