@zat-design/sisyphus-react 3.8.3-beta.12 → 3.8.3-beta.14

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.
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "kisstkondoros.vscode-codemetrics"
4
+ ]
5
+ }
@@ -3155,10 +3155,23 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3155
3155
  background: var(--zaui-contract-bg-add, #d2fff4);
3156
3156
  border-radius: 4px;
3157
3157
  }
3158
- .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
3158
+ .original-value-tootip {
3159
+ max-width: 100%;
3160
+ width: -webkit-max-content;
3161
+ width: -moz-max-content;
3162
+ width: max-content;
3163
+ z-index: 1;
3164
+ }
3165
+ .original-value-tootip .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
3159
3166
  white-space: nowrap;
3160
3167
  }
3161
- .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
3168
+ .original-value-tootip .changed-tooltip .original-value-container .pro-group .ant-space-compact {
3169
+ display: block;
3170
+ }
3171
+ .original-value-tootip .changed-tooltip .original-value-container .pro-group .pro-form-view-container {
3172
+ word-break: keep-all;
3173
+ }
3174
+ .original-value-tootip .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
3162
3175
  white-space: nowrap;
3163
3176
  }
3164
3177
  .pro-upload .pro-upload-dragger .pro-upload-handle-box {
package/dist/less.esm.css CHANGED
@@ -3155,10 +3155,23 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
3155
3155
  background: var(--zaui-contract-bg-add, #d2fff4);
3156
3156
  border-radius: 4px;
3157
3157
  }
3158
- .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
3158
+ .original-value-tootip {
3159
+ max-width: 100%;
3160
+ width: -webkit-max-content;
3161
+ width: -moz-max-content;
3162
+ width: max-content;
3163
+ z-index: 1;
3164
+ }
3165
+ .original-value-tootip .changed-tooltip .original-value-container .ant-space-item:nth-child(1) {
3159
3166
  white-space: nowrap;
3160
3167
  }
3161
- .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
3168
+ .original-value-tootip .changed-tooltip .original-value-container .pro-group .ant-space-compact {
3169
+ display: block;
3170
+ }
3171
+ .original-value-tootip .changed-tooltip .original-value-container .pro-group .pro-form-view-container {
3172
+ word-break: keep-all;
3173
+ }
3174
+ .original-value-tootip .changed-tooltip .current-value-container .ant-space-item:nth-child(1) {
3162
3175
  white-space: nowrap;
3163
3176
  }
3164
3177
  .pro-upload .pro-upload-dragger .pro-upload-handle-box {
@@ -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", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender"];
8
+ var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender", "diffConfig"];
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  import React, { useMemo } from 'react';
11
11
  import classNames from 'classnames';
@@ -66,6 +66,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
66
66
  }) : get(originalValues, originalName);
67
67
  };
68
68
  var ListChangedWrapper = function ListChangedWrapper(props) {
69
+ var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
69
70
  var name = props.name,
70
71
  names = props.names,
71
72
  namesStr = props.namesStr,
@@ -84,12 +85,14 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
84
85
  _props$valuePropName = props.valuePropName,
85
86
  valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
86
87
  viewRender = props.viewRender,
88
+ diffConfig = props.diffConfig,
87
89
  rest = _objectWithoutProperties(props, _excluded);
88
90
  var _ref2 = useProConfig('ProEditTable') || {},
89
91
  isDiffAll = _ref2.isDiffAll;
90
92
  var namePath = toNamePath(namesStr || name);
91
93
  var originalNamePath = toNamePath(originalName);
92
94
  var originalNamePaths = originalNames && toNamePaths(originalNames);
95
+ var toolTip = (_diffConfig$toolTip = diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
93
96
  var isWatch = Boolean(originalValues);
94
97
  var originalValue = isWatch ? getOriginalValue({
95
98
  namePath: namePath,
@@ -133,22 +136,47 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
133
136
  if (!isWatch || noChange) {
134
137
  return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest));
135
138
  }
139
+ var tipOpenCalc = function tipOpenCalc() {
140
+ if (!toolTip) return false;
141
+ // 传入undefined 鼠标移入显示移出隐藏
142
+ return isChanged ? undefined : false;
143
+ };
144
+ // @ts-ignore
145
+ var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
136
146
  var diffClassName = classNames({
137
147
  'pro-form-item-changed': isChanged,
138
148
  'pro-form-item-add': isAdd
139
149
  });
140
150
  return _jsx(_Tooltip, {
141
151
  // 传入undefined 鼠标移入显示移出隐藏
142
- open: isChanged ? undefined : false,
152
+ open: tipOpenCalc(),
143
153
  getPopupContainer: function getPopupContainer(target) {
144
154
  return target.parentElement;
145
155
  },
156
+ overlayStyle: {
157
+ zIndex: 99
158
+ },
146
159
  title: _jsxs(_Space, {
147
- children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
160
+ direction: "vertical",
161
+ className: "changed-tooltip",
162
+ children: [_jsxs(_Space, {
163
+ align: "start",
164
+ className: "original-value-container",
165
+ children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
166
+ }), _showEllipse && _jsxs(_Space, {
167
+ className: "current-value-container",
168
+ children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
169
+ isView: true
170
+ })) : undefined]
171
+ })]
148
172
  }),
