@oceanbase/ui 1.0.0-alpha.2 → 1.0.0-alpha.3

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 (73) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/style/index.d.ts +2 -2
  4. package/es/FooterToolbar/style/index.d.ts +0 -2
  5. package/es/FooterToolbar/style/index.js +0 -12
  6. package/es/Highlight/index.d.ts +1 -1
  7. package/es/ProCard/style/index.d.ts +2 -2
  8. package/es/ProCard/style/index.js +3 -2
  9. package/es/ProTable/style/index.d.ts +2 -2
  10. package/es/ProTable/style/index.js +6 -5
  11. package/lib/Action/Group.js +57 -46
  12. package/lib/Action/Item.js +14 -9
  13. package/lib/Action/style/index.d.ts +2 -2
  14. package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
  15. package/lib/BackgroundTaskManager/index.js +3 -12
  16. package/lib/BasicLayout/Header.js +120 -62
  17. package/lib/BasicLayout/index.js +166 -143
  18. package/lib/BatchOperationBar/index.js +59 -44
  19. package/lib/Boundary/Components/Code.js +11 -5
  20. package/lib/Boundary/Components/Exception.js +33 -23
  21. package/lib/Boundary/Components/Function.js +11 -5
  22. package/lib/ContentWithIcon/index.js +30 -22
  23. package/lib/ContentWithQuestion/index.js +8 -3
  24. package/lib/DateRanger/PickerPanel.js +235 -217
  25. package/lib/DateRanger/Ranger.js +349 -313
  26. package/lib/Dialog/Anchor.js +8 -5
  27. package/lib/Dialog/EventProxy.js +3 -12
  28. package/lib/Dialog/index.js +132 -108
  29. package/lib/DocDialog/index.js +3 -2
  30. package/lib/FooterToolbar/index.js +3 -2
  31. package/lib/FooterToolbar/style/index.d.ts +0 -2
  32. package/lib/FooterToolbar/style/index.js +0 -17
  33. package/lib/FullscreenBox/index.js +16 -7
  34. package/lib/GraphToolbar/index.js +70 -58
  35. package/lib/Highlight/DiffView/DiffCells.js +17 -10
  36. package/lib/Highlight/DiffView/index.js +35 -31
  37. package/lib/Highlight/HighlightCell.js +13 -10
  38. package/lib/Highlight/JsonView.js +15 -14
  39. package/lib/Highlight/index.d.ts +1 -1
  40. package/lib/Highlight/index.js +50 -45
  41. package/lib/IconFont/index.js +2 -12
  42. package/lib/LightFilter/index.js +3 -2
  43. package/lib/LocaleDropdown/index.js +13 -20
  44. package/lib/Login/ActivateForm.js +53 -60
  45. package/lib/Login/LoginForm.js +118 -109
  46. package/lib/Login/RegisterForm.js +79 -86
  47. package/lib/Login/index.js +92 -64
  48. package/lib/NavMenu/index.js +9 -8
  49. package/lib/PageContainer/ItemRender.js +5 -5
  50. package/lib/PageContainer/index.js +9 -5
  51. package/lib/PageLoading/index.js +6 -16
  52. package/lib/Password/Content.js +38 -42
  53. package/lib/Password/index.js +83 -68
  54. package/lib/ProCard/index.js +5 -4
  55. package/lib/ProCard/style/index.d.ts +2 -2
  56. package/lib/ProCard/style/index.js +3 -2
  57. package/lib/ProTable/index.js +5 -4
  58. package/lib/ProTable/style/index.d.ts +2 -2
  59. package/lib/ProTable/style/index.js +6 -7
  60. package/lib/Ranger/QuickPicker.js +24 -15
  61. package/lib/Ranger/Ranger.js +37 -34
  62. package/lib/SideTip/Dragger.js +5 -4
  63. package/lib/SideTip/IconLoading.js +25 -25
  64. package/lib/SideTip/index.js +19 -10
  65. package/lib/TagSelect/Group.js +9 -5
  66. package/lib/TagSelect/Item.js +22 -18
  67. package/lib/TaskGraph/Graph.js +29 -24
  68. package/lib/TaskGraph/index.js +56 -50
  69. package/lib/TreeSearch/index.js +30 -35
  70. package/lib/Welcome/index.js +64 -37
  71. package/lib/Welcome/step.js +11 -4
  72. package/lib/locale/LocaleWrapper.js +15 -14
  73. package/package.json +3 -3
