@zat-design/sisyphus-react 3.7.0 → 3.7.1-beta.1

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.
Files changed (76) hide show
  1. package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
  2. package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
  3. package/coverage/lcov-report/src/.umi/core/index.html +206 -0
  4. package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
  5. package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
  6. package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
  7. package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
  8. package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
  9. package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
  10. package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
  11. package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
  12. package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
  13. package/coverage/lcov-report/src/.umi/index.html +116 -0
  14. package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
  15. package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
  16. package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
  17. package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
  18. package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
  19. package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
  20. package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
  21. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
  22. package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
  23. package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
  24. package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
  25. package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
  26. package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
  27. package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
  28. package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
  29. package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
  30. package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
  31. package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
  32. package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
  33. package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
  34. package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
  35. package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
  36. package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
  37. package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
  38. package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
  39. package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
  40. package/dist/index.esm.css +30 -4
  41. package/dist/less.esm.css +30 -4
  42. package/es/ProEditTable/style/index.less +0 -1
  43. package/es/ProEditTable/utils/index.js +2 -2
  44. package/es/ProEnum/hooks/useEnumRequest.js +3 -0
  45. package/es/ProEnum/utils/index.js +1 -1
  46. package/es/ProForm/components/base/Select/index.js +1 -0
  47. package/es/ProForm/components/combination/ProModalSelect/index.js +4 -3
  48. package/es/ProForm/components/combination/ProModalSelect/style/index.less +37 -4
  49. package/es/ProForm/components/render/ConfirmWrapper.js +2 -1
  50. package/es/ProForm/components/render/propsType.d.ts +1 -1
  51. package/es/ProLayout/style/index.less +0 -1
  52. package/es/ProSelect/index.js +4 -0
  53. package/es/ProTable/components/RcTable/components/BaseTable/index.js +0 -1
  54. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +1 -1
  55. package/es/ProTable/components/RenderColumn/index.js +71 -12
  56. package/es/ProTable/components/RenderFooter/index.js +5 -3
  57. package/es/ProTable/index.js +14 -2
  58. package/es/ProTable/style/index.less +1 -2
  59. package/lib/ProEditTable/style/index.less +0 -1
  60. package/lib/ProEditTable/utils/index.js +1 -1
  61. package/lib/ProEnum/hooks/useEnumRequest.js +3 -0
  62. package/lib/ProEnum/utils/index.js +1 -1
  63. package/lib/ProForm/components/base/Select/index.js +1 -0
  64. package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -2
  65. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +37 -4
  66. package/lib/ProForm/components/render/ConfirmWrapper.js +2 -1
  67. package/lib/ProForm/components/render/propsType.d.ts +1 -1
  68. package/lib/ProLayout/style/index.less +0 -1
  69. package/lib/ProSelect/index.js +4 -0
  70. package/lib/ProTable/components/RcTable/components/BaseTable/index.js +0 -1
  71. package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +1 -1
  72. package/lib/ProTable/components/RenderColumn/index.js +71 -12
  73. package/lib/ProTable/components/RenderFooter/index.js +5 -3
  74. package/lib/ProTable/index.js +13 -1
  75. package/lib/ProTable/style/index.less +1 -2
  76. package/package.json +1 -1
@@ -1,9 +1,11 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import "antd/es/tooltip/style";
3
3
  import _Tooltip from "antd/es/tooltip";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
5
  import "antd/es/typography/style";
5
6
  import _Typography from "antd/es/typography";
6
7
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { useSetState } from 'ahooks';
7
9
  import { CheckOutlined } from '@ant-design/icons';
8
10
  import { ReactSVG } from 'react-svg';
9
11
  import copySvg from '../../../assets/copy.svg';
