@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.
- package/.vscode/extensions.json +5 -0
- package/dist/index.esm.css +38 -3
- package/dist/less.esm.css +37 -2
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +83 -20
- package/es/ProEditTable/components/RenderField/index.js +6 -2
- package/es/ProEditTable/index.js +18 -9
- package/es/ProEditTable/propsType.d.ts +3 -6
- package/es/ProEditTable/style/index.less +0 -1
- package/es/ProEditTable/utils/index.js +10 -3
- package/es/ProForm/components/base/InputNumber/index.js +1 -1
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
- package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
- package/es/ProForm/components/combination/FormList/components/LineFields.js +4 -2
- package/es/ProForm/components/combination/FormList/index.js +14 -3
- package/es/ProForm/components/combination/Group/index.js +3 -4
- package/es/ProForm/components/combination/ProCascader/index.js +21 -14
- package/es/ProForm/components/combination/ProModalSelect/index.js +17 -3
- package/es/ProForm/components/render/ChangedWrapper.js +29 -10
- package/es/ProForm/components/render/Render.js +3 -1
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/propsType.d.ts +3 -0
- package/es/ProForm/style/index.less +35 -9
- package/es/ProForm/utils/diffOriginal.js +14 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -9
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/es/ProTable/components/FormatColumn/index.js +107 -29
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/es/ProTable/components/RenderColumn/index.js +23 -6
- package/es/ProTable/index.js +8 -7
- package/es/ProTable/propsType.d.ts +4 -0
- package/es/ProTable/style/index.less +14 -0
- package/es/style/theme/antd.less +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +26 -0
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +82 -21
- package/lib/ProEditTable/components/RenderField/index.js +6 -2
- package/lib/ProEditTable/index.js +18 -9
- package/lib/ProEditTable/propsType.d.ts +3 -6
- package/lib/ProEditTable/style/index.less +0 -1
- package/lib/ProEditTable/utils/index.js +10 -3
- package/lib/ProForm/components/base/InputNumber/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
- package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -0
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +4 -2
- package/lib/ProForm/components/combination/FormList/index.js +14 -3
- package/lib/ProForm/components/combination/Group/index.js +3 -4
- package/lib/ProForm/components/combination/ProCascader/index.js +21 -14
- package/lib/ProForm/components/combination/ProModalSelect/index.js +17 -3
- package/lib/ProForm/components/render/ChangedWrapper.js +29 -10
- package/lib/ProForm/components/render/Render.js +3 -1
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/propsType.d.ts +3 -0
- package/lib/ProForm/style/index.less +35 -9
- package/lib/ProForm/utils/diffOriginal.js +13 -1
- package/lib/ProForm/utils/useShouldUpdate.js +1 -9
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +107 -29
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/lib/ProTable/components/RenderColumn/index.js +20 -5
- package/lib/ProTable/index.js +8 -7
- package/lib/ProTable/propsType.d.ts +4 -0
- package/lib/ProTable/style/index.less +14 -0
- package/lib/style/theme/antd.less +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +28 -1
- package/package.json +1 -1
package/lib/ProTable/index.js
CHANGED
@@ -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 {
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
@@ -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
|
};
|