@oceanbase/ui 0.4.20 → 0.4.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 (127) hide show
  1. package/dist/ui.min.js +1 -1
  2. package/es/Action/Group.js +121 -15
  3. package/es/Action/style/index.js +8 -4
  4. package/es/BasicLayout/locale/ja-JP.d.ts +13 -0
  5. package/es/BasicLayout/locale/ja-JP.js +12 -0
  6. package/es/BatchOperationBar/locale/ja-JP.d.ts +7 -0
  7. package/es/BatchOperationBar/locale/ja-JP.js +6 -0
  8. package/es/Boundary/locale/ja-JP.d.ts +11 -0
  9. package/es/Boundary/locale/ja-JP.js +10 -0
  10. package/es/DateRanger/locale/ja-JP.d.ts +56 -0
  11. package/es/DateRanger/locale/ja-JP.js +20 -0
  12. package/es/Dialog/locale/ja-JP.d.ts +5 -0
  13. package/es/Dialog/locale/ja-JP.js +4 -0
  14. package/es/DocDialog/locale/ja-JP.d.ts +2 -0
  15. package/es/DocDialog/locale/ja-JP.js +1 -0
  16. package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
  17. package/es/FullscreenBox/locale/ja-JP.js +1 -0
  18. package/es/GraphToolbar/locale/ja-JP.d.ts +9 -0
  19. package/es/GraphToolbar/locale/ja-JP.js +8 -0
  20. package/es/Highlight/locale/ja-JP.d.ts +4 -0
  21. package/es/Highlight/locale/ja-JP.js +3 -0
  22. package/es/Login/locale/ja-JP.d.ts +28 -0
  23. package/es/Login/locale/ja-JP.js +27 -0
  24. package/es/PageContainer/locale/ja-JP.d.ts +4 -0
  25. package/es/PageContainer/locale/ja-JP.js +3 -0
  26. package/es/Password/locale/ja-JP.d.ts +13 -0
  27. package/es/Password/locale/ja-JP.js +12 -0
  28. package/es/Ranger/locale/ja-JP.d.ts +28 -0
  29. package/es/Ranger/locale/ja-JP.js +29 -0
  30. package/es/SideTip/locale/ja-JP.d.ts +2 -0
  31. package/es/SideTip/locale/ja-JP.js +1 -0
  32. package/es/TaskGraph/locale/ja-JP.d.ts +13 -0
  33. package/es/TaskGraph/locale/ja-JP.js +12 -0
  34. package/es/Welcome/locale/ja-JP.d.ts +5 -0
  35. package/es/Welcome/locale/ja-JP.js +4 -0
  36. package/es/locale/ja-JP.d.ts +3 -0
  37. package/es/locale/ja-JP.js +42 -0
  38. package/lib/Action/Group.js +122 -46
  39. package/lib/Action/Item.js +14 -9
  40. package/lib/Action/style/index.js +16 -1
  41. package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
  42. package/lib/BackgroundTaskManager/index.js +3 -12
  43. package/lib/BasicLayout/Header.js +120 -62
  44. package/lib/BasicLayout/index.js +166 -143
  45. package/lib/BasicLayout/locale/ja-JP.d.ts +13 -0
  46. package/lib/BasicLayout/locale/ja-JP.js +36 -0
  47. package/lib/BatchOperationBar/index.js +59 -44
  48. package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
  49. package/lib/BatchOperationBar/locale/ja-JP.js +30 -0
  50. package/lib/Boundary/Components/Code.js +11 -5
  51. package/lib/Boundary/Components/Exception.js +33 -23
  52. package/lib/Boundary/Components/Function.js +11 -5
  53. package/lib/Boundary/locale/ja-JP.d.ts +11 -0
  54. package/lib/Boundary/locale/ja-JP.js +34 -0
  55. package/lib/ContentWithIcon/index.js +30 -22
  56. package/lib/ContentWithQuestion/index.js +8 -3
  57. package/lib/DateRanger/PickerPanel.js +235 -217
  58. package/lib/DateRanger/Ranger.js +349 -313
  59. package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
  60. package/lib/DateRanger/locale/ja-JP.js +49 -0
  61. package/lib/Dialog/Anchor.js +8 -5
  62. package/lib/Dialog/EventProxy.js +3 -12
  63. package/lib/Dialog/index.js +132 -108
  64. package/lib/Dialog/locale/ja-JP.d.ts +5 -0
  65. package/lib/Dialog/locale/ja-JP.js +28 -0
  66. package/lib/DocDialog/index.js +3 -2
  67. package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
  68. package/lib/DocDialog/locale/ja-JP.js +25 -0
  69. package/lib/FooterToolbar/index.js +3 -2
  70. package/lib/FullscreenBox/index.js +16 -7
  71. package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
  72. package/lib/FullscreenBox/locale/ja-JP.js +25 -0
  73. package/lib/GraphToolbar/index.js +70 -58
  74. package/lib/GraphToolbar/locale/ja-JP.d.ts +9 -0
  75. package/lib/GraphToolbar/locale/ja-JP.js +32 -0
  76. package/lib/Highlight/DiffView/DiffCells.js +17 -10
  77. package/lib/Highlight/DiffView/index.js +35 -31
  78. package/lib/Highlight/HighlightCell.js +13 -10
  79. package/lib/Highlight/JsonView.js +15 -14
  80. package/lib/Highlight/index.js +50 -45
  81. package/lib/Highlight/locale/ja-JP.d.ts +4 -0
  82. package/lib/Highlight/locale/ja-JP.js +27 -0
  83. package/lib/IconFont/index.js +2 -12
  84. package/lib/LightFilter/index.js +3 -2
  85. package/lib/LocaleDropdown/index.js +13 -20
  86. package/lib/Login/ActivateForm.js +53 -60
  87. package/lib/Login/LoginForm.js +118 -109
  88. package/lib/Login/RegisterForm.js +79 -86
  89. package/lib/Login/index.js +92 -64
  90. package/lib/Login/locale/ja-JP.d.ts +28 -0
  91. package/lib/Login/locale/ja-JP.js +51 -0
  92. package/lib/NavMenu/index.js +9 -8
  93. package/lib/PageContainer/ItemRender.js +5 -5
  94. package/lib/PageContainer/index.js +8 -4
  95. package/lib/PageContainer/locale/ja-JP.d.ts +4 -0
  96. package/lib/PageContainer/locale/ja-JP.js +27 -0
  97. package/lib/PageLoading/index.js +6 -16
  98. package/lib/Password/Content.js +38 -42
  99. package/lib/Password/index.js +83 -68
  100. package/lib/Password/locale/ja-JP.d.ts +13 -0
  101. package/lib/Password/locale/ja-JP.js +36 -0
  102. package/lib/ProCard/index.js +4 -3
  103. package/lib/ProTable/index.js +5 -4
  104. package/lib/Ranger/QuickPicker.js +24 -15
  105. package/lib/Ranger/Ranger.js +37 -34
  106. package/lib/Ranger/locale/ja-JP.d.ts +28 -0
  107. package/lib/Ranger/locale/ja-JP.js +53 -0
  108. package/lib/SideTip/Dragger.js +5 -4
  109. package/lib/SideTip/IconLoading.js +25 -25
  110. package/lib/SideTip/index.js +19 -10
  111. package/lib/SideTip/locale/ja-JP.d.ts +2 -0
  112. package/lib/SideTip/locale/ja-JP.js +25 -0
  113. package/lib/TagSelect/Group.js +9 -5
  114. package/lib/TagSelect/Item.js +22 -18
  115. package/lib/TaskGraph/Graph.js +29 -24
  116. package/lib/TaskGraph/index.js +56 -50
  117. package/lib/TaskGraph/locale/ja-JP.d.ts +13 -0
  118. package/lib/TaskGraph/locale/ja-JP.js +36 -0
  119. package/lib/TreeSearch/index.js +30 -35
  120. package/lib/Welcome/index.js +64 -37
  121. package/lib/Welcome/locale/ja-JP.d.ts +5 -0
  122. package/lib/Welcome/locale/ja-JP.js +28 -0
  123. package/lib/Welcome/step.js +11 -4
  124. package/lib/locale/LocaleWrapper.js +15 -14
  125. package/lib/locale/ja-JP.d.ts +3 -0
  126. package/lib/locale/ja-JP.js +71 -0
  127. package/package.json +5 -5
