@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.
- package/CHANGELOG.json +323 -303
- package/CHANGELOG.md +123 -115
- package/es/components/Descriptions/index.d.ts +13 -0
- package/es/components/Descriptions/index.js +57 -0
- package/es/components/Descriptions/style.css +337 -0
- package/es/components/Descriptions/style.less +15 -0
- package/es/components/Drawer/CloseIcon/index.d.ts +7 -0
- package/es/components/Drawer/CloseIcon/index.js +13 -0
- package/es/components/Drawer/CloseIcon/style.css +12 -0
- package/es/components/Drawer/CloseIcon/style.less +8 -0
- package/es/components/Drawer/index.d.ts +17 -3
- package/es/components/Drawer/index.js +73 -11
- package/es/components/Drawer/style.css +11 -3
- package/es/components/Drawer/style.less +12 -3
- package/es/components/Modal/index.js +3 -2
- 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/language/en.js +3 -1
- package/es/constants/language/modal/en.d.ts +2 -0
- package/es/constants/language/modal/en.js +3 -0
- package/es/constants/language/modal/type.d.ts +4 -0
- package/es/constants/language/modal/type.js +3 -0
- package/es/constants/language/modal/zh.d.ts +2 -0
- package/es/constants/language/modal/zh.js +3 -0
- package/es/constants/language/type.d.ts +2 -0
- package/es/constants/language/zh.js +3 -1
- 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 +4670 -4647
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +19 -17
- package/es/style/theme.less +6 -2
- package/es/utils/dom.d.ts +1 -0
- package/es/utils/dom.js +42 -0
- package/lib/components/Descriptions/index.d.ts +13 -0
- package/lib/components/Descriptions/index.js +69 -0
- package/lib/components/Descriptions/style.css +337 -0
- package/lib/components/Descriptions/style.less +15 -0
- package/lib/components/Drawer/CloseIcon/index.d.ts +7 -0
- package/lib/components/Drawer/CloseIcon/index.js +18 -0
- package/lib/components/Drawer/CloseIcon/style.css +12 -0
- package/lib/components/Drawer/CloseIcon/style.less +8 -0
- package/lib/components/Drawer/index.d.ts +17 -3
- package/lib/components/Drawer/index.js +72 -10
- package/lib/components/Drawer/style.css +11 -3
- package/lib/components/Drawer/style.less +12 -3
- package/lib/components/Modal/index.js +3 -2
- 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/language/en.js +4 -2
- package/lib/constants/language/modal/en.d.ts +2 -0
- package/lib/constants/language/modal/en.js +5 -0
- package/lib/constants/language/modal/type.d.ts +4 -0
- package/lib/constants/language/modal/type.js +5 -0
- package/lib/constants/language/modal/zh.d.ts +2 -0
- package/lib/constants/language/modal/zh.js +5 -0
- package/lib/constants/language/type.d.ts +2 -0
- package/lib/constants/language/zh.js +4 -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 +13745 -13722
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/index.less +20 -18
- package/lib/style/theme.less +6 -2
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/dom.js +45 -0
- package/package.json +5 -5
- package/es/hoc/popContainer.d.ts +0 -5
- package/lib/hoc/popContainer.d.ts +0 -5
@@ -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:
|
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
|
-
|
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;
|
@@ -53,18 +53,23 @@ var lodash_1 = require("lodash");
|
|
53
53
|
var mobx_react_1 = require("mobx-react");
|
54
54
|
var mobx_1 = require("mobx");
|
55
55
|
var antd_1 = require("antd");
|
56
|
-
var
|
56
|
+
var dom_1 = require("../../utils/dom");
|
57
57
|
var style_1 = require("../../constants/style");
|
58
|
-
var
|
58
|
+
var modalPopupContainer_1 = __importDefault(require("../../hoc/modalPopupContainer"));
|
59
59
|
var bind_1 = __importDefault(require("../../utils/bind"));
|
60
|
+
var CloseIcon_1 = __importDefault(require("./CloseIcon"));
|
61
|
+
var DEFAULT_WIDTH = 640;
|
62
|
+
var SMALL_WIDTH = 480;
|
63
|
+
var LARGE_WIDTH = 960;
|
60
64
|
var MAX_WIDTH = 6000;
|
61
65
|
var MIN_WIDTH = 300;
|
62
66
|
var Drawer = /** @class */ (function (_super) {
|
63
67
|
__extends(Drawer, _super);
|
64
68
|
function Drawer() {
|
65
69
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
70
|
+
_this.drawerId = "drawer-id-" + Math.floor(Math.random() * 10000);
|
66
71
|
_this.isResizing = false;
|
67
|
-
_this.realWidth = _this.props.width;
|
72
|
+
_this.realWidth = _this.initWidth(_this.props.width, _this.props.size);
|
68
73
|
_this.throttleMouseMove = lodash_1.throttle(function (e) { return _this.onMouseMove(e); }, 100);
|
69
74
|
return _this;
|
70
75
|
}
|
@@ -82,10 +87,11 @@ var Drawer = /** @class */ (function (_super) {
|
|
82
87
|
});
|
83
88
|
Object.defineProperty(Drawer.prototype, "extra", {
|
84
89
|
get: function () {
|
85
|
-
|
90
|
+
var _a = this.props, closable = _a.closable, closeIconPlacement = _a.closeIconPlacement, onClose = _a.onClose;
|
91
|
+
if (closable && closeIconPlacement === 'right') {
|
86
92
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
87
93
|
this.props.extra,
|
88
|
-
react_1.default.createElement(
|
94
|
+
react_1.default.createElement(CloseIcon_1.default, { className: style_1.SDK_PREFIX + "-drawer-close-icon", onClick: onClose })));
|
89
95
|
}
|
90
96
|
return this.props.extra;
|
91
97
|
},
|
@@ -108,16 +114,56 @@ var Drawer = /** @class */ (function (_super) {
|
|
108
114
|
Drawer.prototype.onMouseMove = function (e) {
|
109
115
|
if (this.isResizing) {
|
110
116
|
var offsetRight = document.body.offsetWidth - (e.clientX - document.body.offsetLeft);
|
111
|
-
if (offsetRight > MIN_WIDTH &&
|
117
|
+
if (offsetRight > MIN_WIDTH &&
|
118
|
+
offsetRight < MAX_WIDTH &&
|
119
|
+
offsetRight < document.body.offsetWidth - 10 // 10表示宽度至少比body小10,防止出现把抽屉拖出body的情况
|
120
|
+
) {
|
112
121
|
this.setRealWidth(offsetRight);
|
113
122
|
}
|
114
123
|
}
|
115
124
|
};
|
125
|
+
Drawer.prototype.onMouseClick = function (e) {
|
126
|
+
var _a = this.props, mask = _a.mask, maskClosable = _a.maskClosable, nonCloseSelector = _a.nonCloseSelector, onClose = _a.onClose, visible = _a.visible;
|
127
|
+
if (mask === false && maskClosable && visible) {
|
128
|
+
var currentEl = e.target;
|
129
|
+
var shouldClose = true;
|
130
|
+
while (currentEl) {
|
131
|
+
if (nonCloseSelector) {
|
132
|
+
if (dom_1.doesDOMMatchSelector(nonCloseSelector, currentEl)) {
|
133
|
+
shouldClose = false;
|
134
|
+
break;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
if (dom_1.doesDOMMatchSelector("." + this.drawerId, currentEl) ||
|
138
|
+
dom_1.doesDOMMatchSelector("." + style_1.ANT_PREFIX + "-modal-root, .ant-modal-root, ." + style_1.ANT_PREFIX + "-drawer, .ant-drawer, ." + style_1.ANT_PREFIX + "-popover, .ant-popover", currentEl)) {
|
139
|
+
shouldClose = false;
|
140
|
+
break;
|
141
|
+
}
|
142
|
+
currentEl = currentEl.parentElement;
|
143
|
+
}
|
144
|
+
if (shouldClose) {
|
145
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(null);
|
146
|
+
}
|
147
|
+
}
|
148
|
+
};
|
149
|
+
Drawer.prototype.initWidth = function (width, size) {
|
150
|
+
if (width) {
|
151
|
+
return width;
|
152
|
+
}
|
153
|
+
if (size && size === 'small')
|
154
|
+
return SMALL_WIDTH;
|
155
|
+
if (size && size === 'default')
|
156
|
+
return DEFAULT_WIDTH;
|
157
|
+
if (size && size === 'large')
|
158
|
+
return LARGE_WIDTH;
|
159
|
+
return undefined;
|
160
|
+
};
|
116
161
|
Drawer.prototype.componentDidMount = function () {
|
117
162
|
if (this.props.canDrag) {
|
118
163
|
document.addEventListener('mousemove', this.throttleMouseMove);
|
119
164
|
document.addEventListener('mouseup', this.onMouseUp);
|
120
165
|
}
|
166
|
+
document.body.addEventListener('click', this.onMouseClick);
|
121
167
|
};
|
122
168
|
Drawer.prototype.UNSAFE_componentWillUpdate = function (nextProps) {
|
123
169
|
if (nextProps.canDrag && !this.props.canDrag) {
|
@@ -128,13 +174,17 @@ var Drawer = /** @class */ (function (_super) {
|
|
128
174
|
Drawer.prototype.componentWillUnmount = function () {
|
129
175
|
document.removeEventListener('mousemove', this.throttleMouseMove);
|
130
176
|
document.removeEventListener('mouseup', this.onMouseUp);
|
177
|
+
document.body.removeEventListener('click', this.onMouseClick);
|
131
178
|
};
|
132
179
|
Drawer.prototype.render = function () {
|
133
180
|
var _a;
|
134
|
-
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 = {},
|
181
|
+
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"]);
|
182
|
+
return (react_1.default.createElement(antd_1.Drawer, __assign({ className: classnames_1.default(this.drawerId, style_1.SDK_PREFIX + "-drawer", className, (_a = {},
|
136
183
|
_a[style_1.SDK_PREFIX + "-drawer-no-mask"] = this.props.mask === false,
|
137
|
-
_a
|
184
|
+
_a[style_1.SDK_PREFIX + "-drawer-size-small"] = size === 'small',
|
185
|
+
_a[style_1.SDK_PREFIX + "-drawer-size-default"] = size === 'default',
|
186
|
+
_a[style_1.SDK_PREFIX + "-drawer-size-large"] = size === 'large',
|
187
|
+
_a)), width: this.realWidth || 'auto', zIndex: 1200, visible: visible, closable: this.closable, extra: this.extra, closeIcon: react_1.default.createElement(CloseIcon_1.default, { className: style_1.SDK_PREFIX + "-drawer-close-icon", onClick: onClose }), onClose: onClose }, other),
|
138
188
|
canDrag && (react_1.default.createElement("div", { className: style_1.SDK_PREFIX + "-scroll-handler", onMouseDown: this.onMouseDown })),
|
139
189
|
children));
|
140
190
|
};
|
@@ -188,10 +238,22 @@ var Drawer = /** @class */ (function (_super) {
|
|
188
238
|
__metadata("design:paramtypes", [Object]),
|
189
239
|
__metadata("design:returntype", void 0)
|
190
240
|
], Drawer.prototype, "onMouseMove", null);
|
241
|
+
__decorate([
|
242
|
+
bind_1.default,
|
243
|
+
__metadata("design:type", Function),
|
244
|
+
__metadata("design:paramtypes", [MouseEvent]),
|
245
|
+
__metadata("design:returntype", void 0)
|
246
|
+
], Drawer.prototype, "onMouseClick", null);
|
247
|
+
__decorate([
|
248
|
+
bind_1.default,
|
249
|
+
__metadata("design:type", Function),
|
250
|
+
__metadata("design:paramtypes", [Object, String]),
|
251
|
+
__metadata("design:returntype", void 0)
|
252
|
+
], Drawer.prototype, "initWidth", null);
|
191
253
|
Drawer = __decorate([
|
192
254
|
mobx_react_1.observer
|
193
255
|
], Drawer);
|
194
256
|
return Drawer;
|
195
257
|
}(react_1.default.Component));
|
196
258
|
exports.Drawer = Drawer;
|
197
|
-
exports.default =
|
259
|
+
exports.default = modalPopupContainer_1.default(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-
|
286
|
-
margin-left:
|
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-
|
37
|
-
margin-left:
|
38
|
-
font-size: 16px;
|
46
|
+
.@{sdk-prefix}-drawer-close-icon {
|
47
|
+
margin-left: 24px;
|
39
48
|
}
|
@@ -61,6 +61,7 @@ var antd_1 = require("antd");
|
|
61
61
|
var config_provider_1 = require("antd/es/config-provider");
|
62
62
|
var style_1 = require("../../constants/style");
|
63
63
|
var bind_1 = __importDefault(require("../../utils/bind"));
|
64
|
+
var CloseIcon_1 = __importDefault(require("../Drawer/CloseIcon"));
|
64
65
|
/**
|
65
66
|
* 全局弹窗组件样式封装
|
66
67
|
*/
|
@@ -84,8 +85,8 @@ var Modal = /** @class */ (function (_super) {
|
|
84
85
|
};
|
85
86
|
Modal.prototype.render = function () {
|
86
87
|
var _this = this;
|
87
|
-
var _a = this.props, wrapClassName = _a.wrapClassName, children = _a.children, bodyStyle = _a.bodyStyle, title = _a.title, otherProps = __rest(_a, ["wrapClassName", "children", "bodyStyle", "title"]);
|
88
|
-
return (React.createElement(antd_1.Modal, __assign({ wrapClassName: classnames_1.default(style_1.SDK_PREFIX + "-modal", wrapClassName), maskClosable: false, title: title }, otherProps),
|
88
|
+
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"]);
|
89
|
+
return (React.createElement(antd_1.Modal, __assign({ wrapClassName: classnames_1.default(style_1.SDK_PREFIX + "-modal", wrapClassName), maskClosable: false, title: title, closeIcon: React.createElement(CloseIcon_1.default, { onClick: onCancel }), onCancel: onCancel }, otherProps),
|
89
90
|
React.createElement("div", { ref: this.setContainerRef, style: bodyStyle },
|
90
91
|
React.createElement(config_provider_1.ConfigConsumer, null, function (config) { return (React.createElement(antd_1.ConfigProvider, __assign({}, config, { getPopupContainer: _this.childrenGetPopupContainer }), children)); }))));
|
91
92
|
};
|
@@ -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:
|
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),
|
@@ -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
|
}
|
@@ -9,7 +9,8 @@ var en_3 = require("./range_input/en");
|
|
9
9
|
var en_4 = require("./steps/en");
|
10
10
|
var en_5 = require("./table/en");
|
11
11
|
var en_6 = require("./transfer/en");
|
12
|
-
var en_7 =
|
12
|
+
var en_7 = require("./modal/en");
|
13
|
+
var en_8 = __importDefault(require("./upload/en"));
|
13
14
|
exports.component_en = {
|
14
15
|
check_transform_list: en_1.check_transform_list_en,
|
15
16
|
datetime: en_2.datetime_en,
|
@@ -17,5 +18,6 @@ exports.component_en = {
|
|
17
18
|
steps: en_4.steps_en,
|
18
19
|
table: en_5.table_en,
|
19
20
|
transfer: en_6.transfer_en,
|
20
|
-
upload:
|
21
|
+
upload: en_8.default,
|
22
|
+
modal: en_7.modal_en
|
21
23
|
};
|
@@ -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;
|
@@ -9,7 +9,8 @@ var zh_3 = require("./range_input/zh");
|
|
9
9
|
var zh_4 = require("./steps/zh");
|
10
10
|
var zh_5 = require("./table/zh");
|
11
11
|
var zh_6 = require("./transfer/zh");
|
12
|
-
var zh_7 =
|
12
|
+
var zh_7 = require("./modal/zh");
|
13
|
+
var zh_8 = __importDefault(require("./upload/zh"));
|
13
14
|
exports.component_zh = {
|
14
15
|
check_transform_list: zh_1.check_transform_list_zh,
|
15
16
|
datetime: zh_2.datetime_zh,
|
@@ -17,5 +18,6 @@ exports.component_zh = {
|
|
17
18
|
steps: zh_4.steps_zh,
|
18
19
|
table: zh_5.table_zh,
|
19
20
|
transfer: zh_6.transfer_zh,
|
20
|
-
upload:
|
21
|
+
upload: zh_8.default,
|
22
|
+
modal: zh_7.modal_zh
|
21
23
|
};
|
package/lib/constants/style.d.ts
CHANGED
package/lib/constants/style.js
CHANGED
@@ -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
|
35
|
+
function modalPopupContainerWrapper(Comp) {
|
36
36
|
return function (props) {
|
37
37
|
var containerRef = react_1.useRef(null);
|
38
|
-
var
|
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
|
-
|
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: 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)); }))) : undefined }),
|
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 =
|
52
|
+
exports.default = modalPopupContainerWrapper;
|