@zat-design/sisyphus-react 3.8.3-beta.3 → 3.8.3-beta.5

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.
@@ -89,7 +89,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
89
89
  return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
90
90
  }, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
91
91
  var _useSetState = useSetState({
92
- _columns: columns,
93
92
  cellNamePath: [],
94
93
  forceUpdate: {},
95
94
  editingKeys: [],
@@ -109,7 +109,6 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
109
109
  }
110
110
  export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
111
111
  export interface State {
112
- _columns: ProEditTableColumnsProps[];
113
112
  cellNamePath: NamePath[];
114
113
  forceUpdate: {};
115
114
  editingKeys: string[];
@@ -335,14 +335,21 @@ export var transformColumns = function transformColumns() {
335
335
  });
336
336
  }
337
337
  // 单行多行交互有较大差异
338
- return _jsx("div", {
338
+ return _jsxs("div", {
339
339
  className: cellClassName,
340
340
  onClick: function onClick() {
341
341
  isCanEdit && setState({
342
342
  cellNamePath: cellName
343
343
  });
344
344
  },
345
- children: _jsx(RenderField, {
345
+ children: [index === 0 && !item.width ? _jsx("div", {
346
+ style: {
347
+ visibility: 'hidden',
348
+ height: 0,
349
+ paddingLeft: (item === null || item === void 0 ? void 0 : item.required) ? 16 : 0
350
+ },
351
+ children: columnTitle
352
+ }) : null, _jsx(RenderField, {
346
353
  text: _text,
347
354
  record: record,
348
355
  index: index,
@@ -351,7 +358,7 @@ export var transformColumns = function transformColumns() {
351
358
  cellName: cellName,
352
359
  isEditing: isEditing // 是否正在编辑
353
360
  })
354
- })
361
+ })]
355
362
  });
356
363
  };
357
364
  item.render = _render;
@@ -54,7 +54,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
54
54
  var isChanged = diffType === 'changed';
55
55
  var tipContent = useMemo(function () {
56
56
  if (!isWatch || noChange) return undefined;
57
- var valueProps = getValueProps ? getValueProps(originalValue) : originalValue;
57
+ var valueProps = getValueProps && !names ? getValueProps(originalValue) : {
58
+ value: originalValue
59
+ };
58
60
  return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
59
61
  isView: true
60
62
  }, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
@@ -384,17 +384,25 @@ export var formatColumn = function formatColumn(_ref2) {
384
384
  code: code,
385
385
  value: originalRealValue
386
386
  });
387
- return _jsx(ProForm.ProCascader, {
387
+ var renderNode = _jsx(ProForm.ProCascader, {
388
388
  className: className,
389
389
  isView: true,
390
390
  mode: "address",
391
391
  code: code,
392
392
  value: realValue,
393
- tooltip: originalValue !== undefined ? _jsxs(_Fragment, {
394
- children: ["\u521D\u59CB\u503C\uFF1A", originalRenderValue, _jsx("br", {}), ellipsis ? _jsxs(_Fragment, {
395
- children: ["\u5F53\u524D\u503C\uFF1A", renderValue]
396
- }) : undefined]
397
- }) : ellipsis
393
+ tooltip: false
394
+ });
395
+ return _jsx(RenderColumn, {
396
+ valueType: valueType,
397
+ originalValue: originalRealValue === undefined ? undefined : originalRenderValue,
398
+ ellipsis: ellipsis !== null && ellipsis !== void 0 ? ellipsis : true,
399
+ width: width,
400
+ node: renderNode,
401
+ value: value,
402
+ currentValue: renderValue,
403
+ originalDiffTip: _originalDiffTip,
404
+ toolTipProps: _toolTipProps,
405
+ minWidth: minWidth
398
406
  });
399
407
  };
400
408
  } else if (copyable) {
@@ -4,7 +4,7 @@ import _Tooltip from "antd/es/tooltip";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import "antd/es/typography/style";
6
6
  import _Typography from "antd/es/typography";
7
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
7
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
8
  import { useSetState } from 'ahooks';
9
9
  import { CheckOutlined } from '@ant-design/icons';
10
10
  import { ReactSVG } from 'react-svg';
@@ -53,7 +53,9 @@ var RenderColumn = function RenderColumn(props) {
53
53
  minWidth: minWidth
54
54
  },
55
55
  title: originalDiffTip ? _jsxs(_Fragment, {
56
- children: ["\u521D\u59CB\u503C\uFF1A", originalValue, _jsx("br", {}), ellipsis ? "\u5F53\u524D\u503C\uFF1A".concat(currentValue) : undefined]
56
+ children: ["\u521D\u59CB\u503C\uFF1A", originalValue, _jsx("br", {}), ellipsis ? _jsxs("span", {
57
+ children: ["\u5F53\u524D\u503C\uFF1A", currentValue]
58
+ }) : undefined]
57
59
  }) : node,
58
60
  getPopupContainer: function getPopupContainer(triggerNode) {
59
61
  return triggerNode.parentNode;
@@ -92,7 +92,6 @@ var ProEditTable = function ProEditTable(_ref, ref) {
92
92
  return (_ref2 = (_themeConfig$data$zau = themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data = themeConfig.data) === null || _themeConfig$data === void 0 ? void 0 : _themeConfig$data.zauiFormAlign) !== null && _themeConfig$data$zau !== void 0 ? _themeConfig$data$zau : configRequiredAlign) !== null && _ref2 !== void 0 ? _ref2 : 'left';
93
93
  }, [themeConfig === null || themeConfig === void 0 ? void 0 : (_themeConfig$data2 = themeConfig.data) === null || _themeConfig$data2 === void 0 ? void 0 : _themeConfig$data2.zauiFormAlign]);
