@zat-design/sisyphus-react 3.10.4-beta.1 → 3.10.4-beta.2
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/es/ProEditTable/components/RcTable/VirtualTable.d.ts +2 -5
- package/es/ProEditTable/components/RcTable/VirtualTable.js +5 -163
- package/es/ProEditTable/components/RcTable/index.d.ts +1 -1
- package/es/ProEditTable/components/RcTable/index.js +1 -1
- package/es/ProForm/components/base/InputNumber/index.js +2 -1
- package/es/ProStep/components/Item/index.d.ts +3 -3
- package/es/ProStep/components/Item/index.js +22 -6
- package/es/ProStep/index.d.ts +1 -1
- package/es/ProStep/propsType.d.ts +4 -1
- package/lib/ProEditTable/components/RcTable/VirtualTable.d.ts +2 -5
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -161
- package/lib/ProEditTable/components/RcTable/index.d.ts +1 -1
- package/lib/ProForm/components/base/InputNumber/index.js +2 -1
- package/lib/ProStep/components/Item/index.d.ts +3 -3
- package/lib/ProStep/components/Item/index.js +22 -6
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/ProStep/propsType.d.ts +4 -1
- package/package.json +5 -4
- package/.vscode/extensions.json +0 -5
@@ -1,6 +1,3 @@
|
|
1
|
-
|
2
|
-
declare const _default:
|
3
|
-
[x: string]: any;
|
4
|
-
tableProps: any;
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const _default: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
6
3
|
export default _default;
|
@@ -1,166 +1,8 @@
|
|
1
|
-
import "
|
2
|
-
import
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
var _excluded = ["tableProps"];
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
-
import { useEffect, useRef, useState, memo } from 'react';
|
9
|
-
import classNames from 'classnames';
|
10
|
-
import ResizeObserver from 'rc-resize-observer';
|
11
|
-
import { VariableSizeGrid } from 'react-window';
|
12
|
-
var VirtualTable = function VirtualTable(_ref) {
|
13
|
-
var _value$;
|
14
|
-
var tableProps = _ref.tableProps,
|
15
|
-
resetProps = _objectWithoutProperties(_ref, _excluded);
|
16
|
-
var value = tableProps.value,
|
17
|
-
headerRender = tableProps.headerRender,
|
18
|
-
tableRef = tableProps.tableRef,
|
19
|
-
className = tableProps.className,
|
20
|
-
columns = tableProps.columns,
|
21
|
-
renderRowSelection = tableProps.renderRowSelection,
|
22
|
-
rowClassName = tableProps.rowClassName,
|
23
|
-
disabled = tableProps.disabled,
|
24
|
-
virtualKey = tableProps.virtualKey,
|
25
|
-
editingKeys = tableProps.editingKeys,
|
26
|
-
isHideCheckBox = tableProps.isHideCheckBox,
|
27
|
-
rowDraggable = tableProps.rowDraggable,
|
28
|
-
scroll = tableProps.scroll,
|
29
|
-
summary = tableProps.summary;
|
30
|
-
var _useState = useState(0),
|
31
|
-
_useState2 = _slicedToArray(_useState, 2),
|
32
|
-
tableWidth = _useState2[0],
|
33
|
-
setTableWidth = _useState2[1];
|
34
|
-
var widthColumnCount = columns.filter(function (_ref2) {
|
35
|
-
var width = _ref2.width;
|
36
|
-
return !width;
|
37
|
-
}).length;
|
38
|
-
var mergedColumns = columns.map(function (column) {
|
39
|
-
if (column.width) {
|
40
|
-
return column;
|
41
|
-
}
|
42
|
-
return _objectSpread(_objectSpread({}, column), {}, {
|
43
|
-
width: Math.floor(tableWidth / widthColumnCount)
|
44
|
-
});
|
45
|
-
});
|
46
|
-
var gridRef = useRef();
|
47
|
-
var _useState3 = useState(function () {
|
48
|
-
var obj = {};
|
49
|
-
Object.defineProperty(obj, 'scrollLeft', {
|
50
|
-
get: function get() {
|
51
|
-
if (gridRef.current) {
|
52
|
-
var _gridRef$current, _gridRef$current$stat;
|
53
|
-
return (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : (_gridRef$current$stat = _gridRef$current.state) === null || _gridRef$current$stat === void 0 ? void 0 : _gridRef$current$stat.scrollLeft;
|
54
|
-
}
|
55
|
-
return null;
|
56
|
-
},
|
57
|
-
set: function set(scrollLeft) {
|
58
|
-
if (gridRef.current) {
|
59
|
-
gridRef.current.scrollTo({
|
60
|
-
scrollLeft: scrollLeft
|
61
|
-
});
|
62
|
-
}
|
63
|
-
}
|
64
|
-
});
|
65
|
-
return obj;
|
66
|
-
}),
|
67
|
-
_useState4 = _slicedToArray(_useState3, 1),
|
68
|
-
connectObject = _useState4[0];
|
69
|
-
var resetVirtualGrid = function resetVirtualGrid() {
|
70
|
-
var _gridRef$current2;
|
71
|
-
(_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.resetAfterIndices({
|
72
|
-
columnIndex: 0,
|
73
|
-
shouldForceUpdate: true
|
74
|
-
});
|
75
|
-
};
|
76
|
-
useEffect(function () {
|
77
|
-
return resetVirtualGrid;
|
78
|
-
}, [tableWidth]);
|
79
|
-
var renderVirtualList = function renderVirtualList(rawData, _ref3) {
|
80
|
-
var scrollbarSize = _ref3.scrollbarSize,
|
81
|
-
ref = _ref3.ref,
|
82
|
-
_onScroll = _ref3.onScroll;
|
83
|
-
ref.current = connectObject;
|
84
|
-
var totalHeight = rawData.length * 54;
|
85
|
-
return _jsx(VariableSizeGrid, {
|
86
|
-
ref: gridRef,
|
87
|
-
className: "virtual-grid",
|
88
|
-
columnCount: mergedColumns.length,
|
89
|
-
columnWidth: function columnWidth(index) {
|
90
|
-
var _width2;
|
91
|
-
var width = mergedColumns[index].width;
|
92
|
-
var _width = width;
|
93
|
-
if (typeof _width === 'string' && ((_width2 = _width) === null || _width2 === void 0 ? void 0 : _width2.includes('px'))) {
|
94
|
-
_width = parseInt(width, 10);
|
95
|
-
}
|
96
|
-
return totalHeight > scroll.y && index === mergedColumns.length - 1 ? _width - scrollbarSize - 1 : _width;
|
97
|
-
},
|
98
|
-
height: scroll.y,
|
99
|
-
rowCount: rawData.length,
|
100
|
-
rowHeight: function rowHeight() {
|
101
|
-
return 54;
|
102
|
-
},
|
103
|
-
width: tableWidth,
|
104
|
-
onScroll: function onScroll(_ref4) {
|
105
|
-
var scrollLeft = _ref4.scrollLeft;
|
106
|
-
_onScroll({
|
107
|
-
scrollLeft: scrollLeft
|
108
|
-
});
|
109
|
-
},
|
110
|
-
children: function children(_ref5) {
|
111
|
-
var columnIndex = _ref5.columnIndex,
|
112
|
-
rowIndex = _ref5.rowIndex,
|
113
|
-
style = _ref5.style;
|
114
|
-
return _jsx("div", {
|
115
|
-
className: classNames('virtual-table-cell', {
|
116
|
-
'virtual-table-cell-last': columnIndex === mergedColumns.length - 1
|
117
|
-
}),
|
118
|
-
style: style,
|
119
|
-
children: rawData[rowIndex][mergedColumns[columnIndex].dataIndex]
|
120
|
-
});
|
121
|
-
}
|
122
|
-
});
|
123
|
-
};
|
124
|
-
return _jsxs(ResizeObserver, {
|
125
|
-
onResize: function onResize(_ref6) {
|
126
|
-
var _width3;
|
127
|
-
var width = _ref6.width;
|
128
|
-
var _width = width;
|
129
|
-
if (typeof _width === 'string' && ((_width3 = _width) === null || _width3 === void 0 ? void 0 : _width3.includes('px'))) {
|
130
|
-
_width = parseInt(width, 10);
|
131
|
-
}
|
132
|
-
setTableWidth(_width);
|
133
|
-
},
|
134
|
-
children: [headerRender ? _jsx("div", {
|
135
|
-
className: "pro-edit-table-header",
|
136
|
-
children: typeof headerRender === 'function' ? headerRender() : headerRender
|
137
|
-
}) : null, _jsx(_Table, _objectSpread(_objectSpread({
|
138
|
-
ref: tableRef,
|
139
|
-
className: className,
|
140
|
-
dataSource: (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.rowKey) ? value : undefined,
|
141
|
-
columns: mergedColumns,
|
142
|
-
rowSelection: renderRowSelection(),
|
143
|
-
rowClassName: rowClassName,
|
144
|
-
components: {
|
145
|
-
body: renderVirtualList
|
146
|
-
},
|
147
|
-
onRow: function onRow() {
|
148
|
-
return {
|
149
|
-
disabled: disabled || virtualKey && !!editingKeys.length,
|
150
|
-
'data-hide': isHideCheckBox,
|
151
|
-
'data-row-draggable': rowDraggable,
|
152
|
-
onClick: function onClick() {}
|
153
|
-
};
|
154
|
-
}
|
155
|
-
}, resetProps), {}, {
|
156
|
-
pagination: false,
|
157
|
-
rowKey: "rowKey",
|
158
|
-
scroll: {
|
159
|
-
x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
|
160
|
-
y: (value === null || value === void 0 ? void 0 : value.length) ? scroll === null || scroll === void 0 ? void 0 : scroll.y : undefined
|
161
|
-
},
|
162
|
-
summary: summary
|
163
|
-
}))]
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { memo } from 'react';
|
3
|
+
var VirtualTable = function VirtualTable() {
|
4
|
+
return _jsx(_Fragment, {
|
5
|
+
children: "\u6682\u65F6\u4E0D\u4F7F\u7528\uFF0C\u53EF\u4EE5\u7B49\u5347\u7EA7antd5\u4F7F\u7528\u5BF9\u5E94\u7684\u80FD\u529B"
|
164
6
|
});
|
165
7
|
};
|
166
8
|
export default /*#__PURE__*/memo(VirtualTable);
|
@@ -48,12 +48,13 @@ var InputNumber = function InputNumber(props) {
|
|
48
48
|
var _ref2 = ProForm.useFieldProps() || {},
|
49
49
|
isViewCon = _ref2.isView,
|
50
50
|
viewEmpty = _ref2.viewEmpty,
|
51
|
-
|
51
|
+
valueTypeCon = _ref2.valueType,
|
52
52
|
viewType = _ref2.viewType,
|
53
53
|
label = _ref2.label;
|
54
54
|
var initialConfig = useProConfig('InputNumber');
|
55
55
|
var activateRef = useRef(false);
|
56
56
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
57
|
+
var valueType = 'valueType' in props ? props.valueType : valueTypeCon; // 组件可直接接收valueType参数, 优先级高
|
57
58
|
var valueProps = {};
|
58
59
|
var formatter = function formatter(value) {
|
59
60
|
var _props$precision;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
declare const
|
3
|
-
export default
|
1
|
+
import { ProStepItemPropsType } from '../../propsType';
|
2
|
+
declare const ProStepItem: ({ id, title, collapse: collapseItem, children, ...restProps }: ProStepItemPropsType) => import("react/jsx-runtime").JSX.Element;
|
3
|
+
export default ProStepItem;
|
@@ -3,9 +3,16 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
3
3
|
var _excluded = ["id", "title", "collapse", "children"];
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
5
|
import { useEffect } from 'react';
|
6
|
+
import LazyLoad from 'react-lazyload';
|
7
|
+
import { isBoolean } from 'lodash';
|
6
8
|
import { useStep } from '../../index';
|
7
9
|
import ProCollapse from '../../../ProLayout/components/ProCollapse';
|
8
|
-
|
10
|
+
var defaultLazyLoadConfig = {
|
11
|
+
height: 100,
|
12
|
+
offset: 100,
|
13
|
+
once: true // 保证只在首次进入视口时触发懒加载
|
14
|
+
};
|
15
|
+
var ProStepItem = function ProStepItem(_ref) {
|
9
16
|
var id = _ref.id,
|
10
17
|
title = _ref.title,
|
11
18
|
_ref$collapse = _ref.collapse,
|
@@ -16,7 +23,7 @@ export default (function (_ref) {
|
|
16
23
|
register = _useStep.register,
|
17
24
|
collapse = _useStep.collapse;
|
18
25
|
useEffect(function () {
|
19
|
-
//
|
26
|
+
// 延迟更新父组件状态,避免重渲染
|
20
27
|
var timeoutId = setTimeout(function () {
|
21
28
|
register === null || register === void 0 ? void 0 : register(_objectSpread(_objectSpread({}, restProps), {}, {
|
22
29
|
title: title,
|
@@ -27,15 +34,24 @@ export default (function (_ref) {
|
|
27
34
|
return clearTimeout(timeoutId);
|
28
35
|
};
|
29
36
|
}, [register]);
|
37
|
+
var childrenRender = function childrenRender() {
|
38
|
+
if (restProps === null || restProps === void 0 ? void 0 : restProps.lazyLoad) {
|
39
|
+
var lazyLoadProps = isBoolean(restProps === null || restProps === void 0 ? void 0 : restProps.lazyLoad) ? defaultLazyLoadConfig : restProps.lazyLoad;
|
40
|
+
return _jsx(LazyLoad, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
41
|
+
children: children
|
42
|
+
}));
|
43
|
+
}
|
44
|
+
return children;
|
45
|
+
};
|
30
46
|
return _jsx("div", {
|
31
47
|
className: "pro-step-item",
|
32
48
|
id: id,
|
33
49
|
children: !register || collapse && collapseItem && title ? _jsx(ProCollapse, _objectSpread(_objectSpread({
|
34
|
-
id: id,
|
35
50
|
title: title,
|
36
51
|
icon: true
|
37
52
|
}, restProps), {}, {
|
38
|
-
children:
|
39
|
-
})) :
|
53
|
+
children: childrenRender()
|
54
|
+
})) : childrenRender()
|
40
55
|
});
|
41
|
-
}
|
56
|
+
};
|
57
|
+
export default ProStepItem;
|
package/es/ProStep/index.d.ts
CHANGED
@@ -6,7 +6,7 @@ export declare const useStep: () => any;
|
|
6
6
|
declare const ProStep: {
|
7
7
|
({ children, ...resetProps }: ProStepPropsType): import("react/jsx-runtime").JSX.Element;
|
8
8
|
useStep: () => any;
|
9
|
-
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").
|
9
|
+
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItemPropsType) => import("react/jsx-runtime").JSX.Element;
|
10
10
|
Listener: ({ children, delayTime, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
11
11
|
};
|
12
12
|
export default ProStep;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { LazyLoadProps } from 'react-lazyload';
|
2
3
|
export interface ItemType {
|
3
4
|
name: string;
|
4
5
|
code: string;
|
@@ -22,10 +23,12 @@ export interface ProStepPropsType {
|
|
22
23
|
/** @name 是否滚动到第一个报错 */
|
23
24
|
scrollToError?: boolean;
|
24
25
|
}
|
25
|
-
export interface
|
26
|
+
export interface ProStepItemPropsType {
|
26
27
|
id: string;
|
27
28
|
title?: string;
|
28
29
|
collapse?: boolean;
|
29
30
|
order?: number;
|
31
|
+
/** 模块可视区域懒加载 */
|
32
|
+
lazyLoad?: boolean | LazyLoadProps;
|
30
33
|
[key: string]: any;
|
31
34
|
}
|
@@ -1,6 +1,3 @@
|
|
1
|
-
|
2
|
-
declare const _default:
|
3
|
-
[x: string]: any;
|
4
|
-
tableProps: any;
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const _default: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
6
3
|
export default _default;
|
@@ -1,172 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.default = void 0;
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
11
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
12
|
-
var _antd = require("antd");
|
13
8
|
var _react = require("react");
|
14
|
-
var
|
15
|
-
|
16
|
-
|
17
|
-
var _excluded = ["tableProps"];
|
18
|
-
var VirtualTable = function VirtualTable(_ref) {
|
19
|
-
var _value$;
|
20
|
-
var tableProps = _ref.tableProps,
|
21
|
-
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
22
|
-
var value = tableProps.value,
|
23
|
-
headerRender = tableProps.headerRender,
|
24
|
-
tableRef = tableProps.tableRef,
|
25
|
-
className = tableProps.className,
|
26
|
-
columns = tableProps.columns,
|
27
|
-
renderRowSelection = tableProps.renderRowSelection,
|
28
|
-
rowClassName = tableProps.rowClassName,
|
29
|
-
disabled = tableProps.disabled,
|
30
|
-
virtualKey = tableProps.virtualKey,
|
31
|
-
editingKeys = tableProps.editingKeys,
|
32
|
-
isHideCheckBox = tableProps.isHideCheckBox,
|
33
|
-
rowDraggable = tableProps.rowDraggable,
|
34
|
-
scroll = tableProps.scroll,
|
35
|
-
summary = tableProps.summary;
|
36
|
-
var _useState = (0, _react.useState)(0),
|
37
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
38
|
-
tableWidth = _useState2[0],
|
39
|
-
setTableWidth = _useState2[1];
|
40
|
-
var widthColumnCount = columns.filter(function (_ref2) {
|
41
|
-
var width = _ref2.width;
|
42
|
-
return !width;
|
43
|
-
}).length;
|
44
|
-
var mergedColumns = columns.map(function (column) {
|
45
|
-
if (column.width) {
|
46
|
-
return column;
|
47
|
-
}
|
48
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
49
|
-
width: Math.floor(tableWidth / widthColumnCount)
|
50
|
-
});
|
51
|
-
});
|
52
|
-
var gridRef = (0, _react.useRef)();
|
53
|
-
var _useState3 = (0, _react.useState)(function () {
|
54
|
-
var obj = {};
|
55
|
-
Object.defineProperty(obj, 'scrollLeft', {
|
56
|
-
get: function get() {
|
57
|
-
if (gridRef.current) {
|
58
|
-
var _gridRef$current, _gridRef$current$stat;
|
59
|
-
return (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : (_gridRef$current$stat = _gridRef$current.state) === null || _gridRef$current$stat === void 0 ? void 0 : _gridRef$current$stat.scrollLeft;
|
60
|
-
}
|
61
|
-
return null;
|
62
|
-
},
|
63
|
-
set: function set(scrollLeft) {
|
64
|
-
if (gridRef.current) {
|
65
|
-
gridRef.current.scrollTo({
|
66
|
-
scrollLeft: scrollLeft
|
67
|
-
});
|
68
|
-
}
|
69
|
-
}
|
70
|
-
});
|
71
|
-
return obj;
|
72
|
-
}),
|
73
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 1),
|
74
|
-
connectObject = _useState4[0];
|
75
|
-
var resetVirtualGrid = function resetVirtualGrid() {
|
76
|
-
var _gridRef$current2;
|
77
|
-
(_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.resetAfterIndices({
|
78
|
-
columnIndex: 0,
|
79
|
-
shouldForceUpdate: true
|
80
|
-
});
|
81
|
-
};
|
82
|
-
(0, _react.useEffect)(function () {
|
83
|
-
return resetVirtualGrid;
|
84
|
-
}, [tableWidth]);
|
85
|
-
var renderVirtualList = function renderVirtualList(rawData, _ref3) {
|
86
|
-
var scrollbarSize = _ref3.scrollbarSize,
|
87
|
-
ref = _ref3.ref,
|
88
|
-
_onScroll = _ref3.onScroll;
|
89
|
-
ref.current = connectObject;
|
90
|
-
var totalHeight = rawData.length * 54;
|
91
|
-
return (0, _jsxRuntime.jsx)(_reactWindow.VariableSizeGrid, {
|
92
|
-
ref: gridRef,
|
93
|
-
className: "virtual-grid",
|
94
|
-
columnCount: mergedColumns.length,
|
95
|
-
columnWidth: function columnWidth(index) {
|
96
|
-
var _width2;
|
97
|
-
var width = mergedColumns[index].width;
|
98
|
-
var _width = width;
|
99
|
-
if (typeof _width === 'string' && ((_width2 = _width) === null || _width2 === void 0 ? void 0 : _width2.includes('px'))) {
|
100
|
-
_width = parseInt(width, 10);
|
101
|
-
}
|
102
|
-
return totalHeight > scroll.y && index === mergedColumns.length - 1 ? _width - scrollbarSize - 1 : _width;
|
103
|
-
},
|
104
|
-
height: scroll.y,
|
105
|
-
rowCount: rawData.length,
|
106
|
-
rowHeight: function rowHeight() {
|
107
|
-
return 54;
|
108
|
-
},
|
109
|
-
width: tableWidth,
|
110
|
-
onScroll: function onScroll(_ref4) {
|
111
|
-
var scrollLeft = _ref4.scrollLeft;
|
112
|
-
_onScroll({
|
113
|
-
scrollLeft: scrollLeft
|
114
|
-
});
|
115
|
-
},
|
116
|
-
children: function children(_ref5) {
|
117
|
-
var columnIndex = _ref5.columnIndex,
|
118
|
-
rowIndex = _ref5.rowIndex,
|
119
|
-
style = _ref5.style;
|
120
|
-
return (0, _jsxRuntime.jsx)("div", {
|
121
|
-
className: (0, _classnames.default)('virtual-table-cell', {
|
122
|
-
'virtual-table-cell-last': columnIndex === mergedColumns.length - 1
|
123
|
-
}),
|
124
|
-
style: style,
|
125
|
-
children: rawData[rowIndex][mergedColumns[columnIndex].dataIndex]
|
126
|
-
});
|
127
|
-
}
|
128
|
-
});
|
129
|
-
};
|
130
|
-
return (0, _jsxRuntime.jsxs)(_rcResizeObserver.default, {
|
131
|
-
onResize: function onResize(_ref6) {
|
132
|
-
var _width3;
|
133
|
-
var width = _ref6.width;
|
134
|
-
var _width = width;
|
135
|
-
if (typeof _width === 'string' && ((_width3 = _width) === null || _width3 === void 0 ? void 0 : _width3.includes('px'))) {
|
136
|
-
_width = parseInt(width, 10);
|
137
|
-
}
|
138
|
-
setTableWidth(_width);
|
139
|
-
},
|
140
|
-
children: [headerRender ? (0, _jsxRuntime.jsx)("div", {
|
141
|
-
className: "pro-edit-table-header",
|
142
|
-
children: typeof headerRender === 'function' ? headerRender() : headerRender
|
143
|
-
}) : null, (0, _jsxRuntime.jsx)(_antd.Table, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
144
|
-
ref: tableRef,
|
145
|
-
className: className,
|
146
|
-
dataSource: (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.rowKey) ? value : undefined,
|
147
|
-
columns: mergedColumns,
|
148
|
-
rowSelection: renderRowSelection(),
|
149
|
-
rowClassName: rowClassName,
|
150
|
-
components: {
|
151
|
-
body: renderVirtualList
|
152
|
-
},
|
153
|
-
onRow: function onRow() {
|
154
|
-
return {
|
155
|
-
disabled: disabled || virtualKey && !!editingKeys.length,
|
156
|
-
'data-hide': isHideCheckBox,
|
157
|
-
'data-row-draggable': rowDraggable,
|
158
|
-
onClick: function onClick() {}
|
159
|
-
};
|
160
|
-
}
|
161
|
-
}, resetProps), {}, {
|
162
|
-
pagination: false,
|
163
|
-
rowKey: "rowKey",
|
164
|
-
scroll: {
|
165
|
-
x: scroll === null || scroll === void 0 ? void 0 : scroll.x,
|
166
|
-
y: (value === null || value === void 0 ? void 0 : value.length) ? scroll === null || scroll === void 0 ? void 0 : scroll.y : undefined
|
167
|
-
},
|
168
|
-
summary: summary
|
169
|
-
}))]
|
9
|
+
var VirtualTable = function VirtualTable() {
|
10
|
+
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
11
|
+
children: "\u6682\u65F6\u4E0D\u4F7F\u7528\uFF0C\u53EF\u4EE5\u7B49\u5347\u7EA7antd5\u4F7F\u7528\u5BF9\u5E94\u7684\u80FD\u529B"
|
170
12
|
});
|
171
13
|
};
|
172
14
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(VirtualTable);
|
@@ -52,12 +52,13 @@ var InputNumber = function InputNumber(props) {
|
|
52
52
|
var _ref2 = _ProForm.default.useFieldProps() || {},
|
53
53
|
isViewCon = _ref2.isView,
|
54
54
|
viewEmpty = _ref2.viewEmpty,
|
55
|
-
|
55
|
+
valueTypeCon = _ref2.valueType,
|
56
56
|
viewType = _ref2.viewType,
|
57
57
|
label = _ref2.label;
|
58
58
|
var initialConfig = (0, _ProConfigProvider.useProConfig)('InputNumber');
|
59
59
|
var activateRef = (0, _react.useRef)(false);
|
60
60
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
61
|
+
var valueType = 'valueType' in props ? props.valueType : valueTypeCon; // 组件可直接接收valueType参数, 优先级高
|
61
62
|
var valueProps = {};
|
62
63
|
var formatter = function formatter(value) {
|
63
64
|
var _props$precision;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
declare const
|
3
|
-
export default
|
1
|
+
import { ProStepItemPropsType } from '../../propsType';
|
2
|
+
declare const ProStepItem: ({ id, title, collapse: collapseItem, children, ...restProps }: ProStepItemPropsType) => import("react/jsx-runtime").JSX.Element;
|
3
|
+
export default ProStepItem;
|
@@ -9,10 +9,17 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
11
11
|
var _react = require("react");
|
12
|
+
var _reactLazyload = _interopRequireDefault(require("react-lazyload"));
|
13
|
+
var _lodash = require("lodash");
|
12
14
|
var _index = require("../../index");
|
13
15
|
var _ProCollapse = _interopRequireDefault(require("../../../ProLayout/components/ProCollapse"));
|
14
16
|
var _excluded = ["id", "title", "collapse", "children"];
|
15
|
-
var
|
17
|
+
var defaultLazyLoadConfig = {
|
18
|
+
height: 100,
|
19
|
+
offset: 100,
|
20
|
+
once: true // 保证只在首次进入视口时触发懒加载
|
21
|
+
};
|
22
|
+
var ProStepItem = function ProStepItem(_ref) {
|
16
23
|
var id = _ref.id,
|
17
24
|
title = _ref.title,
|
18
25
|
_ref$collapse = _ref.collapse,
|
@@ -23,7 +30,7 @@ var _default = exports.default = function _default(_ref) {
|
|
23
30
|
register = _useStep.register,
|
24
31
|
collapse = _useStep.collapse;
|
25
32
|
(0, _react.useEffect)(function () {
|
26
|
-
//
|
33
|
+
// 延迟更新父组件状态,避免重渲染
|
27
34
|
var timeoutId = setTimeout(function () {
|
28
35
|
register === null || register === void 0 ? void 0 : register((0, _objectSpread2.default)((0, _objectSpread2.default)({}, restProps), {}, {
|
29
36
|
title: title,
|
@@ -34,15 +41,24 @@ var _default = exports.default = function _default(_ref) {
|
|
34
41
|
return clearTimeout(timeoutId);
|
35
42
|
};
|
36
43
|
}, [register]);
|
44
|
+
var childrenRender = function childrenRender() {
|
45
|
+
if (restProps === null || restProps === void 0 ? void 0 : restProps.lazyLoad) {
|
46
|
+
var lazyLoadProps = (0, _lodash.isBoolean)(restProps === null || restProps === void 0 ? void 0 : restProps.lazyLoad) ? defaultLazyLoadConfig : restProps.lazyLoad;
|
47
|
+
return (0, _jsxRuntime.jsx)(_reactLazyload.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, lazyLoadProps), {}, {
|
48
|
+
children: children
|
49
|
+
}));
|
50
|
+
}
|
51
|
+
return children;
|
52
|
+
};
|
37
53
|
return (0, _jsxRuntime.jsx)("div", {
|
38
54
|
className: "pro-step-item",
|
39
55
|
id: id,
|
40
56
|
children: !register || collapse && collapseItem && title ? (0, _jsxRuntime.jsx)(_ProCollapse.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
41
|
-
id: id,
|
42
57
|
title: title,
|
43
58
|
icon: true
|
44
59
|
}, restProps), {}, {
|
45
|
-
children:
|
46
|
-
})) :
|
60
|
+
children: childrenRender()
|
61
|
+
})) : childrenRender()
|
47
62
|
});
|
48
|
-
};
|
63
|
+
};
|
64
|
+
var _default = exports.default = ProStepItem;
|
package/lib/ProStep/index.d.ts
CHANGED
@@ -6,7 +6,7 @@ export declare const useStep: () => any;
|
|
6
6
|
declare const ProStep: {
|
7
7
|
({ children, ...resetProps }: ProStepPropsType): import("react/jsx-runtime").JSX.Element;
|
8
8
|
useStep: () => any;
|
9
|
-
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").
|
9
|
+
Item: ({ id, title, collapse: collapseItem, children, ...restProps }: import("./propsType").ProStepItemPropsType) => import("react/jsx-runtime").JSX.Element;
|
10
10
|
Listener: ({ children, delayTime, excludes, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>;
|
11
11
|
};
|
12
12
|
export default ProStep;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { LazyLoadProps } from 'react-lazyload';
|
2
3
|
export interface ItemType {
|
3
4
|
name: string;
|
4
5
|
code: string;
|
@@ -22,10 +23,12 @@ export interface ProStepPropsType {
|
|
22
23
|
/** @name 是否滚动到第一个报错 */
|
23
24
|
scrollToError?: boolean;
|
24
25
|
}
|
25
|
-
export interface
|
26
|
+
export interface ProStepItemPropsType {
|
26
27
|
id: string;
|
27
28
|
title?: string;
|
28
29
|
collapse?: boolean;
|
29
30
|
order?: number;
|
31
|
+
/** 模块可视区域懒加载 */
|
32
|
+
lazyLoad?: boolean | LazyLoadProps;
|
30
33
|
[key: string]: any;
|
31
34
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
3
|
-
"version": "3.10.4-beta.
|
3
|
+
"version": "3.10.4-beta.2",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -68,9 +68,9 @@
|
|
68
68
|
"lodash": "^4.17.21",
|
69
69
|
"moment": "^2.29.1",
|
70
70
|
"rc-resize-observer": "^1.4.0",
|
71
|
-
"react-
|
72
|
-
"react-
|
73
|
-
"react-
|
71
|
+
"react-lazyload": "^3.2.1",
|
72
|
+
"react-resizable": "^3.0.5",
|
73
|
+
"react-svg": "^15.1.7"
|
74
74
|
},
|
75
75
|
"peerDependencies": {
|
76
76
|
"antd": "^4.24.8",
|
@@ -88,6 +88,7 @@
|
|
88
88
|
"@types/lodash": "^4.14.171",
|
89
89
|
"@types/react": "^17.0.53",
|
90
90
|
"@types/react-dom": "^17.0.0",
|
91
|
+
"@types/react-lazyload": "^3.2.3",
|
91
92
|
"@types/react-resizable": "^1.7.4",
|
92
93
|
"@typescript-eslint/eslint-plugin": "4.0.1",
|
93
94
|
"@typescript-eslint/parser": "4.0.1",
|