@magicbe/antd-crud 0.0.33 → 0.0.36

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.
@@ -134,7 +134,7 @@ export var CustormRender = function (_a) {
134
134
  var getSelectedRows = function () { var _a; return (_a = table_ref === null || table_ref === void 0 ? void 0 : table_ref.current) === null || _a === void 0 ? void 0 : _a.selected_rows; };
135
135
  return React.cloneElement(children, { add: add, edit: edit, del: del, getSelectedKeys: getSelectedKeys, getSelectedRows: getSelectedRows });
136
136
  };
137
- var append_action_default_children = (_jsxs(Space, { children: [_jsx(PlusOutlined, {}), "\u65B0\u589E"] }));
137
+ var append_action_default_children = (_jsxs(Button, { type: "primary", children: [_jsx(PlusOutlined, {}), "\u65B0\u589E"] }));
138
138
  /**新增方法 */
139
139
  export var AppendAction = function (_a) {
140
140
  var _b = _a.children, children = _b === void 0 ? append_action_default_children : _b;
@@ -237,9 +237,9 @@ export var AppendAction = function (_a) {
237
237
  return drawer.add;
238
238
  return 600;
239
239
  }, [drawer]);
240
- return (_jsxs(Fragment, { children: [_jsx(Button, { type: "primary", onClick: switchAddDrawer, children: children }), _jsx(Drawer, { title: "\u65B0\u589E", width: drawer_width, onClose: switchAddDrawer, open: add_drawer_open, closable: false, extra: add_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, children: _jsx(AddForm, { ref: form_ref, default_data: init_data }) }), modalContextHolder] }));
240
+ return (_jsxs(Fragment, { children: [React.cloneElement(children, { onClick: switchAddDrawer }), _jsx(Drawer, { title: "\u65B0\u589E", width: drawer_width, onClose: switchAddDrawer, open: add_drawer_open, closable: false, extra: add_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, keyboard: false, children: _jsx(AddForm, { ref: form_ref, default_data: init_data }) }), modalContextHolder] }));
241
241
  };
242
- var delete_action_default_children = (_jsxs(Space, { children: [_jsx(DeleteOutlined, {}), "\u5220\u9664"] }));
242
+ var delete_action_default_children = (_jsxs(Button, { type: "primary", danger: true, children: [_jsx(DeleteOutlined, {}), "\u5220\u9664"] }));
243
243
  /**删除方法 */
244
244
  export var DeleteAction = function (_a) {
245
245
  var _b = _a.children, children = _b === void 0 ? delete_action_default_children : _b;
@@ -344,9 +344,9 @@ export var DeleteAction = function (_a) {
344
344
  });
345
345
  });
346
346
  };
347
- return (_jsxs(Fragment, { children: [_jsx(Button, { type: "primary", danger: true, onClick: onClick, loading: loading, children: children }), modalContextHolder] }));
347
+ return (_jsxs(Fragment, { children: [React.cloneElement(children, { onClick: onClick, loading: loading }), modalContextHolder] }));
348
348
  };
349
- var edit_action_default_children = (_jsxs(Space, { children: [_jsx(EditFilled, {}), "\u7F16\u8F91"] }));
349
+ var edit_action_default_children = (_jsxs(Button, { children: [_jsx(EditFilled, {}), "\u7F16\u8F91"] }));
350
350
  /**编辑方法 */
351
351
  export var EditAction = function (_a) {
352
352
  var _b = _a.children, children = _b === void 0 ? edit_action_default_children : _b;
@@ -451,6 +451,6 @@ export var EditAction = function (_a) {
451
451
  return drawer.add;
452
452
  return 600;
453
453
  }, [drawer]);
454
- return (_jsxs(Fragment, { children: [_jsx(Button, { onClick: onClick, children: children }), _jsx(Drawer, { title: "\u7F16\u8F91", width: drawer_width, onClose: switchEditDrawer, open: edit_drawer_open, closable: false, extra: edit_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, children: _jsx(EditForm, { ref: form_ref, default_data: init_data }) }), modalContextHolder] }));
454
+ return (_jsxs(Fragment, { children: [React.cloneElement(children, { onClick: onClick }), _jsx(Drawer, { title: "\u7F16\u8F91", width: drawer_width, onClose: switchEditDrawer, open: edit_drawer_open, closable: false, extra: edit_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, keyboard: false, children: _jsx(EditForm, { ref: form_ref, default_data: init_data }) }), modalContextHolder] }));
455
455
  };
456
456
  var templateObject_1;
@@ -200,7 +200,7 @@ var Table = function (_a, ref) {
200
200
  return (_jsx(AntdTable, __assign({}, props, { rowSelection: rowSelection, columns: columns, loading: loading, onChange: loadRecords, dataSource: sources, pagination: pagination })));
201
201
  };
202
202
  export default React.forwardRef(Table);