149
173
  children: _jsx("div", {
150
174
  className: diffClassName,
151
- children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), rest)) : undefined
175
+ children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
176
+ otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
177
+ isDiffChange: isChanged
178
+ })
179
+ })) : undefined
152
180
  })
153
181
  });
154
182
  };
@@ -87,18 +87,19 @@ var ChangedWrapper = function ChangedWrapper(props) {
87
87
  '--zaui-contract-bg': changeTipColor,
88
88
  '--zaui-contract-bg-add': addTipColor
89
89
  };
90
+ // @ts-ignore
91
+ var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
90
92
  var diffClassName = classNames({
91
93
  'pro-form-item-changed': isChanged,
92
94
  'pro-form-item-add': isAdd
93
95
  });
94
- // @ts-ignore
95
- var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
96
96
  return _jsx(_Tooltip, {
97
97
  open: tipOpenCalc(),
98
- // mouseEnterDelay={1}
98
+ // open
99
99
  getPopupContainer: function getPopupContainer(target) {
100
100
  return target.parentElement;
101
101
  },
102
+ overlayClassName: "original-value-tootip",
102
103
  title: _jsxs(_Space, {
103
104
  direction: "vertical",
104
105
  className: "changed-tooltip",
@@ -480,15 +480,29 @@
480
480
  }
481
481
  }
482
482
 
483
- .changed-tooltip {
484
- .original-value-container {
485
- .ant-space-item:nth-child(1) {
486
- white-space: nowrap;
483
+ .original-value-tootip{
484
+ max-width: 100%;
485
+ width: max-content;
486
+ z-index: 1;
487
+ .changed-tooltip {
488
+ .original-value-container {
489
+ .ant-space-item:nth-child(1) {
490
+ white-space: nowrap;
491
+ }
492
+ .pro-group{
493
+ .ant-space-compact{
494
+ display: block;
495
+ }
496
+ .pro-form-view-container{
497
+ word-break: keep-all;
498
+ }
499
+ }
487
500
  }
488
- }
489
- .current-value-container {
490
- .ant-space-item:nth-child(1) {
491
- white-space: nowrap;
501
+ .current-value-container {
502
+ .ant-space-item:nth-child(1) {
503
+ white-space: nowrap;
504
+ }
492
505
  }
493
506
  }
494
- }
507
+ }
508
+
@@ -17,7 +17,7 @@ var _lodash = require("lodash");
17
17
  var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
18
18
  var _ProConfigProvider = require("../../../ProConfigProvider");
19
19
  var _utils = require("../../../utils");
20
- var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender"];
20
+ var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "getValueProps", "valuePropName", "viewRender", "diffConfig"];
21
21
  var toNamePath = function toNamePath(name) {
22
22
  if (Array.isArray(name)) {
23
23
  return name;
@@ -71,6 +71,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
71
71
  }) : (0, _lodash.get)(originalValues, originalName);
72
72
  };
73
73
  var ListChangedWrapper = function ListChangedWrapper(props) {
74
+ var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
74
75
  var name = props.name,
75
76
  names = props.names,
76
77
  namesStr = props.namesStr,
@@ -89,12 +90,14 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
89
90
  _props$valuePropName = props.valuePropName,
90
91
  valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
91
92
  viewRender = props.viewRender,
93
+ diffConfig = props.diffConfig,
92
94
  rest = (0, _objectWithoutProperties2.default)(props, _excluded);
93
95
  var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEditTable') || {},
94
96
  isDiffAll = _ref2.isDiffAll;
95
97
  var namePath = toNamePath(namesStr || name);
96
98
  var originalNamePath = toNamePath(originalName);
97
99
  var originalNamePaths = originalNames && toNamePaths(originalNames);
100
+ var toolTip = (_diffConfig$toolTip = diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
98
101
  var isWatch = Boolean(originalValues);
99
102
  var originalValue = isWatch ? getOriginalValue({
100
103
  namePath: namePath,
@@ -138,6 +141,13 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
138
141
  if (!isWatch || noChange) {
139
142
  return /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest));
140
143
  }
144
+ var tipOpenCalc = function tipOpenCalc() {
145
+ if (!toolTip) return false;
146
+ // 传入undefined 鼠标移入显示移出隐藏
147
+ return isChanged ? undefined : false;
148
+ };
149
+ // @ts-ignore
150
+ var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
141
151
  var diffClassName = (0, _classnames.default)({
142
152
  'pro-form-item-changed': isChanged,
143
153
  'pro-form-item-add': isAdd
@@ -146,16 +156,34 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
146
156
  // 传入undefined 鼠标移入显示移出隐藏
147
157
  , {
148
158
  // 传入undefined 鼠标移入显示移出隐藏
149
- open: isChanged ? undefined : false,
159
+ open: tipOpenCalc(),
150
160
  getPopupContainer: function getPopupContainer(target) {
151
161
  return target.parentElement;
152
162
  },
163
+ overlayStyle: {
164
+ zIndex: 99
165
+ },
153
166
  title: (0, _jsxRuntime.jsxs)(_antd.Space, {
154
- children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
167
+ direction: "vertical",
168
+ className: "changed-tooltip",
169
+ children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
170
+ align: "start",
171
+ className: "original-value-container",
172
+ children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
173
+ }), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
174
+ className: "current-value-container",
175
+ 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), {}, {
176
+ isView: true
177
+ })) : undefined]
178
+ })]
155
179
  }),
