@zat-design/sisyphus-react 3.8.3 → 3.9.0

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.
Files changed (68) hide show
  1. package/.vscode/extensions.json +5 -0
  2. package/dist/index.esm.css +38 -3
  3. package/dist/less.esm.css +37 -2
  4. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +83 -20
  5. package/es/ProEditTable/components/RenderField/index.js +6 -2
  6. package/es/ProEditTable/index.js +18 -9
  7. package/es/ProEditTable/propsType.d.ts +3 -6
  8. package/es/ProEditTable/style/index.less +0 -1
  9. package/es/ProEditTable/utils/index.js +10 -3
  10. package/es/ProForm/components/base/InputNumber/index.js +1 -1
  11. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
  12. package/es/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
  13. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
  14. package/es/ProForm/components/combination/FormList/components/LineFields.js +4 -2
  15. package/es/ProForm/components/combination/FormList/index.js +14 -3
  16. package/es/ProForm/components/combination/Group/index.js +3 -4
  17. package/es/ProForm/components/combination/ProCascader/index.js +21 -14
  18. package/es/ProForm/components/combination/ProModalSelect/index.js +17 -3
  19. package/es/ProForm/components/render/ChangedWrapper.js +29 -10
  20. package/es/ProForm/components/render/Render.js +3 -1
  21. package/es/ProForm/components/render/RenderFields.js +4 -2
  22. package/es/ProForm/propsType.d.ts +3 -0
  23. package/es/ProForm/style/index.less +35 -9
  24. package/es/ProForm/utils/diffOriginal.js +14 -2
  25. package/es/ProForm/utils/useShouldUpdate.js +1 -9
  26. package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
  27. package/es/ProTable/components/FormatColumn/index.js +107 -29
  28. package/es/ProTable/components/RenderColumn/index.d.ts +1 -0
  29. package/es/ProTable/components/RenderColumn/index.js +23 -6
  30. package/es/ProTable/index.js +8 -7
  31. package/es/ProTable/propsType.d.ts +4 -0
  32. package/es/ProTable/style/index.less +14 -0
  33. package/es/style/theme/antd.less +1 -1
  34. package/es/utils/index.d.ts +1 -0
  35. package/es/utils/index.js +26 -0
  36. package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +82 -21
  37. package/lib/ProEditTable/components/RenderField/index.js +6 -2
  38. package/lib/ProEditTable/index.js +18 -9
  39. package/lib/ProEditTable/propsType.d.ts +3 -6
  40. package/lib/ProEditTable/style/index.less +0 -1
  41. package/lib/ProEditTable/utils/index.js +10 -3
  42. package/lib/ProForm/components/base/InputNumber/index.js +1 -1
  43. package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
  44. package/lib/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
  45. package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
  46. package/lib/ProForm/components/combination/FormList/components/LineFields.js +4 -2
  47. package/lib/ProForm/components/combination/FormList/index.js +14 -3
  48. package/lib/ProForm/components/combination/Group/index.js +3 -4
  49. package/lib/ProForm/components/combination/ProCascader/index.js +21 -14
  50. package/lib/ProForm/components/combination/ProModalSelect/index.js +17 -3
  51. package/lib/ProForm/components/render/ChangedWrapper.js +29 -10
  52. package/lib/ProForm/components/render/Render.js +3 -1
  53. package/lib/ProForm/components/render/RenderFields.js +4 -2
  54. package/lib/ProForm/propsType.d.ts +3 -0
  55. package/lib/ProForm/style/index.less +35 -9
  56. package/lib/ProForm/utils/diffOriginal.js +13 -1
  57. package/lib/ProForm/utils/useShouldUpdate.js +1 -9
  58. package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
  59. package/lib/ProTable/components/FormatColumn/index.js +107 -29
  60. package/lib/ProTable/components/RenderColumn/index.d.ts +1 -0
  61. package/lib/ProTable/components/RenderColumn/index.js +20 -5
  62. package/lib/ProTable/index.js +8 -7
  63. package/lib/ProTable/propsType.d.ts +4 -0
  64. package/lib/ProTable/style/index.less +14 -0
  65. package/lib/style/theme/antd.less +1 -1
  66. package/lib/utils/index.d.ts +1 -0
  67. package/lib/utils/index.js +28 -1
  68. package/package.json +1 -1
@@ -190,6 +190,11 @@ function ProTable(props) {
190
190
  setCurColumns(nextColumns);
191
191
  };
192
192
  };
