@qn-pandora/pandora-component 4.0.12 → 4.0.14

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 (79) hide show
  1. package/CHANGELOG.json +323 -303
  2. package/CHANGELOG.md +123 -115
  3. package/es/components/Descriptions/index.d.ts +13 -0
  4. package/es/components/Descriptions/index.js +57 -0
  5. package/es/components/Descriptions/style.css +337 -0
  6. package/es/components/Descriptions/style.less +15 -0
  7. package/es/components/Drawer/CloseIcon/index.d.ts +7 -0
  8. package/es/components/Drawer/CloseIcon/index.js +13 -0
  9. package/es/components/Drawer/CloseIcon/style.css +12 -0
  10. package/es/components/Drawer/CloseIcon/style.less +8 -0
  11. package/es/components/Drawer/index.d.ts +17 -3
  12. package/es/components/Drawer/index.js +73 -11
  13. package/es/components/Drawer/style.css +11 -3
  14. package/es/components/Drawer/style.less +12 -3
  15. package/es/components/Modal/index.js +3 -2
  16. package/es/components/Table/index.d.ts +2 -0
  17. package/es/components/Table/index.js +27 -5
  18. package/es/components/Tabs/index.d.ts +4 -0
  19. package/es/components/Tabs/index.js +2 -2
  20. package/es/constants/language/en.js +3 -1
  21. package/es/constants/language/modal/en.d.ts +2 -0
  22. package/es/constants/language/modal/en.js +3 -0
  23. package/es/constants/language/modal/type.d.ts +4 -0
  24. package/es/constants/language/modal/type.js +3 -0
  25. package/es/constants/language/modal/zh.d.ts +2 -0
  26. package/es/constants/language/modal/zh.js +3 -0
  27. package/es/constants/language/type.d.ts +2 -0
  28. package/es/constants/language/zh.js +3 -1
  29. package/es/constants/style.d.ts +1 -0
  30. package/es/constants/style.js +1 -0
  31. package/es/hoc/modalPopupContainer.d.ts +6 -0
  32. package/es/hoc/{popContainer.js → modalPopupContainer.js} +8 -3
  33. package/es/index.css +4670 -4647
  34. package/es/index.d.ts +1 -0
  35. package/es/index.js +1 -0
  36. package/es/index.less +19 -17
  37. package/es/style/theme.less +6 -2
  38. package/es/utils/dom.d.ts +1 -0
  39. package/es/utils/dom.js +42 -0
  40. package/lib/components/Descriptions/index.d.ts +13 -0
  41. package/lib/components/Descriptions/index.js +69 -0
  42. package/lib/components/Descriptions/style.css +337 -0
  43. package/lib/components/Descriptions/style.less +15 -0
  44. package/lib/components/Drawer/CloseIcon/index.d.ts +7 -0
  45. package/lib/components/Drawer/CloseIcon/index.js +18 -0
  46. package/lib/components/Drawer/CloseIcon/style.css +12 -0
  47. package/lib/components/Drawer/CloseIcon/style.less +8 -0
  48. package/lib/components/Drawer/index.d.ts +17 -3
  49. package/lib/components/Drawer/index.js +72 -10
  50. package/lib/components/Drawer/style.css +11 -3
  51. package/lib/components/Drawer/style.less +12 -3
  52. package/lib/components/Modal/index.js +3 -2
  53. package/lib/components/Table/index.d.ts +2 -0
  54. package/lib/components/Table/index.js +27 -5
  55. package/lib/components/Tabs/index.d.ts +4 -0
  56. package/lib/components/Tabs/index.js +2 -2
  57. package/lib/constants/language/en.js +4 -2
  58. package/lib/constants/language/modal/en.d.ts +2 -0
  59. package/lib/constants/language/modal/en.js +5 -0
  60. package/lib/constants/language/modal/type.d.ts +4 -0
  61. package/lib/constants/language/modal/type.js +5 -0
  62. package/lib/constants/language/modal/zh.d.ts +2 -0
  63. package/lib/constants/language/modal/zh.js +5 -0
  64. package/lib/constants/language/type.d.ts +2 -0
  65. package/lib/constants/language/zh.js +4 -2
  66. package/lib/constants/style.d.ts +1 -0
  67. package/lib/constants/style.js +1 -0
  68. package/lib/hoc/modalPopupContainer.d.ts +6 -0
  69. package/lib/hoc/{popContainer.js → modalPopupContainer.js} +9 -4
  70. package/lib/index.css +13745 -13722
  71. package/lib/index.d.ts +1 -0
  72. package/lib/index.js +2 -0
  73. package/lib/index.less +20 -18
  74. package/lib/style/theme.less +6 -2
  75. package/lib/utils/dom.d.ts +1 -0
  76. package/lib/utils/dom.js +45 -0
  77. package/package.json +5 -5
  78. package/es/hoc/popContainer.d.ts +0 -5
  79. package/lib/hoc/popContainer.d.ts +0 -5