@@ -37,6 +37,7 @@ var import_design = require("@oceanbase/design");
37
37
  var import_icons = require("@oceanbase/icons");
38
38
  var import_lodash = require("lodash");
39
39
  var import_style = __toESM(require("./style"));
40
+ var import_jsx_runtime = require("react/jsx-runtime");
40
41
  var getOrder = ({ type, fixed }) => {
41
42
  const ORDER_SET = { primary: 3, fixed: 2, default: 0 };
42
43
  let order = ORDER_SET.default;
@@ -48,6 +49,64 @@ var getOrder = ({ type, fixed }) => {
48
49
  }
49
50
  return order;
50
51
  };
52
+ var findActionComponent = (element, depth = 0) => {
53
+ var _a, _b, _c;
54
+ if (!import_react.default.isValidElement(element)) {
55
+ return null;
56
+ }
57
+ if (((_a = element.type) == null ? void 0 : _a.__DISPLAY_NAME) === "button" || ((_b = element.type) == null ? void 0 : _b.__DISPLAY_NAME) === "link") {
58
+ return { action: element, wrapper: null };
59
+ }
60
+ if (depth > 10) {
61
+ return null;
62
+ }
63
+ const elementChildren = (_c = element.props) == null ? void 0 : _c.children;
64
+ if (elementChildren) {
65
+ const child = import_react.default.Children.only(elementChildren);
66
+ if (import_react.default.isValidElement(child)) {
67
+ const result = findActionComponent(child, depth + 1);
68
+ if (result) {
69
+ return { action: result.action, wrapper: element };
70
+ }
71
+ }
72
+ }
73
+ return null;
74
+ };
75
+ var renderMenuItemContent = (action, actionProps, enableLoading) => {
76
+ const { loading, children, tooltip } = actionProps;
77
+ const result = findActionComponent(action);
78
+ if (!result) {
79
+ const content2 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
80
+ loading && enableLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}),
81
+ " ",
82
+ children || action
83
+ ] });
84
+ return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: tooltip, children: content2 }) : content2;
85
+ }
86
+ const { action: actualAction, wrapper } = result;
87
+ const newAction = import_react.default.cloneElement(actualAction, {
88
+ ...actualAction.props,
89
+ ...actionProps,
90
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
91
+ loading && enableLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}),
92
+ " ",
93
+ children || actualAction.props.children
94
+ ] })
95
+ });
96
+ if (wrapper) {
97
+ const wrapperProps = wrapper.props;
98
+ return import_react.default.cloneElement(wrapper, {
99
+ ...wrapperProps,
100
+ children: newAction
101
+ });
102
+ }
103
+ const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
104
+ loading && enableLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}),
105
+ " ",
106
+ children || actualAction.props.children
107
+ ] });
108
+ return tooltip ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: tooltip, children: content }) : content;
109
+ };
51
110
  var Group_default = ({
52
111
  prefixCls: customizePrefixCls,
53
112
  size = 3,
@@ -95,58 +154,75 @@ var Group_default = ({
95
154
  const getDefaultDisabled = (key) => (shouldDisabled == null ? void 0 : shouldDisabled(key)) ?? false;
96
155
  let moreDom;
97
156
  if (ellipsisType === "button") {
98
- moreDom = /* @__PURE__ */ import_react.default.createElement(
157
+ moreDom = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
158
  import_design.Button,
100
159
  {
101
160
  size: buttonSize,
102
- icon: moreText ? void 0 : /* @__PURE__ */ import_react.default.createElement(import_icons.EllipsisOutlined, { style: { cursor: "pointer" } })
103
- },
104
- moreText
161
+ icon: moreText ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EllipsisOutlined, { style: { cursor: "pointer" } }),
162
+ children: moreText
163
+ }
105
164
  );
106
165
  } else {
107
- moreDom = /* @__PURE__ */ import_react.default.createElement(import_design.Typography.Link, null, moreText ?? /* @__PURE__ */ import_react.default.createElement(import_icons.EllipsisOutlined, { style: { cursor: "pointer" } }));
166
+ moreDom = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Typography.Link, { children: moreText ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EllipsisOutlined, { style: { cursor: "pointer" } }) });
108
167
  }
