@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.
Files changed (100) hide show
  1. package/dist/ui.min.js +1 -1
  2. package/es/Action/Group.d.ts +1 -1
  3. package/es/Action/Group.js +50 -41
  4. package/es/Action/Item.d.ts +2 -2
  5. package/es/Action/Item.js +32 -26
  6. package/es/Action/index.d.ts +1 -2
  7. package/es/BackgroundTaskManager/RefreshMan.js +8 -3
  8. package/es/BackgroundTaskManager/index.js +8 -4
  9. package/es/BasicLayout/Header.js +193 -140
  10. package/es/BasicLayout/index.js +149 -108
  11. package/es/BatchOperationBar/index.js +46 -29
  12. package/es/Boundary/Components/Code.js +17 -10
  13. package/es/Boundary/Components/Exception.js +46 -31
  14. package/es/Boundary/Components/Function.js +17 -10
  15. package/es/ContentWithIcon/index.js +42 -26
  16. package/es/ContentWithIcon/index.less +0 -1
  17. package/es/Dialog/Anchor.d.ts +1 -1
  18. package/es/Dialog/Anchor.js +9 -6
  19. package/es/Dialog/EventProxy.d.ts +1 -1
  20. package/es/Dialog/EventProxy.js +3 -2
  21. package/es/Dialog/index.js +129 -108
  22. package/es/Dialog/index.less +3 -1
  23. package/es/DocDialog/index.d.ts +1 -1
  24. package/es/DocDialog/index.js +8 -3
  25. package/es/FullscreenBox/index.d.ts +1 -1
  26. package/es/FullscreenBox/index.js +22 -16
  27. package/es/GraphToolbar/index.js +79 -65
  28. package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
  29. package/es/Highlight/DiffView/DiffCells.js +22 -15
  30. package/es/Highlight/DiffView/index.js +49 -40
  31. package/es/Highlight/HighlightCell.d.ts +1 -1
  32. package/es/Highlight/HighlightCell.js +19 -13
  33. package/es/Highlight/JsonView.d.ts +1 -2
  34. package/es/Highlight/JsonView.js +15 -13
  35. package/es/Highlight/index.d.ts +1 -1
  36. package/es/Highlight/index.js +66 -54
  37. package/es/IconFont/index.d.ts +1 -1
  38. package/es/IconFont/index.js +9 -3
  39. package/es/LocaleDropdown/index.js +38 -26
  40. package/es/Login/ActivateForm.js +63 -50
  41. package/es/Login/LoginForm.js +115 -99
  42. package/es/Login/RegisterForm.js +78 -67
  43. package/es/Login/index.js +122 -91
  44. package/es/Lottie/index.js +2 -1
  45. package/es/NavMenu/index.d.ts +2 -2
  46. package/es/NavMenu/index.js +34 -29
  47. package/es/PageContainer/ItemRender.d.ts +1 -2
  48. package/es/PageContainer/ItemRender.js +7 -3
  49. package/es/PageContainer/index.js +13 -10
  50. package/es/Password/Content.js +55 -47
  51. package/es/Password/index.js +62 -45
  52. package/es/Ranger/QuickPicker.d.ts +1 -2
  53. package/es/Ranger/QuickPicker.js +42 -31
  54. package/es/Ranger/Ranger.js +31 -27
  55. package/es/SideTip/Dragger.d.ts +1 -1
  56. package/es/SideTip/Dragger.js +5 -3
  57. package/es/SideTip/IconLoading.d.ts +1 -2
  58. package/es/SideTip/IconLoading.js +28 -20
  59. package/es/SideTip/index.js +43 -30
  60. package/es/SideTip/index.less +4 -1
  61. package/es/TagSelect/Group.d.ts +1 -1
  62. package/es/TagSelect/Group.js +16 -11
  63. package/es/TagSelect/Item.d.ts +1 -1
  64. package/es/TagSelect/Item.js +30 -23
  65. package/es/TagSelect/style/index.d.ts +1 -1
  66. package/es/TaskGraph/Graph.js +39 -31
  67. package/es/TaskGraph/index.js +68 -57
  68. package/es/TreeSearch/index.js +36 -32
  69. package/es/Welcome/index.js +113 -83
  70. package/es/Welcome/step.js +31 -23
  71. package/es/locale/LocaleWrapper.js +3 -3
  72. package/lib/Action/Group.d.ts +1 -1
  73. package/lib/Action/Item.d.ts +2 -2
  74. package/lib/Action/index.d.ts +1 -2
  75. package/lib/ContentWithIcon/index.less +0 -1
  76. package/lib/Dialog/Anchor.d.ts +1 -1
  77. package/lib/Dialog/EventProxy.d.ts +1 -1
  78. package/lib/Dialog/EventProxy.js +12 -2
  79. package/lib/Dialog/index.less +3 -1
  80. package/lib/DocDialog/index.d.ts +1 -1
  81. package/lib/FullscreenBox/index.d.ts +1 -1
  82. package/lib/FullscreenBox/index.js +76 -74
  83. package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
  84. package/lib/Highlight/DiffView/index.js +1 -1
  85. package/lib/Highlight/HighlightCell.d.ts +1 -1
  86. package/lib/Highlight/JsonView.d.ts +1 -2
  87. package/lib/Highlight/JsonView.js +3 -3
  88. package/lib/Highlight/index.d.ts +1 -1
  89. package/lib/IconFont/index.d.ts +1 -1
  90. package/lib/NavMenu/index.d.ts +2 -2
  91. package/lib/PageContainer/ItemRender.d.ts +1 -2
  92. package/lib/Ranger/QuickPicker.d.ts +1 -2
  93. package/lib/SideTip/Dragger.d.ts +1 -1
  94. package/lib/SideTip/IconLoading.d.ts +1 -2
  95. package/lib/SideTip/index.less +4 -1
  96. package/lib/TagSelect/Group.d.ts +1 -1
  97. package/lib/TagSelect/Group.js +4 -6
  98. package/lib/TagSelect/Item.d.ts +1 -1
  99. package/lib/TagSelect/style/index.d.ts +1 -1
  100. package/package.json +10 -9
