@magicbe/antd-crud 0.0.61 → 0.0.63
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
|
@@ -208,7 +208,7 @@ export type getPageData = () => ({
|
|
|
208
208
|
current?: number;
|
|
209
209
|
pageSize?: number;
|
|
210
210
|
});
|
|
211
|
-
export type loadRecords = (params
|
|
211
|
+
export type loadRecords = (params?: TablePaginationConfig, filter?: Record<string, any>, sorter?: SorterResult | SorterResult[], extra?: TableCurrentDataSource) => void;
|
|
212
212
|
export type getRecords<T = AnyObject> = () => T[];
|
|
213
213
|
export interface TableRef<RecordType = AnyObject> {
|
|
214
214
|
getPageData: getPageData;
|