@@ -36,10 +36,11 @@ 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_lodash = require("lodash");
39
- var import_react = __toESM(require("react"));
39
+ var import_react = require("react");
40
40
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
41
41
  var import_index = require("./index.less");
42
42
  var import_zh_CN = __toESM(require("./locale/zh-CN"));
43
+ var import_jsx_runtime = require("react/jsx-runtime");
43
44
  var prefix = "ob-batch-operation-bar";
44
45
  var BatchOperationBar = (props) => {
45
46
  var _a, _b;
@@ -55,9 +56,9 @@ var BatchOperationBar = (props) => {
55
56
  className = "",
56
57
  cancelText = locale == null ? void 0 : locale.cancelText,
57
58
  openText = locale == null ? void 0 : locale.openText,
58
- openIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.DownOutlined, null),
59
+ openIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {}),
59
60
  hiddenText = locale == null ? void 0 : locale.hiddenText,
60
- hiddenIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.UpOutlined, null),
61
+ hiddenIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.UpOutlined, {}),
61
62
  showCancelBtn = true,
62
63
  showOpenBtn = true,
63
64
  position = ["bottom", "right"],
@@ -95,7 +96,7 @@ var BatchOperationBar = (props) => {
95
96
  const disPlayBtnRender = () => {
96
97
  if (!showOpenBtn)
97
98
  return null;
98
- return /* @__PURE__ */ import_react.default.createElement(
99
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
99
100
  "div",
100
101
  {
101
102
  className: (0, import_classnames.default)({
@@ -103,18 +104,20 @@ var BatchOperationBar = (props) => {
103
104
  [`${prefix}-close-btn`]: !isOpen,
104
105
  [`${prefix}-display-btn`]: true
105
106
  }),
106
- onClick: () => setIsOpen(!isOpen)
107
- },
108
- /* @__PURE__ */ import_react.default.createElement(
109
- "span",
110
- {
111
- className: (0, import_classnames.default)({
112
- [`${prefix}-display-text`]: true
113
- })
114
- },
115
- isOpen ? hiddenText : openText
116
- ),
117
- isOpen ? hiddenIcon : openIcon
107
+ onClick: () => setIsOpen(!isOpen),
108
+ children: [
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
110
+ "span",
111
+ {
112
+ className: (0, import_classnames.default)({
113
+ [`${prefix}-display-text`]: true
114
+ }),
115
+ children: isOpen ? hiddenText : openText
116
+ }
117
+ ),
118
+ isOpen ? hiddenIcon : openIcon
119
+ ]
120
+ }
118
121
  );
119
122
  };