94
94
  var _useSetState = (0, _ahooks.useSetState)({
95
- _columns: columns,
96
95
  cellNamePath: [],
97
96
  forceUpdate: {},
98
97
  editingKeys: [],
@@ -109,7 +109,6 @@ export interface ProColumnsProps<Values = any, T = any> extends Omit<FormItemPro
109
109
  }
110
110
  export type ProEditTableColumnsProps<K = any> = ProColumnsProps & ColumnPropsMap<K, 'ProEditTable'>;
111
111
  export interface State {
112
- _columns: ProEditTableColumnsProps[];
113
112
  cellNamePath: NamePath[];
114
113
  forceUpdate: {};
115
114
  editingKeys: string[];
@@ -339,14 +339,21 @@ var transformColumns = exports.transformColumns = function transformColumns() {
339
339
  });
340
340
  }
341
341
  // 单行多行交互有较大差异
342
- return (0, _jsxRuntime.jsx)("div", {
342
+ return (0, _jsxRuntime.jsxs)("div", {
343
343
  className: cellClassName,
344
344
  onClick: function onClick() {
345
345
  isCanEdit && setState({
346
346
  cellNamePath: cellName
347
347
  });
348
348
  },
349
- children: (0, _jsxRuntime.jsx)(_components.RenderField, {
349
+ children: [index === 0 && !item.width ? (0, _jsxRuntime.jsx)("div", {
350
+ style: {
351
+ visibility: 'hidden',
352
+ height: 0,
353
+ paddingLeft: (item === null || item === void 0 ? void 0 : item.required) ? 16 : 0
354
+ },
355
+ children: columnTitle
356
+ }) : null, (0, _jsxRuntime.jsx)(_components.RenderField, {
350
357
  text: _text,
351
358
  record: record,
352
359
  index: index,
@@ -355,7 +362,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
355
362
  cellName: cellName,
356
363
  isEditing: isEditing // 是否正在编辑
357
364
  })
358
- })
365
+ })]
359
366
  });
360
367
  };
361
368
  item.render = _render;
@@ -59,7 +59,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
59
59
  var isChanged = diffType === 'changed';
60
60
  var tipContent = (0, _react.useMemo)(function () {
61
61
  if (!isWatch || noChange) return undefined;
62
- var valueProps = getValueProps ? getValueProps(originalValue) : originalValue;
62
+ var valueProps = getValueProps && !names ? getValueProps(originalValue) : {
63
+ value: originalValue
64
+ };
63
65
  return /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), {}, (0, _defineProperty2.default)({
64
66
  isView: true
65
67
  }, valuePropName, valueProps === null || valueProps === void 0 ? void 0 : valueProps.value))) : undefined;
@@ -390,17 +390,25 @@ var formatColumn = exports.formatColumn = function formatColumn(_ref2) {
390
390
  code: code,
391
391
  value: originalRealValue
392
392
  });
393
- return (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
393
+ var renderNode = (0, _jsxRuntime.jsx)(_ProForm.default.ProCascader, {
394
394
  className: className,
395
395
  isView: true,
396
396
  mode: "address",
397
397
  code: code,
398
398
  value: realValue,
399
- tooltip: originalValue !== undefined ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
400
- children: ["\u521D\u59CB\u503C\uFF1A", originalRenderValue, (0, _jsxRuntime.jsx)("br", {}), ellipsis ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
401
- children: ["\u5F53\u524D\u503C\uFF1A", renderValue]
402
- }) : undefined]
403
- }) : ellipsis
399
+ tooltip: false
400
+ });
401
+ return (0, _jsxRuntime.jsx)(_RenderColumn.default, {
402
+ valueType: valueType,
403
+ originalValue: originalRealValue === undefined ? undefined : originalRenderValue,
404
+ ellipsis: ellipsis !== null && ellipsis !== void 0 ? ellipsis : true,
405
+ width: width,
406
+ node: renderNode,
407
+ value: value,
408
+ currentValue: renderValue,
409
+ originalDiffTip: _originalDiffTip,
410
+ toolTipProps: _toolTipProps,
411
+ minWidth: minWidth
404
412
  });
405
413
  };
406
414
  } else if (copyable) {
@@ -57,7 +57,9 @@ var RenderColumn = function RenderColumn(props) {
57
57
  minWidth: minWidth
58
58
  },
59
59
  title: originalDiffTip ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
60
- children: ["\u521D\u59CB\u503C\uFF1A", originalValue, (0, _jsxRuntime.jsx)("br", {}), ellipsis ? "\u5F53\u524D\u503C\uFF1A".concat(currentValue) : undefined]
60
+ children: ["\u521D\u59CB\u503C\uFF1A", originalValue, (0, _jsxRuntime.jsx)("br", {}), ellipsis ? (0, _jsxRuntime.jsxs)("span", {
61
+ children: ["\u5F53\u524D\u503C\uFF1A", currentValue]
62
+ }) : undefined]
61
63
  }) : node,
62
64
  getPopupContainer: function getPopupContainer(triggerNode) {
63
65
  return triggerNode.parentNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.8.3-beta.3",
3
+ "version": "3.8.3-beta.5",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "kisstkondoros.vscode-codemetrics"
4
- ]
5
- }