@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.
Files changed (37) hide show
  1. package/CHANGELOG.json +40 -0
  2. package/CHANGELOG.md +17 -1
  3. package/es/components/Drawer/index.d.ts +13 -2
  4. package/es/components/Drawer/index.js +38 -4
  5. package/es/components/FileResumable/index.js +70 -12
  6. package/es/components/Table/index.d.ts +2 -0
  7. package/es/components/Table/index.js +27 -5
  8. package/es/components/Tabs/index.d.ts +4 -0
  9. package/es/components/Tabs/index.js +2 -2
  10. package/es/constants/style.d.ts +1 -0
  11. package/es/constants/style.js +1 -0
  12. package/es/hoc/modalPopupContainer.d.ts +6 -0
  13. package/es/hoc/{popContainer.js → modalPopupContainer.js} +8 -3
  14. package/es/index.css +4940 -4940
  15. package/es/index.less +20 -20
  16. package/es/style/theme.less +2 -2
  17. package/es/utils/dom.d.ts +1 -0
  18. package/es/utils/dom.js +42 -0
  19. package/lib/components/Drawer/index.d.ts +13 -2
  20. package/lib/components/Drawer/index.js +37 -3
  21. package/lib/components/FileResumable/index.js +69 -11
  22. package/lib/components/Table/index.d.ts +2 -0
  23. package/lib/components/Table/index.js +27 -5
  24. package/lib/components/Tabs/index.d.ts +4 -0
  25. package/lib/components/Tabs/index.js +2 -2
  26. package/lib/constants/style.d.ts +1 -0
  27. package/lib/constants/style.js +1 -0
  28. package/lib/hoc/modalPopupContainer.d.ts +6 -0
  29. package/lib/hoc/{popContainer.js → modalPopupContainer.js} +9 -4
  30. package/lib/index.css +7189 -7189
  31. package/lib/index.less +17 -17
  32. package/lib/style/theme.less +2 -2
  33. package/lib/utils/dom.d.ts +1 -0
  34. package/lib/utils/dom.js +45 -0
  35. package/package.json +9 -5
  36. package/es/hoc/popContainer.d.ts +0 -5
  37. package/lib/hoc/popContainer.d.ts +0 -5
package/es/index.less CHANGED
@@ -1,50 +1,50 @@
1
1
  @import './style\mixin.less';
2
2
  @import './style\theme.less';
3
- @import './components\AutoComplete\style.less';
4
3
  @import './components\Button\style.less';
4
+ @import './components\AutoComplete\style.less';
5
5
  @import './components\Breadcrumb\style.less';
6
- @import './components\Card\style.less';
7
6
  @import './components\Checkbox\style.less';
8
7
  @import './components\CheckboxList\style.less';
9
- @import './components\CheckTransformList\style.less';
10
- @import './components\Collapse\style.less';
8
+ @import './components\Card\style.less';
11
9
  @import './components\CollapsiblePanel\style.less';
12
- @import './components\DateTimePicker\style.less';
10
+ @import './components\Collapse\style.less';
13
11
  @import './components\Drawer\style.less';
14
- @import './components\Input\style.less';
12
+ @import './components\CheckTransformList\style.less';
13
+ @import './components\DateTimePicker\style.less';
15
14
  @import './components\FileResumable\style.less';
15
+ @import './components\Input\style.less';
16
16
  @import './components\KeyValuePair\style.less';
17
- @import './components\NameExplainTooltip\style.less';
18
17
  @import './components\Menu\style.less';
19
- @import './components\NameLimiter\style.less';
20
18
  @import './components\Modal\style.less';
19
+ @import './components\NameExplainTooltip\style.less';
20
+ @import './components\NameLimiter\style.less';
21
21
  @import './components\OptionList\style.less';
22
22
  @import './components\RadioGroup\style.less';
23
23
  @import './components\RangeInput\style.less';
24
24
  @import './components\RemarkName\style.less';
