@magicbe/antd-crud 0.0.48 → 0.0.49

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.
@@ -65,13 +65,20 @@ var Filter = React.forwardRef(function (_a, ref) {
65
65
  var _c = params || {}, current = _c.current, pageSize = _c.pageSize;
66
66
  (_b = table_ref === null || table_ref === void 0 ? void 0 : table_ref.current) === null || _b === void 0 ? void 0 : _b.loadRecords(Object.assign({ current: current, pageSize: pageSize }, value));
67
67
  };
68
+ var onReset = function () {
69
+ var _a, _b;
70
+ form.resetFields();
71
+ var params = (_a = table_ref === null || table_ref === void 0 ? void 0 : table_ref.current) === null || _a === void 0 ? void 0 : _a.getPageData();
72
+ var _c = params !== null && params !== void 0 ? params : {}, current = _c.current, pageSize = _c.pageSize;
73
+ (_b = table_ref === null || table_ref === void 0 ? void 0 : table_ref.current) === null || _b === void 0 ? void 0 : _b.loadRecords(Object.assign({ current: current, pageSize: pageSize }));
74
+ };
68
75
  useImperativeHandle(ref, function () { return ({
69
76
  form: form,
70
77
  }); });
71
78
  var initialValues;
72
79
  if (!(filters === null || filters === void 0 ? void 0 : filters.length))
73
80
  return _jsx(Fragment, {});
74
- return (_jsxs(Form, { layout: "inline", onFinish: onFinish, className: wrapper_css, form: form, initialValues: initialValues, children: [filters === null || filters === void 0 ? void 0 : filters.map(function (filter) { return _createElement(Field, __assign({}, filter, { key: String(filter.dataIndex) })); }), _jsxs(Space, { size: 14, children: [_jsxs(Button, { htmlType: "submit", type: "primary", children: [_jsx(SearchOutlined, {}), "\u67E5\u8BE2"] }), _jsxs(Button, { htmlType: "reset", children: [_jsx(UndoOutlined, {}), "\u91CD\u7F6E"] })] })] }));
81
+ return (_jsxs(Form, { layout: "inline", onFinish: onFinish, className: wrapper_css, form: form, initialValues: initialValues, children: [filters === null || filters === void 0 ? void 0 : filters.map(function (filter) { return _createElement(Field, __assign({}, filter, { key: String(filter.dataIndex) })); }), _jsxs(Space, { size: 14, children: [_jsxs(Button, { htmlType: "submit", type: "primary", children: [_jsx(SearchOutlined, {}), "\u67E5\u8BE2"] }), _jsxs(Button, { onClick: onReset, children: [_jsx(UndoOutlined, {}), "\u91CD\u7F6E"] })] })] }));
75
82
  });
76
83
  export default (function () {
77
84
  var filter_ref = useTableContext().filter_ref;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicbe/antd-crud",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "antd crud table",
5
5
  "author": "wang quan",
6
6
  "private": false,