109
168
  return wrapSSR(
110
- /* @__PURE__ */ import_react.default.createElement(import_design.Space, { size: ellipsisType === "button" ? 8 : 16 }, mainActions.map((action) => {
111
- return import_react.default.cloneElement(action, {
112
- // size should be covered by action props
113
- size: buttonSize,
114
- ...action.props,
115
- key: action.key,
116
- enableLoading,
117
- disabled: (0, import_lodash.isBoolean)(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key)
118
- });
119
- }), ellipsisActions.length > 0 && /* @__PURE__ */ import_react.default.createElement(
120
- import_design.Dropdown,
121
- {
122
- placement: dropDownPlacement,
123
- overlay: /* @__PURE__ */ import_react.default.createElement(import_design.Menu, { className: `${prefixCls}-more-menu` }, ellipsisActions.map((action, index) => {
124
- const actionKey = action.key;
125
- let disabled = false;
126
- if ((0, import_lodash.isBoolean)(action.props.disabled))
127
- disabled = action.props.disabled;
128
- else if (shouldDisabled)
129
- disabled = shouldDisabled(action.key);
130
- const actionDisabled = action.props.loading || ((0, import_lodash.isBoolean)(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key));
131
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
132
- import_design.Menu.Item,
133
- {
134
- key: actionKey ?? index.toString(),
135
- onClick: ({ domEvent }) => {
136
- var _a, _b;
137
- (_b = (_a = action.props).onClick) == null ? void 0 : _b.call(
138
- _a,
139
- domEvent
140
- );
141
- },
142
- ...(0, import_lodash.omit)(action.props, ["disabled"]),
143
- disabled: actionDisabled
144
- },
145
- /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { title: action.props.tooltip }, action.props.loading && /* @__PURE__ */ import_react.default.createElement(import_icons.LoadingOutlined, null), " ", action.props.children || action)
146
- ), action.props.divider && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Divider, null));
147
- }))
148
- },
149
- moreDom
150
- ))
169
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: ellipsisType === "button" ? 8 : 16, children: [
170
+ mainActions.map((action) => {
171
+ return import_react.default.cloneElement(action, {
172
+ // size should be covered by action props
173
+ size: buttonSize,
174
+ ...action.props,
175
+ key: action.key,
176
+ enableLoading,
177
+ disabled: (0, import_lodash.isBoolean)(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key)
178
+ });
179
+ }),
180
+ ellipsisActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
181
+ import_design.Dropdown,
182
+ {
183
+ placement: dropDownPlacement,
184
+ overlay: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu, { className: `${prefixCls}-more-menu`, children: ellipsisActions.map((action, index) => {
185
+ const actionKey = action.key;
186
+ const actionResult = findActionComponent(action);
187
+ const actualAction = (actionResult == null ? void 0 : actionResult.action) || action;
188
+ const actionProps = actualAction.props;
189
+ const actionDisabled = actionProps.loading || ((0, import_lodash.isBoolean)(actionProps.disabled) ? actionProps.disabled : getDefaultDisabled(action.key));
190
+ const menuItemProps = (0, import_lodash.omit)(actionProps, [
191
+ "disabled",
192
+ "loading",
193
+ "tooltip",
194
+ "visible",
195
+ "fixed",
196
+ "enableLoading",
197
+ "onClick",
198
+ "children",
199
+ "danger"
200
+ ]);
201
+ const handleMenuItemClick = (info) => {
202
+ var _a;
203
+ if (actionResult == null ? void 0 : actionResult.wrapper) {
204
+ return;
205
+ }
206
+ (_a = actionProps.onClick) == null ? void 0 : _a.call(actionProps, info.domEvent);
207
+ };
208
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
209
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
210
+ import_design.Menu.Item,
211
+ {
212
+ onClick: handleMenuItemClick,
213
+ disabled: actionDisabled,
214
+ danger: !!actionProps.danger,
215
+ ...menuItemProps,
216
+ children: renderMenuItemContent(action, actionProps, enableLoading)
217
+ },
218
+ actionKey ?? index.toString()
219
+ ),
220
+ actionProps.divider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Divider, {})
221
+ ] });
222
+ }) }),
223
+ children: moreDom
224
+ }
225
+ )
226
+ ] })
151
227
  );