120
123
  (0, import_react.useEffect)(() => {
@@ -123,40 +126,52 @@ var BatchOperationBar = (props) => {
123
126
  else
124
127
  setSelectedData(selectedRows);
125
128
  }, [selectedRows]);
126
- return /* @__PURE__ */ import_react.default.createElement(
129
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
127
130
  "div",
128
131
  {
129
132
  className: (0, import_classnames.default)({
130
133
  [className]: !!className,
131
134
  [prefix]: true
132
135
  }),
133
- style
134
- },
135
- /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-header` }, /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, !!alertRender ? alertRender == null ? void 0 : alertRender(selectedData) : /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, title && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}-title` }, title), /* @__PURE__ */ import_react.default.createElement("span", null, (_b = (_a = locale == null ? void 0 : locale.alertText) == null ? void 0 : _a.replace) == null ? void 0 : _b.call(_a, /\$\{\}/, (selectedData == null ? void 0 : selectedData.length) || 0))), !!showCancelBtn && /* @__PURE__ */ import_react.default.createElement(
136
- "span",
137
- {
138
- className: (0, import_classnames.default)({
139
- [`${prefix}-cancel`]: true
140
- }),
141
- onClick: () => cleanSelectedRows()
142
- },
143
- cancelText
144
- ), disPlayBtnRender()), !!alertOptionRender && /* @__PURE__ */ import_react.default.createElement("div", null, alertOptionRender == null ? void 0 : alertOptionRender({
145
- selectedRows: selectedData,
146
- setSelectedRows,
147
- cleanSelectedRows
148
- }))),
149
- /* @__PURE__ */ import_react.default.createElement(
150
- "div",
151
- {
152
- className: (0, import_classnames.default)({
153
- [`${prefix}-content`]: true,
154
- [`${prefix}-content-active`]: !!isOpen,
155
- [`${prefix}-content-hidden`]: !isOpen
156
- })
157
- },
158
- typeof content === "function" ? content == null ? void 0 : content({ selectedRows: selectedData, setSelectedRows, cleanSelectedRows }) : content
159
- )
136
+ style,
137
+ children: [
138
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-header`, children: [
139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { children: [
140
+ !!alertRender ? alertRender == null ? void 0 : alertRender(selectedData) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { children: [
141
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefix}-title`, children: title }),
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (_b = (_a = locale == null ? void 0 : locale.alertText) == null ? void 0 : _a.replace) == null ? void 0 : _b.call(_a, /\$\{\}/, (selectedData == null ? void 0 : selectedData.length) || 0) })
143
+ ] }),
144
+ !!showCancelBtn && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
145
+ "span",
146
+ {
147
+ className: (0, import_classnames.default)({
148
+ [`${prefix}-cancel`]: true
149
+ }),
150
+ onClick: () => cleanSelectedRows(),
151
+ children: cancelText
152
+ }
153
+ ),
154
+ disPlayBtnRender()
155
+ ] }),
156
+ !!alertOptionRender && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: alertOptionRender == null ? void 0 : alertOptionRender({
157
+ selectedRows: selectedData,
158
+ setSelectedRows,
159
+ cleanSelectedRows
160
+ }) })
161
+ ] }),
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
163
+ "div",
164
+ {
165
+ className: (0, import_classnames.default)({
166
+ [`${prefix}-content`]: true,
167
+ [`${prefix}-content-active`]: !!isOpen,
168
+ [`${prefix}-content-hidden`]: !isOpen
169
+ }),
170
+ children: typeof content === "function" ? content == null ? void 0 : content({ selectedRows: selectedData, setSelectedRows, cleanSelectedRows }) : content
171
+ }
172
+ )
173
+ ]
174
+ }
160
175
  );
161
176
  };
162
177
  var BatchOperationBar_default = (0, import_LocaleWrapper.default)({
@@ -33,18 +33,19 @@ __export(Code_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Code_exports);
35
35
  var import_design = require("@oceanbase/design");
36
- var import_react = __toESM(require("react"));
36
+ var import_react = require("react");
37
37
  var import_LocaleWrapper = __toESM(require("../../locale/LocaleWrapper"));
38
38
  var import_constant = require("../constant");
39
39
  var import_zh_CN = __toESM(require("../locale/zh-CN"));
40
40
  var import_classnames = __toESM(require("classnames"));
41
+ var import_jsx_runtime = require("react/jsx-runtime");
41
42
  var BoundaryCode = (props) => {
42
43
  const { children, onClick, code, imageUrl, title, buttonText, locale, className, ...restProps } = props;
43
44
  const info = (0, import_react.useMemo)(() => {
44
45
  const data = (0, import_constant.CODE_PRESET)(locale);
45
46
  return data[code];
46
47
  }, [code, locale]);
47
- return /* @__PURE__ */ import_react.default.createElement(
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
48
49
  "div",
49
50
  {
50
51
  className: (0, import_classnames.default)(
@@ -53,9 +54,14 @@ var BoundaryCode = (props) => {
53
54
  `ob-boundary-${code}`,
54
55
  className
55
56
  ),
56
- ...restProps
57
- },
58
- /* @__PURE__ */ import_react.default.createElement("div", { className: "empty" }, /* @__PURE__ */ import_react.default.createElement("img", { src: imageUrl || info.imageUrl }), /* @__PURE__ */ import_react.default.createElement("h4", null, title || info.title), children, /* @__PURE__ */ import_react.default.createElement(import_design.Button, { type: "primary", onClick: onClick || info.onClick }, buttonText || info.buttonText))
57
+ ...restProps,
58
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "empty", children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: imageUrl || info.imageUrl }),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: title || info.title }),
61
+ children,
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { type: "primary", onClick: onClick || info.onClick, children: buttonText || info.buttonText })
63
+ ] })
64
+ }
59
65
  );
