ztxkui 4.2.23-565 → 4.2.23-566
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/components/EnhanceSelect/index.js +3 -1
- package/dist/components/Table/table-context.d.ts +6 -1
- package/dist/components/Table/table-context.js +24 -15
- package/dist/components/Table/table-menu.d.ts +1 -2
- package/dist/components/Table/table-menu.js +2 -13
- package/dist/components/Table/table.js +2 -4
- package/package.json +1 -1
|
@@ -1266,7 +1266,9 @@ function EnhanceSelect(_a) {
|
|
|
1266
1266
|
}, [selectList, newValue, dataKey, titleKey]);
|
|
1267
1267
|
return (React.createElement(Select, __assign({ defaultValue: showAll ? '' : undefined, allowClear: true, showSearch: true, autoClearSearchValue: !!remoteSearch, filterOption: remoteSearch ? false : filterOptionHandle,
|
|
1268
1268
|
// searchValue={searchValue}
|
|
1269
|
-
onSearch: remoteSearch ? onSearchHandle : onSearchHandleInnerDebounce, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle, onMouseDown: onMouseDownHandle,
|
|
1269
|
+
onSearch: remoteSearch ? onSearchHandle : onSearchHandleInnerDebounce, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onBlur: onBlurHandle, onClear: onClearHandle, onSelect: onSelectHandle, onClick: onClickHandle, onMouseDown: onMouseDownHandle,
|
|
1270
|
+
// getPopupContainer={(trigger) => trigger || document.body}
|
|
1271
|
+
getPopupContainer: getPopupContainer, open: isOpen, onDropdownVisibleChange: function (visible) { return setIsOpen(visible); }, onPopupScroll: onPopupScrollHandle, dropdownRender: url && !remoteSearch && isCatch
|
|
1270
1272
|
? function (menu) { return (React.createElement(React.Fragment, null,
|
|
1271
1273
|
menu,
|
|
1272
1274
|
React.createElement(Divider, { style: { marginTop: 0, marginBottom: '4px' } }),
|
|
@@ -12,9 +12,14 @@ export declare function useTableContext(): TableContextProps;
|
|
|
12
12
|
* 否则采用传入的getContainer方法
|
|
13
13
|
* 其次全局的getPopupContainer方法
|
|
14
14
|
* 最后默认的document.body
|
|
15
|
+
* 这个方案彻底放弃了 不可行
|
|
16
|
+
* 之前想的是 表格全屏的时候 把弹出层容器挂载到表格容器上(因为全屏的容器层级是系统层级的,如果挂载到body上或者其他容器上下拉框、日期框会选择不了)
|
|
17
|
+
* 但是这样会产生一个问题。当表格退出全屏的时候,如果表格容器高度不够,那么弹出层会显示不全,因为表格已经overflow: hidden了
|
|
18
|
+
* 就算把表格的overflow:hidden去掉,也会产生别的问题。比如外部使用的时候,表格容器被嵌套在了一个overflow:hidden的容器里面
|
|
19
|
+
* 所以这里不处理了,直接禁用掉编辑表格的全屏功能
|
|
15
20
|
* @param options
|
|
16
21
|
* @returns
|
|
17
22
|
*/
|
|
18
23
|
export declare function usePopupContainer(options?: {
|
|
19
24
|
getPopupContainer?: any;
|
|
20
|
-
}):
|
|
25
|
+
}): any;
|
|
@@ -15,28 +15,37 @@ export function useTableContext() {
|
|
|
15
15
|
* 否则采用传入的getContainer方法
|
|
16
16
|
* 其次全局的getPopupContainer方法
|
|
17
17
|
* 最后默认的document.body
|
|
18
|
+
* 这个方案彻底放弃了 不可行
|
|
19
|
+
* 之前想的是 表格全屏的时候 把弹出层容器挂载到表格容器上(因为全屏的容器层级是系统层级的,如果挂载到body上或者其他容器上下拉框、日期框会选择不了)
|
|
20
|
+
* 但是这样会产生一个问题。当表格退出全屏的时候,如果表格容器高度不够,那么弹出层会显示不全,因为表格已经overflow: hidden了
|
|
21
|
+
* 就算把表格的overflow:hidden去掉,也会产生别的问题。比如外部使用的时候,表格容器被嵌套在了一个overflow:hidden的容器里面
|
|
22
|
+
* 所以这里不处理了,直接禁用掉编辑表格的全屏功能
|
|
18
23
|
* @param options
|
|
19
24
|
* @returns
|
|
20
25
|
*/
|
|
21
26
|
export function usePopupContainer(options) {
|
|
22
27
|
var comGetPopupContainer = (options || {}).getPopupContainer;
|
|
23
|
-
|
|
28
|
+
// const { inTable, tableContainerRef } = useTableContext();
|
|
24
29
|
var antdConfig = useAntdContext();
|
|
25
30
|
var getPopupContainer = useMemoizedFn(function (target) {
|
|
26
|
-
var _a
|
|
31
|
+
var _a;
|
|
27
32
|
var targetElement = target || document.body;
|
|
28
|
-
if (inTable) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return
|
|
33
|
+
// if (inTable) {
|
|
34
|
+
// return (
|
|
35
|
+
// tableContainerRef?.current ||
|
|
36
|
+
// antdConfig?.getPopupContainer?.(targetElement) ||
|
|
37
|
+
// document.body
|
|
38
|
+
// );
|
|
39
|
+
// }
|
|
40
|
+
// if (typeof comGetPopupContainer === 'function') {
|
|
41
|
+
// return comGetPopupContainer?.(targetElement);
|
|
42
|
+
// }
|
|
43
|
+
// if (typeof comGetPopupContainer !== 'undefined') {
|
|
44
|
+
// return comGetPopupContainer;
|
|
45
|
+
// }
|
|
46
|
+
return ((_a = antdConfig === null || antdConfig === void 0 ? void 0 : antdConfig.getPopupContainer) === null || _a === void 0 ? void 0 : _a.call(antdConfig, targetElement)) || document.body;
|
|
40
47
|
});
|
|
41
|
-
return
|
|
48
|
+
return typeof comGetPopupContainer !== 'undefined'
|
|
49
|
+
? comGetPopupContainer
|
|
50
|
+
: getPopupContainer;
|
|
42
51
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import 'react-contexify/dist/ReactContexify.min.css';
|
|
3
|
-
declare const TableMenu: ({ menuId, columns, originColumns, tableRef, virtualTableKey, onEditableSave,
|
|
3
|
+
declare const TableMenu: ({ menuId, columns, originColumns, tableRef, virtualTableKey, onEditableSave, }: {
|
|
4
4
|
menuId: any;
|
|
5
5
|
columns: any;
|
|
6
6
|
originColumns: any;
|
|
7
7
|
tableRef: any;
|
|
8
8
|
virtualTableKey: any;
|
|
9
9
|
onEditableSave: any;
|
|
10
|
-
isFlex: any;
|
|
11
10
|
}) => JSX.Element;
|
|
12
11
|
export default TableMenu;
|
|
@@ -17,7 +17,7 @@ import screenfull from 'screenfull';
|
|
|
17
17
|
import TableEnhanceCell from './table-enhance-cell';
|
|
18
18
|
import { Modal, Descriptions, Button } from '../../index.build';
|
|
19
19
|
var TableMenu = function (_a) {
|
|
20
|
-
var menuId = _a.menuId, columns = _a.columns, originColumns = _a.originColumns, tableRef = _a.tableRef, virtualTableKey = _a.virtualTableKey, onEditableSave = _a.onEditableSave
|
|
20
|
+
var menuId = _a.menuId, columns = _a.columns, originColumns = _a.originColumns, tableRef = _a.tableRef, virtualTableKey = _a.virtualTableKey, onEditableSave = _a.onEditableSave;
|
|
21
21
|
var _b = useState(false), visible = _b[0], setVisible = _b[1];
|
|
22
22
|
var _c = useState(undefined), record = _c[0], setRecord = _c[1];
|
|
23
23
|
var _d = useState(-1), recordIndex = _d[0], setRecordIndex = _d[1];
|
|
@@ -94,17 +94,6 @@ var TableMenu = function (_a) {
|
|
|
94
94
|
function onCancel() {
|
|
95
95
|
setVisible(false);
|
|
96
96
|
}
|
|
97
|
-
useEffect(function () {
|
|
98
|
-
if (!onEditableSave || isFlex) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (visible) {
|
|
102
|
-
tableRef.current.classList.add('zt-table--menu-modal');
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
tableRef.current.classList.remove('zt-table--menu-modal');
|
|
106
|
-
}
|
|
107
|
-
}, [visible, onEditableSave]);
|
|
108
97
|
function renderItem(items) {
|
|
109
98
|
return items.map(function (item) {
|
|
110
99
|
var _a, _b;
|
|
@@ -129,7 +118,7 @@ var TableMenu = function (_a) {
|
|
|
129
118
|
return (React.createElement(React.Fragment, null,
|
|
130
119
|
React.createElement(Menu, { id: menuId },
|
|
131
120
|
React.createElement(Item, { data: "detail", onClick: onMenuItemClick }, i18next.t('查看明细')),
|
|
132
|
-
React.createElement(Item, { data: "fullscreen", onClick: onMenuItemClick }, isFull ? i18next.t('退出全屏') : i18next.t('全屏'))),
|
|
121
|
+
onEditableSave ? null : (React.createElement(Item, { data: "fullscreen", onClick: onMenuItemClick }, isFull ? i18next.t('退出全屏') : i18next.t('全屏')))),
|
|
133
122
|
React.createElement(Modal, { width: '800px', title: i18next.t('详情'), visible: visible, onCancel: onCancel, stick: true, loading: false, footer: React.createElement("div", { style: { textAlign: 'right', paddingRight: '10px' } },
|
|
134
123
|
React.createElement(Button, { type: "primary", onClick: onCancel }, i18next.t('关闭'))), getContainer: false },
|
|
135
124
|
React.createElement("div", { style: { maxHeight: '70vh', overflow: 'auto' } },
|
|
@@ -1247,9 +1247,7 @@ function Table(props) {
|
|
|
1247
1247
|
return (React.createElement(TableContextProvider, { value: { inTable: true, tableContainerRef: tableRef } },
|
|
1248
1248
|
React.createElement("div", { className: isFlex ? 'zt-table-flex' : 'zt-table--wrap-container', style: isFlex
|
|
1249
1249
|
? { position: 'relative', overflow: 'hidden', flex: 1 }
|
|
1250
|
-
:
|
|
1251
|
-
// 这里不能设置overflow:hidden,否则右键全屏之后,会导致表格中的弹出组件出现问题
|
|
1252
|
-
{ position: 'relative' }, ref: tableRef },
|
|
1250
|
+
: { position: 'relative', overflow: 'hidden' }, ref: tableRef },
|
|
1253
1251
|
React.createElement(DndProvider, { backend: HTML5Backend, context: window },
|
|
1254
1252
|
React.createElement(AntTable, __assign({ className: classes, bordered: bordered, pagination: showInnerPagination
|
|
1255
1253
|
? pagination
|
|
@@ -1262,7 +1260,7 @@ function Table(props) {
|
|
|
1262
1260
|
summary: summaryConfig ? onSummaryHandle : summary, rowSelection: rowSelection ? rowSelectionObj : rowSelection }, restProps)),
|
|
1263
1261
|
showColumnDynamic && dynamicVisible && (React.createElement(TableDynamic, { visible: dynamicVisible, onClose: hideDynamicHandle, onSave: saveDynamicHandle, onReset: resetDynamicHandle, columns: dynamicColumns, dynamicStorageKey: showColumnDynamicKey, innerDynamicList: initColumns || _columns || [], newColumns: newColumns }))),
|
|
1264
1262
|
React.createElement("div", { ref: tipRef, className: "table-subtotal--tip" }),
|
|
1265
|
-
menuId && (React.createElement(TableMenu, { menuId: menuId, columns: newColumns, originColumns: _columns, tableRef: tableRef, virtualTableKey: virtualTableKey, onEditableSave: props.onEditableSave
|
|
1263
|
+
menuId && (React.createElement(TableMenu, { menuId: menuId, columns: newColumns, originColumns: _columns, tableRef: tableRef, virtualTableKey: virtualTableKey, onEditableSave: props.onEditableSave })))));
|
|
1266
1264
|
}
|
|
1267
1265
|
// export default memo(Table, (prevProps, nextProps) => {
|
|
1268
1266
|
// return shallowEqual(prevProps, nextProps);
|