152
228
  };
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(Item_exports);
36
36
  var import_icons = require("@oceanbase/icons");
37
37
  var import_design = require("@oceanbase/design");
38
38
  var import_react = __toESM(require("react"));
39
+ var import_jsx_runtime = require("react/jsx-runtime");
39
40
  var ActionButton = class extends import_react.default.PureComponent {
40
41
  constructor() {
41
42
  super(...arguments);
@@ -45,7 +46,7 @@ var ActionButton = class extends import_react.default.PureComponent {
45
46
  }
46
47
  render() {
47
48
  const { children, onClick, enableLoading = true, tooltip, loading, ...restProps } = this.props;
48
- return /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { placement: "top", title: tooltip }, /* @__PURE__ */ import_react.default.createElement(
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { placement: "top", title: tooltip, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
50
  import_design.Button,
50
51
  {
51
52
  loading: enableLoading && (loading || this.state.loading),
@@ -58,10 +59,10 @@ var ActionButton = class extends import_react.default.PureComponent {
58
59
  });
59
60
  }
60
61
  },
61
- ...restProps
62
- },
63
- children
64
- ));
62
+ ...restProps,
63
+ children
64
+ }
65
+ ) });
65
66
  }
66
67
  };
67
68
  ActionButton.__DISPLAY_NAME = "button";
