@zat-design/sisyphus-react 3.8.2-beta.9 → 3.8.3
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/dist/index.esm.css +10 -4
- package/dist/less.esm.css +10 -4
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -6
- package/es/ProEditTable/components/RenderField/index.js +1 -0
- package/es/ProEnum/hooks/useEnumRequest.js +1 -1
- package/es/ProEnum/index.js +2 -2
- package/es/ProForm/components/base/InputNumber/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.js +8 -2
- package/es/ProForm/components/render/Render.js +1 -0
- package/es/ProForm/style/index.less +13 -0
- package/es/ProTable/components/FormatColumn/index.d.ts +3 -1
- package/es/ProTable/components/FormatColumn/index.js +77 -21
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/es/ProTable/components/RenderColumn/index.js +22 -7
- package/es/ProTable/index.js +11 -6
- package/es/ProTable/style/index.less +5 -4
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +10 -9
- package/lib/ProEditTable/components/RenderField/index.js +1 -0
- package/lib/ProEnum/hooks/useEnumRequest.js +1 -1
- package/lib/ProEnum/index.js +2 -2
- package/lib/ProForm/components/base/InputNumber/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +8 -2
- package/lib/ProForm/components/render/Render.js +1 -0
- package/lib/ProForm/style/index.less +13 -0
- package/lib/ProTable/components/FormatColumn/index.d.ts +3 -1
- package/lib/ProTable/components/FormatColumn/index.js +76 -20
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/lib/ProTable/components/RenderColumn/index.js +22 -7
- package/lib/ProTable/index.js +11 -6
- package/lib/ProTable/style/index.less +5 -4
- package/package.json +1 -1
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +0 -241
- package/coverage/lcov-report/src/.umi/core/history.ts.html +0 -148
- package/coverage/lcov-report/src/.umi/core/index.html +0 -206
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +0 -109
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +0 -160
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +0 -97
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +0 -26050
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +0 -112
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +0 -6340
- package/coverage/lcov-report/src/.umi/dumi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +0 -109
- package/coverage/lcov-report/src/.umi/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +0 -172
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +0 -94
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +0 -196
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +0 -106
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +0 -88
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +0 -124
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +0 -1246
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +0 -161
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +0 -268
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +0 -778
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +0 -115
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +0 -202
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +0 -97
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +0 -142
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +0 -334
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +0 -146
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +0 -121
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +0 -298
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +0 -116
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +0 -919
- package/coverage/lcov-report/src/.umi/umi.ts.html +0 -268
package/lib/ProEnum/index.js
CHANGED
|
@@ -54,8 +54,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
54
54
|
showCodeName = _ref2.showCodeName,
|
|
55
55
|
resProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
56
56
|
enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
|
|
57
|
-
var label = '';
|
|
58
|
-
var fieldValue = '';
|
|
57
|
+
var label = 'label';
|
|
58
|
+
var fieldValue = 'value';
|
|
59
59
|
var _useState = (0, _react.useState)(dataSource || []),
|
|
60
60
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
61
61
|
dataList = _useState2[0],
|
|
@@ -86,7 +86,7 @@ var InputNumber = function InputNumber(props) {
|
|
|
86
86
|
var _parser = function parser(value, precision) {
|
|
87
87
|
if (value === '') return value;
|
|
88
88
|
var num = Number(value.replace(/[\s,]+/g, ''));
|
|
89
|
-
return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : value : num.toFixed(precision);
|
|
89
|
+
return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : Number(value) : Number(num.toFixed(precision));
|
|
90
90
|
};
|
|
91
91
|
if (valueType) {
|
|
92
92
|
switch (valueType) {
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _diffOriginal = require("../../utils/diffOriginal");
|
|
18
18
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
19
19
|
var _utils = require("../../../utils");
|
|
20
|
-
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps"];
|
|
21
21
|
var ChangedWrapper = function ChangedWrapper(props) {
|
|
22
22
|
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
23
23
|
var name = props.name,
|
|
@@ -31,6 +31,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
31
31
|
_props$valuePropName = props.valuePropName,
|
|
32
32
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
33
33
|
normalize = props.normalize,
|
|
34
|
+
getValueProps = props.getValueProps,
|
|
34
35
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
35
36
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProForm'),
|
|
36
37
|
isDiffAll = _useProConfig.isDiffAll;
|
|
@@ -58,9 +59,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
58
59
|
var isChanged = diffType === 'changed';
|
|
59
60
|
var tipContent = (0, _react.useMemo)(function () {
|
|
60
61
|
if (!isWatch || noChange) return undefined;
|
|
62
|
+
var valueProps = getValueProps ? getValueProps(originalValue) : originalValue;
|
|
61
63
|
return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
|
|
62
64
|
isView: true
|
|
63
|
-
}, valuePropName,
|
|
65
|
+
}, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
|
|
64
66
|
}, [originalValue, children]);
|
|
65
67
|
if (!isWatch || noChange) {
|
|
66
68
|
// 嵌套子组件
|
|
@@ -92,9 +94,13 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
92
94
|
},
|
|
93
95
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
94
96
|
direction: "vertical",
|
|
97
|
+
className: "changed-tooltip",
|
|
95
98
|
children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
99
|
+
align: "start",
|
|
100
|
+
className: "original-value-container",
|
|
96
101
|
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
97
102
|
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
103
|
+
className: "current-value-container",
|
|
98
104
|
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
99
105
|
isView: true
|
|
100
106
|
})) : undefined]
|
|
@@ -472,3 +472,16 @@
|
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
+
|
|
476
|
+
.changed-tooltip {
|
|
477
|
+
.original-value-container {
|
|
478
|
+
.ant-space-item:nth-child(1) {
|
|
479
|
+
white-space: nowrap;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
.current-value-container {
|
|
483
|
+
.ant-space-item:nth-child(1) {
|
|
484
|
+
white-space: nowrap;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from '../../propsType';
|
|
3
|
-
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, }: {
|
|
3
|
+
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, scroll, onUpdateMinWidth, }: {
|
|
4
4
|
column: ProTableColumn;
|
|
5
5
|
originalObj: any;
|
|
6
6
|
dataSourceObj: any;
|
|
7
7
|
rowKey: any;
|
|
8
8
|
diffToolTip?: boolean;
|
|
9
9
|
wrapToolTipProps?: any;
|
|
10
|
+
scroll?: any;
|
|
11
|
+
onUpdateMinWidth?: any;
|
|
10
12
|
}) => void;
|
|
11
13
|
/**
|
|
12
14
|
* 查找最近的父级className
|
|
@@ -10,6 +10,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _moment15 = _interopRequireDefault(require("moment"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
14
|
var _antd = require("antd");
|
|
14
15
|
var _lodash = require("lodash");
|
|
15
16
|
var _utils = require("@zat-design/utils");
|
|
@@ -18,13 +19,45 @@ var _RenderColumn = _interopRequireDefault(require("../RenderColumn"));
|
|
|
18
19
|
var _utils2 = require("../../utils");
|
|
19
20
|
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
|
20
21
|
var _ProForm = _interopRequireDefault(require("../../../ProForm"));
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
var isReactElement = function isReactElement(element) {
|
|
23
|
+
return /*#__PURE__*/(0, _react.isValidElement)(element);
|
|
24
|
+
};
|
|
25
|
+
var calcMinWidth = function calcMinWidth(_ref) {
|
|
26
|
+
var minWidth = _ref.minWidth,
|
|
27
|
+
width = _ref.width,
|
|
28
|
+
title = _ref.title,
|
|
29
|
+
isMaxContentOverFlow = _ref.isMaxContentOverFlow,
|
|
30
|
+
callback = _ref.callback;
|
|
31
|
+
if (!minWidth && !width && isMaxContentOverFlow) {
|
|
32
|
+
var tempEl = document.createElement('div');
|
|
33
|
+
tempEl.style.display = 'inline-block';
|
|
34
|
+
document.body.appendChild(tempEl);
|
|
35
|
+
if ((0, _lodash.isFunction)(title)) {
|
|
36
|
+
var component = title();
|
|
37
|
+
_reactDom.default.render(component, tempEl);
|
|
38
|
+
} else if (isReactElement(title)) {
|
|
39
|
+
_reactDom.default.render(title, tempEl);
|
|
40
|
+
} else {
|
|
41
|
+
tempEl.innerHTML = title;
|
|
42
|
+
}
|
|
43
|
+
// 使用 requestAnimationFrame 确保在下一个浏览器重绘周期中获取宽度
|
|
44
|
+
requestAnimationFrame(function () {
|
|
45
|
+
var _width = tempEl.offsetWidth;
|
|
46
|
+
_reactDom.default.unmountComponentAtNode(tempEl);
|
|
47
|
+
tempEl.remove();
|
|
48
|
+
callback(_width);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
|
|
53
|
+
var column = _ref2.column,
|
|
54
|
+
originalObj = _ref2.originalObj,
|
|
55
|
+
dataSourceObj = _ref2.dataSourceObj,
|
|
56
|
+
rowKey = _ref2.rowKey,
|
|
57
|
+
diffToolTip = _ref2.diffToolTip,
|
|
58
|
+
wrapToolTipProps = _ref2.wrapToolTipProps,
|
|
59
|
+
scroll = _ref2.scroll,
|
|
60
|
+
onUpdateMinWidth = _ref2.onUpdateMinWidth;
|
|
28
61
|
var title = column.title,
|
|
29
62
|
valueType = column.valueType,
|
|
30
63
|
_column$format = column.format,
|
|
@@ -43,7 +76,17 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
43
76
|
_column$originalDiffT = column.originalDiffTip,
|
|
44
77
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
45
78
|
_column$toolTipProps = column.toolTipProps,
|
|
46
|
-
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps
|
|
79
|
+
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps,
|
|
80
|
+
minWidth = column.minWidth;
|
|
81
|
+
// 仅在 {x: 'max-content', y: 300 } 且 column无指定 width minWidth 情况下 才开启 minWidth的自动计算
|
|
82
|
+
var isMaxContentOverFlow = (0, _lodash.isObject)(scroll) ? (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' && Reflect.ownKeys(scroll).includes('y') : false;
|
|
83
|
+
calcMinWidth({
|
|
84
|
+
minWidth: minWidth,
|
|
85
|
+
width: width,
|
|
86
|
+
title: title,
|
|
87
|
+
isMaxContentOverFlow: isMaxContentOverFlow,
|
|
88
|
+
callback: onUpdateMinWidth
|
|
89
|
+
});
|
|
47
90
|
var _toolTipProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, toolTipProps), wrapToolTipProps);
|
|
48
91
|
var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
|
|
49
92
|
// 前缀处理
|
|
@@ -71,13 +114,17 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
71
114
|
}
|
|
72
115
|
};
|
|
73
116
|
if (column === null || column === void 0 ? void 0 : column.render) {
|
|
117
|
+
if (!originalObj && Object.keys(originalObj !== null && originalObj !== void 0 ? originalObj : {}).length === 0) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
74
120
|
var originalRender = column.render; // 保存原始的 render 方法
|
|
75
121
|
// 自定义render 手动重载下
|
|
76
122
|
column.render = function (value, record, index) {
|
|
123
|
+
var _originalObj$record$r;
|
|
77
124
|
var isFn = (0, _lodash.isFunction)(originalRender);
|
|
78
|
-
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record, index) : undefined;
|
|
79
|
-
var originalValue = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
|
80
|
-
var originalRenderValue = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(originalValue, originalObj, index) : undefined;
|
|
125
|
+
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : undefined;
|
|
126
|
+
var originalValue = (0, _utils2.getOriginalValue)(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
|
|
127
|
+
var originalRenderValue = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(originalValue, (_originalObj$record$r = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r !== void 0 ? _originalObj$record$r : {}, index) : undefined;
|
|
81
128
|
return (0, _jsxRuntime.jsx)(_RenderColumn.default, {
|
|
82
129
|
valueType: valueType,
|
|
83
130
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -87,7 +134,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
87
134
|
node: _value,
|
|
88
135
|
currentValue: _value,
|
|
89
136
|
originalDiffTip: _originalDiffTip,
|
|
90
|
-
toolTipProps: _toolTipProps
|
|
137
|
+
toolTipProps: _toolTipProps,
|
|
138
|
+
minWidth: minWidth
|
|
91
139
|
});
|
|
92
140
|
};
|
|
93
141
|
return;
|
|
@@ -133,7 +181,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
133
181
|
value: value,
|
|
134
182
|
currentValue: renderValue,
|
|
135
183
|
originalDiffTip: _originalDiffTip,
|
|
136
|
-
toolTipProps: _toolTipProps
|
|
184
|
+
toolTipProps: _toolTipProps,
|
|
185
|
+
minWidth: minWidth
|
|
137
186
|
});
|
|
138
187
|
};
|
|
139
188
|
// 千分位, 千分位带CNY前缀
|
|
@@ -163,7 +212,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
163
212
|
value: value,
|
|
164
213
|
currentValue: renderValue,
|
|
165
214
|
originalDiffTip: _originalDiffTip,
|
|
166
|
-
toolTipProps: _toolTipProps
|
|
215
|
+
toolTipProps: _toolTipProps,
|
|
216
|
+
minWidth: minWidth
|
|
167
217
|
});
|
|
168
218
|
};
|
|
169
219
|
} else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
|
|
@@ -216,7 +266,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
216
266
|
value: value,
|
|
217
267
|
currentValue: renderValue,
|
|
218
268
|
originalDiffTip: _originalDiffTip,
|
|
219
|
-
toolTipProps: _toolTipProps
|
|
269
|
+
toolTipProps: _toolTipProps,
|
|
270
|
+
minWidth: minWidth
|
|
220
271
|
});
|
|
221
272
|
};
|
|
222
273
|
} else if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
@@ -254,7 +305,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
254
305
|
value: value,
|
|
255
306
|
currentValue: renderValue,
|
|
256
307
|
originalDiffTip: _originalDiffTip,
|
|
257
|
-
toolTipProps: _toolTipProps
|
|
308
|
+
toolTipProps: _toolTipProps,
|
|
309
|
+
minWidth: minWidth
|
|
258
310
|
});
|
|
259
311
|
};
|
|
260
312
|
} else if (precision || prefix || suffix) {
|
|
@@ -281,7 +333,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
281
333
|
value: value,
|
|
282
334
|
currentValue: renderValue,
|
|
283
335
|
originalDiffTip: _originalDiffTip,
|
|
284
|
-
toolTipProps: _toolTipProps
|
|
336
|
+
toolTipProps: _toolTipProps,
|
|
337
|
+
minWidth: minWidth
|
|
285
338
|
});
|
|
286
339
|
};
|
|
287
340
|
} else if (valueType === 'address') {
|
|
@@ -337,7 +390,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
337
390
|
node: value,
|
|
338
391
|
value: value,
|
|
339
392
|
currentValue: value,
|
|
340
|
-
toolTipProps: _toolTipProps
|
|
393
|
+
toolTipProps: _toolTipProps,
|
|
394
|
+
minWidth: minWidth
|
|
341
395
|
}), suffixNode(value, record, index)]
|
|
342
396
|
});
|
|
343
397
|
};
|
|
@@ -358,7 +412,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
358
412
|
value: value,
|
|
359
413
|
currentValue: value || '-',
|
|
360
414
|
originalDiffTip: _originalDiffTip,
|
|
361
|
-
toolTipProps: _toolTipProps
|
|
415
|
+
toolTipProps: _toolTipProps,
|
|
416
|
+
minWidth: minWidth
|
|
362
417
|
}), suffixNode(value, record, index)]
|
|
363
418
|
});
|
|
364
419
|
};
|
|
@@ -381,7 +436,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
381
436
|
value: value,
|
|
382
437
|
currentValue: value || '-',
|
|
383
438
|
originalDiffTip: _originalDiffTip,
|
|
384
|
-
toolTipProps: _toolTipProps
|
|
439
|
+
toolTipProps: _toolTipProps,
|
|
440
|
+
minWidth: minWidth
|
|
385
441
|
});
|
|
386
442
|
};
|
|
387
443
|
}
|
|
@@ -27,7 +27,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
27
27
|
originalValue = props.originalValue,
|
|
28
28
|
originalDiffTip = props.originalDiffTip,
|
|
29
29
|
_props$toolTipProps = props.toolTipProps,
|
|
30
|
-
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps
|
|
30
|
+
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
|
|
31
|
+
minWidth = props.minWidth;
|
|
31
32
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
32
33
|
tooltip: false
|
|
33
34
|
}),
|
|
@@ -40,7 +41,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
40
41
|
if (ellipsis) {
|
|
41
42
|
renderNode = (0, _jsxRuntime.jsx)(Text, {
|
|
42
43
|
style: {
|
|
43
|
-
width: currentValue === '-' ? 32.5 : width
|
|
44
|
+
width: currentValue === '-' ? 32.5 : width,
|
|
45
|
+
minWidth: minWidth
|
|
44
46
|
},
|
|
45
47
|
ellipsis: {
|
|
46
48
|
tooltip: false
|
|
@@ -51,7 +53,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
51
53
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
52
54
|
className: "varied-cell",
|
|
53
55
|
style: {
|
|
54
|
-
width: width
|
|
56
|
+
width: width,
|
|
57
|
+
minWidth: minWidth
|
|
55
58
|
},
|
|
56
59
|
title: originalDiffTip ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
57
60
|
children: ["\u521D\u59CB\u503C\uFF1A", originalValue, (0, _jsxRuntime.jsx)("br", {}), ellipsis ? "\u5F53\u524D\u503C\uFF1A".concat(currentValue) : undefined]
|
|
@@ -66,7 +69,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
66
69
|
return (0, _jsxRuntime.jsx)("span", {
|
|
67
70
|
className: "varied-cell",
|
|
68
71
|
style: {
|
|
69
|
-
width: width
|
|
72
|
+
width: width,
|
|
73
|
+
minWidth: minWidth
|
|
70
74
|
},
|
|
71
75
|
children: renderNode
|
|
72
76
|
});
|
|
@@ -137,7 +141,12 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
137
141
|
}
|
|
138
142
|
}, toolTipProps);
|
|
139
143
|
if (!value) {
|
|
140
|
-
return
|
|
144
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
145
|
+
style: {
|
|
146
|
+
minWidth: minWidth
|
|
147
|
+
},
|
|
148
|
+
children: "-"
|
|
149
|
+
});
|
|
141
150
|
}
|
|
142
151
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
143
152
|
title: value,
|
|
@@ -150,7 +159,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
150
159
|
}, tooltipProps), {}, {
|
|
151
160
|
children: (0, _jsxRuntime.jsx)(Text, {
|
|
152
161
|
style: {
|
|
153
|
-
width: width
|
|
162
|
+
width: width,
|
|
163
|
+
minWidth: minWidth
|
|
154
164
|
},
|
|
155
165
|
ellipsis: true,
|
|
156
166
|
onMouseOver: handleMouseOver,
|
|
@@ -159,6 +169,11 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
159
169
|
})
|
|
160
170
|
}));
|
|
161
171
|
}
|
|
162
|
-
return
|
|
172
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
173
|
+
style: {
|
|
174
|
+
minWidth: minWidth
|
|
175
|
+
},
|
|
176
|
+
children: value || value === 0 ? node : '-'
|
|
177
|
+
});
|
|
163
178
|
};
|
|
164
179
|
var _default = exports.default = RenderColumn;
|
package/lib/ProTable/index.js
CHANGED
|
@@ -211,18 +211,22 @@ function ProTable(props) {
|
|
|
211
211
|
}).filter(function (item) {
|
|
212
212
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
213
213
|
});
|
|
214
|
-
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
214
|
+
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item, index) {
|
|
215
215
|
(0, _FormatColumn.formatColumn)({
|
|
216
216
|
column: item,
|
|
217
217
|
originalObj: originalObj,
|
|
218
218
|
dataSourceObj: dataSourceObj,
|
|
219
219
|
rowKey: 'rowKey',
|
|
220
220
|
diffToolTip: toolTip,
|
|
221
|
-
wrapToolTipProps: wrapToolTipProps
|
|
221
|
+
wrapToolTipProps: wrapToolTipProps,
|
|
222
|
+
scroll: _scroll,
|
|
223
|
+
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
|
224
|
+
curColumns[index].minWidth = w;
|
|
225
|
+
}
|
|
222
226
|
});
|
|
223
227
|
});
|
|
224
228
|
return newColumns;
|
|
225
|
-
}, [curColumns, handleResize]);
|
|
229
|
+
}, [curColumns, handleResize, _scroll]);
|
|
226
230
|
var _columns = (0, _react.useMemo)(function () {
|
|
227
231
|
return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
|
|
228
232
|
var show = item.show;
|
|
@@ -235,9 +239,10 @@ function ProTable(props) {
|
|
|
235
239
|
return true;
|
|
236
240
|
});
|
|
237
241
|
}, [columns]);
|
|
238
|
-
var isExistPercentWidth = !!_columns.find(function (item) {
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
var isExistPercentWidth = !!(_columns === null || _columns === void 0 ? void 0 : _columns.find(function (item) {
|
|
243
|
+
var _item$width;
|
|
244
|
+
return (item === null || item === void 0 ? void 0 : item.width) && typeof (item === null || item === void 0 ? void 0 : item.width) === 'string' && (item === null || item === void 0 ? void 0 : (_item$width = item.width) === null || _item$width === void 0 ? void 0 : _item$width.endsWith('%'));
|
|
245
|
+
}));
|
|
241
246
|
if (isExistPercentWidth) {
|
|
242
247
|
_scroll = props === null || props === void 0 ? void 0 : props.scroll;
|
|
243
248
|
}
|
|
@@ -259,11 +259,12 @@
|
|
|
259
259
|
|
|
260
260
|
tbody.@{ant-prefix}-table-tbody {
|
|
261
261
|
tr.@{ant-prefix}-table-row.new-cell {
|
|
262
|
-
background: #d2fff4 !important;
|
|
263
|
-
background-color: #d2fff4 !important;
|
|
262
|
+
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
|
263
|
+
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
|
264
|
+
|
|
264
265
|
td.@{ant-prefix}-table-cell {
|
|
265
|
-
background: #d2fff4 !important;
|
|
266
|
-
background-color: #d2fff4 !important;
|
|
266
|
+
background: var(--zaui-contract-bg-add; #d2fff4) !important;
|
|
267
|
+
background-color: var(--zaui-contract-bg-add; #d2fff4) !important;
|
|
267
268
|
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
|
268
269
|
}
|
|
269
270
|
}
|