@oceanbase/ui 0.2.19 → 0.2.21
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/dist/ui.min.js +1 -1
- package/es/Action/Group.d.ts +1 -1
- package/es/Action/Group.js +50 -41
- package/es/Action/Item.d.ts +2 -2
- package/es/Action/Item.js +32 -26
- package/es/Action/index.d.ts +1 -2
- package/es/BackgroundTaskManager/RefreshMan.js +8 -3
- package/es/BackgroundTaskManager/index.js +8 -4
- package/es/BasicLayout/Header.js +193 -140
- package/es/BasicLayout/index.js +149 -108
- package/es/BatchOperationBar/index.js +46 -29
- package/es/Boundary/Components/Code.js +17 -10
- package/es/Boundary/Components/Exception.js +46 -31
- package/es/Boundary/Components/Function.js +17 -10
- package/es/ContentWithIcon/index.js +42 -26
- package/es/ContentWithIcon/index.less +0 -1
- package/es/Dialog/Anchor.d.ts +1 -1
- package/es/Dialog/Anchor.js +9 -6
- package/es/Dialog/EventProxy.d.ts +1 -1
- package/es/Dialog/EventProxy.js +3 -2
- package/es/Dialog/index.js +129 -108
- package/es/Dialog/index.less +3 -1
- package/es/DocDialog/index.d.ts +1 -1
- package/es/DocDialog/index.js +8 -3
- package/es/FullscreenBox/index.d.ts +1 -1
- package/es/FullscreenBox/index.js +22 -16
- package/es/GraphToolbar/index.js +79 -65
- package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
- package/es/Highlight/DiffView/DiffCells.js +22 -15
- package/es/Highlight/DiffView/index.js +49 -40
- package/es/Highlight/HighlightCell.d.ts +1 -1
- package/es/Highlight/HighlightCell.js +19 -13
- package/es/Highlight/JsonView.d.ts +1 -2
- package/es/Highlight/JsonView.js +15 -13
- package/es/Highlight/index.d.ts +1 -1
- package/es/Highlight/index.js +66 -54
- package/es/IconFont/index.d.ts +1 -1
- package/es/IconFont/index.js +9 -3
- package/es/LocaleDropdown/index.js +38 -26
- package/es/Login/ActivateForm.js +63 -50
- package/es/Login/LoginForm.js +115 -99
- package/es/Login/RegisterForm.js +78 -67
- package/es/Login/index.js +122 -91
- package/es/Lottie/index.js +2 -1
- package/es/NavMenu/index.d.ts +2 -2
- package/es/NavMenu/index.js +34 -29
- package/es/PageContainer/ItemRender.d.ts +1 -2
- package/es/PageContainer/ItemRender.js +7 -3
- package/es/PageContainer/index.js +13 -10
- package/es/Password/Content.js +55 -47
- package/es/Password/index.js +62 -45
- package/es/Ranger/QuickPicker.d.ts +1 -2
- package/es/Ranger/QuickPicker.js +42 -31
- package/es/Ranger/Ranger.js +31 -27
- package/es/SideTip/Dragger.d.ts +1 -1
- package/es/SideTip/Dragger.js +5 -3
- package/es/SideTip/IconLoading.d.ts +1 -2
- package/es/SideTip/IconLoading.js +28 -20
- package/es/SideTip/index.js +43 -30
- package/es/SideTip/index.less +4 -1
- package/es/TagSelect/Group.d.ts +1 -1
- package/es/TagSelect/Group.js +16 -11
- package/es/TagSelect/Item.d.ts +1 -1
- package/es/TagSelect/Item.js +30 -23
- package/es/TagSelect/style/index.d.ts +1 -1
- package/es/TaskGraph/Graph.js +39 -31
- package/es/TaskGraph/index.js +68 -57
- package/es/TreeSearch/index.js +36 -32
- package/es/Welcome/index.js +113 -83
- package/es/Welcome/step.js +31 -23
- package/es/locale/LocaleWrapper.js +3 -3
- package/lib/Action/Group.d.ts +1 -1
- package/lib/Action/Item.d.ts +2 -2
- package/lib/Action/index.d.ts +1 -2
- package/lib/ContentWithIcon/index.less +0 -1
- package/lib/Dialog/Anchor.d.ts +1 -1
- package/lib/Dialog/EventProxy.d.ts +1 -1
- package/lib/Dialog/EventProxy.js +12 -2
- package/lib/Dialog/index.less +3 -1
- package/lib/DocDialog/index.d.ts +1 -1
- package/lib/FullscreenBox/index.d.ts +1 -1
- package/lib/FullscreenBox/index.js +76 -74
- package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
- package/lib/Highlight/DiffView/index.js +1 -1
- package/lib/Highlight/HighlightCell.d.ts +1 -1
- package/lib/Highlight/JsonView.d.ts +1 -2
- package/lib/Highlight/JsonView.js +3 -3
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/IconFont/index.d.ts +1 -1
- package/lib/NavMenu/index.d.ts +2 -2
- package/lib/PageContainer/ItemRender.d.ts +1 -2
- package/lib/Ranger/QuickPicker.d.ts +1 -2
- package/lib/SideTip/Dragger.d.ts +1 -1
- package/lib/SideTip/IconLoading.d.ts +1 -2
- package/lib/SideTip/index.less +4 -1
- package/lib/TagSelect/Group.d.ts +1 -1
- package/lib/TagSelect/Group.js +4 -6
- package/lib/TagSelect/Item.d.ts +1 -1
- package/lib/TagSelect/style/index.d.ts +1 -1
- package/package.json +10 -9
package/es/BasicLayout/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["children", "location", "banner", "iconUrl", "logoUrl", "simpleLogoUrl", "topHeader", "menus", "defaultCollapsed", "defaultSelectedKeys", "defaultOpenKeys", "sideHeader", "subSideMenuProps", "subSideMenus", "prefixCls", "className"];
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -28,6 +29,9 @@ import Header from "./Header";
|
|
|
28
29
|
import zhCN from "./locale/zh-CN";
|
|
29
30
|
import useStyle from "./style";
|
|
30
31
|
import "./index.less";
|
|
32
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
35
|
var Content = Layout.Content,
|
|
32
36
|
Sider = Layout.Sider;
|
|
33
37
|
var SubMenu = Menu.SubMenu,
|
|
@@ -142,10 +146,9 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
142
146
|
childAccessible = _ref3$accessible === void 0 ? true : _ref3$accessible;
|
|
143
147
|
return childAccessible;
|
|
144
148
|
}) : item.accessible)) {
|
|
145
|
-
pre.push( /*#__PURE__*/
|
|
149
|
+
pre.push( /*#__PURE__*/_jsx(SubMenu, {
|
|
146
150
|
"data-testid": "menu.sub",
|
|
147
|
-
|
|
148
|
-
title: /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
151
|
+
title: /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
149
152
|
placement: "right",
|
|
150
153
|
title: item.title
|
|
151
154
|
// SubMenu 通常都会带 icon,因此这里判断英文环境下如果标题字符长度 > 15 就支持 tooltip 展示
|
|
@@ -153,37 +156,48 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
153
156
|
visible: false,
|
|
154
157
|
// Support for antd 5.0
|
|
155
158
|
open: false
|
|
156
|
-
}, {
|
|
159
|
+
}), {}, {
|
|
157
160
|
getPopupContainer: function getPopupContainer() {
|
|
158
161
|
return document.body;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
},
|
|
163
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
164
|
+
children: [renderIcon(item), /*#__PURE__*/_jsx("span", {
|
|
165
|
+
children: item.title
|
|
166
|
+
})]
|
|
167
|
+
})
|
|
168
|
+
})),
|
|
169
|
+
children: renderMenu(item.children)
|
|
170
|
+
}, item.link));
|
|
162
171
|
} else if (!item.children && accessible) {
|
|
163
|
-
pre.push( /*#__PURE__*/
|
|
172
|
+
pre.push( /*#__PURE__*/_jsx(Item, {
|
|
164
173
|
"data-testid": "menu.item",
|
|
165
|
-
key: item.link,
|
|
166
174
|
onClick: function onClick() {
|
|
167
175
|
if (pathname !== item.link) {
|
|
168
176
|
navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
|
|
169
177
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
},
|
|
179
|
+
children: /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
180
|
+
placement: "right",
|
|
181
|
+
title: item.title
|
|
182
|
+
// 对于 Menu.Item,英文环境下如果标题字符长度 > 20 就支持 tooltip 展示
|
|
183
|
+
}, isEnglish() && item.title && item.title.length > 20 ? {} : {
|
|
184
|
+
visible: false,
|
|
185
|
+
// Support for antd 5.0
|
|
186
|
+
open: false
|
|
187
|
+
}), {}, {
|
|
188
|
+
getPopupContainer: function getPopupContainer() {
|
|
189
|
+
return document.body;
|
|
190
|
+
},
|
|
191
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
192
|
+
children: [renderIcon(item), /*#__PURE__*/_jsx("span", {
|
|
193
|
+
children: item.title
|
|
194
|
+
})]
|
|
195
|
+
})
|
|
196
|
+
}))
|
|
197
|
+
}, item.link));
|
|
184
198
|
}
|
|
185
199
|
if (item.divider && accessible) {
|
|
186
|
-
pre.push( /*#__PURE__*/
|
|
200
|
+
pre.push( /*#__PURE__*/_jsx(Divider, {
|
|
187
201
|
style: {
|
|
188
202
|
// 渐变的分隔线
|
|
189
203
|
borderImage: "linear-gradient(90deg, ".concat(token.colorTextQuaternary, " 0%, ").concat(setAlpha(token.colorTextQuaternary, 0), " 100%) 1")
|
|
@@ -207,29 +221,32 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
207
221
|
childAccessible = _ref4$accessible === void 0 ? true : _ref4$accessible;
|
|
208
222
|
return childAccessible;
|
|
209
223
|
}) : item.accessible)) {
|
|
210
|
-
pre.push( /*#__PURE__*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
},
|
|
224
|
+
pre.push( /*#__PURE__*/_jsx(SubMenu, {
|
|
225
|
+
title: renderIcon(item, isSubSider),
|
|
226
|
+
children: renderMenu(item.children)
|
|
227
|
+
}, item.link));
|
|
214
228
|
} else if (!item.children && accessible) {
|
|
215
|
-
pre.push( /*#__PURE__*/
|
|
229
|
+
pre.push( /*#__PURE__*/_jsx(Item, {
|
|
216
230
|
"data-testid": "menu.item",
|
|
217
|
-
key: item.link,
|
|
218
231
|
onClick: function onClick() {
|
|
219
232
|
if (pathname !== item.link) {
|
|
220
233
|
navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
|
|
221
234
|
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
235
|
+
},
|
|
236
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
237
|
+
placement: "right",
|
|
238
|
+
title: item.title,
|
|
239
|
+
getPopupContainer: function getPopupContainer() {
|
|
240
|
+
return document.body;
|
|
241
|
+
},
|
|
242
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
243
|
+
children: renderIcon(item, isSubSider)
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
}, item.link));
|
|
230
247
|
}
|
|
231
248
|
if (item.divider && accessible) {
|
|
232
|
-
pre.push( /*#__PURE__*/
|
|
249
|
+
pre.push( /*#__PURE__*/_jsx(Divider, {}));
|
|
233
250
|
}
|
|
234
251
|
return pre;
|
|
235
252
|
}, []);
|
|
@@ -245,74 +262,98 @@ var BasicLayout = function BasicLayout(_ref) {
|
|
|
245
262
|
} else if (!subSideMenus && !menus) {
|
|
246
263
|
siderWidth = 0;
|
|
247
264
|
}
|
|
248
|
-
return wrapSSR( /*#__PURE__*/
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
265
|
+
return wrapSSR( /*#__PURE__*/_jsxs(_Fragment, {
|
|
266
|
+
children: [banner && /*#__PURE__*/_jsx("div", {
|
|
267
|
+
className: "".concat(prefix, "-banner-wrapper"),
|
|
268
|
+
children: banner
|
|
269
|
+
}), /*#__PURE__*/_jsx(Layout, _objectSpread(_objectSpread({
|
|
270
|
+
className: classNames(prefix, className, basicLayoutCls, _defineProperty({}, "".concat(prefix, "-with-banner"), banner))
|
|
271
|
+
}, restProps), {}, {
|
|
272
|
+
children: /*#__PURE__*/_jsxs(React.Fragment, {
|
|
273
|
+
children: [/*#__PURE__*/_jsx(Header, _objectSpread({
|
|
274
|
+
pathname: pathname,
|
|
275
|
+
iconUrl: iconUrl,
|
|
276
|
+
logoUrl: logoUrl,
|
|
277
|
+
simpleLogoUrl: simpleLogoUrl
|
|
278
|
+
}, topHeader)), /*#__PURE__*/_jsx("div", {
|
|
279
|
+
children: /*#__PURE__*/_jsxs(Layout, {
|
|
280
|
+
className: "".concat(prefix, "-content-layout"),
|
|
281
|
+
style: {
|
|
282
|
+
marginTop: 48
|
|
283
|
+
},
|
|
284
|
+
children: [(subSideMenus || menus) && /*#__PURE__*/_jsx(Sider, {
|
|
285
|
+
theme: "light",
|
|
286
|
+
width: siderWidth,
|
|
287
|
+
className: classNames("".concat(prefix, "-sider"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "-sider-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefix, "-sider-has-sub-sider"), subSideMenus), _classNames2)),
|
|
288
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
289
|
+
className: "".concat(prefix, "-sider-wrapper"),
|
|
290
|
+
children: [subSideMenus && /*#__PURE__*/_jsx("div", {
|
|
291
|
+
className: "".concat(prefix, "-sub-sider"),
|
|
292
|
+
children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, subSideMenuProps), {}, {
|
|
293
|
+
mode: "vertical",
|
|
294
|
+
className: "".concat(prefix, "-menu-vertical"),
|
|
295
|
+
children: renderCollapsedMenu(subSideMenus, true)
|
|
296
|
+
}))
|
|
297
|
+
}), (sideHeader || menus) && /*#__PURE__*/_jsxs("div", {
|
|
298
|
+
style: {
|
|
299
|
+
display: 'flex',
|
|
300
|
+
width: '100%'
|
|
301
|
+
},
|
|
302
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
303
|
+
className: "".concat(prefix, "-sider-content"),
|
|
304
|
+
children: [sideHeader && /*#__PURE__*/_jsx("div", {
|
|
305
|
+
className: "".concat(prefix, "-sider-header"),
|
|
306
|
+
children: sideHeader
|
|
307
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
308
|
+
className: "".concat(prefix, "-menu-wrapper"),
|
|
309
|
+
children: collapsed ? /*#__PURE__*/_jsx("div", {
|
|
310
|
+
className: "".concat(prefix, "-menu-collapsed"),
|
|
311
|
+
children: /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
312
|
+
mode: "vertical",
|
|
313
|
+
className: "".concat(prefix, "-menu-vertical"),
|
|
314
|
+
children: renderCollapsedMenu(menus, false)
|
|
315
|
+
}))
|
|
316
|
+
}) : /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({}, menuProps), {}, {
|
|
317
|
+
mode: "inline",
|
|
318
|
+
expandIcon: function expandIcon(_ref5) {
|
|
319
|
+
var isOpen = _ref5.isOpen;
|
|
320
|
+
return /*#__PURE__*/_jsx(CaretRightFilled, {
|
|
321
|
+
rotate: isOpen ? 90 : 0,
|
|
322
|
+
style: {
|
|
323
|
+
fontSize: 12
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
className: "".concat(prefix, "-menu"),
|
|
328
|
+
children: renderMenu(menus)
|
|
329
|
+
}))
|
|
330
|
+
})]
|
|
331
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
332
|
+
className: "".concat(prefix, "-sider-border"),
|
|
333
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
334
|
+
className: "".concat(prefix, "-sider-collapse"),
|
|
335
|
+
onClick: function onClick() {
|
|
336
|
+
setCollapsed(!collapsed);
|
|
337
|
+
// 导航展开/收起时,重置 openKeys
|
|
338
|
+
setOpenKeys([]);
|
|
339
|
+
},
|
|
340
|
+
children: collapsed ? /*#__PURE__*/_jsx(RightOutlined, {}) : /*#__PURE__*/_jsx(LeftOutlined, {})
|
|
341
|
+
})
|
|
342
|
+
})]
|
|
343
|
+
})]
|
|
344
|
+
})
|
|
345
|
+
}), /*#__PURE__*/_jsx(Content, {
|
|
346
|
+
className: classNames("".concat(prefix, "-content"), "".concat(prefix, "-content-").concat(siderWidth)),
|
|
347
|
+
style: {
|
|
348
|
+
marginLeft: siderWidth
|
|
349
|
+
},
|
|
350
|
+
children: children
|
|
351
|
+
})]
|
|
352
|
+
})
|
|
353
|
+
})]
|
|
354
|
+
})
|
|
355
|
+
}))]
|
|
356
|
+
}));
|
|
316
357
|
};
|
|
317
358
|
export default LocaleWrapper({
|
|
318
359
|
componentName: 'BasicLayout',
|
|
@@ -18,6 +18,8 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
18
18
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
19
19
|
import "./index.less";
|
|
20
20
|
import zhCN from "./locale/zh-CN";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
23
|
var prefix = 'ob-batch-operation-bar';
|
|
22
24
|
var BatchOperationBar = function BatchOperationBar(props) {
|
|
23
25
|
var _classnames3, _locale$alertText, _locale$alertText$rep, _classnames5;
|
|
@@ -38,11 +40,11 @@ var BatchOperationBar = function BatchOperationBar(props) {
|
|
|
38
40
|
_props$openText = props.openText,
|
|
39
41
|
openText = _props$openText === void 0 ? locale === null || locale === void 0 ? void 0 : locale.openText : _props$openText,
|
|
40
42
|
_props$openIcon = props.openIcon,
|
|
41
|
-
openIcon = _props$openIcon === void 0 ? /*#__PURE__*/
|
|
43
|
+
openIcon = _props$openIcon === void 0 ? /*#__PURE__*/_jsx(DownOutlined, {}) : _props$openIcon,
|
|
42
44
|
_props$hiddenText = props.hiddenText,
|
|
43
45
|
hiddenText = _props$hiddenText === void 0 ? locale === null || locale === void 0 ? void 0 : locale.hiddenText : _props$hiddenText,
|
|
44
46
|
_props$hiddenIcon = props.hiddenIcon,
|
|
45
|
-
hiddenIcon = _props$hiddenIcon === void 0 ? /*#__PURE__*/
|
|
47
|
+
hiddenIcon = _props$hiddenIcon === void 0 ? /*#__PURE__*/_jsx(UpOutlined, {}) : _props$hiddenIcon,
|
|
46
48
|
_props$showCancelBtn = props.showCancelBtn,
|
|
47
49
|
showCancelBtn = _props$showCancelBtn === void 0 ? true : _props$showCancelBtn,
|
|
48
50
|
_props$showOpenBtn = props.showOpenBtn,
|
|
@@ -84,41 +86,56 @@ var BatchOperationBar = function BatchOperationBar(props) {
|
|
|
84
86
|
var disPlayBtnRender = function disPlayBtnRender() {
|
|
85
87
|
var _classnames;
|
|
86
88
|
if (!showOpenBtn) return null;
|
|
87
|
-
return /*#__PURE__*/
|
|
89
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
88
90
|
className: classnames((_classnames = {}, _defineProperty(_classnames, "".concat(prefix, "-open-btn"), isOpen), _defineProperty(_classnames, "".concat(prefix, "-close-btn"), !isOpen), _defineProperty(_classnames, "".concat(prefix, "-display-btn"), true), _classnames)),
|
|
89
91
|
onClick: function onClick() {
|
|
90
92
|
return setIsOpen(!isOpen);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
},
|
|
94
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
95
|
+
className: classnames(_defineProperty({}, "".concat(prefix, "-display-text"), true)),
|
|
96
|
+
children: isOpen ? hiddenText : openText
|
|
97
|
+
}), isOpen ? hiddenIcon : openIcon]
|
|
98
|
+
});
|
|
95
99
|
};
|
|
96
100
|
useEffect(function () {
|
|
97
101
|
if (isEmpty(selectedRows) || !selectedRows) setSelectedData([]);else setSelectedData(selectedRows);
|
|
98
102
|
}, [selectedRows]);
|
|
99
|
-
return /*#__PURE__*/
|
|
103
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
100
104
|
className: classnames((_classnames3 = {}, _defineProperty(_classnames3, className, !!className), _defineProperty(_classnames3, prefix, true), _classnames3)),
|
|
101
|
-
style: style
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
105
|
+
style: style,
|
|
106
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
107
|
+
className: "".concat(prefix, "-header"),
|
|
108
|
+
children: [/*#__PURE__*/_jsxs(Space, {
|
|
109
|
+
children: [!!alertRender ? alertRender === null || alertRender === void 0 ? void 0 : alertRender(selectedData) : /*#__PURE__*/_jsxs(Space, {
|
|
110
|
+
children: [title && /*#__PURE__*/_jsx("span", {
|
|
111
|
+
className: "".concat(prefix, "-title"),
|
|
112
|
+
children: title
|
|
113
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
114
|
+
children: locale === null || locale === void 0 ? void 0 : (_locale$alertText = locale.alertText) === null || _locale$alertText === void 0 ? void 0 : (_locale$alertText$rep = _locale$alertText.replace) === null || _locale$alertText$rep === void 0 ? void 0 : _locale$alertText$rep.call(_locale$alertText, /\$\{\}/, (selectedData === null || selectedData === void 0 ? void 0 : selectedData.length) || 0)
|
|
115
|
+
})]
|
|
116
|
+
}), !!showCancelBtn && /*#__PURE__*/_jsx("span", {
|
|
117
|
+
className: classnames(_defineProperty({}, "".concat(prefix, "-cancel"), true)),
|
|
118
|
+
onClick: function onClick() {
|
|
119
|
+
return cleanSelectedRows();
|
|
120
|
+
},
|
|
121
|
+
children: cancelText
|
|
122
|
+
}), disPlayBtnRender()]
|
|
123
|
+
}), !!alertOptionRender && /*#__PURE__*/_jsx("div", {
|
|
124
|
+
children: alertOptionRender === null || alertOptionRender === void 0 ? void 0 : alertOptionRender({
|
|
125
|
+
selectedRows: selectedData,
|
|
126
|
+
setSelectedRows: setSelectedRows,
|
|
127
|
+
cleanSelectedRows: cleanSelectedRows
|
|
128
|
+
})
|
|
129
|
+
})]
|
|
130
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
131
|
+
className: classnames((_classnames5 = {}, _defineProperty(_classnames5, "".concat(prefix, "-content"), true), _defineProperty(_classnames5, "".concat(prefix, "-content-active"), !!isOpen), _defineProperty(_classnames5, "".concat(prefix, "-content-hidden"), !isOpen), _classnames5)),
|
|
132
|
+
children: typeof content === 'function' ? content === null || content === void 0 ? void 0 : content({
|
|
133
|
+
selectedRows: selectedData,
|
|
134
|
+
setSelectedRows: setSelectedRows,
|
|
135
|
+
cleanSelectedRows: cleanSelectedRows
|
|
136
|
+
}) : content
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
122
139
|
};
|
|
123
140
|
export default LocaleWrapper({
|
|
124
141
|
componentName: 'BatchOperationBar',
|
|
@@ -3,6 +3,8 @@ import React, { useMemo } from 'react';
|
|
|
3
3
|
import LocaleWrapper from "../../locale/LocaleWrapper";
|
|
4
4
|
import { CODE_PRESET } from "../constant";
|
|
5
5
|
import zhCN from "../locale/zh-CN";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
8
|
var BoundaryCode = function BoundaryCode(props) {
|
|
7
9
|
var children = props.children,
|
|
8
10
|
onClick = props.onClick,
|
|
@@ -15,16 +17,21 @@ var BoundaryCode = function BoundaryCode(props) {
|
|
|
15
17
|
var data = CODE_PRESET(locale);
|
|
16
18
|
return data[code];
|
|
17
19
|
}, [code, locale]);
|
|
18
|
-
return /*#__PURE__*/
|
|
19
|
-
className: "boundary-container boundary-code"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
return /*#__PURE__*/_jsx("div", {
|
|
21
|
+
className: "boundary-container boundary-code",
|
|
22
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
23
|
+
className: "empty",
|
|
24
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
25
|
+
src: imageUrl || info.imageUrl
|
|
26
|
+
}), /*#__PURE__*/_jsx("h4", {
|
|
27
|
+
children: title || info.title
|
|
28
|
+
}), children, /*#__PURE__*/_jsx(Button, {
|
|
29
|
+
type: "primary",
|
|
30
|
+
onClick: onClick || info.onClick,
|
|
31
|
+
children: buttonText || info.buttonText
|
|
32
|
+
})]
|
|
33
|
+
})
|
|
34
|
+
});
|
|
28
35
|
};
|
|
29
36
|
export var Code = LocaleWrapper({
|
|
30
37
|
componentName: 'Boundary',
|
|
@@ -17,6 +17,8 @@ import React from 'react';
|
|
|
17
17
|
import LocaleWrapper from "../../locale/LocaleWrapper";
|
|
18
18
|
import { EXCEPTION_PRESET } from "../constant";
|
|
19
19
|
import zhCN from "../locale/zh-CN";
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
22
|
var BoundaryException = /*#__PURE__*/function (_React$PureComponent) {
|
|
21
23
|
_inherits(BoundaryException, _React$PureComponent);
|
|
22
24
|
var _super = _createSuper(BoundaryException);
|
|
@@ -78,38 +80,51 @@ var BoundaryException = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
78
80
|
var errorDescription = info === null || info === void 0 ? void 0 : info.componentStack;
|
|
79
81
|
var errorMessage = (error || '').toString();
|
|
80
82
|
if ((_this$state2 = this.state) !== null && _this$state2 !== void 0 && _this$state2.hasError) {
|
|
81
|
-
return /*#__PURE__*/
|
|
82
|
-
className: "boundary-container"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
83
|
+
return /*#__PURE__*/_jsx("div", {
|
|
84
|
+
className: "boundary-container",
|
|
85
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
86
|
+
className: "empty",
|
|
87
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
88
|
+
src: imageUrl || errorInfo.imageUrl
|
|
89
|
+
}), /*#__PURE__*/_jsx("h4", {
|
|
90
|
+
children: title || errorInfo.title
|
|
91
|
+
}), showError ? /*#__PURE__*/_jsx(Alert, {
|
|
92
|
+
type: "error",
|
|
93
|
+
showIcon: true,
|
|
94
|
+
message: errorMessage,
|
|
95
|
+
description: errorDescription,
|
|
96
|
+
style: {
|
|
97
|
+
marginTop: 24,
|
|
98
|
+
overflow: 'auto',
|
|
99
|
+
maxHeight: '50vh',
|
|
100
|
+
// 为了避免被 Empty 的水平居中样式影响,需要设置 textAlign
|
|
101
|
+
textAlign: 'left'
|
|
102
|
+
}
|
|
103
|
+
}) : subscription && /*#__PURE__*/_jsx("span", {
|
|
104
|
+
children: subscription
|
|
105
|
+
}), hasButton ? /*#__PURE__*/_jsx(Button, {
|
|
106
|
+
type: "primary",
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return _this2.onClick();
|
|
109
|
+
},
|
|
110
|
+
children: buttonText || errorInfo.buttonText
|
|
111
|
+
}) : '']
|
|
112
|
+
})
|
|
113
|
+
});
|
|
105
114
|
} else if (isNotCompatible) {
|
|
106
|
-
return /*#__PURE__*/
|
|
107
|
-
className: "boundary-container"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
return /*#__PURE__*/_jsx("div", {
|
|
116
|
+
className: "boundary-container",
|
|
117
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
118
|
+
className: "empty",
|
|
119
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
120
|
+
src: imageUrl || notCompatibleInfo.imageUrl
|
|
121
|
+
}), /*#__PURE__*/_jsx("h4", {
|
|
122
|
+
children: title || notCompatibleInfo.title
|
|
123
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
124
|
+
children: subscription ? subscription : notCompatibleInfo.subscription
|
|
125
|
+
})]
|
|
126
|
+
})
|
|
127
|
+
});
|
|
113
128
|
}
|
|
114
129
|
return this.props.children;
|
|
115
130
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Button } from '@oceanbase/design';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
5
|
export var BoundaryFunction = function BoundaryFunction(props) {
|
|
4
6
|
var children = props.children,
|
|
5
7
|
state = props.state,
|
|
@@ -8,14 +10,19 @@ export var BoundaryFunction = function BoundaryFunction(props) {
|
|
|
8
10
|
var info = useMemo(function () {
|
|
9
11
|
return state ? config[state] : config[Object.keys(config)[0]];
|
|
10
12
|
}, [config, state]);
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
className: "boundary-container"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
return /*#__PURE__*/_jsx("div", {
|
|
14
|
+
className: "boundary-container",
|
|
15
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
16
|
+
className: "empty",
|
|
17
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
18
|
+
src: info.imageUrl
|
|
19
|
+
}), /*#__PURE__*/_jsx("h4", {
|
|
20
|
+
children: info.title
|
|
21
|
+
}), children, info.buttonText && /*#__PURE__*/_jsx(Button, {
|
|
22
|
+
type: "primary",
|
|
23
|
+
onClick: onClick || info.onClick,
|
|
24
|
+
children: info.buttonText
|
|
25
|
+
})]
|
|
26
|
+
})
|
|
27
|
+
});
|
|
21
28
|
};
|