@qn-pandora/pandora-component 4.0.12 → 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 +20 -0
- package/CHANGELOG.md +9 -1
- package/es/components/Drawer/index.d.ts +13 -2
- package/es/components/Drawer/index.js +38 -4
- 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 +3725 -3725
- package/es/index.less +17 -17
- 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/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 +4331 -4331
- package/lib/index.less +13 -13
- 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 +3 -3
- package/es/hoc/popContainer.d.ts +0 -5
- package/lib/hoc/popContainer.d.ts +0 -5
package/es/index.less
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
@import './style\mixin.less';
|
2
2
|
@import './style\theme.less';
|
3
|
-
@import './components\Breadcrumb\style.less';
|
4
|
-
@import './components\AutoComplete\style.less';
|
5
|
-
@import './components\Card\style.less';
|
6
3
|
@import './components\Button\style.less';
|
7
|
-
@import './components\
|
4
|
+
@import './components\AutoComplete\style.less';
|
5
|
+
@import './components\Breadcrumb\style.less';
|
8
6
|
@import './components\Checkbox\style.less';
|
7
|
+
@import './components\CheckboxList\style.less';
|
8
|
+
@import './components\Card\style.less';
|
9
|
+
@import './components\CollapsiblePanel\style.less';
|
9
10
|
@import './components\Collapse\style.less';
|
11
|
+
@import './components\Drawer\style.less';
|
10
12
|
@import './components\CheckTransformList\style.less';
|
11
|
-
@import './components\CollapsiblePanel\style.less';
|
12
13
|
@import './components\DateTimePicker\style.less';
|
13
|
-
@import './components\Drawer\style.less';
|
14
14
|
@import './components\FileResumable\style.less';
|
15
15
|
@import './components\Input\style.less';
|
16
16
|
@import './components\KeyValuePair\style.less';
|
@@ -18,33 +18,33 @@
|
|
18
18
|
@import './components\Modal\style.less';
|
19
19
|
@import './components\NameExplainTooltip\style.less';
|
20
20
|
@import './components\NameLimiter\style.less';
|
21
|
-
@import './components\RadioGroup\style.less';
|
22
21
|
@import './components\OptionList\style.less';
|
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
26
|
@import './components\Spin\style.less';
|
27
27
|
@import './components\Steps\style.less';
|
28
|
-
@import './components\Tabs\style.less';
|
29
28
|
@import './components\Table\style.less';
|
30
|
-
@import './components\
|
29
|
+
@import './components\Tabs\style.less';
|
31
30
|
@import './components\Timeline\style.less';
|
32
31
|
@import './components\TreeSelector\style.less';
|
33
32
|
@import './components\Transfer\style.less';
|
33
|
+
@import './components\TagList\style.less';
|
34
34
|
@import './components\Card\SearchInput\style.less';
|
35
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';
|
38
|
+
@import './components\DateTimePicker\BaseMobile\style.less';
|
39
39
|
@import './components\OptionList\OptionItem\style.less';
|
40
|
-
@import './components\OptionList\PopoverOptionList\style.less';
|
41
40
|
@import './components\OptionList\InlineOptionList\style.less';
|
42
|
-
@import './components\
|
41
|
+
@import './components\OptionList\PopoverOptionList\style.less';
|
43
42
|
@import './components\Table\ColumnTag\style.less';
|
44
|
-
@import './components\
|
45
|
-
@import './components\TagList\TagSwitch\style.less';
|
46
|
-
@import './components\Timeline\TimelineItem\style.less';
|
43
|
+
@import './components\Steps\ControlButton\style.less';
|
47
44
|
@import './components\Transfer\List\style.less';
|
45
|
+
@import './components\Timeline\TimelineItem\style.less';
|
48
46
|
@import './components\Transfer\ListBody\style.less';
|
49
|
-
@import './components\
|
50
|
-
@import './components\
|
47
|
+
@import './components\TagList\Tag\style.less';
|
48
|
+
@import './components\TagList\TagSwitch\style.less';
|
49
|
+
@import './components\DateTimePicker\Collapse\Panel\style.less';
|
50
|
+
@import './components\DateTimePicker\BaseMobile\Absolute\style.less';
|
package/es/style/theme.less
CHANGED
@@ -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-
|
392
|
-
@agent-user-
|
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;
|
package/es/utils/dom.js
ADDED
@@ -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:
|
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
|
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 =
|
231
|
+
exports.default = modalPopupContainer_1.default(Drawer);
|
@@ -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
|
}
|
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: 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 =
|
52
|
+
exports.default = modalPopupContainerWrapper;
|