@@ -0,0 +1,8 @@
1
+ @import '../../../style/theme.less';
2
+
3
+ .@{sdk-prefix}-close-icon {
4
+ font-size: 20px;
5
+ &:hover {
6
+ background: @close-icon-hover-color;
7
+ }
8
+ }
@@ -51,15 +51,21 @@ 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;
65
+ size?: 'small' | 'default' | 'large';
61
66
  }>;
62
67
  export declare class Drawer extends React.Component<React.PropsWithChildren<IDrawerProps>, any> {
68
+ drawerId: string;
63
69
  isResizing: boolean;
64
70
  realWidth: string | number | undefined;
65
71
  throttleMouseMove: import("lodash").DebouncedFunc<(e: any) => void>;
@@ -70,6 +76,8 @@ export declare class Drawer extends React.Component<React.PropsWithChildren<IDra
70
76
  onMouseDown(): void;
71
77
  onMouseUp(): void;
72
78
  onMouseMove(e: any): void;
79
+ onMouseClick(e: MouseEvent): void;
80
+ initWidth(width?: string | number, size?: string): string | number | undefined;
73
81
  componentDidMount(): void;
74
82
  UNSAFE_componentWillUpdate(nextProps: Readonly<React.PropsWithChildren<IDrawerProps>>): void;
75
83
  componentWillUnmount(): void;
@@ -122,17 +130,23 @@ declare const _default: (props: {
122
130
  */
123
131
  zIndex?: number | undefined;
124
132
  getContainer?: string | false | HTMLElement | getContainerFunc | undefined;
125
- onClose?: ((e: EventType) => void) | undefined;
133
+ onClose?: ((e: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement | HTMLButtonElement, MouseEvent> | null) => void) | undefined;
126
134
  afterVisibleChange?: ((visible: boolean) => void) | undefined;
127
135
  /**
128
136
  * 是否允许拖拽
129
137
  */
130
138
  canDrag?: boolean | undefined;
131
139
  closeIconPlacement?: import("antd/es/collapse/Collapse").ExpandIconPosition;
132
- } & Pick<DrawerProps, "style" | "autoFocus" | "size" | "prefixCls" | "footer" | "extra" | "bodyStyle" | "forceRender" | "keyboard" | "destroyOnClose" | "closeIcon" | "drawerStyle" | "headerStyle" | "contentWrapperStyle" | "push" | "handler" | "footerStyle" | "level" | "levelMove"> & {
140
+ /**
141
+ * 无遮罩时点击空白处中的哪些元素不关闭
142
+ */
143
+ nonCloseSelector?: string | undefined;
144
+ size?: "small" | "default" | "large" | undefined;
145
+ } & Pick<DrawerProps, "style" | "autoFocus" | "prefixCls" | "footer" | "extra" | "bodyStyle" | "forceRender" | "keyboard" | "destroyOnClose" | "closeIcon" | "drawerStyle" | "headerStyle" | "contentWrapperStyle" | "push" | "handler" | "footerStyle" | "level" | "levelMove"> & {
133
146
  children?: React.ReactNode;
134
147
  } & {
135
148
  bodyStyle?: React.CSSProperties | undefined;
136
149
  children: React.ReactNode;
150
+ title?: React.ReactNode;
137
151
  }) => JSX.Element;
138
152
  export default _default;
@@ -48,18 +48,23 @@ import { throttle } from 'lodash';
48
48
  import { observer } from 'mobx-react';
49
49
  import { observable, action, computed } from 'mobx';
50
50
  import { Drawer as BaseDrawer } from 'antd';
51
- import { CloseOutlined } from '@ant-design/icons';
52
- import { SDK_PREFIX } from '../../constants/style';
53
- import popContainerWrapper from '../../hoc/popContainer';
51
+ import { doesDOMMatchSelector } from '../../utils/dom';
52
+ import { SDK_PREFIX, ANT_PREFIX } from '../../constants/style';
53
+ import modalPopupContainerWrapper from '../../hoc/modalPopupContainer';
54
54
  import bind from '../../utils/bind';
55
+ import CloseIcon from './CloseIcon';
56
+ var DEFAULT_WIDTH = 640;
57
+ var SMALL_WIDTH = 480;
58
+ var LARGE_WIDTH = 960;
55
59
  var MAX_WIDTH = 6000;
56
60
  var MIN_WIDTH = 300;
57
61
  var Drawer = /** @class */ (function (_super) {
58
62
  __extends(Drawer, _super);
59
63
  function Drawer() {
60
64
  var _this = _super !== null && _super.apply(this, arguments) || this;
65
+ _this.drawerId = "drawer-id-" + Math.floor(Math.random() * 10000);
61
66
  _this.isResizing = false;
62
- _this.realWidth = _this.props.width;
67
+ _this.realWidth = _this.initWidth(_this.props.width, _this.props.size);
63
68
  _this.throttleMouseMove = throttle(function (e) { return _this.onMouseMove(e); }, 100);
64
69
  return _this;
65
70
  }
@@ -77,10 +82,11 @@ var Drawer = /** @class */ (function (_super) {
77
82
  });
78
83
  Object.defineProperty(Drawer.prototype, "extra", {
79
84
  get: function () {
80
- if (this.props.closable && this.props.closeIconPlacement === 'right') {
85
+ var _a = this.props, closable = _a.closable, closeIconPlacement = _a.closeIconPlacement, onClose = _a.onClose;
86
+ if (closable && closeIconPlacement === 'right') {
81
87
  return (React.createElement(React.Fragment, null,
82
88
  this.props.extra,
83
- React.createElement(CloseOutlined, { onClick: this.props.onClose, className: SDK_PREFIX + "-drawer-right-close-icon" })));
89
+ React.createElement(CloseIcon, { className: SDK_PREFIX + "-drawer-close-icon", onClick: onClose })));
84
90
  }
85
91
  return this.props.extra;
86
92
  },
@@ -103,16 +109,56 @@ var Drawer = /** @class */ (function (_super) {
103
109
  Drawer.prototype.onMouseMove = function (e) {
104
110
  if (this.isResizing) {
105
111
  var offsetRight = document.body.offsetWidth - (e.clientX - document.body.offsetLeft);
106
- if (offsetRight > MIN_WIDTH && offsetRight < MAX_WIDTH) {
112
+ if (offsetRight > MIN_WIDTH &&
113
+ offsetRight < MAX_WIDTH &&
114
+ offsetRight < document.body.offsetWidth - 10 // 10表示宽度至少比body小10,防止出现把抽屉拖出body的情况
115
+ ) {
107
116
  this.setRealWidth(offsetRight);
108
117
  }
109
118
  }
110
119
  };
120
+ Drawer.prototype.onMouseClick = function (e) {
121
+ var _a = this.props, mask = _a.mask, maskClosable = _a.maskClosable, nonCloseSelector = _a.nonCloseSelector, onClose = _a.onClose, visible = _a.visible;
122
+ if (mask === false && maskClosable && visible) {
123
+ var currentEl = e.target;
124
+ var shouldClose = true;
125
+ while (currentEl) {
126
+ if (nonCloseSelector) {
127
+ if (doesDOMMatchSelector(nonCloseSelector, currentEl)) {
128
+ shouldClose = false;
129
+ break;
130
+ }
131
+ }
132
+ if (doesDOMMatchSelector("." + this.drawerId, currentEl) ||
133
+ doesDOMMatchSelector("." + ANT_PREFIX + "-modal-root, .ant-modal-root, ." + ANT_PREFIX + "-drawer, .ant-drawer, ." + ANT_PREFIX + "-popover, .ant-popover", currentEl)) {
134
+ shouldClose = false;
135
+ break;
136
+ }
137
+ currentEl = currentEl.parentElement;
138
+ }
139
+ if (shouldClose) {
140
+ onClose === null || onClose === void 0 ? void 0 : onClose(null);
141
+ }
142
+ }
143
+ };
144
+ Drawer.prototype.initWidth = function (width, size) {
145
+ if (width) {
146
+ return width;
147
+ }
148
+ if (size && size === 'small')
149
+ return SMALL_WIDTH;
150
+ if (size && size === 'default')
151
+ return DEFAULT_WIDTH;
152
+ if (size && size === 'large')
153
+ return LARGE_WIDTH;
154
+ return undefined;
155
+ };
111
156
  Drawer.prototype.componentDidMount = function () {
112
157
  if (this.props.canDrag) {
113
158
  document.addEventListener('mousemove', this.throttleMouseMove);
114
159
  document.addEventListener('mouseup', this.onMouseUp);
115
160
  }
161
+ document.body.addEventListener('click', this.onMouseClick);
116
162
  };
117
163
  Drawer.prototype.UNSAFE_componentWillUpdate = function (nextProps) {
118
164
  if (nextProps.canDrag && !this.props.canDrag) {
@@ -123,13 +169,17 @@ var Drawer = /** @class */ (function (_super) {
123
169
  Drawer.prototype.componentWillUnmount = function () {
124
170
  document.removeEventListener('mousemove', this.throttleMouseMove);
125
171
  document.removeEventListener('mouseup', this.onMouseUp);
172
+ document.body.removeEventListener('click', this.onMouseClick);
126
173
  };
127
174
  Drawer.prototype.render = function () {
128
175
  var _a;
129
- 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 = {},
176
+ 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, size = _b.size, onClose = _b.onClose, other = __rest(_b, ["width", "className", "children", "canDrag", "visible", "closable", "extra", "size", "onClose"]);
177
+ return (React.createElement(BaseDrawer, __assign({ className: classnames(this.drawerId, SDK_PREFIX + "-drawer", className, (_a = {},
131
178
  _a[SDK_PREFIX + "-drawer-no-mask"] = this.props.mask === false,
132
- _a)), width: this.realWidth || 'auto', zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra }, other),
179
+ _a[SDK_PREFIX + "-drawer-size-small"] = size === 'small',
180
+ _a[SDK_PREFIX + "-drawer-size-default"] = size === 'default',
181
+ _a[SDK_PREFIX + "-drawer-size-large"] = size === 'large',
182
+ _a)), width: this.realWidth || 'auto', zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra, closeIcon: React.createElement(CloseIcon, { className: SDK_PREFIX + "-drawer-close-icon", onClick: onClose }), onClose: onClose }, other),
133
183
  canDrag && (React.createElement("div", { className: SDK_PREFIX + "-scroll-handler", onMouseDown: this.onMouseDown })),
134
184
  children));
135
185
  };
@@ -183,10 +233,22 @@ var Drawer = /** @class */ (function (_super) {
183
233
  __metadata("design:paramtypes", [Object]),
184
234
  __metadata("design:returntype", void 0)
185
235
  ], Drawer.prototype, "onMouseMove", null);
236
+ __decorate([
237
+ bind,
238
+ __metadata("design:type", Function),
239
+ __metadata("design:paramtypes", [MouseEvent]),
240
+ __metadata("design:returntype", void 0)
241
+ ], Drawer.prototype, "onMouseClick", null);
242
+ __decorate([
243
+ bind,
244
+ __metadata("design:type", Function),
245
+ __metadata("design:paramtypes", [Object, String]),
246
+ __metadata("design:returntype", void 0)
247
+ ], Drawer.prototype, "initWidth", null);
186
248
  Drawer = __decorate([
187
249
  observer
188
250
  ], Drawer);
189
251
  return Drawer;
190
252
  }(React.Component));
191
253
  export { Drawer };
192
- export default popContainerWrapper(Drawer);
254
+ export default modalPopupContainerWrapper(Drawer);
@@ -269,6 +269,15 @@
269
269
  height: 60px;
270
270
  line-height: 60px;
271
271
  }
272
+ .pandora-sdk-drawer-size-small {
273
+ max-width: 38%;
274
+ }
275
+ .pandora-sdk-drawer-size-default {
276
+ max-width: 50%;
277
+ }
278
+ .pandora-sdk-drawer-size-large {
279
+ max-width: 75%;
280
+ }
272
281
  .pandora-sdk-drawer-no-mask .ant-drawer-content-wrapper {
273
282
  width: 100%;
274
283
  }
@@ -282,7 +291,6 @@
282
291
  z-index: 100;
283
292
  cursor: ew-resize;
284
293
  }
285
- .pandora-sdk-drawer-right-close-icon {
286
- margin-left: 8px;
287
- font-size: 16px;
294
+ .pandora-sdk-drawer-close-icon {
295
+ margin-left: 24px;
288
296
  }
@@ -16,6 +16,16 @@
16
16
  }
17
17
  }
18
18
 
19
+ .@{sdk-prefix}-drawer-size-small {
20
+ max-width: 38%;
21
+ }
22
+ .@{sdk-prefix}-drawer-size-default {
23
+ max-width: 50%;
24
+ }
25
+ .@{sdk-prefix}-drawer-size-large {
26
+ max-width: 75%;
27
+ }
28
+
19
29
  .@{sdk-prefix}-drawer-no-mask {
20
30
  .@{ant-prefix}-drawer-content-wrapper {
21
31
  width: 100%;
@@ -33,7 +43,6 @@
33
43
  cursor: ew-resize;
34
44
  }
35
45
 
36
- .@{sdk-prefix}-drawer-right-close-icon {
37
- margin-left: 8px;
38
- font-size: 16px;
46
+ .@{sdk-prefix}-drawer-close-icon {
47
+ margin-left: 24px;
39
48
  }
@@ -49,6 +49,7 @@ import { Modal as BaseModal, ConfigProvider } from 'antd';
49
49
  import { ConfigConsumer } from 'antd/es/config-provider';
50
50
  import { SDK_PREFIX } from '../../constants/style';
51
51
  import bind from '../../utils/bind';
52
+ import CloseIcon from '../Drawer/CloseIcon';
52
53
  /**
53
54
  * 全局弹窗组件样式封装
54
55
  */
@@ -72,8 +73,8 @@ var Modal = /** @class */ (function (_super) {
72
73
  };
73
74
  Modal.prototype.render = function () {
74
75
  var _this = this;
75
- var _a = this.props, wrapClassName = _a.wrapClassName, children = _a.children, bodyStyle = _a.bodyStyle, title = _a.title, otherProps = __rest(_a, ["wrapClassName", "children", "bodyStyle", "title"]);
76
- return (React.createElement(BaseModal, __assign({ wrapClassName: classnames(SDK_PREFIX + "-modal", wrapClassName), maskClosable: false, title: title }, otherProps),
76
+ var _a = this.props, wrapClassName = _a.wrapClassName, children = _a.children, bodyStyle = _a.bodyStyle, title = _a.title, onCancel = _a.onCancel, otherProps = __rest(_a, ["wrapClassName", "children", "bodyStyle", "title", "onCancel"]);
77
+ return (React.createElement(BaseModal, __assign({ wrapClassName: classnames(SDK_PREFIX + "-modal", wrapClassName), maskClosable: false, title: title, closeIcon: React.createElement(CloseIcon, { onClick: onCancel }), onCancel: onCancel }, otherProps),
77
78
  React.createElement("div", { ref: this.setContainerRef, style: bodyStyle },
78
79
  React.createElement(ConfigConsumer, null, function (config) { return (React.createElement(ConfigProvider, __assign({}, config, { getPopupContainer: _this.childrenGetPopupContainer }), children)); }))));
79
80
  };
@@ -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: (React.createElement("div", { className: SDK_PREFIX + "-table-empty" },
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),
@@ -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
  /**
@@ -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
  }
@@ -4,6 +4,7 @@ import { range_input_en } from './range_input/en';
4
4
  import { steps_en } from './steps/en';
5
5
  import { table_en } from './table/en';
6
6
  import { transfer_en } from './transfer/en';
7
+ import { modal_en } from './modal/en';
7
8
  import upload_en from './upload/en';
8
9
  export var component_en = {
9
10
  check_transform_list: check_transform_list_en,
@@ -12,5 +13,6 @@ export var component_en = {
12
13
  steps: steps_en,
13
14
  table: table_en,
14
15
  transfer: transfer_en,
15
- upload: upload_en
16
+ upload: upload_en,
17
+ modal: modal_en
16
18
  };
@@ -0,0 +1,2 @@
1
+ import { IModalLocale } from './type';
2
+ export declare const modal_en: IModalLocale;
@@ -0,0 +1,3 @@
1
+ export var modal_en = {
2
+ close_tooltip: 'close modal'
3
+ };
@@ -0,0 +1,4 @@
1
+ export interface IModalLocale {
2
+ close_tooltip: string;
3
+ }
4
+ export declare const ModalLocale: IModalLocale;
@@ -0,0 +1,3 @@
1
+ import { languageLocale } from '../../../utils/languageLocale';
2
+ import { modal_zh } from './zh';
3
+ export var ModalLocale = languageLocale('modal.', modal_zh);
@@ -0,0 +1,2 @@
1
+ import { IModalLocale } from './type';
2
+ export declare const modal_zh: IModalLocale;
@@ -0,0 +1,3 @@
1
+ export var modal_zh = {
2
+ close_tooltip: '关闭弹窗'
3
+ };
@@ -5,6 +5,7 @@ import { IStepsLocale } from './steps/type';
5
5
  import { ITableLocale } from './table/type';
6
6
  import { ITransferLocale } from './transfer/type';
7
7
  import { IUploadLocale } from './upload/type';
8
+ import { IModalLocale } from './modal/type';
8
9
  export interface IComponentLocal {
9
10
  check_transform_list: ICheckTransformListLocale;
10
11
  datetime: IDateTimeLocale;
@@ -13,5 +14,6 @@ export interface IComponentLocal {
13
14
  table: ITableLocale;
14
15
  transfer: ITransferLocale;
15
16
  upload: IUploadLocale;
17
+ modal: IModalLocale;
16
18
  }
17
19
  export declare const ComponentLocale: IComponentLocal;
@@ -4,6 +4,7 @@ import { range_input_zh } from './range_input/zh';
4
4
  import { steps_zh } from './steps/zh';
5
5
  import { table_zh } from './table/zh';
6
6
  import { transfer_zh } from './transfer/zh';
7
+ import { modal_zh } from './modal/zh';
7
8
  import upload_zh from './upload/zh';
8
9
  export var component_zh = {
9
10
  check_transform_list: check_transform_list_zh,
@@ -12,5 +13,6 @@ export var component_zh = {
12
13
  steps: steps_zh,
13
14
  table: table_zh,
14
15
  transfer: transfer_zh,
15
- upload: upload_zh
16
+ upload: upload_zh,
17
+ modal: modal_zh
16
18
  };
@@ -1 +1,2 @@
1
1
  export declare const SDK_PREFIX = "pandora-sdk";
2
+ export declare const ANT_PREFIX = "pandora-antd";
@@ -1 +1,2 @@
1
1
  export var SDK_PREFIX = 'pandora-sdk';
2
+ export var 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;
@@ -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 popContainerWrapper(Comp) {
26
+ export default function modalPopupContainerWrapper(Comp) {
27
27
  return function (props) {
28
28
  var containerRef = useRef(null);
29
- var _a = props.bodyStyle, bodyStyle = _a === void 0 ? {} : _a, children = props.children, rest = __rest(props, ["bodyStyle", "children"]);
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
- return (React.createElement(Comp, __assign({}, rest),
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: title ? (React.createElement("div", { ref: titleRef },
38
+ React.createElement(ConfigConsumer, null, function (config) { return (React.createElement(ConfigProvider, __assign({}, config, { getPopupContainer: titleGetPopupContainer }), title)); }))) : undefined }),
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
  };