@magicbe/antd-crud 0.0.62 → 0.0.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/components/Add.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { FormProps } from "antd";
|
|
2
3
|
import { FormRef } from "../interface";
|
|
3
|
-
export interface AddFormProps {
|
|
4
|
+
export interface AddFormProps extends Omit<FormProps, "initialValues"> {
|
|
4
5
|
default_data?: Record<string, any>;
|
|
5
6
|
}
|
|
6
7
|
declare const AddForm: React.ForwardRefExoticComponent<AddFormProps & React.RefAttributes<FormRef>>;
|
package/dist/components/Add.js
CHANGED
|
@@ -28,7 +28,7 @@ import Field from "./Field";
|
|
|
28
28
|
import { get, isFunction, isObject, isString } from "lodash";
|
|
29
29
|
import { useTableContext } from "./Context";
|
|
30
30
|
var AddForm = React.forwardRef(function (_a, ref) {
|
|
31
|
-
var
|
|
31
|
+
var _b = _a.default_data, default_data = _b === void 0 ? {} : _b, props = __rest(_a, ["default_data"]);
|
|
32
32
|
var form = AntdForm.useForm()[0];
|
|
33
33
|
var columns = useTableContext().columns;
|
|
34
34
|
var fields = columns === null || columns === void 0 ? void 0 : columns.filter(function (_a) {
|
|
@@ -60,6 +60,6 @@ var AddForm = React.forwardRef(function (_a, ref) {
|
|
|
60
60
|
useImperativeHandle(ref, function () { return ({
|
|
61
61
|
form: form,
|
|
62
62
|
}); });
|
|
63
|
-
return (_jsx(AntdForm, { form: form, layout: "vertical", initialValues: default_data, children: fields.map(function (field) { return _createElement(Field, __assign({}, field, { key: String(field.dataIndex) })); }) }));
|
|
63
|
+
return (_jsx(AntdForm, __assign({ form: form, layout: "vertical", initialValues: default_data }, props, { children: fields.map(function (field) { return _createElement(Field, __assign({}, field, { key: String(field.dataIndex) })); }) })));
|
|
64
64
|
});
|
|
65
65
|
export default AddForm;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { FormProps } from "antd";
|
|
2
3
|
import { FormRef } from "../interface";
|
|
3
|
-
export interface EditFormProps {
|
|
4
|
+
export interface EditFormProps extends Omit<FormProps, "initialValues"> {
|
|
4
5
|
default_data?: Record<string, any>;
|
|
5
6
|
}
|
|
6
7
|
declare const EditForm: React.ForwardRefExoticComponent<EditFormProps & React.RefAttributes<FormRef>>;
|
package/dist/components/Edit.js
CHANGED
|
@@ -28,7 +28,7 @@ import { useTableContext } from "./Context";
|
|
|
28
28
|
import { get, isFunction, isObject, isString } from "lodash";
|
|
29
29
|
import Field from "./Field";
|
|
30
30
|
var EditForm = React.forwardRef(function (_a, ref) {
|
|
31
|
-
var _b = _a.default_data, default_data = _b === void 0 ? {} : _b;
|
|
31
|
+
var _b = _a.default_data, default_data = _b === void 0 ? {} : _b, props = __rest(_a, ["default_data"]);
|
|
32
32
|
var form = AntdForm.useForm()[0];
|
|
33
33
|
var columns = useTableContext().columns;
|
|
34
34
|
var fields = columns === null || columns === void 0 ? void 0 : columns.filter(function (_a) {
|
|
@@ -60,6 +60,6 @@ var EditForm = React.forwardRef(function (_a, ref) {
|
|
|
60
60
|
useImperativeHandle(ref, function () { return ({
|
|
61
61
|
form: form,
|
|
62
62
|
}); });
|
|
63
|
-
return (_jsx(AntdForm, { form: form, layout: "vertical", initialValues: default_data, children: fields.map(function (field) { return _createElement(Field, __assign({}, field, { key: String(field.dataIndex) })); }) }));
|
|
63
|
+
return (_jsx(AntdForm, __assign({ form: form, layout: "vertical", initialValues: default_data }, props, { children: fields.map(function (field) { return _createElement(Field, __assign({}, field, { key: String(field.dataIndex) })); }) })));
|
|
64
64
|
});
|
|
65
65
|
export default EditForm;
|
package/dist/interface.d.ts
CHANGED
|
@@ -146,20 +146,20 @@ export interface CustomFilterProps {
|
|
|
146
146
|
initialValues?: Record<string, any>;
|
|
147
147
|
}
|
|
148
148
|
export interface CustomActionGroup {
|
|
149
|
-
add?: boolean | React.FC
|
|
150
|
-
del?: boolean | React.FC
|
|
151
|
-
edit?: boolean | React.FC
|
|
149
|
+
add?: boolean | React.FC<any>;
|
|
150
|
+
del?: boolean | React.FC<any>;
|
|
151
|
+
edit?: boolean | React.FC<any>;
|
|
152
152
|
}
|
|
153
153
|
export interface RecordCustomActionGroup extends CustomActionGroup {
|
|
154
154
|
}
|
|
155
155
|
export interface MasterCustomActionGroup extends CustomActionGroup {
|
|
156
156
|
}
|
|
157
157
|
export interface CustomAction {
|
|
158
|
-
master?: boolean | React.FC | (React.FC)[] | MasterCustomActionGroup;
|
|
159
|
-
record?: boolean | React.FC | (React.FC)[] | RecordCustomActionGroup;
|
|
158
|
+
master?: boolean | React.FC<any> | (React.FC<any>)[] | MasterCustomActionGroup;
|
|
159
|
+
record?: boolean | React.FC<any> | (React.FC<any>)[] | RecordCustomActionGroup;
|
|
160
160
|
}
|
|
161
161
|
/**操作 */
|
|
162
|
-
export type Action = boolean | React.FC | React.FC[] | CustomAction;
|
|
162
|
+
export type Action = boolean | React.FC<any> | React.FC<any>[] | CustomAction;
|
|
163
163
|
export interface DrawerProps {
|
|
164
164
|
add?: number;
|
|
165
165
|
edit?: number;
|