25
25
  @import './components\Selector\style.less';
26
- @import './components\Steps\style.less';
27
26
  @import './components\Spin\style.less';
28
- @import './components\Tabs\style.less';
27
+ @import './components\Steps\style.less';
29
28
  @import './components\Table\style.less';
30
- @import './components\TagList\style.less';
31
- @import './components\Transfer\style.less';
29
+ @import './components\Tabs\style.less';
32
30
  @import './components\Timeline\style.less';
33
31
  @import './components\TreeSelector\style.less';
34
- @import './components\Card\RowExtra\style.less';
32
+ @import './components\Transfer\style.less';
33
+ @import './components\TagList\style.less';
35
34
  @import './components\Card\SearchInput\style.less';
35
+ @import './components\Card\RowExtra\style.less';
36
36
  @import './components\DateTimePicker\Base\style.less';
37
- @import './components\DateTimePicker\BaseMobile\style.less';
38
37
  @import './components\DateTimePicker\DisplayInput\style.less';
39
- @import './components\OptionList\InlineOptionList\style.less';
38
+ @import './components\DateTimePicker\BaseMobile\style.less';
40
39
  @import './components\OptionList\OptionItem\style.less';
40
+ @import './components\OptionList\InlineOptionList\style.less';
41
41
  @import './components\OptionList\PopoverOptionList\style.less';
42
- @import './components\Steps\ControlButton\style.less';
43
42
  @import './components\Table\ColumnTag\style.less';
43
+ @import './components\Steps\ControlButton\style.less';
44
44
  @import './components\Transfer\List\style.less';
45
+ @import './components\Timeline\TimelineItem\style.less';
46
+ @import './components\Transfer\ListBody\style.less';
45
47
  @import './components\TagList\Tag\style.less';
46
48
  @import './components\TagList\TagSwitch\style.less';
47
- @import './components\Transfer\ListBody\style.less';
48
- @import './components\Timeline\TimelineItem\style.less';
49
- @import './components\DateTimePicker\BaseMobile\Absolute\style.less';
50
- @import './components\DateTimePicker\Collapse\Panel\style.less';
49
+ @import './components\DateTimePicker\Collapse\Panel\style.less';
50
+ @import './components\DateTimePicker\BaseMobile\Absolute\style.less';
@@ -388,5 +388,5 @@
388
388
  @editor_nav_border_color: #d8d8d8;
389
389
  @editor_nav_line_color: #fcce72;
390
390
  @image-operator-hover-bg: rgba(51, 51, 51, 0.7);
391
- @agent-user-color: #853ee8; // 智能机器人智能鼓用户头像颜色
392
- @agent-user-message-background-color: #f7f7f8; // 用户框背景色
391
+ @agent-agent-message-background-color: #f7f7f8; // 用户框背景色
392
+ @agent-user-avatar-color: #e6902d; // 机器人用户头像颜色;
@@ -0,0 +1 @@
1
+ export declare function doesDOMMatchSelector(selector: string, element: HTMLElement): boolean;
@@ -0,0 +1,42 @@
1
+ var __values = (this && this.__values) || function(o) {
2
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
+ if (m) return m.call(o);
4
+ if (o && typeof o.length === "number") return {
5
+ next: function () {
6
+ if (o && i >= o.length) o = void 0;
7
+ return { value: o && o[i++], done: !o };
8
+ }
9
+ };
10
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
+ };
12
+ // 判断css选择器selector是否命中element
13
+ export function doesDOMMatchSelector(selector, element) {
14
+ var e_1, _a;
15
+ var _b;
16
+ // Check if the browser supports matches() method
17
+ if (typeof element.matches === 'function') {
18
+ return element.matches(selector);
19
+ }
20
+ // Check if the browser supports webkitMatchesSelector() method
21
+ if (typeof element.webkitMatchesSelector === 'function') {
22
+ return element.webkitMatchesSelector(selector);
23
+ }
24
+ // If none of the above methods are supported, fall back to querySelectorAll()
25
+ var matches = ((_b = element.ownerDocument) === null || _b === void 0 ? void 0 : _b.querySelectorAll(selector)) || [];
26
+ try {
27
+ for (var _c = __values(Array.from(matches)), _d = _c.next(); !_d.done; _d = _c.next()) {
28
+ var el = _d.value;
29
+ if (el === element) {
30
+ return true;
31
+ }
32
+ }
33
+ }
34
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
35
+ finally {
36
+ try {
37
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
38
+ }
39
+ finally { if (e_1) throw e_1.error; }
40
+ }
41
+ return false;
42
+ }
@@ -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: EventType) => void) | undefined;
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;
@@ -54,8 +54,9 @@ var mobx_react_1 = require("mobx-react");
54
54
  var mobx_1 = require("mobx");
