@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.
- package/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/dist/index.esm.css +30 -4
- package/dist/less.esm.css +30 -4
- package/es/ProEditTable/style/index.less +0 -1
- package/es/ProEditTable/utils/index.js +2 -2
- package/es/ProEnum/hooks/useEnumRequest.js +3 -0
- package/es/ProEnum/utils/index.js +1 -1
- package/es/ProForm/components/base/Select/index.js +1 -0
- package/es/ProForm/components/combination/ProModalSelect/index.js +4 -3
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +37 -4
- package/es/ProForm/components/render/ConfirmWrapper.js +2 -1
- package/es/ProForm/components/render/propsType.d.ts +1 -1
- package/es/ProLayout/style/index.less +0 -1
- package/es/ProSelect/index.js +4 -0
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +0 -1
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +1 -1
- package/es/ProTable/components/RenderColumn/index.js +71 -12
- package/es/ProTable/components/RenderFooter/index.js +5 -3
- package/es/ProTable/index.js +14 -2
- package/es/ProTable/style/index.less +1 -2
- package/lib/ProEditTable/style/index.less +0 -1
- package/lib/ProEditTable/utils/index.js +1 -1
- package/lib/ProEnum/hooks/useEnumRequest.js +3 -0
- package/lib/ProEnum/utils/index.js +1 -1
- package/lib/ProForm/components/base/Select/index.js +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +37 -4
- package/lib/ProForm/components/render/ConfirmWrapper.js +2 -1
- package/lib/ProForm/components/render/propsType.d.ts +1 -1
- package/lib/ProLayout/style/index.less +0 -1
- package/lib/ProSelect/index.js +4 -0
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +0 -1
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +71 -12
- package/lib/ProTable/components/RenderFooter/index.js +5 -3
- package/lib/ProTable/index.js +13 -1
- package/lib/ProTable/style/index.less +1 -2
- 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
|
-
|
|
86
|
-
style
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
package/es/ProTable/index.js
CHANGED
|
@@ -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:
|
|
376
|
+
columns: _columns,
|
|
365
377
|
renderRowSelection: renderRowSelection,
|
|
366
378
|
rowClassName: _rowClassName,
|
|
367
379
|
disabled: disabled,
|
|
@@ -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: (
|
|
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
|
|
90
|
+
result.children = dataSource[children].map(function (item) {
|
|
91
91
|
return cacheFieldNames(fieldNames, item);
|
|
92
92
|
});
|
|
93
93
|
}
|
|
@@ -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,
|
|
408
|
-
var tempSelectedRowKeys = (0,
|
|
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
|
-
|
|
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
|
-
& +
|
|
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
|
-
|
|
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
|
}
|
package/lib/ProSelect/index.js
CHANGED
|
@@ -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-
|
|
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
|
-
|
|
90
|
-
style
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
package/lib/ProTable/index.js
CHANGED
|
@@ -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:
|
|
383
|
+
columns: _columns,
|
|
372
384
|
renderRowSelection: renderRowSelection,
|
|
373
385
|
rowClassName: _rowClassName,
|
|
374
386
|
disabled: disabled,
|