@fle-ui/plus-table 1.2.28-beta.0 → 1.2.28

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.
@@ -168,14 +168,6 @@ var FormSearch = /*#__PURE__*/function (_React$Component) {
168
168
  search: search,
169
169
  form: _objectSpread(_objectSpread({
170
170
  onValuesChange: function onValuesChange(changeValue, allValue) {
171
- for (var key in changeValue) {
172
- if (Object.hasOwn(changeValue, key)) {
173
- if (!changeValue[key]) {
174
- changeValue[key] = undefined;
175
- allValue[key] = undefined;
176
- }
177
- }
178
- }
179
171
  _this.props.changeValue(changeValue, allValue);
180
172
  },
181
173
  autoFocusFirstInput: false
package/es/index.d.ts CHANGED
@@ -34,6 +34,7 @@ interface PlusTableProps<DataSource, U, ValueType> extends Omit<ProTableProps<Da
34
34
  };
35
35
  hasShowFull?: boolean;
36
36
  getContainer?: string | HTMLElement | (() => HTMLElement) | false;
37
+ defaultShowFull?: boolean;
37
38
  }
38
39
  interface PlusTableRef {
39
40
  getFieldsValue: () => Promise<any>;
package/es/index.js CHANGED
@@ -50,7 +50,7 @@ function PlusTable(props, ref) {
50
50
  _useState2 = _slicedToArray(_useState, 2),
51
51
  searchDrawer = _useState2[0],
52
52
  setSearchDrawer = _useState2[1];
53
- var _useState3 = useState(false),
53
+ var _useState3 = useState(props.defaultShowFull || false),
54
54
  _useState4 = _slicedToArray(_useState3, 2),
55
55
  showFull = _useState4[0],
56
56
  setShowFull = _useState4[1];
@@ -219,9 +219,8 @@ function PlusTable(props, ref) {
219
219
  };
220
220
  }();
221
221
  var onValuesChange = function onValuesChange(changeValue, allValue) {
222
- var _drawFormRef$current4, _searchRef$current4;
223
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.setFieldsValue(allValue);
224
- searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.setFieldsValue(allValue);
222
+ var _searchRef$current4;
223
+ searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.setFieldsValue(drawFormRef.current.getFieldsValue());
225
224
  };
226
225
  var handleSearchAll = /*#__PURE__*/function () {
227
226
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(searchConfig) {
@@ -263,7 +262,7 @@ function PlusTable(props, ref) {
263
262
  };
264
263
  var propsRequest = /*#__PURE__*/function () {
265
264
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params, sort, filter) {
266
- var _searchRef$current5, _drawFormRef$current5;
265
+ var _searchRef$current5, _drawFormRef$current4;
267
266
  var res1, res2, res;
268
267
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
269
268
  while (1) switch (_context8.prev = _context8.next) {
@@ -273,7 +272,7 @@ function PlusTable(props, ref) {
273
272
  case 2:
274
273
  res1 = _context8.sent;
275
274
  _context8.next = 5;
276
- return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.getFieldsValue();
275
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.getFieldsValue();
277
276
  case 5:
278
277
  res2 = _context8.sent;
279
278
  if (!request) {
@@ -365,8 +364,8 @@ function PlusTable(props, ref) {
365
364
  key: "2",
366
365
  type: "default",
367
366
  onClick: function onClick() {
368
- var _drawFormRef$current6, _actionRef$current, _actionRef$current$re, _actionRef$current2, _actionRef$current2$r;
369
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current6 = drawFormRef.current) === null || _drawFormRef$current6 === void 0 ? void 0 : _drawFormRef$current6.resetFields();
367
+ var _drawFormRef$current5, _actionRef$current, _actionRef$current$re, _actionRef$current2, _actionRef$current2$r;
368
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.resetFields();
370
369
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.reset) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current);
371
370
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.reload) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
372
371
  },
@@ -378,7 +377,7 @@ function PlusTable(props, ref) {
378
377
  whiteSpace: 'nowrap'
379
378
  },
380
379
  onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
381
- var _drawFormRef$current7, _searchRef$current6;
380
+ var _drawFormRef$current6, _searchRef$current6;
382
381
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
383
382
  while (1) switch (_context9.prev = _context9.next) {
384
383
  case 0:
@@ -386,7 +385,7 @@ function PlusTable(props, ref) {
386
385
  return setSearchDrawer(!searchDrawer);
387
386
  case 2:
388
387
  // 没法实时监听数据所以这里要带过来
389
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current6 = searchRef.current) === null || _searchRef$current6 === void 0 ? void 0 : _searchRef$current6.getFieldsValue());
388
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current6 = drawFormRef.current) === null || _drawFormRef$current6 === void 0 ? void 0 : _drawFormRef$current6.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current6 = searchRef.current) === null || _searchRef$current6 === void 0 ? void 0 : _searchRef$current6.getFieldsValue());
390
389
  case 3:
391
390
  case "end":
392
391
  return _context9.stop();
@@ -410,11 +409,11 @@ function PlusTable(props, ref) {
410
409
  fieldProps: _objectSpread({
411
410
  onChange: function onChange(e) {
412
411
  if (e) {
413
- var _drawFormRef$current8;
414
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current8 = drawFormRef.current) === null || _drawFormRef$current8 === void 0 ? void 0 : _drawFormRef$current8.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
412
+ var _drawFormRef$current7;
413
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
415
414
  } else {
416
- var _drawFormRef$current10;
417
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields([item.dataIndex]);
415
+ var _drawFormRef$current9;
416
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current9 = drawFormRef.current) === null || _drawFormRef$current9 === void 0 ? void 0 : _drawFormRef$current9.resetFields([item.dataIndex]);
418
417
  }
419
418
  }
420
419
  }, item.fieldProps)
@@ -426,6 +425,7 @@ function PlusTable(props, ref) {
426
425
  }) : columns,
427
426
  toolBarRender: function toolBarRender(searchConfig, rows) {
428
427
  return [(action === null || action === void 0 ? void 0 : action.includes('viewInvisibleData')) ? /*#__PURE__*/React.createElement(_Checkbox, {
428
+ defaultChecked: showFull,
429
429
  onChange: function onChange(e) {
430
430
  setShowFull(e.target.checked);
431
431
  setTimeout(function () {
@@ -491,8 +491,8 @@ function PlusTable(props, ref) {
491
491
  }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(_Button, {
492
492
  type: "default",
493
493
  onClick: function onClick() {
494
- var _drawFormRef$current11, _actionRef$current3, _actionRef$current3$r, _actionRef$current4, _actionRef$current4$r;
495
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current11 = drawFormRef.current) === null || _drawFormRef$current11 === void 0 ? void 0 : _drawFormRef$current11.resetFields();
494
+ var _drawFormRef$current10, _actionRef$current3, _actionRef$current3$r, _actionRef$current4, _actionRef$current4$r;
495
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields();
496
496
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$r = _actionRef$current3.reset) === null || _actionRef$current3$r === void 0 ? void 0 : _actionRef$current3$r.call(_actionRef$current3);
497
497
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.reload) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4);
498
498
  },
@@ -175,14 +175,6 @@ var FormSearch = /*#__PURE__*/function (_React$Component) {
175
175
  search: search,
176
176
  form: _objectSpread(_objectSpread({
177
177
  onValuesChange: function onValuesChange(changeValue, allValue) {
178
- for (var key in changeValue) {
179
- if (Object.hasOwn(changeValue, key)) {
180
- if (!changeValue[key]) {
181
- changeValue[key] = undefined;
182
- allValue[key] = undefined;
183
- }
184
- }
185
- }
186
178
  _this.props.changeValue(changeValue, allValue);
187
179
  },
188
180
  autoFocusFirstInput: false
package/lib/index.d.ts CHANGED
@@ -34,6 +34,7 @@ interface PlusTableProps<DataSource, U, ValueType> extends Omit<ProTableProps<Da
34
34
  };
35
35
  hasShowFull?: boolean;
36
36
  getContainer?: string | HTMLElement | (() => HTMLElement) | false;
37
+ defaultShowFull?: boolean;
37
38
  }
38
39
  interface PlusTableRef {
39
40
  getFieldsValue: () => Promise<any>;
package/lib/index.js CHANGED
@@ -54,7 +54,7 @@ function PlusTable(props, ref) {
54
54
  _useState2 = _slicedToArray(_useState, 2),
55
55
  searchDrawer = _useState2[0],
56
56
  setSearchDrawer = _useState2[1];
57
- var _useState3 = (0, _react.useState)(false),
57
+ var _useState3 = (0, _react.useState)(props.defaultShowFull || false),
58
58
  _useState4 = _slicedToArray(_useState3, 2),
59
59
  showFull = _useState4[0],
60
60
  setShowFull = _useState4[1];
@@ -223,9 +223,8 @@ function PlusTable(props, ref) {
223
223
  };
224
224
  }();
225
225
  var onValuesChange = function onValuesChange(changeValue, allValue) {
226
- var _drawFormRef$current4, _searchRef$current4;
227
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.setFieldsValue(allValue);
228
- searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.setFieldsValue(allValue);
226
+ var _searchRef$current4;
227
+ searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current4 = searchRef.current) === null || _searchRef$current4 === void 0 ? void 0 : _searchRef$current4.setFieldsValue(drawFormRef.current.getFieldsValue());
229
228
  };
230
229
  var handleSearchAll = /*#__PURE__*/function () {
231
230
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(searchConfig) {
@@ -267,7 +266,7 @@ function PlusTable(props, ref) {
267
266
  };
268
267
  var propsRequest = /*#__PURE__*/function () {
269
268
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params, sort, filter) {
270
- var _searchRef$current5, _drawFormRef$current5;
269
+ var _searchRef$current5, _drawFormRef$current4;
271
270
  var res1, res2, res;
272
271
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
273
272
  while (1) switch (_context8.prev = _context8.next) {
@@ -277,7 +276,7 @@ function PlusTable(props, ref) {
277
276
  case 2:
278
277
  res1 = _context8.sent;
279
278
  _context8.next = 5;
280
- return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.getFieldsValue();
279
+ return drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current4 = drawFormRef.current) === null || _drawFormRef$current4 === void 0 ? void 0 : _drawFormRef$current4.getFieldsValue();
281
280
  case 5:
282
281
  res2 = _context8.sent;
283
282
  if (!request) {
@@ -369,8 +368,8 @@ function PlusTable(props, ref) {
369
368
  key: "2",
370
369
  type: "default",
371
370
  onClick: function onClick() {
372
- var _drawFormRef$current6, _actionRef$current, _actionRef$current$re, _actionRef$current2, _actionRef$current2$r;
373
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current6 = drawFormRef.current) === null || _drawFormRef$current6 === void 0 ? void 0 : _drawFormRef$current6.resetFields();
371
+ var _drawFormRef$current5, _actionRef$current, _actionRef$current$re, _actionRef$current2, _actionRef$current2$r;
372
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current5 = drawFormRef.current) === null || _drawFormRef$current5 === void 0 ? void 0 : _drawFormRef$current5.resetFields();
374
373
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.reset) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current);
375
374
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.reload) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
376
375
  },
@@ -382,7 +381,7 @@ function PlusTable(props, ref) {
382
381
  whiteSpace: 'nowrap'
383
382
  },
384
383
  onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
385
- var _drawFormRef$current7, _searchRef$current6;
384
+ var _drawFormRef$current6, _searchRef$current6;
386
385
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
387
386
  while (1) switch (_context9.prev = _context9.next) {
388
387
  case 0:
@@ -390,7 +389,7 @@ function PlusTable(props, ref) {
390
389
  return setSearchDrawer(!searchDrawer);
391
390
  case 2:
392
391
  // 没法实时监听数据所以这里要带过来
393
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current6 = searchRef.current) === null || _searchRef$current6 === void 0 ? void 0 : _searchRef$current6.getFieldsValue());
392
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current6 = drawFormRef.current) === null || _drawFormRef$current6 === void 0 ? void 0 : _drawFormRef$current6.setFieldsValue(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current6 = searchRef.current) === null || _searchRef$current6 === void 0 ? void 0 : _searchRef$current6.getFieldsValue());
394
393
  case 3:
395
394
  case "end":
396
395
  return _context9.stop();
@@ -414,11 +413,11 @@ function PlusTable(props, ref) {
414
413
  fieldProps: _objectSpread({
415
414
  onChange: function onChange(e) {
416
415
  if (e) {
417
- var _drawFormRef$current8;
418
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current8 = drawFormRef.current) === null || _drawFormRef$current8 === void 0 ? void 0 : _drawFormRef$current8.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
416
+ var _drawFormRef$current7;
417
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current7 = drawFormRef.current) === null || _drawFormRef$current7 === void 0 ? void 0 : _drawFormRef$current7.setFieldsValue(_defineProperty({}, item.dataIndex, e.target ? e.target.value : e));
419
418
  } else {
420
- var _drawFormRef$current10;
421
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields([item.dataIndex]);
419
+ var _drawFormRef$current9;
420
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current9 = drawFormRef.current) === null || _drawFormRef$current9 === void 0 ? void 0 : _drawFormRef$current9.resetFields([item.dataIndex]);
422
421
  }
423
422
  }
424
423
  }, item.fieldProps)
@@ -430,6 +429,7 @@ function PlusTable(props, ref) {
430
429
  }) : columns,
431
430
  toolBarRender: function toolBarRender(searchConfig, rows) {
432
431
  return [(action === null || action === void 0 ? void 0 : action.includes('viewInvisibleData')) ? /*#__PURE__*/_react.default.createElement(_antd.Checkbox, {
432
+ defaultChecked: showFull,
433
433
  onChange: function onChange(e) {
434
434
  setShowFull(e.target.checked);
435
435
  setTimeout(function () {
@@ -495,8 +495,8 @@ function PlusTable(props, ref) {
495
495
  }, "\u67E5\u8BE2"), /*#__PURE__*/_react.default.createElement(_antd.Button, {
496
496
  type: "default",
497
497
  onClick: function onClick() {
498
- var _drawFormRef$current11, _actionRef$current3, _actionRef$current3$r, _actionRef$current4, _actionRef$current4$r;
499
- drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current11 = drawFormRef.current) === null || _drawFormRef$current11 === void 0 ? void 0 : _drawFormRef$current11.resetFields();
498
+ var _drawFormRef$current10, _actionRef$current3, _actionRef$current3$r, _actionRef$current4, _actionRef$current4$r;
499
+ drawFormRef === null || drawFormRef === void 0 ? void 0 : (_drawFormRef$current10 = drawFormRef.current) === null || _drawFormRef$current10 === void 0 ? void 0 : _drawFormRef$current10.resetFields();
500
500
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$r = _actionRef$current3.reset) === null || _actionRef$current3$r === void 0 ? void 0 : _actionRef$current3$r.call(_actionRef$current3);
501
501
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.reload) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4);
502
502
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fle-ui/plus-table",
3
- "version": "1.2.28-beta.0",
3
+ "version": "1.2.28",
4
4
  "description": "@fle-ui/plus-table",
5
5
  "keywords": [
6
6
  "fle-ui",
@@ -46,5 +46,5 @@
46
46
  "@ant-design/pro-components": "^2.7.0",
47
47
  "dayjs": "^1.11.10"
48
48
  },
49
- "gitHead": "902b47509c9d8063678bfbdf0942163d569cee75"
49
+ "gitHead": "009fe2c46a634dc85deb25d46b39b611b09bafab"
50
50
  }