@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/dist/index.esm.css
CHANGED
|
@@ -1900,12 +1900,12 @@
|
|
|
1900
1900
|
background: unset !important;
|
|
1901
1901
|
}
|
|
1902
1902
|
.pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell {
|
|
1903
|
-
background: #d2fff4 !important;
|
|
1904
|
-
background-color: #d2fff4 !important;
|
|
1903
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1904
|
+
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1905
1905
|
}
|
|
1906
1906
|
.pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell td.ant-table-cell {
|
|
1907
|
-
background: #d2fff4 !important;
|
|
1908
|
-
background-color: #d2fff4 !important;
|
|
1907
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1908
|
+
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1909
1909
|
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
|
1910
1910
|
}
|
|
1911
1911
|
.pro-table tbody.ant-table-tbody .ant-table-cell .varied-cell {
|
|
@@ -3139,6 +3139,12 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3139
3139
|
background: var(--zaui-contract-bg-add, #d2fff4);
|
|
3140
3140
|
border-radius: 4px;
|
|
3141
3141
|
}
|
|
3142
|
+
.changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
|
|
3143
|
+
white-space: nowrap;
|
|
3144
|
+
}
|
|
3145
|
+
.changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
|
|
3146
|
+
white-space: nowrap;
|
|
3147
|
+
}
|
|
3142
3148
|
.pro-upload .pro-upload-dragger .pro-upload-handle-box {
|
|
3143
3149
|
padding: var(--zaui-space-size-sm, 8px);
|
|
3144
3150
|
background: #f8f9fa;
|
package/dist/less.esm.css
CHANGED
|
@@ -1900,12 +1900,12 @@
|
|
|
1900
1900
|
background: unset !important;
|
|
1901
1901
|
}
|
|
1902
1902
|
.pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell {
|
|
1903
|
-
background: #d2fff4 !important;
|
|
1904
|
-
background-color: #d2fff4 !important;
|
|
1903
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1904
|
+
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1905
1905
|
}
|
|
1906
1906
|
.pro-table tbody.ant-table-tbody tr.ant-table-row.new-cell td.ant-table-cell {
|
|
1907
|
-
background: #d2fff4 !important;
|
|
1908
|
-
background-color: #d2fff4 !important;
|
|
1907
|
+
background: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1908
|
+
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
|
1909
1909
|
border-bottom: 1px solid var(--zaui-form-control-line, #dcdcdc);
|
|
1910
1910
|
}
|
|
1911
1911
|
.pro-table tbody.ant-table-tbody .ant-table-cell .varied-cell {
|
|
@@ -3139,6 +3139,12 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3139
3139
|
background: var(--zaui-contract-bg-add, #d2fff4);
|
|
3140
3140
|
border-radius: 4px;
|
|
3141
3141
|
}
|
|
3142
|
+
.changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
|
|
3143
|
+
white-space: nowrap;
|
|
3144
|
+
}
|
|
3145
|
+
.changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
|
|
3146
|
+
white-space: nowrap;
|
|
3147
|
+
}
|
|
3142
3148
|
.pro-upload .pro-upload-dragger .pro-upload-handle-box {
|
|
3143
3149
|
padding: var(--zaui-space-size-sm, 8px);
|
|
3144
3150
|
background: #f8f9fa;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import "antd/es/space/style";
|
|
2
3
|
import _Space from "antd/es/space";
|
|
3
4
|
import "antd/es/tooltip/style";
|
|
4
5
|
import _Tooltip from "antd/es/tooltip";
|
|
5
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "valuePropName"];
|
|
8
|
+
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName"];
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
import React, { useMemo } from 'react';
|
|
10
11
|
import classNames from 'classnames';
|
|
@@ -65,6 +66,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
|
|
|
65
66
|
}) : get(originalValues, originalName);
|
|
66
67
|
};
|
|
67
68
|
var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
69
|
+
var _getValueProps;
|
|
68
70
|
var name = props.name,
|
|
69
71
|
names = props.names,
|
|
70
72
|
namesStr = props.namesStr,
|
|
@@ -79,6 +81,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
79
81
|
children = props.children,
|
|
80
82
|
type = props.type,
|
|
81
83
|
normalize = props.normalize,
|
|
84
|
+
getValueProps = props.getValueProps,
|
|
82
85
|
_props$valuePropName = props.valuePropName,
|
|
83
86
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
84
87
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -124,12 +127,10 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
124
127
|
return target.parentElement;
|
|
125
128
|
},
|
|
126
129
|
title: _jsxs(_Space, {
|
|
127
|
-
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children), {}, {
|
|
130
|
+
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children), {}, _defineProperty(_defineProperty({
|
|
128
131
|
// @ts-ignore
|
|
129
|
-
isView: true
|
|
130
|
-
|
|
131
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
132
|
-
})) : undefined]
|
|
132
|
+
isView: true
|
|
133
|
+
}, valuePropName, getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : props[valuePropName]), "checked", type === 'Switch' ? originalValue : undefined))) : undefined]
|
|
133
134
|
}),
|
|
134
135
|
children: _jsx("div", {
|
|
135
136
|
className: diffClassName,
|
|
@@ -42,7 +42,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
42
42
|
}
|
|
43
43
|
var logDebug = function logDebug(msg) {
|
|
44
44
|
if (props.debugger) {
|
|
45
|
-
console.
|
|
45
|
+
console.warn('proEnum:', msg);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
var enumRes = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread(_objectSpread({
|
package/es/ProEnum/index.js
CHANGED
|
@@ -53,8 +53,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
53
53
|
showCodeName = _ref2.showCodeName,
|
|
54
54
|
resProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
55
55
|
enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
|
|
56
|
-
var label = '';
|
|
57
|
-
var fieldValue = '';
|
|
56
|
+
var label = 'label';
|
|
57
|
+
var fieldValue = 'value';
|
|
58
58
|
var _useState = useState(dataSource || []),
|
|
59
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
60
|
dataList = _useState2[0],
|
|
@@ -82,7 +82,7 @@ var InputNumber = function InputNumber(props) {
|
|
|
82
82
|
var _parser = function parser(value, precision) {
|
|
83
83
|
if (value === '') return value;
|
|
84
84
|
var num = Number(value.replace(/[\s,]+/g, ''));
|
|
85
|
-
return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : value : num.toFixed(precision);
|
|
85
|
+
return Number.isNaN(num) || !precision && precision !== 0 ? Number.isNaN(Number(value)) ? null : Number(value) : Number(num.toFixed(precision));
|
|
86
86
|
};
|
|
87
87
|
if (valueType) {
|
|
88
88
|
switch (valueType) {
|
|
@@ -5,7 +5,7 @@ import _Tooltip from "antd/es/tooltip";
|
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
-
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
|
|
8
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize", "getValueProps"];
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { get } from 'lodash';
|
|
@@ -26,6 +26,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
26
26
|
_props$valuePropName = props.valuePropName,
|
|
27
27
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
28
28
|
normalize = props.normalize,
|
|
29
|
+
getValueProps = props.getValueProps,
|
|
29
30
|
rest = _objectWithoutProperties(props, _excluded);
|
|
30
31
|
var _useProConfig = useProConfig('ProForm'),
|
|
31
32
|
isDiffAll = _useProConfig.isDiffAll;
|
|
@@ -53,9 +54,10 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
53
54
|
var isChanged = diffType === 'changed';
|
|
54
55
|
var tipContent = useMemo(function () {
|
|
55
56
|
if (!isWatch || noChange) return undefined;
|
|
57
|
+
var valueProps = getValueProps ? getValueProps(originalValue) : originalValue;
|
|
56
58
|
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
|
|
57
59
|
isView: true
|
|
58
|
-
}, valuePropName,
|
|
60
|
+
}, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
|
|
59
61
|
}, [originalValue, children]);
|
|
60
62
|
if (!isWatch || noChange) {
|
|
61
63
|
// 嵌套子组件
|
|
@@ -87,9 +89,13 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
87
89
|
},
|
|
88
90
|
title: _jsxs(_Space, {
|
|
89
91
|
direction: "vertical",
|
|
92
|
+
className: "changed-tooltip",
|
|
90
93
|
children: [_jsxs(_Space, {
|
|
94
|
+
align: "start",
|
|
95
|
+
className: "original-value-container",
|
|
91
96
|
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
92
97
|
}), _showEllipse && _jsxs(_Space, {
|
|
98
|
+
className: "current-value-container",
|
|
93
99
|
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
94
100
|
isView: true
|
|
95
101
|
})) : 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
|
|
@@ -5,20 +5,53 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
import { isValidElement } from 'react';
|
|
6
6
|
import moment from 'moment';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
|
-
import
|
|
8
|
+
import ReactDOM from 'react-dom';
|
|
9
|
+
import { isEqual, isFunction, isString, isObject } from 'lodash';
|
|
9
10
|
import { tools } from '@zat-design/utils';
|
|
10
11
|
import TooltipTitle from '../TooltipTitle';
|
|
11
12
|
import RenderColumn from '../RenderColumn';
|
|
12
13
|
import { getDecimalDigits, getOriginalValue } from '../../utils';
|
|
13
14
|
import getEnumLabel from '../../../ProEnum/utils/getEnumLabel';
|
|
14
15
|
import ProForm from '../../../ProForm';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var isReactElement = function isReactElement(element) {
|
|
17
|
+
return /*#__PURE__*/isValidElement(element);
|
|
18
|
+
};
|
|
19
|
+
var calcMinWidth = function calcMinWidth(_ref) {
|
|
20
|
+
var minWidth = _ref.minWidth,
|
|
21
|
+
width = _ref.width,
|
|
22
|
+
title = _ref.title,
|
|
23
|
+
isMaxContentOverFlow = _ref.isMaxContentOverFlow,
|
|
24
|
+
callback = _ref.callback;
|
|
25
|
+
if (!minWidth && !width && isMaxContentOverFlow) {
|
|
26
|
+
var tempEl = document.createElement('div');
|
|
27
|
+
tempEl.style.display = 'inline-block';
|
|
28
|
+
document.body.appendChild(tempEl);
|
|
29
|
+
if (isFunction(title)) {
|
|
30
|
+
var component = title();
|
|
31
|
+
ReactDOM.render(component, tempEl);
|
|
32
|
+
} else if (isReactElement(title)) {
|
|
33
|
+
ReactDOM.render(title, tempEl);
|
|
34
|
+
} else {
|
|
35
|
+
tempEl.innerHTML = title;
|
|
36
|
+
}
|
|
37
|
+
// 使用 requestAnimationFrame 确保在下一个浏览器重绘周期中获取宽度
|
|
38
|
+
requestAnimationFrame(function () {
|
|
39
|
+
var _width = tempEl.offsetWidth;
|
|
40
|
+
ReactDOM.unmountComponentAtNode(tempEl);
|
|
41
|
+
tempEl.remove();
|
|
42
|
+
callback(_width);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export var formatColumn = function formatColumn(_ref2) {
|
|
47
|
+
var column = _ref2.column,
|
|
48
|
+
originalObj = _ref2.originalObj,
|
|
49
|
+
dataSourceObj = _ref2.dataSourceObj,
|
|
50
|
+
rowKey = _ref2.rowKey,
|
|
51
|
+
diffToolTip = _ref2.diffToolTip,
|
|
52
|
+
wrapToolTipProps = _ref2.wrapToolTipProps,
|
|
53
|
+
scroll = _ref2.scroll,
|
|
54
|
+
onUpdateMinWidth = _ref2.onUpdateMinWidth;
|
|
22
55
|
var title = column.title,
|
|
23
56
|
valueType = column.valueType,
|
|
24
57
|
_column$format = column.format,
|
|
@@ -37,7 +70,17 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
37
70
|
_column$originalDiffT = column.originalDiffTip,
|
|
38
71
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
39
72
|
_column$toolTipProps = column.toolTipProps,
|
|
40
|
-
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps
|
|
73
|
+
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps,
|
|
74
|
+
minWidth = column.minWidth;
|
|
75
|
+
// 仅在 {x: 'max-content', y: 300 } 且 column无指定 width minWidth 情况下 才开启 minWidth的自动计算
|
|
76
|
+
var isMaxContentOverFlow = isObject(scroll) ? (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' && Reflect.ownKeys(scroll).includes('y') : false;
|
|
77
|
+
calcMinWidth({
|
|
78
|
+
minWidth: minWidth,
|
|
79
|
+
width: width,
|
|
80
|
+
title: title,
|
|
81
|
+
isMaxContentOverFlow: isMaxContentOverFlow,
|
|
82
|
+
callback: onUpdateMinWidth
|
|
83
|
+
});
|
|
41
84
|
var _toolTipProps = _objectSpread(_objectSpread({}, toolTipProps), wrapToolTipProps);
|
|
42
85
|
var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
|
|
43
86
|
// 前缀处理
|
|
@@ -65,13 +108,17 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
65
108
|
}
|
|
66
109
|
};
|
|
67
110
|
if (column === null || column === void 0 ? void 0 : column.render) {
|
|
111
|
+
if (!originalObj && Object.keys(originalObj !== null && originalObj !== void 0 ? originalObj : {}).length === 0) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
68
114
|
var originalRender = column.render; // 保存原始的 render 方法
|
|
69
115
|
// 自定义render 手动重载下
|
|
70
116
|
column.render = function (value, record, index) {
|
|
117
|
+
var _originalObj$record$r;
|
|
71
118
|
var isFn = isFunction(originalRender);
|
|
72
|
-
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record, index) : undefined;
|
|
73
|
-
var originalValue = getOriginalValue(value, record, originalObj, rowKey, dataIndex);
|
|
74
|
-
var originalRenderValue = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(originalValue, originalObj, index) : undefined;
|
|
119
|
+
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : undefined;
|
|
120
|
+
var originalValue = getOriginalValue(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
|
|
121
|
+
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;
|
|
75
122
|
return _jsx(RenderColumn, {
|
|
76
123
|
valueType: valueType,
|
|
77
124
|
originalValue: originalValue === undefined ? undefined : originalRenderValue,
|
|
@@ -81,7 +128,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
81
128
|
node: _value,
|
|
82
129
|
currentValue: _value,
|
|
83
130
|
originalDiffTip: _originalDiffTip,
|
|
84
|
-
toolTipProps: _toolTipProps
|
|
131
|
+
toolTipProps: _toolTipProps,
|
|
132
|
+
minWidth: minWidth
|
|
85
133
|
});
|
|
86
134
|
};
|
|
87
135
|
return;
|
|
@@ -127,7 +175,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
127
175
|
value: value,
|
|
128
176
|
currentValue: renderValue,
|
|
129
177
|
originalDiffTip: _originalDiffTip,
|
|
130
|
-
toolTipProps: _toolTipProps
|
|
178
|
+
toolTipProps: _toolTipProps,
|
|
179
|
+
minWidth: minWidth
|
|
131
180
|
});
|
|
132
181
|
};
|
|
133
182
|
// 千分位, 千分位带CNY前缀
|
|
@@ -157,7 +206,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
157
206
|
value: value,
|
|
158
207
|
currentValue: renderValue,
|
|
159
208
|
originalDiffTip: _originalDiffTip,
|
|
160
|
-
toolTipProps: _toolTipProps
|
|
209
|
+
toolTipProps: _toolTipProps,
|
|
210
|
+
minWidth: minWidth
|
|
161
211
|
});
|
|
162
212
|
};
|
|
163
213
|
} else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
|
|
@@ -210,7 +260,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
210
260
|
value: value,
|
|
211
261
|
currentValue: renderValue,
|
|
212
262
|
originalDiffTip: _originalDiffTip,
|
|
213
|
-
toolTipProps: _toolTipProps
|
|
263
|
+
toolTipProps: _toolTipProps,
|
|
264
|
+
minWidth: minWidth
|
|
214
265
|
});
|
|
215
266
|
};
|
|
216
267
|
} else if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
@@ -248,7 +299,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
248
299
|
value: value,
|
|
249
300
|
currentValue: renderValue,
|
|
250
301
|
originalDiffTip: _originalDiffTip,
|
|
251
|
-
toolTipProps: _toolTipProps
|
|
302
|
+
toolTipProps: _toolTipProps,
|
|
303
|
+
minWidth: minWidth
|
|
252
304
|
});
|
|
253
305
|
};
|
|
254
306
|
} else if (precision || prefix || suffix) {
|
|
@@ -275,7 +327,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
275
327
|
value: value,
|
|
276
328
|
currentValue: renderValue,
|
|
277
329
|
originalDiffTip: _originalDiffTip,
|
|
278
|
-
toolTipProps: _toolTipProps
|
|
330
|
+
toolTipProps: _toolTipProps,
|
|
331
|
+
minWidth: minWidth
|
|
279
332
|
});
|
|
280
333
|
};
|
|
281
334
|
} else if (valueType === 'address') {
|
|
@@ -331,7 +384,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
331
384
|
node: value,
|
|
332
385
|
value: value,
|
|
333
386
|
currentValue: value,
|
|
334
|
-
toolTipProps: _toolTipProps
|
|
387
|
+
toolTipProps: _toolTipProps,
|
|
388
|
+
minWidth: minWidth
|
|
335
389
|
}), suffixNode(value, record, index)]
|
|
336
390
|
});
|
|
337
391
|
};
|
|
@@ -352,7 +406,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
352
406
|
value: value,
|
|
353
407
|
currentValue: value || '-',
|
|
354
408
|
originalDiffTip: _originalDiffTip,
|
|
355
|
-
toolTipProps: _toolTipProps
|
|
409
|
+
toolTipProps: _toolTipProps,
|
|
410
|
+
minWidth: minWidth
|
|
356
411
|
}), suffixNode(value, record, index)]
|
|
357
412
|
});
|
|
358
413
|
};
|
|
@@ -375,7 +430,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
375
430
|
value: value,
|
|
376
431
|
currentValue: value || '-',
|
|
377
432
|
originalDiffTip: _originalDiffTip,
|
|
378
|
-
toolTipProps: _toolTipProps
|
|
433
|
+
toolTipProps: _toolTipProps,
|
|
434
|
+
minWidth: minWidth
|
|
379
435
|
});
|
|
380
436
|
};
|
|
381
437
|
}
|
|
@@ -23,7 +23,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
23
23
|
originalValue = props.originalValue,
|
|
24
24
|
originalDiffTip = props.originalDiffTip,
|
|
25
25
|
_props$toolTipProps = props.toolTipProps,
|
|
26
|
-
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps
|
|
26
|
+
toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps,
|
|
27
|
+
minWidth = props.minWidth;
|
|
27
28
|
var _useSetState = useSetState({
|
|
28
29
|
tooltip: false
|
|
29
30
|
}),
|
|
@@ -36,7 +37,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
36
37
|
if (ellipsis) {
|
|
37
38
|
renderNode = _jsx(Text, {
|
|
38
39
|
style: {
|
|
39
|
-
width: currentValue === '-' ? 32.5 : width
|
|
40
|
+
width: currentValue === '-' ? 32.5 : width,
|
|
41
|
+
minWidth: minWidth
|
|
40
42
|
},
|
|
41
43
|
ellipsis: {
|
|
42
44
|
tooltip: false
|
|
@@ -47,7 +49,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
47
49
|
return _jsx(_Tooltip, _objectSpread(_objectSpread({
|
|
48
50
|
className: "varied-cell",
|
|
49
51
|
style: {
|
|
50
|
-
width: width
|
|
52
|
+
width: width,
|
|
53
|
+
minWidth: minWidth
|
|
51
54
|
},
|
|
52
55
|
title: originalDiffTip ? _jsxs(_Fragment, {
|
|
53
56
|
children: ["\u521D\u59CB\u503C\uFF1A", originalValue, _jsx("br", {}), ellipsis ? "\u5F53\u524D\u503C\uFF1A".concat(currentValue) : undefined]
|
|
@@ -62,7 +65,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
62
65
|
return _jsx("span", {
|
|
63
66
|
className: "varied-cell",
|
|
64
67
|
style: {
|
|
65
|
-
width: width
|
|
68
|
+
width: width,
|
|
69
|
+
minWidth: minWidth
|
|
66
70
|
},
|
|
67
71
|
children: renderNode
|
|
68
72
|
});
|
|
@@ -133,7 +137,12 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
133
137
|
}
|
|
134
138
|
}, toolTipProps);
|
|
135
139
|
if (!value) {
|
|
136
|
-
return
|
|
140
|
+
return _jsx("div", {
|
|
141
|
+
style: {
|
|
142
|
+
minWidth: minWidth
|
|
143
|
+
},
|
|
144
|
+
children: "-"
|
|
145
|
+
});
|
|
137
146
|
}
|
|
138
147
|
return _jsx(_Tooltip, _objectSpread(_objectSpread({
|
|
139
148
|
title: value,
|
|
@@ -146,7 +155,8 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
146
155
|
}, tooltipProps), {}, {
|
|
147
156
|
children: _jsx(Text, {
|
|
148
157
|
style: {
|
|
149
|
-
width: width
|
|
158
|
+
width: width,
|
|
159
|
+
minWidth: minWidth
|
|
150
160
|
},
|
|
151
161
|
ellipsis: true,
|
|
152
162
|
onMouseOver: handleMouseOver,
|
|
@@ -155,6 +165,11 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
155
165
|
})
|
|
156
166
|
}));
|
|
157
167
|
}
|
|
158
|
-
return
|
|
168
|
+
return _jsx("div", {
|
|
169
|
+
style: {
|
|
170
|
+
minWidth: minWidth
|
|
171
|
+
},
|
|
172
|
+
children: value || value === 0 ? node : '-'
|
|
173
|
+
});
|
|
159
174
|
};
|
|
160
175
|
export default RenderColumn;
|
package/es/ProTable/index.js
CHANGED
|
@@ -204,18 +204,22 @@ function ProTable(props) {
|
|
|
204
204
|
}).filter(function (item) {
|
|
205
205
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
206
206
|
});
|
|
207
|
-
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
207
|
+
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item, index) {
|
|
208
208
|
formatColumn({
|
|
209
209
|
column: item,
|
|
210
210
|
originalObj: originalObj,
|
|
211
211
|
dataSourceObj: dataSourceObj,
|
|
212
212
|
rowKey: 'rowKey',
|
|
213
213
|
diffToolTip: toolTip,
|
|
214
|
-
wrapToolTipProps: wrapToolTipProps
|
|
214
|
+
wrapToolTipProps: wrapToolTipProps,
|
|
215
|
+
scroll: _scroll,
|
|
216
|
+
onUpdateMinWidth: function onUpdateMinWidth(w) {
|
|
217
|
+
curColumns[index].minWidth = w;
|
|
218
|
+
}
|
|
215
219
|
});
|
|
216
220
|
});
|
|
217
221
|
return newColumns;
|
|
218
|
-
}, [curColumns, handleResize]);
|
|
222
|
+
}, [curColumns, handleResize, _scroll]);
|
|
219
223
|
var _columns = useMemo(function () {
|
|
220
224
|
return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
|
|
221
225
|
var show = item.show;
|
|
@@ -228,9 +232,10 @@ function ProTable(props) {
|
|
|
228
232
|
return true;
|
|
229
233
|
});
|
|
230
234
|
}, [columns]);
|
|
231
|
-
var isExistPercentWidth = !!_columns.find(function (item) {
|
|
232
|
-
|
|
233
|
-
|
|
235
|
+
var isExistPercentWidth = !!(_columns === null || _columns === void 0 ? void 0 : _columns.find(function (item) {
|
|
236
|
+
var _item$width;
|
|
237
|
+
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('%'));
|
|
238
|
+
}));
|
|
234
239
|
if (isExistPercentWidth) {
|
|
235
240
|
_scroll = props === null || props === void 0 ? void 0 : props.scroll;
|
|
236
241
|
}
|
|
@@ -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
|
}
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -16,7 +17,7 @@ var _lodash = require("lodash");
|
|
|
16
17
|
var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
|
|
17
18
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
18
19
|
var _utils = require("../../../utils");
|
|
19
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "valuePropName"];
|
|
20
|
+
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName"];
|
|
20
21
|
var toNamePath = function toNamePath(name) {
|
|
21
22
|
if (Array.isArray(name)) {
|
|
22
23
|
return name;
|
|
@@ -70,6 +71,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
|
|
|
70
71
|
}) : (0, _lodash.get)(originalValues, originalName);
|
|
71
72
|
};
|
|
72
73
|
var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
74
|
+
var _getValueProps;
|
|
73
75
|
var name = props.name,
|
|
74
76
|
names = props.names,
|
|
75
77
|
namesStr = props.namesStr,
|
|
@@ -84,6 +86,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
84
86
|
children = props.children,
|
|
85
87
|
type = props.type,
|
|
86
88
|
normalize = props.normalize,
|
|
89
|
+
getValueProps = props.getValueProps,
|
|
87
90
|
_props$valuePropName = props.valuePropName,
|
|
88
91
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
89
92
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
@@ -116,7 +119,7 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
116
119
|
var isAdd = diffType === 'add';
|
|
117
120
|
var isChanged = diffType === 'changed';
|
|
118
121
|
if (!isWatch || noChange) {
|
|
119
|
-
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0,
|
|
122
|
+
return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest));
|
|
120
123
|
}
|
|
121
124
|
var diffClassName = (0, _classnames.default)({
|
|
122
125
|
'pro-form-item-changed': isChanged,
|
|
@@ -131,16 +134,14 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
131
134
|
return target.parentElement;
|
|
132
135
|
},
|
|
133
136
|
title: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
134
|
-
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0,
|
|
137
|
+
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
135
138
|
// @ts-ignore
|
|
136
|
-
isView: true
|
|
137
|
-
|
|
138
|
-
checked: type === 'Switch' ? originalValue : undefined
|
|
139
|
-
})) : undefined]
|
|
139
|
+
isView: true
|
|
140
|
+
}, valuePropName, getValueProps ? (_getValueProps = getValueProps(originalValue)) === null || _getValueProps === void 0 ? void 0 : _getValueProps[valuePropName] : props[valuePropName]), "checked", type === 'Switch' ? originalValue : undefined))) : undefined]
|
|
140
141
|
}),
|
|
141
142
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
142
143
|
className: diffClassName,
|
|
143
|
-
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0,
|
|
144
|
+
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest)) : undefined
|
|
144
145
|
})
|
|
145
146
|
});
|
|
146
147
|
};
|
|
@@ -49,7 +49,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
49
49
|
}
|
|
50
50
|
var logDebug = function logDebug(msg) {
|
|
51
51
|
if (props.debugger) {
|
|
52
|
-
console.
|
|
52
|
+
console.warn('proEnum:', msg);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
var enumRes = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|