60
66
  };
61
67
  var Code = (0, import_LocaleWrapper.default)({
@@ -38,6 +38,7 @@ var import_LocaleWrapper = __toESM(require("../../locale/LocaleWrapper"));
38
38
  var import_constant = require("../constant");
39
39
  var import_zh_CN = __toESM(require("../locale/zh-CN"));
40
40
  var import_classnames = __toESM(require("classnames"));
41
+ var import_jsx_runtime = require("react/jsx-runtime");
41
42
  var BoundaryException = class extends import_react.default.PureComponent {
42
43
  constructor() {
43
44
  super(...arguments);
@@ -85,31 +86,36 @@ var BoundaryException = class extends import_react.default.PureComponent {
85
86
  const errorDescription = info == null ? void 0 : info.componentStack;
86
87
  const errorMessage = (error || "").toString();
87
88
  if ((_a = this.state) == null ? void 0 : _a.hasError) {
88
- return /* @__PURE__ */ import_react.default.createElement(
89
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
90
  "div",
90
91
  {
91
92
  className: (0, import_classnames.default)("boundary-container", "ob-boundary-error", className),
92
- ...restProps
93
- },
94
- /* @__PURE__ */ import_react.default.createElement("div", { className: "empty" }, /* @__PURE__ */ import_react.default.createElement("img", { src: imageUrl || errorInfo.imageUrl }), /* @__PURE__ */ import_react.default.createElement("h4", null, title || errorInfo.title), showError ? /* @__PURE__ */ import_react.default.createElement(
95
- import_design.Alert,
96
- {
97
- type: "error",
98
- showIcon: true,
99
- message: errorMessage,
100
- description: errorDescription,
101
- style: {
102
- marginTop: 24,
103
- overflow: "auto",
104
- maxHeight: "50vh",
105
- // 为了避免被 Empty 的水平居中样式影响,需要设置 textAlign
106
- textAlign: "left"
107
- }
108
- }
109
- ) : subscription && /* @__PURE__ */ import_react.default.createElement("span", null, subscription), hasButton ? /* @__PURE__ */ import_react.default.createElement(import_design.Button, { type: "primary", onClick: () => this.onClick() }, buttonText || errorInfo.buttonText) : "")
93
+ ...restProps,
94
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "empty", children: [
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: imageUrl || errorInfo.imageUrl }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: title || errorInfo.title }),
97
+ showError ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
+ import_design.Alert,
99
+ {
100
+ type: "error",
101
+ showIcon: true,
102
+ message: errorMessage,
103
+ description: errorDescription,
104
+ style: {
105
+ marginTop: 24,
106
+ overflow: "auto",
107
+ maxHeight: "50vh",
108
+ // 为了避免被 Empty 的水平居中样式影响,需要设置 textAlign
109
+ textAlign: "left"
110
+ }
111
+ }
112
+ ) : subscription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: subscription }),
113
+ hasButton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { type: "primary", onClick: () => this.onClick(), children: buttonText || errorInfo.buttonText }) : ""
114
+ ] })
115
+ }
110
116
  );
111
117
  } else if (isNotCompatible) {
112
- return /* @__PURE__ */ import_react.default.createElement(
118
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
119
  "div",
114
120
  {
115
121
  className: (0, import_classnames.default)(
@@ -117,9 +123,13 @@ var BoundaryException = class extends import_react.default.PureComponent {
117
123
  "ob-boundary-browser-not-compatible",
118
124
  className
119
125
  ),
120
- ...restProps
121
- },
122
- /* @__PURE__ */ import_react.default.createElement("div", { className: "empty" }, /* @__PURE__ */ import_react.default.createElement("img", { src: imageUrl || notCompatibleInfo.imageUrl }), /* @__PURE__ */ import_react.default.createElement("h4", null, title || notCompatibleInfo.title), /* @__PURE__ */ import_react.default.createElement("span", null, subscription ? subscription : notCompatibleInfo.subscription))
126
+ ...restProps,
127
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "empty", children: [
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: imageUrl || notCompatibleInfo.imageUrl }),
129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: title || notCompatibleInfo.title }),
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: subscription ? subscription : notCompatibleInfo.subscription })
131
+ ] })
132
+ }
123
133
  );
124
134
  }
125
135
  return this.props.children;