@@ -22,6 +24,12 @@ var RenderColumn = function RenderColumn(props) {
22
24
  originalDiffTip = props.originalDiffTip,
23
25
  _props$toolTipProps = props.toolTipProps,
24
26
  toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps;
27
+ var _useSetState = useSetState({
28
+ tooltip: false
29
+ }),
30
+ _useSetState2 = _slicedToArray(_useSetState, 2),
31
+ tooltip = _useSetState2[0].tooltip,
32
+ setState = _useSetState2[1];
25
33
  if (originalValue !== undefined) {
26
34
  var renderNode = value ? node : '-';
27
35
  if (ellipsis || originalDiffTip) {
@@ -82,19 +90,70 @@ var RenderColumn = function RenderColumn(props) {
82
90
  });
83
91
  }
84
92
  if (ellipsis) {
85
- return value ? _jsx(Text, {
86
- style: {
87
- width: width
88
- },
89
- ellipsis: {
90
- tooltip: _objectSpread({
91
- getPopupContainer: function getPopupContainer(triggerNode) {
92
- return triggerNode.parentNode;
93
- }
94
- }, toolTipProps)
93
+ var getPadding = function getPadding(el) {
94
+ var style = window.getComputedStyle(el, null);
95
+ var paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
96
+ var paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
97
+ var paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
98
+ var paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0;
99
+ return {
100
+ pLeft: paddingLeft,
101
+ pRight: paddingRight,
102
+ pTop: paddingTop,
103
+ pBottom: paddingBottom
104
+ };
105
+ };
106
+ var checkEllipsis = function checkEllipsis(box) {
107
+ var range = document.createRange();
108
+ range.setStart(box, 0);
109
+ range.setEnd(box, box.childNodes.length);
110
+ var rangeWidth = range.getBoundingClientRect().width;
111
+ var rangeHeight = range.getBoundingClientRect().height;
112
+ var contentWidth = rangeWidth - Math.floor(rangeWidth);
113
+ var _getPadding = getPadding(box),
114
+ pLeft = _getPadding.pLeft,
115
+ pRight = _getPadding.pRight,
116
+ pTop = _getPadding.pTop,
117
+ pBottom = _getPadding.pBottom;
118
+ var horizontalPadding = pLeft + pRight;
119
+ var verticalPadding = pTop + pBottom;
120
+ if (rangeWidth + horizontalPadding > box.clientWidth) {
121
+ return true;
122
+ }
123
+ return false;
124
+ };
125
+ var handleMouseOver = function handleMouseOver(e) {
126
+ setState({
127
+ tooltip: checkEllipsis(e.target)
128
+ });
129
+ };
130
+ var tooltipProps = _objectSpread({
131
+ getPopupContainer: function getPopupContainer(triggerNode) {
132
+ return triggerNode.parentNode;
133
+ }
134
+ }, toolTipProps);
135
+ if (!value) {
136
+ return '-';
137
+ }
138
+ return _jsx(_Tooltip, _objectSpread(_objectSpread({
139
+ title: value,
140
+ onOpenChange: function onOpenChange(open) {
141
+ setState({
142
+ tooltip: false
143
+ });
95
144
  },
96
- children: node
97
- }) : '-';
145
+ open: tooltip
146
+ }, tooltipProps), {}, {
147
+ children: _jsx(Text, {
148
+ style: {
149
+ width: width
150
+ },
151
+ ellipsis: true,
152
+ onMouseOver: handleMouseOver,
153
+ onFocus: handleMouseOver,
154
+ children: node
155
+ })
156
+ }));
98
157
  }
99
158
  return value || value === 0 ? node : '-';
100
159
  };
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  var RenderFooter = function RenderFooter(props) {
3
3
  var _ref = props || {},
4
- footerRender = _ref.footerRender,
5
- pagination = _ref.pagination,
6
- _dataSource = _ref._dataSource;
4
+ dataSource = _ref.dataSource;
5
+ var _ref2 = dataSource || {},
6
+ footerRender = _ref2.footerRender,
7
+ pagination = _ref2.pagination,
8
+ _dataSource = _ref2._dataSource;
7
9
  return footerRender ? _jsx("div", {
8
10
  className: "pro-table-footer ".concat(pagination && !!(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.length) ? 'has-page' : 'no-page'),
9
11
  children: typeof footerRender === 'function' ? footerRender() : footerRender
@@ -9,7 +9,7 @@ var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stri
9
9
  _excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
10
10
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { useEffect, useMemo, useState, createContext } from 'react';
12
- import { get, keyBy, assign, isObject } from 'lodash';
12
+ import { get, keyBy, assign, isObject, isFunction, isBoolean } from 'lodash';
13
13
  import { useDebounceEffect, useDeepCompareEffect, useSetState } from 'ahooks';
14
14
  import classnames from 'classnames';
15
15
  import { useProConfig } from '../index';
@@ -192,6 +192,18 @@ function ProTable(props) {
192
192
  });
193
193
  return newColumns;
194
194
  }, [curColumns, handleResize]);
195
+ var _columns = useMemo(function () {
196
+ return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
197
+ var show = item.show;
198
+ if (isBoolean(show)) {
199
+ return show;
200
+ }
201
+ if (isFunction(show)) {
202
+ return show(item, index);
203
+ }
204
+ return true;
205
+ });
206
+ }, [columns]);
195
207
  var handleColumnConfig = /*#__PURE__*/function () {
196
208
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(checkList) {
197
209
  var newColumns, _columnConfig$onColum, catchColumns;
@@ -361,7 +373,7 @@ function ProTable(props) {
361
373
  tableProps: {
362
374
  value: _dataSource,
363
375
  headerRender: headerRender,
364
- columns: columns,
376
+ columns: _columns,
365
377
  renderRowSelection: renderRowSelection,
366
378
  rowClassName: _rowClassName,
367
379
  disabled: disabled,
@@ -403,7 +403,6 @@
403
403
  }
404
404
 
405
405
  .@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
406
- white-space: nowrap;
407
406
  background: var(--zaui-table-header-bg, #f2f3f5);
408
407
  border-bottom: 0;
409
408
 
@@ -558,4 +557,4 @@
558
557
  }
559
558
  }
560
559
  }
561
- }
560
+ }
@@ -206,7 +206,6 @@
206
206
 