@@ -85,7 +86,7 @@ var ActionLink = class extends import_react.default.PureComponent {
85
86
  style,
86
87
  ...restProps
87
88
  } = this.props;
88
- return /* @__PURE__ */ import_react.default.createElement(
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
90
  import_design.Typography.Link,
90
91
  {
91
92
  style: { padding: 0, ...style },
@@ -99,9 +100,13 @@ var ActionLink = class extends import_react.default.PureComponent {
99
100
  });
100
101
  }
101
102
  },
102
- ...restProps
103
- },
104
- /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { placement: "top", title: tooltip }, loading || this.state.disabled ? /* @__PURE__ */ import_react.default.createElement(import_icons.LoadingOutlined, null) : "", " ", children)
103
+ ...restProps,
104
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Tooltip, { placement: "top", title: tooltip, children: [
105
+ loading || this.state.disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LoadingOutlined, {}) : "",
106
+ " ",
107
+ children
108
+ ] })
109
+ }
105
110
  );
106
111
  }
107
112
  };
@@ -32,7 +32,6 @@ var genActionStyle = (token) => {
32
32
  const margin = `-${paddingVertical}px -${paddingHorizontal}px`;
33
33
  return {
34
34
  [`${componentCls}-more-menu`]: {
35
- background: "red",
36
35
  [`${antCls}-dropdown-menu-item`]: {
37
36
  [`${antCls}-typography`]: {
38
37
  display: "block",
@@ -61,6 +60,22 @@ var genActionStyle = (token) => {
61
60
  [`${antCls}-wave`]: {
62
61
  display: "none"
63
62
  }
63
+ },
64
+ // 确保 danger 状态的样式能够正确显示,不覆盖 Menu.Item 的默认 danger 颜色
65
+ [`&${antCls}-dropdown-menu-item-danger`]: {
66
+ [`${antCls}-typography`]: {
67
+ [`&:not(${antCls}-typography-disabled)`]: {
68
+ color: "unset"
69
+ }
70
+ },
71
+ [`${antCls}-btn`]: {
72
+ [`&:not(:disabled):not(${antCls}-btn-disabled)`]: {
73
+ color: "unset",
74
+ [`&:hover`]: {
75
+ color: "unset"
76
+ }
77
+ }
78
+ }
64
79
  }
65
80
  }
66
81
  }
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/BackgroundTaskManager/RefreshMan.tsx
@@ -34,8 +24,9 @@ __export(RefreshMan_exports, {
34
24
  module.exports = __toCommonJS(RefreshMan_exports);
35
25
  var import_ahooks = require("ahooks");
36
26
  var import_design = require("@oceanbase/design");
37
- var import_react = __toESM(require("react"));
27
+ var import_react = require("react");
38
28
  var import_constants = require("./constants");
29
+ var import_jsx_runtime = require("react/jsx-runtime");
39
30
  var RefreshMan = (0, import_react.forwardRef)((props, ref) => {
40
31
  const {
41
32
  run,
@@ -78,7 +69,7 @@ var RefreshMan = (0, import_react.forwardRef)((props, ref) => {
78
69
  stopLoop();
79
70
  };
80
71
  }, [startLoop, stopLoop, timeout]);
81
- return /* @__PURE__ */ import_react.default.createElement(import_design.Spin, { spinning: spinning && refreshManLoading }, /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children));
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Spin, { spinning: spinning && refreshManLoading, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }) });
82
73
  });
83
74
  // Annotate the CommonJS export names for ESM import in node:
84
75
  0 && (module.exports = {
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // src/BackgroundTaskManager/index.tsx
@@ -34,10 +24,11 @@ __export(BackgroundTaskManager_exports, {
34
24
  default: () => BackgroundTaskManager_default
35
25
  });
36
26
  module.exports = __toCommonJS(BackgroundTaskManager_exports);
37
- var import_react = __toESM(require("react"));
27
+ var import_react = require("react");
38
28
  var import_design = require("@oceanbase/design");
39
29
  var import_constants = require("./constants");
40
30
  var import_RefreshMan = require("./RefreshMan");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
41
32
  var NotificationApi = /* @__PURE__ */ ((NotificationApi2) => {
42
33
  NotificationApi2["success"] = "success";
43
34
  NotificationApi2["error"] = "error";
@@ -166,7 +157,7 @@ var BackgroundTaskManager_default = (0, import_react.forwardRef)((props, ref) =>
166
157
  window.removeEventListener("beforeunload", onUnload);
167
158
  };
168
159
  }, [queue, preset]);
169
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!taskQueue.length && /* @__PURE__ */ import_react.default.createElement(import_RefreshMan.RefreshMan, { run, rollingFrequency }));
160
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: !!taskQueue.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_RefreshMan.RefreshMan, { run, rollingFrequency }) });
170
161
  });