@@ -33,20 +33,26 @@ __export(Function_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Function_exports);
35
35
  var import_design = require("@oceanbase/design");
36
- var import_react = __toESM(require("react"));
36
+ var import_react = require("react");
37
37
  var import_classnames = __toESM(require("classnames"));
38
+ var import_jsx_runtime = require("react/jsx-runtime");
38
39
  var BoundaryFunction = (props) => {
39
40
  const { children, state, config, onClick, className, ...restProps } = props;
40
41
  const info = (0, import_react.useMemo)(() => {
41
42
  return state ? config[state] : config[Object.keys(config)[0]];
42
43
  }, [config, state]);
43
- return /* @__PURE__ */ import_react.default.createElement(
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
44
45
  "div",
45
46
  {
46
47
  className: (0, import_classnames.default)("boundary-container", "ob-boundary-function", className),
47
- ...restProps
48
- },
49
- /* @__PURE__ */ import_react.default.createElement("div", { className: "empty" }, /* @__PURE__ */ import_react.default.createElement("img", { src: info.imageUrl }), /* @__PURE__ */ import_react.default.createElement("h4", null, info.title), children, info.buttonText && /* @__PURE__ */ import_react.default.createElement(import_design.Button, { type: "primary", onClick: onClick || info.onClick }, info.buttonText))
48
+ ...restProps,
49
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "empty", children: [
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: info.imageUrl }),
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: info.title }),
52
+ children,
53
+ info.buttonText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Button, { type: "primary", onClick: onClick || info.onClick, children: info.buttonText })
54
+ ] })
55
+ }
50
56
  );
51
57
  };
52
58
  // Annotate the CommonJS export names for ESM import in node:
@@ -32,12 +32,13 @@ __export(ContentWithIcon_exports, {
32
32
  default: () => ContentWithIcon_default
33
33
  });
34
34
  module.exports = __toCommonJS(ContentWithIcon_exports);
35
- var import_react = __toESM(require("react"));
35
+ var import_react = require("react");
36
36
  var import_antd = require("antd");
37
37
  var import_icons = require("@oceanbase/icons");
38
38
  var import_classnames = __toESM(require("classnames"));
39
39
  var import_util = require("../_util");
40
40
  var import_index = require("./index.less");
41
+ var import_jsx_runtime = require("react/jsx-runtime");
41
42
  var prefix = (0, import_util.getPrefix)("content-with-question");