156
180
  children: (0, _jsxRuntime.jsx)("div", {
157
181
  className: diffClassName,
158
- children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest)) : undefined
182
+ children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
183
+ otherProps: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
184
+ isDiffChange: isChanged
185
+ })
186
+ })) : undefined
159
187
  })
160
188
  });
161
189
  };
@@ -92,18 +92,19 @@ var ChangedWrapper = function ChangedWrapper(props) {
92
92
  '--zaui-contract-bg': changeTipColor,
93
93
  '--zaui-contract-bg-add': addTipColor
94
94
  };
95
+ // @ts-ignore
96
+ var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
95
97
  var diffClassName = (0, _classnames.default)({
96
98
  'pro-form-item-changed': isChanged,
97
99
  'pro-form-item-add': isAdd
98
100
  });
99
- // @ts-ignore
100
- var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
101
101
  return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
102
102
  open: tipOpenCalc(),
103
- // mouseEnterDelay={1}
103
+ // open
104
104
  getPopupContainer: function getPopupContainer(target) {
105
105
  return target.parentElement;
106
106
  },
107
+ overlayClassName: "original-value-tootip",
107
108
  title: (0, _jsxRuntime.jsxs)(_antd.Space, {
108
109
  direction: "vertical",
109
110
  className: "changed-tooltip",
@@ -480,15 +480,29 @@
480
480
  }
481
481
  }
482
482
 
483
- .changed-tooltip {
484
- .original-value-container {
485
- .ant-space-item:nth-child(1) {
486
- white-space: nowrap;
483
+ .original-value-tootip{
484
+ max-width: 100%;
485
+ width: max-content;
486
+ z-index: 1;
487
+ .changed-tooltip {
488
+ .original-value-container {
489
+ .ant-space-item:nth-child(1) {
490
+ white-space: nowrap;
491
+ }
492
+ .pro-group{
493
+ .ant-space-compact{
494
+ display: block;
495
+ }
496
+ .pro-form-view-container{
497
+ word-break: keep-all;
498
+ }
499
+ }
487
500
  }
488
- }
489
- .current-value-container {
490
- .ant-space-item:nth-child(1) {
491
- white-space: nowrap;
501
+ .current-value-container {
502
+ .ant-space-item:nth-child(1) {
503
+ white-space: nowrap;
504
+ }
492
505
  }
493
506
  }
494
- }
507
+ }
508
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.8.3-beta.12",
3
+ "version": "3.8.3-beta.14",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",