171
162
  // Annotate the CommonJS export names for ESM import in node:
172
163
  0 && (module.exports = {
@@ -36,7 +36,7 @@ var import_icons = require("@oceanbase/icons");
36
36
  var import_design = require("@oceanbase/design");
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_moment = __toESM(require("moment"));
39
- var import_react = __toESM(require("react"));
39
+ var import_react = require("react");
40
40
  var import_constant = require("../constant");
41
41
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
42
42
  var import_util = require("../_util");
@@ -46,6 +46,7 @@ var import_oceanbase_logo = __toESM(require("../assets/logo/oceanbase_logo.svg")
46
46
  var import_oceanbase_logo_dark = __toESM(require("../assets/logo/oceanbase_logo_dark.svg"));
47
47
  var import_LocaleDropdown = __toESM(require("../LocaleDropdown"));
48
48
  var import_Header = __toESM(require("./style/Header"));
49
+ var import_jsx_runtime = require("react/jsx-runtime");
49
50
  var Header = ({
50
51
  prefixCls: customizePrefixCls,
51
52
  showLabel = true,
@@ -76,7 +77,7 @@ var Header = ({
76
77
  const navigate = (0, import_useNavigate.default)();
77
78
  const [visible, setVisible] = (0, import_react.useState)(false);
78
79
  const isWelcome = pathname === welcomePath;
79
- const helpMenu = /* @__PURE__ */ import_react.default.createElement(
80
+ const helpMenu = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
80
81
  import_design.Menu,
81
82
  {
82
83
  onClick: ({ key }) => {
@@ -96,73 +97,130 @@ var Header = ({
96
97
  } else if (key === "about") {
97
98
  setVisible(true);
98
99
  }
99
- }
100
- },
101
- welcomePath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "welcome" }, locale.welcome),
102
- versionNoticePath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "versionNotice" }, locale.versionNotice),
103
- docsPath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "viewDocs" }, locale.viewDocs),
104
- pdfPath && /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "downloadDocs" }, locale.downloadDocs),
105
- /* @__PURE__ */ import_react.default.createElement(import_design.Menu.Item, { key: "about" }, `${locale.about}${appData.shortName ? ` ${appData.shortName}` : ""}`)
100
+ },
101
+ children: [
102
+ welcomePath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: locale.welcome }, "welcome"),
103
+ versionNoticePath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: locale.versionNotice }, "versionNotice"),
104
+ docsPath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: locale.viewDocs }, "viewDocs"),
105
+ pdfPath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: locale.downloadDocs }, "downloadDocs"),
106
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: `${locale.about}${appData.shortName ? ` ${appData.shortName}` : ""}` }, "about")
107
+ ]
108
+ }
106
109
  );