55
55
  var antd_1 = require("antd");
56
56
  var icons_1 = require("@ant-design/icons");
57
+ var dom_1 = require("../../utils/dom");
57
58
  var style_1 = require("../../constants/style");
58
- var popContainer_1 = __importDefault(require("../../hoc/popContainer"));
59
+ var modalPopupContainer_1 = __importDefault(require("../../hoc/modalPopupContainer"));
59
60
  var bind_1 = __importDefault(require("../../utils/bind"));
60
61
  var MAX_WIDTH = 6000;
61
62
  var MIN_WIDTH = 300;
@@ -63,6 +64,7 @@ var Drawer = /** @class */ (function (_super) {
63
64
  __extends(Drawer, _super);
64
65
  function Drawer() {
65
66
  var _this = _super !== null && _super.apply(this, arguments) || this;
67
+ _this.drawerId = "drawer-id-" + Math.floor(Math.random() * 10000);
66
68
  _this.isResizing = false;
67
69
  _this.realWidth = _this.props.width;
68
70
  _this.throttleMouseMove = lodash_1.throttle(function (e) { return _this.onMouseMove(e); }, 100);
@@ -113,11 +115,36 @@ var Drawer = /** @class */ (function (_super) {
113
115
  }
114
116
  }
115
117
  };
118
+ Drawer.prototype.onMouseClick = function (e) {
119
+ var _a = this.props, mask = _a.mask, maskClosable = _a.maskClosable, nonCloseSelector = _a.nonCloseSelector, onClose = _a.onClose, visible = _a.visible;
120
+ if (mask === false && maskClosable && visible) {
121
+ var currentEl = e.target;
122
+ var shouldClose = true;
123
+ while (currentEl) {
124
+ if (nonCloseSelector) {
125
+ if (dom_1.doesDOMMatchSelector(nonCloseSelector, currentEl)) {
126
+ shouldClose = false;
127
+ break;
128
+ }
129
+ }
130
+ if (dom_1.doesDOMMatchSelector("." + this.drawerId, currentEl) ||
131
+ dom_1.doesDOMMatchSelector("." + style_1.ANT_PREFIX + "-modal-root, .ant-modal-root", currentEl)) {
132
+ shouldClose = false;
133
+ break;
134
+ }
135
+ currentEl = currentEl.parentElement;
136
+ }
137
+ if (shouldClose) {
138
+ onClose === null || onClose === void 0 ? void 0 : onClose(null);
139
+ }
140
+ }
141
+ };
116
142
  Drawer.prototype.componentDidMount = function () {
117
143
  if (this.props.canDrag) {
118
144
  document.addEventListener('mousemove', this.throttleMouseMove);
119
145
  document.addEventListener('mouseup', this.onMouseUp);
120
146
  }
147
+ document.body.addEventListener('click', this.onMouseClick);
121
148
  };
122
149
  Drawer.prototype.UNSAFE_componentWillUpdate = function (nextProps) {
123
150
  if (nextProps.canDrag && !this.props.canDrag) {
@@ -128,11 +155,12 @@ var Drawer = /** @class */ (function (_super) {
128
155
  Drawer.prototype.componentWillUnmount = function () {
129
156
  document.removeEventListener('mousemove', this.throttleMouseMove);
130
157
  document.removeEventListener('mouseup', this.onMouseUp);
158
+ document.body.removeEventListener('click', this.onMouseClick);
131
159
  };
132
160
  Drawer.prototype.render = function () {
133
161
  var _a;
134
162
  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"]);
135
- return (react_1.default.createElement(antd_1.Drawer, __assign({ className: classnames_1.default(style_1.SDK_PREFIX + "-drawer", className, (_a = {},
163
+ return (react_1.default.createElement(antd_1.Drawer, __assign({ className: classnames_1.default(this.drawerId, style_1.SDK_PREFIX + "-drawer", className, (_a = {},
136
164
  _a[style_1.SDK_PREFIX + "-drawer-no-mask"] = this.props.mask === false,
137
165
  _a)), width: this.realWidth || 'auto', zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra }, other),
138
166
  canDrag && (react_1.default.createElement("div", { className: style_1.SDK_PREFIX + "-scroll-handler", onMouseDown: this.onMouseDown })),
@@ -188,10 +216,16 @@ var Drawer = /** @class */ (function (_super) {
188
216
  __metadata("design:paramtypes", [Object]),
189
217
  __metadata("design:returntype", void 0)
190
218
  ], Drawer.prototype, "onMouseMove", null);
219
+ __decorate([
220
+ bind_1.default,
221
+ __metadata("design:type", Function),
222
+ __metadata("design:paramtypes", [MouseEvent]),
223
+ __metadata("design:returntype", void 0)
224
+ ], Drawer.prototype, "onMouseClick", null);
191
225
  Drawer = __decorate([
192
226
  mobx_react_1.observer
193
227
  ], Drawer);
194
228
  return Drawer;
195
229
  }(react_1.default.Component));
196
230
  exports.Drawer = Drawer;
197
- exports.default = popContainer_1.default(Drawer);
231
+ exports.default = modalPopupContainer_1.default(Drawer);
@@ -86,6 +86,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
86
86
  Object.defineProperty(exports, "__esModule", { value: true });
87
87
  var react_1 = __importStar(require("react"));
88
88
  var resumablejs_1 = __importDefault(require("resumablejs"));
89
+ var uuid_1 = __importDefault(require("uuid"));
90
+ var md5_1 = __importDefault(require("crypto-js/md5"));
89
91
  var antd_1 = require("antd");
90
92
  var config_provider_1 = require("antd/es/config-provider");
91
93
  var classnames_1 = __importDefault(require("classnames"));
@@ -235,12 +237,6 @@ function FileResumable(props) {
235
237
  mode,
236
238
  handleReadeImageFile
237
239
  ]);
238
- var handleStart = react_1.useCallback(function () {
239
- var _a, _b;
240
- (_a = resumable.current) === null || _a === void 0 ? void 0 : _a.updateQuery(query);
241
- (_b = resumable.current) === null || _b === void 0 ? void 0 : _b.upload();
242
- setShowTool(true);
243
- }, [query, setShowTool]);
244
240
  var handleFileSuccess = react_1.useCallback(function (message) {
245
241
  var _a;
246
242
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(message);
@@ -257,11 +253,6 @@ function FileResumable(props) {
257
253
  setShowTool,
258
254
  setPercent
259
255
  ]);
260
- var handleUploadStart = react_1.useCallback(function () {
261
- setIsPlayDisabled(true);
262
- setIsPauseDisabled(false);
263
- setIsStopDisabled(false);
264
- }, [setIsPlayDisabled, setIsPauseDisabled, setIsStopDisabled]);
265
256
  var handleError = react_1.useCallback(function (error) {
266
257
  var _a;
267
258
  (_a = resumable.current) === null || _a === void 0 ? void 0 : _a.cancel();
@@ -281,6 +272,73 @@ function FileResumable(props) {
281
272
  setShowTool,
282
273
  onError
283
274
  ]);
275
+ var handleStart = react_1.useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
276
+ var params, realFile_1, reader;
277
+ var _this = this;
278
+ return __generator(this, function (_a) {
279
+ params = __assign({}, query);
280
+ if (fileList.length === 1) {
281
+ realFile_1 = fileList[0];
282
+ reader = new FileReader();
283
+ reader.readAsText(realFile_1.size > 50 * 1024 * 1024
284
+ ? realFile_1.slice(0, 2 * 1024 * 1024)
285
+ : realFile_1);
286
+ reader.onloadend = function (e) { return __awaiter(_this, void 0, void 0, function () {
287
+ var md5Str, id, fileId, error_1;
288
+ var _a, _b, _c;
289
+ return __generator(this, function (_d) {
290
+ switch (_d.label) {
291
+ case 0:
292
+ if (!(e.target.readyState === FileReader.DONE)) return [3 /*break*/, 5];
293
+ md5Str = md5_1.default(e.target.result).toString();
294
+ id = '';
295
+ _d.label = 1;
296
+ case 1:
297
+ _d.trys.push([1, 3, , 4]);
298
+ return [4 /*yield*/, app_sdk_1.fileIsExit({
299
+ resumableModifyTime: realFile_1.lastModified,
300
+ resumableFilename: realFile_1.name,
301
+ resumableType: realFile_1.type,
302
+ resumableFileMd5: md5Str,
303
+ resumableTotalSize: realFile_1.size
304
+ })];
305
+ case 2:
306
+ fileId = (_d.sent()).fileId;
307
+ id = fileId;
308
+ return [3 /*break*/, 4];
309
+ case 3:
310
+ error_1 = _d.sent();
311
+ handleError(lodash_1.get(error_1, 'message'));
312
+ return [3 /*break*/, 4];
313
+ case 4:
314
+ if (!id) {
315
+ params.resumableFileMd5 = md5Str;
316
+ params.resumableModifyTime = realFile_1.lastModified;
317
+ params.resumableIdentifier = uuid_1.default();
318
+ (_a = resumable.current) === null || _a === void 0 ? void 0 : _a.updateQuery(params);
319
+ (_b = resumable.current) === null || _b === void 0 ? void 0 : _b.upload();
320
+ }
321
+ else {
322
+ handleFileSuccess(JSON.stringify({
323
+ fileId: id
324
+ }));
325
+ (_c = resumable.current) === null || _c === void 0 ? void 0 : _c.cancel();
326
+ }
327
+ _d.label = 5;
328
+ case 5: return [2 /*return*/];
329
+ }
330
+ });
331
+ }); };
332
+ }
333
+ setShowTool(true);
334
+ return [2 /*return*/];
335
+ });
336
+ }); }, [query, setShowTool, fileList, handleError, handleFileSuccess]);
337
+ var handleUploadStart = react_1.useCallback(function () {
338
+ setIsPlayDisabled(true);
339
+ setIsPauseDisabled(false);
340
+ setIsStopDisabled(false);
341
+ }, [setIsPlayDisabled, setIsPauseDisabled, setIsStopDisabled]);
284
342
  var init = react_1.useCallback(function () {
285
343
  var ResumableField = new resumablejs_1.default(__assign(__assign({ permanentErrors: [400, 404, 415, 500, 501, 409] }, others), { target: others.target || app_sdk_1.appEnv.getApiPrefix() + "/upload/file" }));
286
344
  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;
@@ -166,6 +166,26 @@ var Table = /** @class */ (function (_super) {
166
166
  enumerable: true,
167
167
  configurable: true
168
168
  });
169
+ Object.defineProperty(Table.prototype, "emptyTextComp", {
170
+ get: function () {
171
+ var emptyText = this.props.emptyText;
172
+ if (!emptyText) {
173
+ return (React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty" },
174
+ React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty-icon" },
175
+ React.createElement(pandora_component_icons_1.EmptyIcon, null)),
176
+ React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty-text" }, language_1.formatString(type_1.TableLocale.empty, this.context.locale))));
177
+ }
178
+ if (typeof emptyText === 'string' || typeof emptyText === 'number') {
179
+ return (React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty" },
180
+ React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty-icon" },
181
+ React.createElement(pandora_component_icons_1.EmptyIcon, null)),
182
+ React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty-text" }, emptyText)));
183
+ }
184
+ return emptyText;
185
+ },
186
+ enumerable: true,
187
+ configurable: true
188
+ });
169
189
  Table.prototype.getRowKey = function (row, index) {
170
190
  var rowKey = this.props.rowKey;
171
191
  if (typeof rowKey === 'function') {
@@ -250,12 +270,9 @@ var Table = /** @class */ (function (_super) {
250
270
  Table.prototype.render = function () {
251
271
  var _a, _b;
252
272
  var _this = this;
253
- var _c = this.props, className = _c.className, batchOptions = _c.batchOptions, scroll = _c.scroll, locale = _c.locale, restProps = __rest(_c, ["className", "batchOptions", "scroll", "locale"]);
273
+ 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"]);
254
274
  return (React.createElement("div", null,
255
- React.createElement(antd_1.Table, __assign({ scroll: scroll, locale: __assign({ emptyText: (React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty" },
256
- React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty-icon" },
257
- React.createElement(pandora_component_icons_1.EmptyIcon, null)),
258
- React.createElement("div", { className: style_1.SDK_PREFIX + "-table-empty-text" }, language_1.formatString(type_1.TableLocale.empty, this.context.locale)))) }, locale) }, restProps, { className: classnames_1.default(style_1.SDK_PREFIX + "-table-wrapper", (_a = {}, _a[style_1.SDK_PREFIX + "-table-scrollX"] = lodash_1.get(scroll, 'x'), _a), (_b = {}, _b[style_1.SDK_PREFIX + "-table-scrollY"] = lodash_1.get(scroll, 'y'), _b), className),
275
+ React.createElement(antd_1.Table, __assign({ scroll: scroll, locale: __assign({ emptyText: this.emptyTextComp }, locale) }, restProps, { className: classnames_1.default(style_1.SDK_PREFIX + "-table-wrapper", (_a = {}, _a[style_1.SDK_PREFIX + "-table-scrollX"] = lodash_1.get(scroll, 'x'), _a), (_b = {}, _b[style_1.SDK_PREFIX + "-table-scrollY"] = lodash_1.get(scroll, 'y'), _b), className),
259
276
  // 涉及到权限
260
277
  // getCheckboxProps只能放到tableBatchWrapper里,因为selectedRowKeys在那个组件计算
261
278
  rowSelection: batchOptions && this.props.rowSelection
@@ -309,6 +326,11 @@ var Table = /** @class */ (function (_super) {
309
326
  __metadata("design:type", Object),
310
327
  __metadata("design:paramtypes", [])
311
328
  ], Table.prototype, "keysOfCurrentPage", null);
329
+ __decorate([
330
+ mobx_1.computed,
331
+ __metadata("design:type", Object),
332
+ __metadata("design:paramtypes", [])
333
+ ], Table.prototype, "emptyTextComp", null);
312
334
  __decorate([
313
335
  bind_1.default,
314
336
  __metadata("design:type", Function),
@@ -21,6 +21,10 @@ export interface IOption {
21
21
  * 当用户点击刷新的回调函数,此项不存在时表示不显示刷新 Icon
22
22
  */
23
23
  onRefresh?: () => void;
24
+ /**
25
+ * tab对应内容
26
+ */
27
+ children?: React.ReactNode;
24
28
  }
25
29
  export interface ITabsProps extends TabsProps {
26
30
  /**
@@ -37,7 +37,7 @@ function Tabs(props) {
37
37
  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"]);
38
38
  var panes = options.map(function (_a) {
39
39
  var _b;
40
- var key = _a.key, text = _a.text, hidden = _a.hidden, refreshTextCur = _a.refreshText, onRefreshCur = _a.onRefresh;
40
+ var key = _a.key, text = _a.text, children = _a.children, hidden = _a.hidden, refreshTextCur = _a.refreshText, onRefreshCur = _a.onRefresh;
41
41
  if (hidden) {
42
42
  return null;
43
43
  }
@@ -49,7 +49,7 @@ function Tabs(props) {
49
49
  _b)) },
50
50
  text,
51
51
  refresh));
52
- return react_1.default.createElement(antd_1.Tabs.TabPane, { key: key, tab: tab });
52
+ return (react_1.default.createElement(antd_1.Tabs.TabPane, { key: key, tab: tab }, children));
53
53
  });
54
54
  return (react_1.default.createElement(antd_1.Tabs, __assign({ className: classnames_1.default(style_1.SDK_PREFIX + "-tabs", className), tabBarGutter: 16, activeKey: active, onChange: onChange }, restProps), panes));
55
55
  }
@@ -1 +1,2 @@
1
1
  export declare const SDK_PREFIX = "pandora-sdk";
2
+ export declare const ANT_PREFIX = "pandora-antd";
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_PREFIX = 'pandora-sdk';
4
+ exports.ANT_PREFIX = 'pandora-antd';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export default function modalPopupContainerWrapper<T>(Comp: React.ComponentType<T>): (props: T & {
3
+ bodyStyle?: React.CSSProperties | undefined;
4
+ children: React.ReactNode;
5
+ title?: React.ReactNode;
6
+ }) => JSX.Element;
@@ -32,16 +32,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
32
32
  var react_1 = __importStar(require("react"));
33
33
  var config_provider_1 = __importStar(require("antd/es/config-provider"));
34
34
  var style_1 = require("../constants/style");
35
- function popContainerWrapper(Comp) {
35
+ function modalPopupContainerWrapper(Comp) {
36
36
  return function (props) {
37
37
  var containerRef = react_1.useRef(null);
38
- var _a = props.bodyStyle, bodyStyle = _a === void 0 ? {} : _a, children = props.children, rest = __rest(props, ["bodyStyle", "children"]);
38
+ var titleRef = react_1.useRef(null);
39
+ var _a = props.bodyStyle, bodyStyle = _a === void 0 ? {} : _a, children = props.children, title = props.title, rest = __rest(props, ["bodyStyle", "children", "title"]);
39
40
  var childrenGetPopupContainer = react_1.useCallback(function () {
40
41
  return (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) || document.body;
41
42
  }, []);
42
- return (react_1.default.createElement(Comp, __assign({}, rest),
43
+ var titleGetPopupContainer = react_1.useCallback(function () {
44
+ return (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) || document.body;
45
+ }, []);
46
+ return (react_1.default.createElement(Comp, __assign({}, rest, { title: react_1.default.createElement("div", { ref: titleRef },
47
+ react_1.default.createElement(config_provider_1.ConfigConsumer, null, function (config) { return (react_1.default.createElement(config_provider_1.default, __assign({}, config, { getPopupContainer: titleGetPopupContainer }), title)); })) }),
43
48
  react_1.default.createElement("div", { className: style_1.SDK_PREFIX + "-drawer-container", ref: containerRef, style: bodyStyle },
44
49
  react_1.default.createElement(config_provider_1.ConfigConsumer, null, function (config) { return (react_1.default.createElement(config_provider_1.default, __assign({}, config, { getPopupContainer: childrenGetPopupContainer }), children)); }))));
45
50
  };
46
51
  }
47
- exports.default = popContainerWrapper;
52
+ exports.default = modalPopupContainerWrapper;