@qn-pandora/pandora-component 4.0.11 → 4.0.13
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/CHANGELOG.json +40 -0
- package/CHANGELOG.md +17 -1
- package/es/components/Drawer/index.d.ts +13 -2
- package/es/components/Drawer/index.js +38 -4
- package/es/components/FileResumable/index.js +70 -12
- package/es/components/Table/index.d.ts +2 -0
- package/es/components/Table/index.js +27 -5
- package/es/components/Tabs/index.d.ts +4 -0
- package/es/components/Tabs/index.js +2 -2
- package/es/constants/style.d.ts +1 -0
- package/es/constants/style.js +1 -0
- package/es/hoc/modalPopupContainer.d.ts +6 -0
- package/es/hoc/{popContainer.js → modalPopupContainer.js} +8 -3
- package/es/index.css +4940 -4940
- package/es/index.less +20 -20
- package/es/style/theme.less +2 -2
- package/es/utils/dom.d.ts +1 -0
- package/es/utils/dom.js +42 -0
- package/lib/components/Drawer/index.d.ts +13 -2
- package/lib/components/Drawer/index.js +37 -3
- package/lib/components/FileResumable/index.js +69 -11
- package/lib/components/Table/index.d.ts +2 -0
- package/lib/components/Table/index.js +27 -5
- package/lib/components/Tabs/index.d.ts +4 -0
- package/lib/components/Tabs/index.js +2 -2
- package/lib/constants/style.d.ts +1 -0
- package/lib/constants/style.js +1 -0
- package/lib/hoc/modalPopupContainer.d.ts +6 -0
- package/lib/hoc/{popContainer.js → modalPopupContainer.js} +9 -4
- package/lib/index.css +7189 -7189
- package/lib/index.less +17 -17
- package/lib/style/theme.less +2 -2
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/dom.js +45 -0
- package/package.json +9 -5
- package/es/hoc/popContainer.d.ts +0 -5
- package/lib/hoc/popContainer.d.ts +0 -5
package/CHANGELOG.json
CHANGED
@@ -1,6 +1,46 @@
|
|
1
1
|
{
|
2
2
|
"name": "@qn-pandora/pandora-component",
|
3
3
|
"entries": [
|
4
|
+
{
|
5
|
+
"version": "4.0.13",
|
6
|
+
"tag": "@qn-pandora/pandora-component_v4.0.13",
|
7
|
+
"date": "Tue, 06 Jun 2023 07:33:10 GMT",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"comment": "2023.06.06发布"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"dependency": [
|
15
|
+
{
|
16
|
+
"comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.15` to `^3.0.16`"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.16` to `^3.0.17`"
|
20
|
+
}
|
21
|
+
]
|
22
|
+
}
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"version": "4.0.12",
|
26
|
+
"tag": "@qn-pandora/pandora-component_v4.0.12",
|
27
|
+
"date": "Mon, 29 May 2023 10:29:42 GMT",
|
28
|
+
"comments": {
|
29
|
+
"patch": [
|
30
|
+
{
|
31
|
+
"comment": "2023.05.29发包"
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"dependency": [
|
35
|
+
{
|
36
|
+
"comment": "Updating dependency \"@qn-pandora/pandora-component-icons\" from `^3.0.14` to `^3.0.15`"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"comment": "Updating dependency \"@qn-pandora/app-sdk\" from `^3.0.15` to `^3.0.16`"
|
40
|
+
}
|
41
|
+
]
|
42
|
+
}
|
43
|
+
},
|
4
44
|
{
|
5
45
|
"version": "4.0.11",
|
6
46
|
"tag": "@qn-pandora/pandora-component_v4.0.11",
|
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
# Change Log - @qn-pandora/pandora-component
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 06 Jun 2023 07:33:10 GMT and should not be manually modified.
|
4
|
+
|
5
|
+
## 4.0.13
|
6
|
+
|
7
|
+
Tue, 06 Jun 2023 07:33:10 GMT
|
8
|
+
|
9
|
+
### Patches
|
10
|
+
|
11
|
+
- 2023.06.06 发布
|
12
|
+
|
13
|
+
## 4.0.12
|
14
|
+
|
15
|
+
Mon, 29 May 2023 10:29:42 GMT
|
16
|
+
|
17
|
+
### Patches
|
18
|
+
|
19
|
+
- 2023.05.29 发包
|
4
20
|
|
5
21
|
## 4.0.11
|
6
22
|
|
@@ -51,15 +51,20 @@ export declare type IDrawerProps = Overwrite<DrawerProps, {
|
|
51
51
|
*/
|
52
52
|
zIndex?: number;
|
53
53
|
getContainer?: string | HTMLElement | getContainerFunc | false;
|
54
|
-
onClose?: (e: EventType) => void;
|
54
|
+
onClose?: (e: EventType | null) => void;
|
55
55
|
afterVisibleChange?: (visible: boolean) => void;
|
56
56
|
/**
|
57
57
|
* 是否允许拖拽
|
58
58
|
*/
|
59
59
|
canDrag?: boolean;
|
60
60
|
closeIconPlacement?: 'left' | 'right';
|
61
|
+
/**
|
62
|
+
* 无遮罩时点击空白处中的哪些元素不关闭
|
63
|
+
*/
|
64
|
+
nonCloseSelector?: string;
|
61
65
|
}>;
|
62
66
|
export declare class Drawer extends React.Component<React.PropsWithChildren<IDrawerProps>, any> {
|
67
|
+
drawerId: string;
|
63
68
|
isResizing: boolean;
|
64
69
|
realWidth: string | number | undefined;
|
65
70
|
throttleMouseMove: import("lodash").DebouncedFunc<(e: any) => void>;
|
@@ -70,6 +75,7 @@ export declare class Drawer extends React.Component<React.PropsWithChildren<IDra
|
|
70
75
|
onMouseDown(): void;
|
71
76
|
onMouseUp(): void;
|
72
77
|
onMouseMove(e: any): void;
|
78
|
+
onMouseClick(e: MouseEvent): void;
|
73
79
|
componentDidMount(): void;
|
74
80
|
UNSAFE_componentWillUpdate(nextProps: Readonly<React.PropsWithChildren<IDrawerProps>>): void;
|
75
81
|
componentWillUnmount(): void;
|
@@ -122,17 +128,22 @@ declare const _default: (props: {
|
|
122
128
|
*/
|
123
129
|
zIndex?: number | undefined;
|
124
130
|
getContainer?: string | false | HTMLElement | getContainerFunc | undefined;
|
125
|
-
onClose?: ((e:
|
131
|
+
onClose?: ((e: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement | HTMLButtonElement, MouseEvent> | null) => void) | undefined;
|
126
132
|
afterVisibleChange?: ((visible: boolean) => void) | undefined;
|
127
133
|
/**
|
128
134
|
* 是否允许拖拽
|
129
135
|
*/
|
130
136
|
canDrag?: boolean | undefined;
|
131
137
|
closeIconPlacement?: import("antd/es/collapse/Collapse").ExpandIconPosition;
|
138
|
+
/**
|
139
|
+
* 无遮罩时点击空白处中的哪些元素不关闭
|
140
|
+
*/
|
141
|
+
nonCloseSelector?: string | undefined;
|
132
142
|
} & Pick<DrawerProps, "style" | "autoFocus" | "size" | "prefixCls" | "footer" | "extra" | "bodyStyle" | "forceRender" | "keyboard" | "destroyOnClose" | "closeIcon" | "drawerStyle" | "headerStyle" | "contentWrapperStyle" | "push" | "handler" | "footerStyle" | "level" | "levelMove"> & {
|
133
143
|
children?: React.ReactNode;
|
134
144
|
} & {
|
135
145
|
bodyStyle?: React.CSSProperties | undefined;
|
136
146
|
children: React.ReactNode;
|
147
|
+
title?: React.ReactNode;
|
137
148
|
}) => JSX.Element;
|
138
149
|
export default _default;
|
@@ -49,8 +49,9 @@ import { observer } from 'mobx-react';
|
|
49
49
|
import { observable, action, computed } from 'mobx';
|
50
50
|
import { Drawer as BaseDrawer } from 'antd';
|
51
51
|
import { CloseOutlined } from '@ant-design/icons';
|
52
|
-
import {
|
53
|
-
import
|
52
|
+
import { doesDOMMatchSelector } from '../../utils/dom';
|
53
|
+
import { SDK_PREFIX, ANT_PREFIX } from '../../constants/style';
|
54
|
+
import modalPopupContainerWrapper from '../../hoc/modalPopupContainer';
|
54
55
|
import bind from '../../utils/bind';
|
55
56
|
var MAX_WIDTH = 6000;
|
56
57
|
var MIN_WIDTH = 300;
|
@@ -58,6 +59,7 @@ var Drawer = /** @class */ (function (_super) {
|
|
58
59
|
__extends(Drawer, _super);
|
59
60
|
function Drawer() {
|
60
61
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
62
|
+
_this.drawerId = "drawer-id-" + Math.floor(Math.random() * 10000);
|
61
63
|
_this.isResizing = false;
|
62
64
|
_this.realWidth = _this.props.width;
|
63
65
|
_this.throttleMouseMove = throttle(function (e) { return _this.onMouseMove(e); }, 100);
|
@@ -108,11 +110,36 @@ var Drawer = /** @class */ (function (_super) {
|
|
108
110
|
}
|
109
111
|
}
|
110
112
|
};
|
113
|
+
Drawer.prototype.onMouseClick = function (e) {
|
114
|
+
var _a = this.props, mask = _a.mask, maskClosable = _a.maskClosable, nonCloseSelector = _a.nonCloseSelector, onClose = _a.onClose, visible = _a.visible;
|
115
|
+
if (mask === false && maskClosable && visible) {
|
116
|
+
var currentEl = e.target;
|
117
|
+
var shouldClose = true;
|
118
|
+
while (currentEl) {
|
119
|
+
if (nonCloseSelector) {
|
120
|
+
if (doesDOMMatchSelector(nonCloseSelector, currentEl)) {
|
121
|
+
shouldClose = false;
|
122
|
+
break;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
if (doesDOMMatchSelector("." + this.drawerId, currentEl) ||
|
126
|
+
doesDOMMatchSelector("." + ANT_PREFIX + "-modal-root, .ant-modal-root", currentEl)) {
|
127
|
+
shouldClose = false;
|
128
|
+
break;
|
129
|
+
}
|
130
|
+
currentEl = currentEl.parentElement;
|
131
|
+
}
|
132
|
+
if (shouldClose) {
|
133
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(null);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
};
|
111
137
|
Drawer.prototype.componentDidMount = function () {
|
112
138
|
if (this.props.canDrag) {
|
113
139
|
document.addEventListener('mousemove', this.throttleMouseMove);
|
114
140
|
document.addEventListener('mouseup', this.onMouseUp);
|
115
141
|
}
|
142
|
+
document.body.addEventListener('click', this.onMouseClick);
|
116
143
|
};
|
117
144
|
Drawer.prototype.UNSAFE_componentWillUpdate = function (nextProps) {
|
118
145
|
if (nextProps.canDrag && !this.props.canDrag) {
|
@@ -123,11 +150,12 @@ var Drawer = /** @class */ (function (_super) {
|
|
123
150
|
Drawer.prototype.componentWillUnmount = function () {
|
124
151
|
document.removeEventListener('mousemove', this.throttleMouseMove);
|
125
152
|
document.removeEventListener('mouseup', this.onMouseUp);
|
153
|
+
document.body.removeEventListener('click', this.onMouseClick);
|
126
154
|
};
|
127
155
|
Drawer.prototype.render = function () {
|
128
156
|
var _a;
|
129
157
|
var _b = this.props, width = _b.width, className = _b.className, children = _b.children, canDrag = _b.canDrag, visible = _b.visible, closable = _b.closable, extra = _b.extra, other = __rest(_b, ["width", "className", "children", "canDrag", "visible", "closable", "extra"]);
|
130
|
-
return (React.createElement(BaseDrawer, __assign({ className: classnames(SDK_PREFIX + "-drawer", className, (_a = {},
|
158
|
+
return (React.createElement(BaseDrawer, __assign({ className: classnames(this.drawerId, SDK_PREFIX + "-drawer", className, (_a = {},
|
131
159
|
_a[SDK_PREFIX + "-drawer-no-mask"] = this.props.mask === false,
|
132
160
|
_a)), width: this.realWidth || 'auto', zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra }, other),
|
133
161
|
canDrag && (React.createElement("div", { className: SDK_PREFIX + "-scroll-handler", onMouseDown: this.onMouseDown })),
|
@@ -183,10 +211,16 @@ var Drawer = /** @class */ (function (_super) {
|
|
183
211
|
__metadata("design:paramtypes", [Object]),
|
184
212
|
__metadata("design:returntype", void 0)
|
185
213
|
], Drawer.prototype, "onMouseMove", null);
|
214
|
+
__decorate([
|
215
|
+
bind,
|
216
|
+
__metadata("design:type", Function),
|
217
|
+
__metadata("design:paramtypes", [MouseEvent]),
|
218
|
+
__metadata("design:returntype", void 0)
|
219
|
+
], Drawer.prototype, "onMouseClick", null);
|
186
220
|
Drawer = __decorate([
|
187
221
|
observer
|
188
222
|
], Drawer);
|
189
223
|
return Drawer;
|
190
224
|
}(React.Component));
|
191
225
|
export { Drawer };
|
192
|
-
export default
|
226
|
+
export default modalPopupContainerWrapper(Drawer);
|
@@ -74,12 +74,14 @@ var __read = (this && this.__read) || function (o, n) {
|
|
74
74
|
};
|
75
75
|
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
76
76
|
import Resumablejs from 'resumablejs';
|
77
|
+
import uuid from 'uuid';
|
78
|
+
import md5 from 'crypto-js/md5';
|
77
79
|
import { Progress, Tooltip, Upload } from 'antd';
|
78
80
|
import { ConfigContext } from 'antd/es/config-provider';
|
79
81
|
import classnames from 'classnames';
|
80
82
|
import { get } from 'lodash';
|
81
83
|
import { CaretRightOutlined, Upload as UploadIcon, StopFill, Pause, PlusOutlined } from '@qn-pandora/pandora-component-icons';
|
82
|
-
import { appEnv } from '@qn-pandora/app-sdk';
|
84
|
+
import { appEnv, fileIsExit } from '@qn-pandora/app-sdk';
|
83
85
|
import { formatString } from '../../utils/language';
|
84
86
|
import { UploadLocale } from '../../constants/language/upload/type';
|
85
87
|
import { SDK_PREFIX } from '../../constants/style';
|
@@ -223,12 +225,6 @@ export default function FileResumable(props) {
|
|
223
225
|
mode,
|
224
226
|
handleReadeImageFile
|
225
227
|
]);
|
226
|
-
var handleStart = useCallback(function () {
|
227
|
-
var _a, _b;
|
228
|
-
(_a = resumable.current) === null || _a === void 0 ? void 0 : _a.updateQuery(query);
|
229
|
-
(_b = resumable.current) === null || _b === void 0 ? void 0 : _b.upload();
|
230
|
-
setShowTool(true);
|
231
|
-
}, [query, setShowTool]);
|
232
228
|
var handleFileSuccess = useCallback(function (message) {
|
233
229
|
var _a;
|
234
230
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(message);
|
@@ -245,11 +241,6 @@ export default function FileResumable(props) {
|
|
245
241
|
setShowTool,
|
246
242
|
setPercent
|
247
243
|
]);
|
248
|
-
var handleUploadStart = useCallback(function () {
|
249
|
-
setIsPlayDisabled(true);
|
250
|
-
setIsPauseDisabled(false);
|
251
|
-
setIsStopDisabled(false);
|
252
|
-
}, [setIsPlayDisabled, setIsPauseDisabled, setIsStopDisabled]);
|
253
244
|
var handleError = useCallback(function (error) {
|
254
245
|
var _a;
|
255
246
|
(_a = resumable.current) === null || _a === void 0 ? void 0 : _a.cancel();
|
@@ -269,6 +260,73 @@ export default function FileResumable(props) {
|
|
269
260
|
setShowTool,
|
270
261
|
onError
|
271
262
|
]);
|
263
|
+
var handleStart = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
264
|
+
var params, realFile_1, reader;
|
265
|
+
var _this = this;
|
266
|
+
return __generator(this, function (_a) {
|
267
|
+
params = __assign({}, query);
|
268
|
+
if (fileList.length === 1) {
|
269
|
+
realFile_1 = fileList[0];
|
270
|
+
reader = new FileReader();
|
271
|
+
reader.readAsText(realFile_1.size > 50 * 1024 * 1024
|
272
|
+
? realFile_1.slice(0, 2 * 1024 * 1024)
|
273
|
+
: realFile_1);
|
274
|
+
reader.onloadend = function (e) { return __awaiter(_this, void 0, void 0, function () {
|
275
|
+
var md5Str, id, fileId, error_1;
|
276
|
+
var _a, _b, _c;
|
277
|
+
return __generator(this, function (_d) {
|
278
|
+
switch (_d.label) {
|
279
|
+
case 0:
|
280
|
+
if (!(e.target.readyState === FileReader.DONE)) return [3 /*break*/, 5];
|
281
|
+
md5Str = md5(e.target.result).toString();
|
282
|
+
id = '';
|
283
|
+
_d.label = 1;
|
284
|
+
case 1:
|
285
|
+
_d.trys.push([1, 3, , 4]);
|
286
|
+
return [4 /*yield*/, fileIsExit({
|
287
|
+
resumableModifyTime: realFile_1.lastModified,
|
288
|
+
resumableFilename: realFile_1.name,
|
289
|
+
resumableType: realFile_1.type,
|
290
|
+
resumableFileMd5: md5Str,
|
291
|
+
resumableTotalSize: realFile_1.size
|
292
|
+
})];
|
293
|
+
case 2:
|
294
|
+
fileId = (_d.sent()).fileId;
|
295
|
+
id = fileId;
|
296
|
+
return [3 /*break*/, 4];
|
297
|
+
case 3:
|
298
|
+
error_1 = _d.sent();
|
299
|
+
handleError(get(error_1, 'message'));
|
300
|
+
return [3 /*break*/, 4];
|
301
|
+
case 4:
|
302
|
+
if (!id) {
|
303
|
+
params.resumableFileMd5 = md5Str;
|
304
|
+
params.resumableModifyTime = realFile_1.lastModified;
|
305
|
+
params.resumableIdentifier = uuid();
|
306
|
+
(_a = resumable.current) === null || _a === void 0 ? void 0 : _a.updateQuery(params);
|
307
|
+
(_b = resumable.current) === null || _b === void 0 ? void 0 : _b.upload();
|
308
|
+
}
|
309
|
+
else {
|
310
|
+
handleFileSuccess(JSON.stringify({
|
311
|
+
fileId: id
|
312
|
+
}));
|
313
|
+
(_c = resumable.current) === null || _c === void 0 ? void 0 : _c.cancel();
|
314
|
+
}
|
315
|
+
_d.label = 5;
|
316
|
+
case 5: return [2 /*return*/];
|
317
|
+
}
|
318
|
+
});
|
319
|
+
}); };
|
320
|
+
}
|
321
|
+
setShowTool(true);
|
322
|
+
return [2 /*return*/];
|
323
|
+
});
|
324
|
+
}); }, [query, setShowTool, fileList, handleError, handleFileSuccess]);
|
325
|
+
var handleUploadStart = useCallback(function () {
|
326
|
+
setIsPlayDisabled(true);
|
327
|
+
setIsPauseDisabled(false);
|
328
|
+
setIsStopDisabled(false);
|
329
|
+
}, [setIsPlayDisabled, setIsPauseDisabled, setIsStopDisabled]);
|
272
330
|
var init = useCallback(function () {
|
273
331
|
var ResumableField = new Resumablejs(__assign(__assign({ permanentErrors: [400, 404, 415, 500, 501, 409] }, others), { target: others.target || appEnv.getApiPrefix() + "/upload/file" }));
|
274
332
|
ResumableField.on('fileSuccess', function (_file, message) {
|
@@ -29,6 +29,7 @@ export interface ITableProps<T> extends TableProps<T> {
|
|
29
29
|
selectedRows?: T[];
|
30
30
|
/** 如果支持多选,则batchOptions为多选时的一些批量操作,如删除、添加等 */
|
31
31
|
batchOptions?: IOptionItem[];
|
32
|
+
emptyText?: React.ReactNode;
|
32
33
|
}
|
33
34
|
/**
|
34
35
|
* pandora2.0风格的表格
|
@@ -48,6 +49,7 @@ declare class Table<T = any> extends React.Component<ITableProps<T>, any> {
|
|
48
49
|
get rowSelection(): TableRowSelection<T> | undefined;
|
49
50
|
get undisabledData(): readonly T[];
|
50
51
|
get keysOfCurrentPage(): any[];
|
52
|
+
get emptyTextComp(): {};
|
51
53
|
getRowKey(row: any, index: number): any;
|
52
54
|
setIndeterminate(indeterminate: boolean): void;
|
53
55
|
setCheckAll(checkAll: boolean): void;
|
@@ -154,6 +154,26 @@ var Table = /** @class */ (function (_super) {
|
|
154
154
|
enumerable: true,
|
155
155
|
configurable: true
|
156
156
|
});
|
157
|
+
Object.defineProperty(Table.prototype, "emptyTextComp", {
|
158
|
+
get: function () {
|
159
|
+
var emptyText = this.props.emptyText;
|
160
|
+
if (!emptyText) {
|
161
|
+
return (React.createElement("div", { className: SDK_PREFIX + "-table-empty" },
|
162
|
+
React.createElement("div", { className: SDK_PREFIX + "-table-empty-icon" },
|
163
|
+
React.createElement(EmptyIcon, null)),
|
164
|
+
React.createElement("div", { className: SDK_PREFIX + "-table-empty-text" }, formatString(TableLocale.empty, this.context.locale))));
|
165
|
+
}
|
166
|
+
if (typeof emptyText === 'string' || typeof emptyText === 'number') {
|
167
|
+
return (React.createElement("div", { className: SDK_PREFIX + "-table-empty" },
|
168
|
+
React.createElement("div", { className: SDK_PREFIX + "-table-empty-icon" },
|
169
|
+
React.createElement(EmptyIcon, null)),
|
170
|
+
React.createElement("div", { className: SDK_PREFIX + "-table-empty-text" }, emptyText)));
|
171
|
+
}
|
172
|
+
return emptyText;
|
173
|
+
},
|
174
|
+
enumerable: true,
|
175
|
+
configurable: true
|
176
|
+
});
|
157
177
|
Table.prototype.getRowKey = function (row, index) {
|
158
178
|
var rowKey = this.props.rowKey;
|
159
179
|
if (typeof rowKey === 'function') {
|
@@ -238,12 +258,9 @@ var Table = /** @class */ (function (_super) {
|
|
238
258
|
Table.prototype.render = function () {
|
239
259
|
var _a, _b;
|
240
260
|
var _this = this;
|
241
|
-
var _c = this.props, className = _c.className, batchOptions = _c.batchOptions, scroll = _c.scroll, locale = _c.locale, restProps = __rest(_c, ["className", "batchOptions", "scroll", "locale"]);
|
261
|
+
var _c = this.props, className = _c.className, batchOptions = _c.batchOptions, scroll = _c.scroll, locale = _c.locale, emptyText = _c.emptyText, restProps = __rest(_c, ["className", "batchOptions", "scroll", "locale", "emptyText"]);
|
242
262
|
return (React.createElement("div", null,
|
243
|
-
React.createElement(AntTable, __assign({ scroll: scroll, locale: __assign({ emptyText:
|
244
|
-
React.createElement("div", { className: SDK_PREFIX + "-table-empty-icon" },
|
245
|
-
React.createElement(EmptyIcon, null)),
|
246
|
-
React.createElement("div", { className: SDK_PREFIX + "-table-empty-text" }, formatString(TableLocale.empty, this.context.locale)))) }, locale) }, restProps, { className: classnames(SDK_PREFIX + "-table-wrapper", (_a = {}, _a[SDK_PREFIX + "-table-scrollX"] = get(scroll, 'x'), _a), (_b = {}, _b[SDK_PREFIX + "-table-scrollY"] = get(scroll, 'y'), _b), className),
|
263
|
+
React.createElement(AntTable, __assign({ scroll: scroll, locale: __assign({ emptyText: this.emptyTextComp }, locale) }, restProps, { className: classnames(SDK_PREFIX + "-table-wrapper", (_a = {}, _a[SDK_PREFIX + "-table-scrollX"] = get(scroll, 'x'), _a), (_b = {}, _b[SDK_PREFIX + "-table-scrollY"] = get(scroll, 'y'), _b), className),
|
247
264
|
// 涉及到权限
|
248
265
|
// getCheckboxProps只能放到tableBatchWrapper里,因为selectedRowKeys在那个组件计算
|
249
266
|
rowSelection: batchOptions && this.props.rowSelection
|
@@ -297,6 +314,11 @@ var Table = /** @class */ (function (_super) {
|
|
297
314
|
__metadata("design:type", Object),
|
298
315
|
__metadata("design:paramtypes", [])
|
299
316
|
], Table.prototype, "keysOfCurrentPage", null);
|
317
|
+
__decorate([
|
318
|
+
computed,
|
319
|
+
__metadata("design:type", Object),
|
320
|
+
__metadata("design:paramtypes", [])
|
321
|
+
], Table.prototype, "emptyTextComp", null);
|
300
322
|
__decorate([
|
301
323
|
bind,
|
302
324
|
__metadata("design:type", Function),
|
@@ -32,7 +32,7 @@ export function Tabs(props) {
|
|
32
32
|
var className = props.className, active = props.active, options = props.options, onChange = props.onChange, refreshText = props.refreshText, onRefresh = props.onRefresh, restProps = __rest(props, ["className", "active", "options", "onChange", "refreshText", "onRefresh"]);
|
33
33
|
var panes = options.map(function (_a) {
|
34
34
|
var _b;
|
35
|
-
var key = _a.key, text = _a.text, hidden = _a.hidden, refreshTextCur = _a.refreshText, onRefreshCur = _a.onRefresh;
|
35
|
+
var key = _a.key, text = _a.text, children = _a.children, hidden = _a.hidden, refreshTextCur = _a.refreshText, onRefreshCur = _a.onRefresh;
|
36
36
|
if (hidden) {
|
37
37
|
return null;
|
38
38
|
}
|
@@ -44,7 +44,7 @@ export function Tabs(props) {
|
|
44
44
|
_b)) },
|
45
45
|
text,
|
46
46
|
refresh));
|
47
|
-
return React.createElement(BaseTabs.TabPane, { key: key, tab: tab });
|
47
|
+
return (React.createElement(BaseTabs.TabPane, { key: key, tab: tab }, children));
|
48
48
|
});
|
49
49
|
return (React.createElement(BaseTabs, __assign({ className: classnames(SDK_PREFIX + "-tabs", className), tabBarGutter: 16, activeKey: active, onChange: onChange }, restProps), panes));
|
50
50
|
}
|
package/es/constants/style.d.ts
CHANGED
package/es/constants/style.js
CHANGED
@@ -23,14 +23,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
23
23
|
import React, { useRef, useCallback } from 'react';
|
24
24
|
import ConfigProvider, { ConfigConsumer } from 'antd/es/config-provider';
|
25
25
|
import { SDK_PREFIX } from '../constants/style';
|
26
|
-
export default function
|
26
|
+
export default function modalPopupContainerWrapper(Comp) {
|
27
27
|
return function (props) {
|
28
28
|
var containerRef = useRef(null);
|
29
|
-
var
|
29
|
+
var titleRef = useRef(null);
|
30
|
+
var _a = props.bodyStyle, bodyStyle = _a === void 0 ? {} : _a, children = props.children, title = props.title, rest = __rest(props, ["bodyStyle", "children", "title"]);
|
30
31
|
var childrenGetPopupContainer = useCallback(function () {
|
31
32
|
return (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) || document.body;
|
32
33
|
}, []);
|
33
|
-
|
34
|
+
var titleGetPopupContainer = useCallback(function () {
|
35
|
+
return (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) || document.body;
|
36
|
+
}, []);
|
37
|
+
return (React.createElement(Comp, __assign({}, rest, { title: React.createElement("div", { ref: titleRef },
|
38
|
+
React.createElement(ConfigConsumer, null, function (config) { return (React.createElement(ConfigProvider, __assign({}, config, { getPopupContainer: titleGetPopupContainer }), title)); })) }),
|
34
39
|
React.createElement("div", { className: SDK_PREFIX + "-drawer-container", ref: containerRef, style: bodyStyle },
|
35
40
|
React.createElement(ConfigConsumer, null, function (config) { return (React.createElement(ConfigProvider, __assign({}, config, { getPopupContainer: childrenGetPopupContainer }), children)); }))));
|
36
41
|
};
|