207
207
  .@{ant-prefix}-table-thead>tr>th {
208
208
  border : 0;
209
- white-space : nowrap;
210
209
  background-color: var(--zaui-table-header-bg, #f2f3f5);
211
210
  }
212
211
 
@@ -288,7 +288,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
288
288
  if (!(_cacheMap === null || _cacheMap === void 0 ? void 0 : (_cacheMap$item$dataIn = _cacheMap[item.dataIndex]) === null || _cacheMap$item$dataIn === void 0 ? void 0 : (_cacheMap$item$dataIn2 = _cacheMap$item$dataIn.dataSource) === null || _cacheMap$item$dataIn2 === void 0 ? void 0 : _cacheMap$item$dataIn2.length)) {
289
289
  var _item$fieldProps, _item$fieldProps2;
290
290
  _cacheMap[item.dataIndex] = {
291
- useRequest: (0, _lodash.cloneDeep)((_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.useRequest),
291
+ useRequest: (_item$fieldProps = item.fieldProps) === null || _item$fieldProps === void 0 ? void 0 : _item$fieldProps.useRequest,
292
292
  dataSource: [],
293
293
  transformResponse: (_item$fieldProps2 = item.fieldProps) === null || _item$fieldProps2 === void 0 ? void 0 : _item$fieldProps2.transformResponse
294
294
  };
@@ -98,6 +98,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
98
98
  // 忽略清洗的 codes
99
99
  ignoreCodes = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.ignoreCodes) || [];
100
100
  Object.keys(response).forEach(function (key) {
101
+ if (!response[key] || !Array.isArray(response[key])) {
102
+ return;
103
+ }
101
104
  var options = (0, _toConsumableArray2.default)(response[key]) || [];
102
105
  if (ignoreCodes.includes(key)) {
103
106
  response[key] = options;
@@ -87,7 +87,7 @@ function cacheFieldNames(fieldNames, dataSource) {
87
87
  });
88
88
  // 递归去对数据进行清洗
89
89
  if (children && Array.isArray(dataSource[children])) {
90
- result[children] = dataSource[children].map(function (item) {
90
+ result.children = dataSource[children].map(function (item) {
91
91
  return cacheFieldNames(fieldNames, item);
92
92
  });
93
93
  }
@@ -64,6 +64,7 @@ var Select = function Select(props) {
64
64
  }, initialConfig), {}, {
65
65
  options: dataSource
66
66
  }, rest), {}, {
67
+ value: rest.value === '' ? null : rest.value,
67
68
  fieldNames: _fieldNames
68
69
  }));
69
70
  };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
11
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
13
  var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
@@ -404,8 +405,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
404
405
  }
405
406
  if (record === null || record === void 0 ? void 0 : record.disabled) return;