193
+ var _rowClassName = function _rowClassName(record, index) {
194
+ if (originalDataSource && !originalObj.hasOwnProperty((0, _lodash.get)(record, 'rowKey'))) {
195
+ return 'new-cell';
196
+ }
197
+ };
193
198
  var columns = (0, _react.useMemo)(function () {
194
199
  var newColumns = curColumns.map(function (item, index) {
195
200
  var _propsColumnObj$getCo2;
@@ -222,11 +227,12 @@ function ProTable(props) {
222
227
  scroll: _scroll,
223
228
  onUpdateMinWidth: function onUpdateMinWidth(w) {
224
229
  curColumns[index].minWidth = w;
225
- }
230
+ },
231
+ isInNewRow: _rowClassName
226
232
  });
227
233
  });
228
234
  return newColumns;
229
- }, [curColumns, handleResize, _scroll]);
235
+ }, [curColumns, handleResize, _scroll, originalDataSource, originalObj, _rowClassName]);
230
236
  var _columns = (0, _react.useMemo)(function () {
231
237
  return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
232
238
  var show = item.show;
@@ -375,11 +381,6 @@ function ProTable(props) {
375
381
  return _ref7.apply(this, arguments);
376
382
  };
377
383
  }();
378
- var _rowClassName = function _rowClassName(record, index) {
379
- if (originalDataSource && !originalObj.hasOwnProperty((0, _lodash.get)(record, 'rowKey'))) {
380
- return 'new-cell';
381
- }
382
- };
383
384
  var TableComponent = draggable ? _RcTable.DraggableTable : _RcTable.BaseTable;
384
385
  // 标记样式
385
386
  var tagStyle = {
@@ -41,6 +41,10 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
41
41
  toolTipProps?: TooltipProps & React.RefAttributes<unknown>;
42
42
  transform?: (value: any, record?: any) => string[];
43
43
  show?: boolean | (() => boolean);
44
+ onDiff?: ({ value, originValue }: {
45
+ value: any;
46
+ originValue: any;
47
+ }) => boolean;
44
48
  }
45
49
  export interface CreateTreeFromArrayOptions {
46
50
  itemKey?: string;
@@ -272,8 +272,22 @@
272
272
  .@{ant-prefix}-table-cell .varied-cell {
273
273
  margin-left: -8px;
274
274
  padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
275
+
275
276
  background: var(--zaui-contract-bg; #fffaa1) !important;
276
277
  border-radius: var(--zaui-border-radius, 8px);
278
+ .pro-form-view-container {
279
+ overflow: hidden;
280
+ white-space: nowrap;
281
+ text-overflow: ellipsis;
282
+ }
283
+ }
284
+
285
+ .@{ant-prefix}-table-cell .@{ant-prefix}-typography-ellipsis {
286
+ .pro-form-view-container {
287
+ overflow: hidden;
288
+ white-space: nowrap;
289
+ text-overflow: ellipsis;
290
+ }
277
291
  }
278
292
 
279
293
  .varied-cell.empty-cell {
@@ -323,7 +323,7 @@
323
323
  .@{ant-prefix}-table-tbody {
324
324
  .@{ant-prefix}-table-row:nth-child(even) {
325
325
  td {
326
- background: #ffffff !important;
326
+ background: #ffffff;
327
327
  }
328
328
  }
329
329
 
@@ -1,2 +1,3 @@
1
1
  /** 判断一个值是否是空值 */
2
2
  export declare const isEmpty: (value: any) => boolean;
3
+ export declare const useFocus: (element: Element) => boolean;
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.isEmpty = void 0;
7
+ exports.useFocus = exports.isEmpty = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _react = require("react");
7
10
  var EMPTY_VALUE = [undefined, null, ''];
8
11
  /** 判断一个值是否是空值 */
9
12
  var isEmpty = exports.isEmpty = function isEmpty(value) {
@@ -16,4 +19,28 @@ var isEmpty = exports.isEmpty = function isEmpty(value) {
16
19
  });
17
20
  }
18
21
  return false;
22
+ };
23
+ var useFocus = exports.useFocus = function useFocus(element) {
24
+ var _useState = (0, _react.useState)(false),
25
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
26
+ focus = _useState2[0],
27
+ setFocus = _useState2[1];
28
+ (0, _react.useEffect)(function () {
29
+ if (!element) return;
30
+ element.addEventListener('focus', function () {
31
+ setFocus(true);
32
+ }, true);
33
+ element.addEventListener('blur', function () {
34
+ setFocus(false);
35
+ }, true);
36
+ return function () {
37
+ element.removeEventListener('focus', function () {
38
+ setFocus(true);
39
+ }, true);
40
+ element.removeEventListener('blur', function () {
41
+ setFocus(false);
42
+ }, true);
43
+ };
44
+ }, [element]);
45
+ return focus;
19
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.8.3",
3
+ "version": "3.9.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",