@teamix/pro 1.5.44 → 1.5.46-beat.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/dist/pro.all.min.css +1 -1
- package/dist/pro.css +1 -1
- package/dist/pro.js +21836 -21394
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.xconsole.min.css +1 -1
- package/es/actions/quick.js +1 -0
- package/es/form/Components/SelectTable2/index.d.ts +1 -0
- package/es/form/Filter/useBindUrl.d.ts +14 -2
- package/es/form/Filter/useBindUrl.js +90 -36
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/page-header/index.js +2 -2
- package/es/sidebar/utils/index.d.ts +1 -1
- package/es/table/components/Cell/index.js +23 -3
- package/es/table/components/Filter/index.js +3 -1
- package/es/table/components/ToolBar/RefreshIcon.js +2 -0
- package/es/table/index.js +7 -4
- package/es/table/typing.d.ts +2 -0
- package/es/table/utils/genAutoWidthColumns.js +4 -1
- package/es/table/utils/useTableSelection.js +5 -1
- package/lib/actions/quick.js +1 -0
- package/lib/form/Components/SelectTable2/index.d.ts +1 -0
- package/lib/form/Filter/useBindUrl.d.ts +14 -2
- package/lib/form/Filter/useBindUrl.js +90 -37
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/page-header/index.js +1 -1
- package/lib/sidebar/utils/index.d.ts +1 -1
- package/lib/table/components/Cell/index.js +23 -3
- package/lib/table/components/Filter/index.js +3 -1
- package/lib/table/components/ToolBar/RefreshIcon.js +2 -0
- package/lib/table/index.js +7 -4
- package/lib/table/typing.d.ts +2 -0
- package/lib/table/utils/genAutoWidthColumns.js +4 -1
- package/lib/table/utils/useTableSelection.js +5 -1
- package/package.json +2 -2
@@ -152,7 +152,7 @@ export declare function getTreeNodeProps(item: ProSidebarDataSourceItem): {
|
|
152
152
|
'aria-colindex'?: number | undefined;
|
153
153
|
'aria-colspan'?: number | undefined;
|
154
154
|
'aria-controls'?: string | undefined;
|
155
|
-
'aria-current'?: boolean | "date" | "time" | "page" | "false" | "true" | "step" |
|
155
|
+
'aria-current'?: boolean | "location" | "date" | "time" | "page" | "false" | "true" | "step" | undefined;
|
156
156
|
'aria-describedby'?: string | undefined;
|
157
157
|
'aria-details'?: string | undefined;
|
158
158
|
'aria-disabled'?: (boolean | "false" | "true") | undefined;
|
@@ -193,11 +193,31 @@ var processBuriedPoint = function processBuriedPoint() {
|
|
193
193
|
}))));
|
194
194
|
};
|
195
195
|
var equalColumns = function equalColumns(prevProps, nextProps) {
|
196
|
-
var preValue = prevProps.value
|
196
|
+
var preValue = prevProps.value,
|
197
|
+
preItem = prevProps.item,
|
198
|
+
preRecord = prevProps.record,
|
199
|
+
preContext = prevProps.context;
|
197
200
|
var nextValue = nextProps.value,
|
198
|
-
|
201
|
+
nextItem = nextProps.item,
|
202
|
+
nextRecord = nextProps.record,
|
203
|
+
nextContext = nextProps.context;
|
204
|
+
// if (nextItem?.render) {
|
205
|
+
// let renderCache = true;
|
206
|
+
// Object.keys(nextItem?.render).forEach((key) => {
|
207
|
+
// // 如果 preItem 不包含 render 的属性,则强制刷新
|
208
|
+
// if (!preItem?.render[key]) {
|
209
|
+
// renderCache = false;
|
210
|
+
// return false
|
211
|
+
// }
|
212
|
+
// let preRenderValue = getTargetValue(preItem?.render[key], {...preRecord, ...preContext});
|
213
|
+
// let nextRenderValue = getTargetValue(nextItem?.render[key], {...nextRecord, ...nextContext})
|
214
|
+
// if (preRenderValue !== nextRenderValue) {
|
215
|
+
// renderCache = false;
|
216
|
+
// }
|
217
|
+
// })
|
218
|
+
// }
|
199
219
|
// columns 强制更新参数
|
200
|
-
if (
|
220
|
+
if (nextItem === null || nextItem === void 0 ? void 0 : nextItem.forcedUpdate) {
|
201
221
|
return false;
|
202
222
|
}
|
203
223
|
// 操作列的时候强制刷新 || 当 value 值拿不到的时候
|
@@ -42,7 +42,9 @@ var Filter = function Filter(props) {
|
|
42
42
|
filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth,
|
43
43
|
_column$defaultFilter = column.defaultFilterSelectedKeys,
|
44
44
|
defaultFilterSelectedKeys = _column$defaultFilter === void 0 ? [] : _column$defaultFilter;
|
45
|
-
var _ref = bindUrl ? (0, _hooks.useUrlState)(
|
45
|
+
var _ref = bindUrl ? (0, _hooks.useUrlState)({}, {
|
46
|
+
navigateMode: 'replace'
|
47
|
+
}) : [],
|
46
48
|
_ref2 = _slicedToArray(_ref, 2),
|
47
49
|
urlState = _ref2[0],
|
48
50
|
setUrlState = _ref2[1];
|
@@ -66,6 +66,7 @@ var LayoutIcon = function LayoutIcon(props) {
|
|
66
66
|
setTimes(timer);
|
67
67
|
timerRef.current.remain = timer / 1000;
|
68
68
|
if (timerRef.current.timer) {
|
69
|
+
//@ts-ignore
|
69
70
|
clearInterval(timerRef.current.timer);
|
70
71
|
timerRef.current.timer = undefined;
|
71
72
|
}
|
@@ -91,6 +92,7 @@ var LayoutIcon = function LayoutIcon(props) {
|
|
91
92
|
var _actionRef$current2, _actionRef$current2$c;
|
92
93
|
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$c = _actionRef$current2.clearAutoRefreshTimers) === null || _actionRef$current2$c === void 0 ? void 0 : _actionRef$current2$c.call(_actionRef$current2);
|
93
94
|
if (timerRef.current.timer) {
|
95
|
+
//@ts-ignore
|
94
96
|
clearInterval(timerRef.current.timer);
|
95
97
|
timerRef.current.timer = undefined;
|
96
98
|
timerRef.current.remain = times / 1000;
|
package/lib/table/index.js
CHANGED
@@ -156,7 +156,9 @@ var ProTable = function ProTable(props) {
|
|
156
156
|
var targetPageKey = pageKey || globalPageKey;
|
157
157
|
var targetPageSizeKey = pageSizeKey || globalPageSizeKey;
|
158
158
|
var targetFormatSort = formatSort || globalFormatSort;
|
159
|
-
var _ref = bindUrl ? (0, _hooks.useUrlState)(
|
159
|
+
var _ref = bindUrl ? (0, _hooks.useUrlState)({}, {
|
160
|
+
navigateMode: 'replace'
|
161
|
+
}) : [],
|
160
162
|
_ref2 = _slicedToArray(_ref, 2),
|
161
163
|
urlState = _ref2[0],
|
162
164
|
setUrlState = _ref2[1];
|
@@ -358,9 +360,9 @@ var ProTable = function ProTable(props) {
|
|
358
360
|
setFooterSuctionState(false);
|
359
361
|
}
|
360
362
|
// 如果有切换区tab,那么重新计算
|
361
|
-
if (headerFixedTopSectionDom.clientHeight) {
|
363
|
+
if (headerFixedTopSectionDom === null || headerFixedTopSectionDom === void 0 ? void 0 : headerFixedTopSectionDom.clientHeight) {
|
362
364
|
var _headerFixedTopSectio;
|
363
|
-
var headerFixedTopSectionHeight = (_headerFixedTopSectio = headerFixedTopSectionDom.clientHeight) !== null && _headerFixedTopSectio !== void 0 ? _headerFixedTopSectio : 0;
|
365
|
+
var headerFixedTopSectionHeight = (_headerFixedTopSectio = headerFixedTopSectionDom === null || headerFixedTopSectionDom === void 0 ? void 0 : headerFixedTopSectionDom.clientHeight) !== null && _headerFixedTopSectio !== void 0 ? _headerFixedTopSectio : 0;
|
364
366
|
// const clientTableBodyHeight =
|
365
367
|
// document.body.clientHeight - offsetHeaderHeight;
|
366
368
|
setHeaderHeight(headerFixedTopSectionHeight + teamixNavHeight + footerRowSelectionHeight + tableHeaderHeight + 1);
|
@@ -1220,7 +1222,8 @@ var ProTable = function ProTable(props) {
|
|
1220
1222
|
}, [fullscreenState, fixedTableBody, footerSuction, footerSuctionState]);
|
1221
1223
|
return /*#__PURE__*/_react.default.createElement(_Fullscreen.default, {
|
1222
1224
|
visible: fullscreenState,
|
1223
|
-
actionRef: actionRef
|
1225
|
+
actionRef: actionRef,
|
1226
|
+
key: props.key
|
1224
1227
|
}, function (isFullScreen) {
|
1225
1228
|
return /*#__PURE__*/_react.default.createElement("div", {
|
1226
1229
|
className: cls({
|
package/lib/table/typing.d.ts
CHANGED
@@ -189,6 +189,8 @@ export declare type ProTableProps = {
|
|
189
189
|
/** 使用超大数据模式 **/
|
190
190
|
useMaxData?: boolean;
|
191
191
|
rowSelection?: rowSelectionType;
|
192
|
+
/** React Key **/
|
193
|
+
key?: React.Key | null;
|
192
194
|
} & Omit<TableProps, 'columns' | 'rowSelection'> & ProTableTopAreaProps;
|
193
195
|
export declare type rowSelectionType = {
|
194
196
|
getProps?: (record: any, index: number) => any;
|
@@ -48,7 +48,10 @@ function genAutoWidthColumns(columns, ref, data, size, useRowSelection, actionCo
|
|
48
48
|
return columns;
|
49
49
|
}
|
50
50
|
var finalColumns = [];
|
51
|
-
|
51
|
+
// @FIXME: lodash 的 cloneDeep 无法正确处理 columns 内部含有 ReactNode 的情况。我们也不该用 React 以外的工具来复制 ReactNode
|
52
|
+
// 因为它里面的 fiber node id 等等的在复制后并不会变,对于 React 来讲这就意味着两个 ReactNode 有相同的 fiber node id,不符合预期。
|
53
|
+
// 先注释掉,后续再想办法
|
54
|
+
var filterdColumnsResult = columns; // _.cloneDeep(columns);
|
52
55
|
filterdColumnsResult.forEach(function (column, index) {
|
53
56
|
var render = column.render,
|
54
57
|
_column$valueType = column.valueType,
|
@@ -46,6 +46,10 @@ function useTableSelection() {
|
|
46
46
|
var dataRef = (0, _react.useRef)({
|
47
47
|
selectedRowKeys: config.selectedRowKeys || defaultSelectedRowKeys
|
48
48
|
});
|
49
|
+
var onSetSelectedRowKeys = function onSetSelectedRowKeys(keys) {
|
50
|
+
setSelectedRowKeys(keys);
|
51
|
+
dataRef.current.selectedRowKeys = keys;
|
52
|
+
};
|
49
53
|
(0, _react.useEffect)(function () {
|
50
54
|
var _config$selectedRowKe, _config$selectedRowKe2;
|
51
55
|
setSelectedRowKeys((_config$selectedRowKe = config === null || config === void 0 ? void 0 : config.selectedRowKeys) !== null && _config$selectedRowKe !== void 0 ? _config$selectedRowKe : []);
|
@@ -153,7 +157,7 @@ function useTableSelection() {
|
|
153
157
|
return {
|
154
158
|
rowSelection: rowSelection,
|
155
159
|
selectedRowKeys: selectedRowKeys,
|
156
|
-
setSelectedRowKeys:
|
160
|
+
setSelectedRowKeys: onSetSelectedRowKeys,
|
157
161
|
selectedRecords: selectedRecords,
|
158
162
|
setSelectedRecords: setSelectedRecords
|
159
163
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teamix/pro",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.46-beat.2",
|
4
4
|
"description": "TeamixPro大包",
|
5
5
|
"keywords": [
|
6
6
|
"aliyun",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"@teamix/formily": "2.2.4",
|
40
40
|
"@teamix/hooks": "^0.1.0",
|
41
41
|
"@teamix/pop-confirm": "^1.2.4",
|
42
|
-
"@teamix/pro-field": "
|
42
|
+
"@teamix/pro-field": "1.0.107-beta.2",
|
43
43
|
"@teamix/pro-page-container": "^1.0.0",
|
44
44
|
"@teamix/pro-skeleton": "^1.0.0",
|
45
45
|
"@teamix/result": "^1.0.29",
|