406
407
  var selectedValue = getRowKey(record);
407
- var tempSelectedRows = (0, _lodash.cloneDeep)(selectedRows);
408
- var tempSelectedRowKeys = (0, _lodash.cloneDeep)(selectedRowKeys);
408
+ var tempSelectedRows = (0, _toConsumableArray2.default)(selectedRows);
409
+ var tempSelectedRowKeys = (0, _toConsumableArray2.default)(selectedRowKeys);
409
410
  if (isMultiple) {
410
411
  var rowIndex = tempSelectedRows.findIndex(function (item) {
411
412
  return getRowKey(item) === selectedValue;
@@ -57,7 +57,7 @@
57
57
  .@{ant-prefix}-input-affix-wrapper {
58
58
  border-top-right-radius: 0;
59
59
  border-bottom-right-radius: 0;
60
- &.ant-input-affix-wrapper-status-error{
60
+ &.@{ant-prefix}-input-affix-wrapper-status-error{
61
61
  & + .@{ant-prefix}-btn{
62
62
  border: 1px solid var(--ant-error-color);
63
63
  >.viewSvg{
@@ -74,6 +74,36 @@
74
74
  }
75
75
  }
76
76
 
77
+ .@{ant-prefix}-input-compact-item:not(.@{ant-prefix}-input-compact-last-item):not(.@{ant-prefix}-input-compact-item-rtl){
78
+ margin-right: 0;
79
+ }
80
+
81
+ .@{ant-prefix}-btn-compact-item.@{ant-prefix}-btn.@{ant-prefix}-btn-compact-last-item:not(.@{ant-prefix}-btn-compact-first-item):not(.@{ant-prefix}-btn-compact-item-rtl){
82
+ &:hover{
83
+ position: relative;
84
+ transition: none;
85
+ &::before{
86
+ opacity: 1;
87
+ }
88
+ }
89
+ &::before{
90
+ content: '';
91
+ position: absolute;
92
+ top: -1px;
93
+ left: -1px;
94
+ width: 1px;
95
+ height: calc(100% + 2px);
96
+ background:var(--ant-primary-color-hover);
97
+ opacity: 0;
98
+ display: block;
99
+ }
100
+ }
101
+
102
+ .@{ant-prefix}-input-affix-wrapper-status-error{
103
+
104
+ }
105
+
106
+
77
107
  .@{ant-prefix}-input-group-wrapper-status-error {
78
108
  &:hover {
79
109
  .@{ant-prefix}-input,
@@ -109,7 +139,7 @@
109
139
 
110
140
  .@{ant-prefix}-space-compact {
111
141
  .@{ant-prefix}-select-compact-item-div:has(.@{ant-prefix}-select-status-error) {
112
- & + .ant-btn-compact-last-item {
142
+ & + .@{ant-prefix}-btn-compact-last-item {
113
143
  border-top: 1px solid var(--ant-error-color);
114
144
  border-right: 1px solid var(--ant-error-color);
115
145
  border-bottom: 1px solid var(--ant-error-color);
@@ -119,7 +149,7 @@
119
149
  }
120
150
  }
121
151
  .@{ant-prefix}-btn-compact-last-item{
122
- border-left: none;
152
+ border-left: none !important;
123
153
  }
124
154
  }
125
155
 
@@ -138,9 +168,12 @@
138
168
  // 报错信息
139
169
  .@{ant-prefix}-form-item-has-error{
140
170
  .pro-modal-select{
141
- .ant-btn-compact-last-item{
171
+ .@{ant-prefix}-btn-compact-last-item{
142
172
  color: @zaui-danger;
143
173
  border-color: @zaui-danger;
174
+ &::before{
175
+ background: @zaui-danger !important;
176
+ }
144
177
  }
145
178
  }
146
179
  }
@@ -52,7 +52,8 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
52
52
  form: form,
53
53
  namePath: otherProps.namePath,
54
54
  name: otherProps.name,
55
- index: otherProps.index
55
+ index: otherProps.index,
56
+ preValue: form.getFieldValue(otherProps.listName || otherProps.name)
56
57
  });
57
58
  case 5:
58
59
  _context.t0 = _context.sent;
@@ -220,7 +220,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
220
220
  extra?: string | React.ReactNode;
221
221
  /** 是否固定字段, 不隐藏 */
222
222
  fixed?: boolean;
223
- confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
223
+ confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void | Promise<boolean | ModalFuncProps | void>>;
224
224
  /** 防抖模式 */
225
225
  debounceWait?: number;
226
226
  }
@@ -242,7 +242,6 @@
242
242
  }
243
243
 
244
244
  .pro-layout-open-menu .@{ant-prefix}-menu-item-selected {
245
- padding-right: 16px;
246
245
  &::after {
247
246
  display: none;
248
247
  }
@@ -269,6 +269,10 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
269
269
  return option === null || option === void 0 ? void 0 : option[code];
270
270
  }
271
271
  }
272
+ // 修复空字符placeholder不显示
273
+ if (value === '') {
274
+ return null;
275
+ }
272
276
  return value;
273
277
  };
274
278
  var newSelectList = selectList;
@@ -31,7 +31,6 @@ var BaseTable = function BaseTable(_ref) {
31
31
  return null;
32
32
  };
33
33
  return (0, _jsxRuntime.jsx)(_antd.Table, (0, _objectSpread2.default)((0, _objectSpread2.default)({
34
- className: "pro-edit-table-drag",
35
34
  components: renderComponents(),
36
35
  columns: columns,
37
36
  locale: {
@@ -19,7 +19,7 @@ var _excluded = ["dataSource", "tableProps", "draggableProps", "summaryProps", "
19
19
  * @Author: za-xuwenli xuwenli@zhongan.io
20
20
  * @Date: 2024-08-09 13:48:59
21
21
  * @LastEditors: za-xuwenli xuwenli@zhongan.io
22
- * @LastEditTime: 2024-08-20 19:31:24
22
+ * @LastEditTime: 2024-08-27 15:27:44
23
23
  * @FilePath: /za-material-warehouse/src/ProTable/components/RcTable/components/DraggableTable/index.tsx
24
24
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
25
25
  */
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _jsxRuntime = require("react/jsx-runtime");
10
11
  var _antd = require("antd");
12
+ var _ahooks = require("ahooks");
11
13
  var _icons = require("@ant-design/icons");
12
14
  var _reactSvg = require("react-svg");
13
15
  var _copy = _interopRequireDefault(require("../../../assets/copy.svg"));
@@ -26,6 +28,12 @@ var RenderColumn = function RenderColumn(props) {
26
28
  originalDiffTip = props.originalDiffTip,
27
29
  _props$toolTipProps = props.toolTipProps,
28
30
  toolTipProps = _props$toolTipProps === void 0 ? {} : _props$toolTipProps;
31
+ var _useSetState = (0, _ahooks.useSetState)({
32
+ tooltip: false
33
+ }),
34
+ _useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
35
+ tooltip = _useSetState2[0].tooltip,
36
+ setState = _useSetState2[1];
29
37
  if (originalValue !== undefined) {
30
38
  var renderNode = value ? node : '-';
31
39
  if (ellipsis || originalDiffTip) {
@@ -86,19 +94,70 @@ var RenderColumn = function RenderColumn(props) {
86
94
  });
87
95
  }
88
96
  if (ellipsis) {
89
- return value ? (0, _jsxRuntime.jsx)(Text, {
90
- style: {
91
- width: width
92
- },
93
- ellipsis: {
94
- tooltip: (0, _objectSpread2.default)({
95
- getPopupContainer: function getPopupContainer(triggerNode) {
96
- return triggerNode.parentNode;
97
- }
98
- }, toolTipProps)
97
+ var getPadding = function getPadding(el) {
98
+ var style = window.getComputedStyle(el, null);
99
+ var paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0;
100
+ var paddingRight = Number.parseInt(style.paddingRight, 10) || 0;
101
+ var paddingTop = Number.parseInt(style.paddingTop, 10) || 0;
102
+ var paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0;
103
+ return {
104
+ pLeft: paddingLeft,
105
+ pRight: paddingRight,
106
+ pTop: paddingTop,
107
+ pBottom: paddingBottom
108
+ };
109
+ };
110
+ var checkEllipsis = function checkEllipsis(box) {
111
+ var range = document.createRange();
112
+ range.setStart(box, 0);
113
+ range.setEnd(box, box.childNodes.length);
114
+ var rangeWidth = range.getBoundingClientRect().width;
115
+ var rangeHeight = range.getBoundingClientRect().height;
116
+ var contentWidth = rangeWidth - Math.floor(rangeWidth);
117
+ var _getPadding = getPadding(box),
118
+ pLeft = _getPadding.pLeft,
119
+ pRight = _getPadding.pRight,
120
+ pTop = _getPadding.pTop,
121
+ pBottom = _getPadding.pBottom;
122
+ var horizontalPadding = pLeft + pRight;
123
+ var verticalPadding = pTop + pBottom;
124
+ if (rangeWidth + horizontalPadding > box.clientWidth) {
125
+ return true;
126
+ }
127
+ return false;
128
+ };
129
+ var handleMouseOver = function handleMouseOver(e) {
130
+ setState({
131
+ tooltip: checkEllipsis(e.target)
132
+ });
133
+ };
134
+ var tooltipProps = (0, _objectSpread2.default)({
135
+ getPopupContainer: function getPopupContainer(triggerNode) {
136
+ return triggerNode.parentNode;
137
+ }
138
+ }, toolTipProps);
139
+ if (!value) {
140
+ return '-';
141
+ }
142
+ return (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
143
+ title: value,
144
+ onOpenChange: function onOpenChange(open) {
145
+ setState({
146
+ tooltip: false
147
+ });
99
148
  },
100
- children: node
101
- }) : '-';
149
+ open: tooltip
150
+ }, tooltipProps), {}, {
151
+ children: (0, _jsxRuntime.jsx)(Text, {
152
+ style: {
153
+ width: width
154
+ },
155
+ ellipsis: true,
156
+ onMouseOver: handleMouseOver,
157
+ onFocus: handleMouseOver,
158
+ children: node
159
+ })
160
+ }));
102
161
  }
103
162
  return value || value === 0 ? node : '-';
104
163
  };
@@ -7,9 +7,11 @@ exports.default = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var RenderFooter = function RenderFooter(props) {
9
9
  var _ref = props || {},
10
- footerRender = _ref.footerRender,
11
- pagination = _ref.pagination,
12
- _dataSource = _ref._dataSource;
10
+ dataSource = _ref.dataSource;
11
+ var _ref2 = dataSource || {},
12
+ footerRender = _ref2.footerRender,
13
+ pagination = _ref2.pagination,
14
+ _dataSource = _ref2._dataSource;
13
15
  return footerRender ? (0, _jsxRuntime.jsx)("div", {
14
16
  className: "pro-table-footer ".concat(pagination && !!(_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.length) ? 'has-page' : 'no-page'),
15
17
  children: typeof footerRender === 'function' ? footerRender() : footerRender
@@ -199,6 +199,18 @@ function ProTable(props) {
199
199
  });
200
200
  return newColumns;
201
201
  }, [curColumns, handleResize]);
202
+ var _columns = (0, _react.useMemo)(function () {
203
+ return columns === null || columns === void 0 ? void 0 : columns.filter(function (item, index) {
204
+ var show = item.show;
205
+ if ((0, _lodash.isBoolean)(show)) {
206
+ return show;
207
+ }
208
+ if ((0, _lodash.isFunction)(show)) {
209
+ return show(item, index);
210
+ }
211
+ return true;
212
+ });
213
+ }, [columns]);
202
214
  var handleColumnConfig = /*#__PURE__*/function () {
203
215
  var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(checkList) {
204
216
  var newColumns, _columnConfig$onColum, catchColumns;
@@ -368,7 +380,7 @@ function ProTable(props) {
368
380
  tableProps: {
369
381
  value: _dataSource,
370
382
  headerRender: headerRender,
371
- columns: columns,
383
+ columns: _columns,
372
384
  renderRowSelection: renderRowSelection,
373
385
  rowClassName: _rowClassName,
374
386
  disabled: disabled,
@@ -403,7 +403,6 @@
403
403
  }
404
404
 
405
405
  .@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
406
- white-space: nowrap;
407
406
  background: var(--zaui-table-header-bg, #f2f3f5);
408
407
  border-bottom: 0;
409
408
 
@@ -558,4 +557,4 @@
558
557
  }
559
558
  }
560
559
  }
561
- }
560
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.7.0",
3
+ "version": "3.7.1-beta.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",