203
- var append_action_default_children = (_jsxs(Space, { children: [_jsx(PlusOutlined, {}), "\u65B0\u589E"] }));
203
+ var append_action_default_children = (_jsxs(Button, { type: "link", size: "small", children: [_jsx(PlusOutlined, {}), "\u65B0\u589E"] }));
204
204
  export var AppendAction = function (_a) {
205
205
  var _b = _a.children, children = _b === void 0 ? append_action_default_children : _b, row = _a.row;
206
206
  var _c = useTableContext(), rowKey = _c.rowKey, content_ref = _c.content_ref, table_ref = _c.table_ref, filter_ref = _c.filter_ref, form_ref = _c.form_ref, add = _c.add, drawer = _c.drawer;
@@ -321,9 +321,9 @@ export var AppendAction = function (_a) {
321
321
  return drawer.add;
322
322
  return 600;
323
323
  }, [drawer]);
324
- return (_jsxs(Fragment, { children: [_jsx(Button, { type: "link", size: "small", onClick: onClick, children: children }), _jsx(Drawer, { title: "\u65B0\u589E", width: drawer_width, onClose: switchAddDrawer, open: add_drawer_open, closable: false, extra: add_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, children: _jsx(AddForm, { default_data: init_data, ref: form_ref }) }), modalContextHolder] }));
324
+ return (_jsxs(Fragment, { children: [React.cloneElement(children, { onClick: onClick }), _jsx(Drawer, { title: "\u65B0\u589E", width: drawer_width, onClose: switchAddDrawer, open: add_drawer_open, closable: false, extra: add_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, keyboard: false, children: _jsx(AddForm, { default_data: init_data, ref: form_ref }) }), modalContextHolder] }));
325
325
  };
326
- var edit_action_default_children = (_jsxs(Space, { children: [_jsx(EditFilled, {}), "\u7F16\u8F91"] }));
326
+ var edit_action_default_children = (_jsxs(Button, { type: "link", size: "small", children: [_jsx(EditFilled, {}), "\u7F16\u8F91"] }));
327
327
  export var EditAction = function (_a) {
328
328
  var _b = _a.children, children = _b === void 0 ? edit_action_default_children : _b, row = _a.row;
329
329
  var _c = useTableContext(), edit = _c.edit, rowKey = _c.rowKey, content_ref = _c.content_ref, table_ref = _c.table_ref, filter_ref = _c.filter_ref, form_ref = _c.form_ref, drawer = _c.drawer;
@@ -437,9 +437,9 @@ export var EditAction = function (_a) {
437
437
  return drawer.add;
438
438
  return 600;
439
439
  }, [drawer]);
440
- return (_jsxs(Fragment, { children: [_jsx(Button, { type: "link", size: "small", onClick: onClick, loading: clickLoading, children: children }), _jsx(Drawer, { title: "\u7F16\u8F91", width: drawer_width, onClose: switchEditDrawer, open: edit_drawer_open, closable: false, extra: edit_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, children: _jsx(EditForm, { ref: form_ref, default_data: init_data }) }), modalContextHolder] }));
440
+ return (_jsxs(Fragment, { children: [React.cloneElement(children, { onClick: onClick, loading: clickLoading }), _jsx(Drawer, { title: "\u7F16\u8F91", width: drawer_width, onClose: switchEditDrawer, open: edit_drawer_open, closable: false, extra: edit_extra, getContainer: function () { return content_ref.current; }, destroyOnClose: true, keyboard: false, children: _jsx(EditForm, { ref: form_ref, default_data: init_data }) }), modalContextHolder] }));
441
441
  };
442
- var delete_action_default_children = (_jsxs(Space, { children: [_jsx(DeleteOutlined, {}), "\u5220\u9664"] }));
442
+ var delete_action_default_children = (_jsxs(Button, { size: "small", type: "link", danger: true, children: [_jsx(DeleteOutlined, {}), "\u5220\u9664"] }));
443
443
  export var DeleteAction = function (_a) {
444
444
  var _b = _a.children, children = _b === void 0 ? delete_action_default_children : _b, row = _a.row;
445
445
  var _c = useTableContext(), table_ref = _c.table_ref, filter_ref = _c.filter_ref, del = _c.del, rowKey = _c.rowKey;
@@ -540,5 +540,5 @@ export var DeleteAction = function (_a) {
540
540
  });
541
541
  });
542
542
  };
543
- return (_jsxs(Fragment, { children: [_jsx(Button, { type: "link", danger: true, size: "small", onClick: onClick, loading: loading, children: children }), modalContextHolder] }));
543
+ return (_jsxs(Fragment, { children: [React.cloneElement(children, { onClick: onClick, loading: loading }), modalContextHolder] }));
544
544
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicbe/antd-crud",
3
- "version": "0.0.33",
3
+ "version": "0.0.36",
4
4
  "description": "antd crud table",
5
5
  "author": "wang quan",
6
6
  "private": false,