@@ -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__*/React.createElement(SubMenu, {
149
+ pre.push( /*#__PURE__*/_jsx(SubMenu, {
146
150
  "data-testid": "menu.sub",
147
- key: item.link,
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
- }), /*#__PURE__*/React.createElement("span", null, renderIcon(item), /*#__PURE__*/React.createElement("span", null, item.title)))
161
- }, renderMenu(item.children)));
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__*/React.createElement(Item, {
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
- }, /*#__PURE__*/React.createElement(Tooltip, _extends({
172
- placement: "right",
173
- title: item.title
174
- // 对于 Menu.Item,英文环境下如果标题字符长度 > 20 就支持 tooltip 展示
175
- }, isEnglish() && item.title && item.title.length > 20 ? {} : {
176
- visible: false,
177
- // Support for antd 5.0
178
- open: false
179
- }, {
180
- getPopupContainer: function getPopupContainer() {
181
- return document.body;
182
- }
183
- }), /*#__PURE__*/React.createElement("span", null, renderIcon(item), /*#__PURE__*/React.createElement("span", null, item.title)))));
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__*/React.createElement(Divider, {
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__*/React.createElement(SubMenu, {
211
- key: item.link,
212
- title: renderIcon(item, isSubSider)
213
- }, renderMenu(item.children)));
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__*/React.createElement(Item, {
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
- }, /*#__PURE__*/React.createElement(Tooltip, {
224
- placement: "right",
225
- title: item.title,
226
- getPopupContainer: function getPopupContainer() {
227
- return document.body;
228
- }
229
- }, /*#__PURE__*/React.createElement("div", null, renderIcon(item, isSubSider)))));
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__*/React.createElement(Divider, null));
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__*/React.createElement(React.Fragment, null, banner && /*#__PURE__*/React.createElement("div", {
249
- className: "".concat(prefix, "-banner-wrapper")
250
- }, banner), /*#__PURE__*/React.createElement(Layout, _extends({
251
- className: classNames(prefix, className, basicLayoutCls, _defineProperty({}, "".concat(prefix, "-with-banner"), banner))
252
- }, restProps), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, _extends({
253
- pathname: pathname,
254
- iconUrl: iconUrl,
255
- logoUrl: logoUrl,
256
- simpleLogoUrl: simpleLogoUrl
257
- }, topHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Layout, {
258
- className: "".concat(prefix, "-content-layout"),
259
- style: {
260
- marginTop: 48
261
- }
262
- }, (subSideMenus || menus) && /*#__PURE__*/React.createElement(Sider, {
263
- theme: "light",
264
- width: siderWidth,
265
- className: classNames("".concat(prefix, "-sider"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "-sider-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefix, "-sider-has-sub-sider"), subSideMenus), _classNames2))
266
- }, /*#__PURE__*/React.createElement("div", {
267
- className: "".concat(prefix, "-sider-wrapper")
268
- }, subSideMenus && /*#__PURE__*/React.createElement("div", {
269
- className: "".concat(prefix, "-sub-sider")
270
- }, /*#__PURE__*/React.createElement(Menu, _extends({}, subSideMenuProps, {
271
- mode: "vertical",
272
- className: "".concat(prefix, "-menu-vertical")
273
- }), renderCollapsedMenu(subSideMenus, true))), (sideHeader || menus) && /*#__PURE__*/React.createElement("div", {
274
- style: {
275
- display: 'flex',
276
- width: '100%'
277
- }
278
- }, /*#__PURE__*/React.createElement("div", {
279
- className: "".concat(prefix, "-sider-content")
280
- }, sideHeader && /*#__PURE__*/React.createElement("div", {
281
- className: "".concat(prefix, "-sider-header")
282
- }, sideHeader), /*#__PURE__*/React.createElement("div", {
283
- className: "".concat(prefix, "-menu-wrapper")
284
- }, collapsed ? /*#__PURE__*/React.createElement("div", {
285
- className: "".concat(prefix, "-menu-collapsed")
286
- }, /*#__PURE__*/React.createElement(Menu, _extends({}, menuProps, {
287
- mode: "vertical",
288
- className: "".concat(prefix, "-menu-vertical")
289
- }), renderCollapsedMenu(menus, false))) : /*#__PURE__*/React.createElement(Menu, _extends({}, menuProps, {
290
- mode: "inline",
291
- expandIcon: function expandIcon(_ref5) {
292
- var isOpen = _ref5.isOpen;
293
- return /*#__PURE__*/React.createElement(CaretRightFilled, {
294
- rotate: isOpen ? 90 : 0,
295
- style: {
296
- fontSize: 12
297
- }
298
- });
299
- },
300
- className: "".concat(prefix, "-menu")
301
- }), renderMenu(menus)))), /*#__PURE__*/React.createElement("div", {
302
- className: "".concat(prefix, "-sider-border")
303
- }, /*#__PURE__*/React.createElement("div", {
304
- className: "".concat(prefix, "-sider-collapse"),
305
- onClick: function onClick() {
306
- setCollapsed(!collapsed);
307
- // 导航展开/收起时,重置 openKeys
308
- setOpenKeys([]);
309
- }
310
- }, collapsed ? /*#__PURE__*/React.createElement(RightOutlined, null) : /*#__PURE__*/React.createElement(LeftOutlined, null)))))), /*#__PURE__*/React.createElement(Content, {
311
- className: classNames("".concat(prefix, "-content"), "".concat(prefix, "-content-").concat(siderWidth)),
312
- style: {
313
- marginLeft: siderWidth
314
- }
315
- }, children)))))));
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__*/React.createElement(DownOutlined, null) : _props$openIcon,
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__*/React.createElement(UpOutlined, null) : _props$hiddenIcon,
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__*/React.createElement("div", {
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
- }, /*#__PURE__*/React.createElement("span", {
93
- className: classnames(_defineProperty({}, "".concat(prefix, "-display-text"), true))
94
- }, isOpen ? hiddenText : openText), isOpen ? hiddenIcon : openIcon);
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__*/React.createElement("div", {
103
+ return /*#__PURE__*/_jsxs("div", {
100
104
  className: classnames((_classnames3 = {}, _defineProperty(_classnames3, className, !!className), _defineProperty(_classnames3, prefix, true), _classnames3)),
101
- style: style
102
- }, /*#__PURE__*/React.createElement("div", {
103
- className: "".concat(prefix, "-header")
104
- }, /*#__PURE__*/React.createElement(Space, null, !!alertRender ? alertRender === null || alertRender === void 0 ? void 0 : alertRender(selectedData) : /*#__PURE__*/React.createElement(Space, null, title && /*#__PURE__*/React.createElement("span", {
105
- className: "".concat(prefix, "-title")
106
- }, title), /*#__PURE__*/React.createElement("span", null, 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))), !!showCancelBtn && /*#__PURE__*/React.createElement("span", {
107
- className: classnames(_defineProperty({}, "".concat(prefix, "-cancel"), true)),
108
- onClick: function onClick() {
109
- return cleanSelectedRows();
110
- }
111
- }, cancelText), disPlayBtnRender()), !!alertOptionRender && /*#__PURE__*/React.createElement("div", null, alertOptionRender === null || alertOptionRender === void 0 ? void 0 : alertOptionRender({
112
- selectedRows: selectedData,
113
- setSelectedRows: setSelectedRows,
114
- cleanSelectedRows: cleanSelectedRows
115
- }))), /*#__PURE__*/React.createElement("div", {
116
- className: classnames((_classnames5 = {}, _defineProperty(_classnames5, "".concat(prefix, "-content"), true), _defineProperty(_classnames5, "".concat(prefix, "-content-active"), !!isOpen), _defineProperty(_classnames5, "".concat(prefix, "-content-hidden"), !isOpen), _classnames5))
117
- }, typeof content === 'function' ? content === null || content === void 0 ? void 0 : content({
118
- selectedRows: selectedData,
119
- setSelectedRows: setSelectedRows,
120
- cleanSelectedRows: cleanSelectedRows
121
- }) : content));
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__*/React.createElement("div", {
19
- className: "boundary-container boundary-code"
20
- }, /*#__PURE__*/React.createElement("div", {
21
- className: "empty"
22
- }, /*#__PURE__*/React.createElement("img", {
23
- src: imageUrl || info.imageUrl
24
- }), /*#__PURE__*/React.createElement("h4", null, title || info.title), children, /*#__PURE__*/React.createElement(Button, {
25
- type: "primary",
26
- onClick: onClick || info.onClick
27
- }, buttonText || info.buttonText)));
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__*/React.createElement("div", {
82
- className: "boundary-container"
83
- }, /*#__PURE__*/React.createElement("div", {
84
- className: "empty"
85
- }, /*#__PURE__*/React.createElement("img", {
86
- src: imageUrl || errorInfo.imageUrl
87
- }), /*#__PURE__*/React.createElement("h4", null, title || errorInfo.title), showError ? /*#__PURE__*/React.createElement(Alert, {
88
- type: "error",
89
- showIcon: true,
90
- message: errorMessage,
91
- description: errorDescription,
92
- style: {
93
- marginTop: 24,
94
- overflow: 'auto',
95
- maxHeight: '50vh',
96
- // 为了避免被 Empty 的水平居中样式影响,需要设置 textAlign
97
- textAlign: 'left'
98
- }
99
- }) : subscription && /*#__PURE__*/React.createElement("span", null, subscription), hasButton ? /*#__PURE__*/React.createElement(Button, {
100
- type: "primary",
101
- onClick: function onClick() {
102
- return _this2.onClick();
103
- }
104
- }, buttonText || errorInfo.buttonText) : ''));
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__*/React.createElement("div", {
107
- className: "boundary-container"
108
- }, /*#__PURE__*/React.createElement("div", {
109
- className: "empty"
110
- }, /*#__PURE__*/React.createElement("img", {
111
- src: imageUrl || notCompatibleInfo.imageUrl
112
- }), /*#__PURE__*/React.createElement("h4", null, title || notCompatibleInfo.title), /*#__PURE__*/React.createElement("span", null, subscription ? subscription : notCompatibleInfo.subscription)));
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__*/React.createElement("div", {
12
- className: "boundary-container"
13
- }, /*#__PURE__*/React.createElement("div", {
14
- className: "empty"
15
- }, /*#__PURE__*/React.createElement("img", {
16
- src: info.imageUrl
17
- }), /*#__PURE__*/React.createElement("h4", null, info.title), children, info.buttonText && /*#__PURE__*/React.createElement(Button, {
18
- type: "primary",
19
- onClick: onClick || info.onClick
20
- }, info.buttonText)));
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
  };