107
110
  return wrapSSR(
108
- /* @__PURE__ */ import_react.default.createElement(
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
109
112
  "div",
110
113
  {
111
114
  ...restProps,
112
115
  className: (0, import_classnames.default)(prefixCls, {
113
116
  [`${prefixCls}-welcome`]: isWelcome
114
- })
115
- },
116
- /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-content` }, /* @__PURE__ */ import_react.default.createElement(
117
- "img",
118
- {
119
- src: simpleLogoUrl,
120
- alt: "",
121
- onClick: () => {
122
- navigate == null ? void 0 : navigate("/");
123
- },
124
- className: `${prefixCls}-logo`
125
- }
126
- ), title && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-title` }, title), showLabel ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-extra ${prefixCls}-extra-with-label` }, extra, showHelp && /* @__PURE__ */ import_react.default.createElement(import_design.Dropdown, { overlay: helpMenu }, /* @__PURE__ */ import_react.default.createElement(import_design.Space, { className: `${prefixCls}-extra-item` }, /* @__PURE__ */ import_react.default.createElement(import_icons.BulbOutlined, null), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "help" }, locale.help))), showLocale && /* @__PURE__ */ import_react.default.createElement(import_LocaleDropdown.default, { locales: locales || langs, className: `${prefixCls}-extra-item` }), userMenu ? /* @__PURE__ */ import_react.default.createElement(import_design.Dropdown, { overlay: userMenu }, /* @__PURE__ */ import_react.default.createElement(import_design.Button, { shape: "round", size: "small" }, /* @__PURE__ */ import_react.default.createElement(import_design.Space, { className: `${prefixCls}-extra-item` }, /* @__PURE__ */ import_react.default.createElement(import_icons.UserOutlined, null), /* @__PURE__ */ import_react.default.createElement("span", null, username)))) : (
127
- // userMenu username 都不存在时,不展示该项
128
- /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, username ? /* @__PURE__ */ import_react.default.createElement(import_design.Button, { shape: "round", size: "small" }, /* @__PURE__ */ import_react.default.createElement(import_design.Space, { className: `${prefixCls}-extra-item` }, /* @__PURE__ */ import_react.default.createElement(import_icons.UserOutlined, null), /* @__PURE__ */ import_react.default.createElement("span", null, username))) : null)
129
- )) : /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-extra` }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-item` }, /* @__PURE__ */ import_react.default.createElement(import_design.Dropdown, { overlay: helpMenu }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-icon-wrapper` }, /* @__PURE__ */ import_react.default.createElement(import_icons.BulbFilled, null)))), docsPath && /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { title: locale.viewDocs }, /* @__PURE__ */ import_react.default.createElement(
130
- "span",
131
- {
132
- className: `${prefixCls}-extra-item`,
133
- onClick: () => {
134
- (0, import_util.directTo)(docsPath);
135
- }
136
- },
137
- /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-icon-wrapper` }, /* @__PURE__ */ import_react.default.createElement(import_icons.ReadFilled, null))
138
- )), showLocale && /* @__PURE__ */ import_react.default.createElement(
139
- import_LocaleDropdown.default,
140
- {
141
- showLabel: true,
142
- locales: locales || langs,
143
- className: `${prefixCls}-extra-item`
144
- }
145
- ), userMenu ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-item` }, /* @__PURE__ */ import_react.default.createElement(import_design.Dropdown, { overlay: userMenu }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-user-wrapper` }, /* @__PURE__ */ import_react.default.createElement(import_icons.UserFilled, { className: `${prefixCls}-extra-user-icon` }), /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-username` }, username)))) : /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-item` }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-extra-user-wrapper` }, /* @__PURE__ */ import_react.default.createElement(import_icons.UserFilled, { className: `${prefixCls}-extra-user-icon` }), /* @__PURE__ */ import_react.default.createElement("span", null, username))))),
146
- /* @__PURE__ */ import_react.default.createElement(
147
- import_design.Modal,
148
- {
149
- visible,
150
- open: visible,
151
- destroyOnClose: true,
152
- footer: false,
153
- onCancel: () => {
154
- setVisible(false);
155
- }
156
- },
157
- /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-about-wrapper` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-about` }, /* @__PURE__ */ import_react.default.createElement("img", { src: logoUrl, alt: "", className: `${prefixCls}-logo` }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-release-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-version` }, locale.version, ": ", appData.version), appData.releaseTime && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-date` }, `${locale.releaseTime}: ${appData.releaseTime}`)), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("a", { href: import_constant.OB_SITE_LINK, target: "_blank", rel: "noopener noreferrer" }, import_constant.OB_SITE_LINK)), /* @__PURE__ */ import_react.default.createElement(
158
- "div",
159
- {
160
- style: { display: "flex", justifyContent: "space-between", alignItems: "center" }
161
- },
162
- /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-copyright` }, locale.right, " ", /* @__PURE__ */ import_react.default.createElement(import_icons.CopyrightOutlined, null), " ", (0, import_moment.default)().year(), " ", locale.company),
163
- /* @__PURE__ */ import_react.default.createElement("img", { src: (theme == null ? void 0 : theme.isDark) ? import_oceanbase_logo_dark.default : import_oceanbase_logo.default, alt: "", style: { height: 12 } })
164
- ))))
165
- )
117
+ }),
118
+ children: [
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-content`, children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
121
+ "img",
122
+ {
123
+ src: simpleLogoUrl,
124
+ alt: "",
125
+ onClick: () => {
126
+ navigate == null ? void 0 : navigate("/");
127
+ },
128
+ className: `${prefixCls}-logo`
129
+ }
130
+ ),
131
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-title`, children: title }),
132
+ showLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-extra ${prefixCls}-extra-with-label`, children: [
133
+ extra,
134
+ showHelp && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Dropdown, { overlay: helpMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefixCls}-extra-item`, children: [
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.BulbOutlined, {}),
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-testid": "help", children: locale.help })
137
+ ] }) }),
138
+ showLocale && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LocaleDropdown.default, { locales: locales || langs, className: `${prefixCls}-extra-item` }),
139
+ userMenu ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Dropdown, { overlay: userMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { shape: "round", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefixCls}-extra-item`, children: [
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserOutlined, {}),
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: username })
142
+ ] }) }) }) : (
143
+ // userMenu username 都不存在时,不展示该项
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: username ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { shape: "round", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { className: `${prefixCls}-extra-item`, children: [
145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserOutlined, {}),
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: username })
147
+ ] }) }) : null })
148
+ )
149
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-extra`, children: [
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-extra-item`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Dropdown, { overlay: helpMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-extra-icon-wrapper`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.BulbFilled, {}) }) }) }),
151
+ docsPath && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.viewDocs, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
152
+ "span",
153
+ {
154
+ className: `${prefixCls}-extra-item`,
155
+ onClick: () => {
156
+ (0, import_util.directTo)(docsPath);
157
+ },
158
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-extra-icon-wrapper`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ReadFilled, {}) })
159
+ }
160
+ ) }),
161
+ showLocale && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
162
+ import_LocaleDropdown.default,
163
+ {
164
+ showLabel: true,
165
+ locales: locales || langs,
166
+ className: `${prefixCls}-extra-item`
167
+ }
168
+ ),
169
+ userMenu ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-extra-item`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Dropdown, { overlay: userMenu, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `${prefixCls}-extra-user-wrapper`, children: [
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserFilled, { className: `${prefixCls}-extra-user-icon` }),
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-extra-username`, children: username })
172
+ ] }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-extra-item`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `${prefixCls}-extra-user-wrapper`, children: [
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UserFilled, { className: `${prefixCls}-extra-user-icon` }),
174
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: username })
175
+ ] }) })
176
+ ] })
177
+ ] }),
178
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
+ import_design.Modal,
180
+ {
181
+ visible,
182
+ open: visible,
183
+ destroyOnClose: true,
184
+ footer: false,
185
+ onCancel: () => {
186
+ setVisible(false);
187
+ },
188
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-about-wrapper`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-about`, children: [
189
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logoUrl, alt: "", className: `${prefixCls}-logo` }),
190
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-release-info`, children: [
191
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-version`, children: [
192
+ locale.version,
193
+ ": ",
194
+ appData.version
195
+ ] }),
196
+ appData.releaseTime && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-date`, children: `${locale.releaseTime}: ${appData.releaseTime}` })
197
+ ] }),
198
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href: import_constant.OB_SITE_LINK, target: "_blank", rel: "noopener noreferrer", children: import_constant.OB_SITE_LINK }) }),
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
201
+ "div",
202
+ {
203
+ style: { display: "flex", justifyContent: "space-between", alignItems: "center" },
204
+ children: [
205
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `${prefixCls}-copyright`, children: [
206
+ locale.right,
207
+ " ",
208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CopyrightOutlined, {}),
209
+ " ",
210
+ (0, import_moment.default)().year(),
211
+ " ",
212
+ locale.company
213
+ ] }),
214
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: (theme == null ? void 0 : theme.isDark) ? import_oceanbase_logo_dark.default : import_oceanbase_logo.default, alt: "", style: { height: 12 } })
215
+ ]
216
+ }
217
+ )
218
+ ] })
219
+ ] }) })
220
+ }
221
+ )
222
+ ]
223
+ }
166
224
  )
167
225
  );
168
226
  };