42
43
  var ContentWithIcon = ({
43
44
  content,
@@ -58,7 +59,7 @@ var ContentWithIcon = ({
58
59
  }) => {
59
60
  const defaultIconType = () => {
60
61
  if (iconType === "question") {
61
- return /* @__PURE__ */ import_react.default.createElement(
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
62
63
  import_icons.QuestionCircleOutlined,
63
64
  {
64
65
  style: { color: color === "default" ? "#132039" : color, fontSize: size },
@@ -68,7 +69,7 @@ var ContentWithIcon = ({
68
69
  }
69
70
  if (iconType === "info") {
70
71
  if (infoColor) {
71
- return /* @__PURE__ */ import_react.default.createElement(
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
73
  import_icons.InfoCircleFilled,
73
74
  {
74
75
  style: { color: infoColor, fontSize: size },
@@ -76,7 +77,7 @@ var ContentWithIcon = ({
76
77
  }
77
78
  );
78
79
  } else {
79
- return /* @__PURE__ */ import_react.default.createElement(
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
80
81
  import_icons.InfoCircleOutlined,
81
82
  {
82
83
  style: { color: "3333333", fontSize: size },
@@ -86,7 +87,7 @@ var ContentWithIcon = ({
86
87
  }
87
88
  }
88
89
  if (iconType === "exclamation") {
89
- return /* @__PURE__ */ import_react.default.createElement(
90
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
91
  import_icons.ExclamationCircleFilled,
91
92
  {
92
93
  style: { color: exclamationColor, fontSize: size },
@@ -99,32 +100,39 @@ var ContentWithIcon = ({
99
100
  const getIcon = (iconConfig) => {
100
101
  return iconConfig ? !textHidden && iconType === "info" ? (
101
102
  // 文本描述直接展示且只在 info 类型下生效
102
- /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, iconConfig, /* @__PURE__ */ import_react.default.createElement("span", { style: { color: "#5C6B8A" } }, "文本示意不超过二十字文本示意不超过二十字"))
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: 4, children: [
104
+ iconConfig,
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { color: "#5C6B8A" }, children: "文本示意不超过二十字文本示意不超过二十字" })
106
+ ] })
103
107
  ) : (
104
108
  // 提示文案描述带有链接
105
- tooltipWithLink ? /* @__PURE__ */ import_react.default.createElement(import_antd.Popover, { ...popOver }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : defaultIconType()) : /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : defaultIconType())
109
+ tooltipWithLink ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Popover, { ...popOver, children: (0, import_react.isValidElement)(iconConfig) ? iconConfig : defaultIconType() }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { ...tooltip, children: (0, import_react.isValidElement)(iconConfig) ? iconConfig : defaultIconType() })
106
110
  ) : null;
107
111
  };
108
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
109
113
  "span",
110
114
  {
111
115
  className: (0, import_classnames.default)({
112
116
  [`${prefix}-item`]: true,
113
117
  [className]: !!className
114
118
  }),
115
- ...restProps
116
- },
117
- /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, getIcon(
118
- // 图标在文字前
119
- prefixIcon === true ? defaultIconType() : prefixIcon
120
- ), /* @__PURE__ */ import_react.default.createElement(
121
- "span",
122
- {
123
- "data-testid": "content",
124
- style: { color: color === "default" ? "#5C6B8A" : color, fontSize: size }
125
- },
126
- content ?? children
127
- ), getIcon(suffixIcon))
128
- ));
119
+ ...restProps,
120
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: 4, children: [
121
+ getIcon(
122
+ // 图标在文字前
123
+ prefixIcon === true ? defaultIconType() : prefixIcon
124
+ ),
125
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
+ "span",
127
+ {
128
+ "data-testid": "content",
129
+ style: { color: color === "default" ? "#5C6B8A" : color, fontSize: size },
130
+ children: content ?? children
131
+ }
132
+ ),
133
+ getIcon(suffixIcon)
134
+ ] })
135
+ }
136
+ ) });
129
137
  };
130
138
  var ContentWithIcon_default = ContentWithIcon;
@@ -35,8 +35,9 @@ module.exports = __toCommonJS(ContentWithQuestion_exports);
35
35
  var import_icons = require("@oceanbase/icons");
36
36
  var import_design = require("@oceanbase/design");
37
37
  var import_classnames = __toESM(require("classnames"));
38
- var import_react = __toESM(require("react"));
38
+ var import_react = require("react");
39
39
  var import_style = __toESM(require("./style"));
40
+ var import_jsx_runtime = require("react/jsx-runtime");
40
41
  var ContentWithQuestion = ({
41
42
  content,
42
43
  tooltip,
@@ -51,10 +52,14 @@ var ContentWithQuestion = ({
51
52
  const prefixCls = getPrefixCls("content-with-question", customizePrefixCls);
52
53
  const { wrapSSR } = (0, import_style.default)(prefixCls);
53
54
  const getIcon = (iconConfig) => {
54
- return iconConfig ? /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { ...tooltip }, (0, import_react.isValidElement)(iconConfig) ? iconConfig : /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, { className: `${prefixCls}-help` })) : null;
55
+ return iconConfig ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { ...tooltip, children: (0, import_react.isValidElement)(iconConfig) ? iconConfig : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.QuestionCircleOutlined, { className: `${prefixCls}-help` }) }) : null;
55
56
  };
56
57
  return wrapSSR(
57
- /* @__PURE__ */ import_react.default.createElement("span", { className: (0, import_classnames.default)(`${prefixCls}-item`, className), ...restProps }, /* @__PURE__ */ import_react.default.createElement(import_design.Space, null, getIcon(prefixIcon), /* @__PURE__ */ import_react.default.createElement("span", { "data-testid": "content" }, content ?? children), getIcon(suffixIcon)))
58
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_classnames.default)(`${prefixCls}-item`, className), ...restProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { children: [
59
+ getIcon(prefixIcon),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-testid": "content", children: content ?? children }),
61
+ getIcon(suffixIcon)
62
+ ] }) })
58
63
  );
59
64
  };
60
65
  var ContentWithQuestion_default = ContentWithQuestion;