@zat-design/sisyphus-react 3.8.2-beta.15 → 3.8.2-beta.17
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/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/es/ProTable/components/FormatColumn/index.js +54 -18
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/es/ProTable/components/RenderColumn/index.js +22 -7
- package/es/ProTable/index.js +3 -2
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +53 -17
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -0
- package/lib/ProTable/components/RenderColumn/index.js +22 -7
- package/lib/ProTable/index.js +3 -2
- package/package.json +1 -1
|
@@ -18,13 +18,31 @@ var _RenderColumn = _interopRequireDefault(require("../RenderColumn"));
|
|
|
18
18
|
var _utils2 = require("../../utils");
|
|
19
19
|
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
|
20
20
|
var _ProForm = _interopRequireDefault(require("../../../ProForm"));
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
var calcMinWidth = function calcMinWidth(_ref) {
|
|
22
|
+
var minWidth = _ref.minWidth,
|
|
23
|
+
width = _ref.width,
|
|
24
|
+
title = _ref.title,
|
|
25
|
+
isMaxContentOverFlow = _ref.isMaxContentOverFlow;
|
|
26
|
+
var resultMinWidth = minWidth;
|
|
27
|
+
if (!minWidth && !width && isMaxContentOverFlow) {
|
|
28
|
+
var tempEl = document.createElement('div');
|
|
29
|
+
tempEl.innerHTML = title;
|
|
30
|
+
tempEl.style.display = 'inline-block'; // 确保元素有宽度
|
|
31
|
+
document.body.appendChild(tempEl); // 将元素添加到 DOM 中
|
|
32
|
+
var _width = tempEl.offsetWidth;
|
|
33
|
+
tempEl.remove();
|
|
34
|
+
resultMinWidth = _width;
|
|
35
|
+
}
|
|
36
|
+
return resultMinWidth;
|
|
37
|
+
};
|
|
38
|
+
var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
|
|
39
|
+
var column = _ref2.column,
|
|
40
|
+
originalObj = _ref2.originalObj,
|
|
41
|
+
dataSourceObj = _ref2.dataSourceObj,
|
|
42
|
+
rowKey = _ref2.rowKey,
|
|
43
|
+
diffToolTip = _ref2.diffToolTip,
|
|
44
|
+
wrapToolTipProps = _ref2.wrapToolTipProps,
|
|
45
|
+
scroll = _ref2.scroll;
|
|
28
46
|
var title = column.title,
|
|
29
47
|
valueType = column.valueType,
|
|
30
48
|
_column$format = column.format,
|
|
@@ -43,7 +61,16 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
43
61
|
_column$originalDiffT = column.originalDiffTip,
|
|
44
62
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
45
63
|
_column$toolTipProps = column.toolTipProps,
|
|
46
|
-
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps
|
|
64
|
+
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps,
|
|
65
|
+
_minWidth = column.minWidth;
|
|
66
|
+
// 仅在 {x: 'max-content', y: 300 } 且 column无指定 width minWidth 情况下 才开启 minWidth的自动计算
|
|
67
|
+
var isMaxContentOverFlow = (0, _lodash.isObject)(scroll) ? (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' && Reflect.ownKeys(scroll).includes('y') : false;
|
|
68
|
+
var minWidth = calcMinWidth({
|
|
69
|
+
minWidth: _minWidth,
|
|
70
|
+
width: width,
|
|
71
|
+
title: title,
|
|
72
|
+
isMaxContentOverFlow: isMaxContentOverFlow
|
|
73
|
+
});
|
|
47
74
|
var _toolTipProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, toolTipProps), wrapToolTipProps);
|
|
48
75
|
var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
|
|
49
76
|
// 前缀处理
|
|
@@ -91,7 +118,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
91
118
|
node: _value,
|
|
92
119
|
currentValue: _value,
|
|
93
120
|
originalDiffTip: _originalDiffTip,
|
|
94
|
-
toolTipProps: _toolTipProps
|
|
121
|
+
toolTipProps: _toolTipProps,
|
|
122
|
+
minWidth: minWidth
|
|
95
123
|
});
|
|
96
124
|
};
|
|
97
125
|
return;
|
|
@@ -137,7 +165,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
137
165
|
value: value,
|
|
138
166
|
currentValue: renderValue,
|
|
139
167
|
originalDiffTip: _originalDiffTip,
|
|
140
|
-
toolTipProps: _toolTipProps
|
|
168
|
+
toolTipProps: _toolTipProps,
|
|
169
|
+
minWidth: minWidth
|
|
141
170
|
});
|
|
142
171
|
};
|
|
143
172
|
// 千分位, 千分位带CNY前缀
|
|
@@ -167,7 +196,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
167
196
|
value: value,
|
|
168
197
|
currentValue: renderValue,
|
|
169
198
|
originalDiffTip: _originalDiffTip,
|
|
170
|
-
toolTipProps: _toolTipProps
|
|
199
|
+
toolTipProps: _toolTipProps,
|
|
200
|
+
minWidth: minWidth
|
|
171
201
|
});
|
|
172
202
|
};
|
|
173
203
|
} else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
|
|
@@ -220,7 +250,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
220
250
|
value: value,
|
|
221
251
|
currentValue: renderValue,
|
|
222
252
|
originalDiffTip: _originalDiffTip,
|
|
223
|
-
toolTipProps: _toolTipProps
|
|
253
|
+
toolTipProps: _toolTipProps,
|
|
254
|
+
minWidth: minWidth
|
|
224
255
|
});
|
|
225
256
|
};
|
|
226
257
|
} else if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
@@ -258,7 +289,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
258
289
|
value: value,
|
|
259
290
|
currentValue: renderValue,
|
|
260
291
|
originalDiffTip: _originalDiffTip,
|
|
261
|
-
toolTipProps: _toolTipProps
|
|
292
|
+
toolTipProps: _toolTipProps,
|
|
293
|
+
minWidth: minWidth
|
|
262
294
|
});
|
|
263
295
|
};
|
|
264
296
|
} else if (precision || prefix || suffix) {
|
|
@@ -285,7 +317,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
285
317
|
value: value,
|
|
286
318
|
currentValue: renderValue,
|
|
287
319
|
originalDiffTip: _originalDiffTip,
|
|
288
|
-
toolTipProps: _toolTipProps
|
|
320
|
+
toolTipProps: _toolTipProps,
|
|
321
|
+
minWidth: minWidth
|
|
289
322
|
});
|
|
290
323
|
};
|
|
291
324
|
} else if (valueType === 'address') {
|
|
@@ -341,7 +374,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
341
374
|
node: value,
|
|
342
375
|
value: value,
|
|
343
376
|
currentValue: value,
|
|
344
|
-
toolTipProps: _toolTipProps
|
|
377
|
+
toolTipProps: _toolTipProps,
|
|
378
|
+
minWidth: minWidth
|
|
345
379
|
}), suffixNode(value, record, index)]
|
|
346
380
|
});
|
|
347
381
|
};
|
|
@@ -362,7 +396,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
362
396
|
value: value,
|
|
363
397
|
currentValue: value || '-',
|
|
364
398
|
originalDiffTip: _originalDiffTip,
|
|
365
|
-
toolTipProps: _toolTipProps
|
|
399
|
+
toolTipProps: _toolTipProps,
|
|
400
|
+
minWidth: minWidth
|
|
366
401
|
}), suffixNode(value, record, index)]
|
|
367
402
|
});
|
|
368
403
|
};
|
|
@@ -385,7 +420,8 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref) {
|
|
|
385
420
|
value: value,
|
|
386
421
|
currentValue: value || '-',
|
|
387
422
|
originalDiffTip: _originalDiffTip,
|
|
388
|
-
toolTipProps: _toolTipProps
|
|
423
|
+
toolTipProps: _toolTipProps,
|
|
424
|
+
minWidth: minWidth
|
|
389
425
|
});
|
|
390
426
|
};
|
|
391
427
|
}
|
|
@@ -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
|
@@ -218,11 +218,12 @@ function ProTable(props) {
|
|
|
218
218
|
dataSourceObj: dataSourceObj,
|
|
219
219
|
rowKey: 'rowKey',
|
|
220
220
|
diffToolTip: toolTip,
|
|
221
|
-
wrapToolTipProps: wrapToolTipProps
|
|
221
|
+
wrapToolTipProps: wrapToolTipProps,
|
|
222
|
+
scroll: _scroll
|
|
222
223
|
});
|
|
223
224
|
});
|
|
224
225
|
return newColumns;
|
|
225
|
-
}, [curColumns, handleResize]);
|
|
226
|
+
}, [curColumns, handleResize, _scroll]);
|
|
226
227
|
var _columns = (0, _react.useMemo)(function () {
|
|
227
228
|
return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
|
|
228
229
|
var show = item.show;
|