@oceanbase/ui 1.0.0-alpha.1 → 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.
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/style/index.d.ts +2 -2
- package/es/DateRanger/Ranger.d.ts +4 -0
- package/es/DateRanger/Ranger.js +158 -14
- package/es/DateRanger/constant/index.js +1 -1
- package/es/DateRanger/index.less +23 -0
- package/es/FooterToolbar/style/index.d.ts +0 -2
- package/es/FooterToolbar/style/index.js +0 -12
- package/es/PageContainer/index.js +14 -4
- package/es/PageContainer/style/index.js +5 -7
- package/es/ProCard/index.js +11 -3
- package/es/ProCard/style/index.d.ts +2 -2
- package/es/ProCard/style/index.js +6 -3
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +11 -5
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +6 -3
- package/lib/Action/Group.js +57 -46
- package/lib/Action/Item.js +14 -9
- package/lib/Action/style/index.d.ts +2 -2
- package/lib/BackgroundTaskManager/RefreshMan.js +3 -12
- package/lib/BackgroundTaskManager/index.js +3 -12
- package/lib/BasicLayout/Header.js +120 -62
- package/lib/BasicLayout/index.js +166 -143
- package/lib/BatchOperationBar/index.js +59 -44
- package/lib/Boundary/Components/Code.js +11 -5
- package/lib/Boundary/Components/Exception.js +33 -23
- package/lib/Boundary/Components/Function.js +11 -5
- package/lib/ContentWithIcon/index.js +30 -22
- package/lib/ContentWithQuestion/index.js +8 -3
- package/lib/DateRanger/PickerPanel.js +235 -217
- package/lib/DateRanger/Ranger.d.ts +4 -0
- package/lib/DateRanger/Ranger.js +396 -227
- package/lib/DateRanger/constant/index.js +1 -1
- package/lib/DateRanger/index.less +23 -0
- package/lib/Dialog/Anchor.js +8 -5
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.js +132 -108
- package/lib/DocDialog/index.js +3 -2
- package/lib/FooterToolbar/index.js +3 -2
- package/lib/FooterToolbar/style/index.d.ts +0 -2
- package/lib/FooterToolbar/style/index.js +0 -17
- package/lib/FullscreenBox/index.js +16 -7
- package/lib/GraphToolbar/index.js +70 -58
- package/lib/Highlight/DiffView/DiffCells.js +17 -10
- package/lib/Highlight/DiffView/index.js +35 -31
- package/lib/Highlight/HighlightCell.js +13 -10
- package/lib/Highlight/JsonView.js +15 -14
- package/lib/Highlight/index.js +50 -45
- package/lib/IconFont/index.js +2 -12
- package/lib/LightFilter/index.js +3 -2
- package/lib/LocaleDropdown/index.js +13 -20
- package/lib/Login/ActivateForm.js +53 -60
- package/lib/Login/LoginForm.js +118 -109
- package/lib/Login/RegisterForm.js +79 -86
- package/lib/Login/index.js +92 -64
- package/lib/NavMenu/index.js +9 -8
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.js +17 -6
- package/lib/PageContainer/style/index.js +5 -6
- package/lib/PageLoading/index.js +6 -16
- package/lib/Password/Content.js +38 -42
- package/lib/Password/index.js +83 -68
- package/lib/ProCard/index.js +6 -3
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +6 -2
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +19 -8
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +7 -1
- package/lib/Ranger/QuickPicker.js +24 -15
- package/lib/Ranger/Ranger.js +37 -34
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.js +19 -10
- package/lib/TagSelect/Group.js +9 -5
- package/lib/TagSelect/Item.js +22 -18
- package/lib/TaskGraph/Graph.js +29 -24
- package/lib/TaskGraph/index.js +56 -50
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.js +64 -37
- package/lib/Welcome/step.js +11 -4
- package/lib/locale/LocaleWrapper.js +15 -14
- package/package.json +4 -4
package/lib/BasicLayout/index.js
CHANGED
|
@@ -47,6 +47,7 @@ var import_useNavigate = __toESM(require("../_util/useNavigate"));
|
|
|
47
47
|
var import_Header = __toESM(require("./Header"));
|
|
48
48
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
49
49
|
var import_style = __toESM(require("./style"));
|
|
50
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
51
|
var { Content, Sider } = import_design2.Layout;
|
|
51
52
|
var { SubMenu, Item } = import_design2.Menu;
|
|
52
53
|
var BasicLayout = ({
|
|
@@ -139,64 +140,70 @@ var BasicLayout = ({
|
|
|
139
140
|
(_a = item.children) == null ? void 0 : _a.some(({ accessible: childAccessible = true }) => childAccessible)
|
|
140
141
|
) : item.accessible)) {
|
|
141
142
|
pre.push(
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
144
|
SubMenu,
|
|
144
145
|
{
|
|
145
146
|
"data-testid": "menu.sub",
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
148
|
+
renderIcon(item),
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
150
|
+
import_design.Typography.Text,
|
|
151
|
+
{
|
|
152
|
+
ellipsis: {
|
|
153
|
+
tooltip: {
|
|
154
|
+
placement: "right"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
style: {
|
|
158
|
+
lineHeight: "40px",
|
|
159
|
+
maxWidth: 80
|
|
160
|
+
},
|
|
161
|
+
children: item.title
|
|
158
162
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
)
|
|
163
|
+
)
|
|
164
|
+
] }),
|
|
165
|
+
children: renderMenu(item.children)
|
|
162
166
|
},
|
|
163
|
-
|
|
167
|
+
item.link
|
|
164
168
|
)
|
|
165
169
|
);
|
|
166
170
|
} else if (!item.children && accessible) {
|
|
167
171
|
pre.push(
|
|
168
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
169
173
|
Item,
|
|
170
174
|
{
|
|
171
175
|
"data-testid": "menu.item",
|
|
172
|
-
key: item.link,
|
|
173
176
|
onClick: () => {
|
|
174
177
|
if (pathname !== item.link) {
|
|
175
178
|
navigate == null ? void 0 : navigate(item.link);
|
|
176
179
|
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
/* @__PURE__ */ import_react.default.createElement("div", null, renderIcon(item), /* @__PURE__ */ import_react.default.createElement(
|
|
180
|
-
import_design.Typography.Text,
|
|
181
|
-
{
|
|
182
|
-
ellipsis: {
|
|
183
|
-
tooltip: {
|
|
184
|
-
placement: "right"
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
style: {
|
|
188
|
-
lineHeight: "40px",
|
|
189
|
-
maxWidth: 116
|
|
190
|
-
}
|
|
191
180
|
},
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
182
|
+
renderIcon(item),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
184
|
+
import_design.Typography.Text,
|
|
185
|
+
{
|
|
186
|
+
ellipsis: {
|
|
187
|
+
tooltip: {
|
|
188
|
+
placement: "right"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
style: {
|
|
192
|
+
lineHeight: "40px",
|
|
193
|
+
maxWidth: 116
|
|
194
|
+
},
|
|
195
|
+
children: item.title
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
199
|
+
},
|
|
200
|
+
item.link
|
|
194
201
|
)
|
|
195
202
|
);
|
|
196
203
|
}
|
|
197
204
|
if (item.divider && accessible) {
|
|
198
205
|
pre.push(
|
|
199
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
200
207
|
import_design2.Divider,
|
|
201
208
|
{
|
|
202
209
|
style: {
|
|
@@ -222,27 +229,27 @@ var BasicLayout = ({
|
|
|
222
229
|
(_a = item.children) == null ? void 0 : _a.some(({ accessible: childAccessible = true }) => childAccessible)
|
|
223
230
|
) : item.accessible)) {
|
|
224
231
|
pre.push(
|
|
225
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubMenu, { title: renderIcon(item, isSubSider), children: renderMenu(item.children) }, item.link)
|
|
226
233
|
);
|
|
227
234
|
} else if (!item.children && accessible) {
|
|
228
235
|
pre.push(
|
|
229
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
230
237
|
Item,
|
|
231
238
|
{
|
|
232
239
|
"data-testid": "menu.item",
|
|
233
|
-
key: item.link,
|
|
234
240
|
onClick: () => {
|
|
235
241
|
if (pathname !== item.link) {
|
|
236
242
|
navigate == null ? void 0 : navigate(item.link);
|
|
237
243
|
}
|
|
238
|
-
}
|
|
244
|
+
},
|
|
245
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design2.Tooltip, { placement: "right", title: item.title, getPopupContainer: () => document.body, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: renderIcon(item, isSubSider) }) })
|
|
239
246
|
},
|
|
240
|
-
|
|
247
|
+
item.link
|
|
241
248
|
)
|
|
242
249
|
);
|
|
243
250
|
}
|
|
244
251
|
if (item.divider && accessible) {
|
|
245
|
-
pre.push(/* @__PURE__ */
|
|
252
|
+
pre.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design2.Divider, {}));
|
|
246
253
|
}
|
|
247
254
|
return pre;
|
|
248
255
|
}, []);
|
|
@@ -258,116 +265,132 @@ var BasicLayout = ({
|
|
|
258
265
|
siderWidth = 0;
|
|
259
266
|
}
|
|
260
267
|
return wrapSSR(
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
className: (0, import_classnames.default)(
|
|
265
|
-
prefixCls,
|
|
266
|
-
{
|
|
267
|
-
[`${prefixCls}-with-banner`]: banner,
|
|
268
|
-
[`${prefixCls}-sider-${siderWidth}`]: true
|
|
269
|
-
},
|
|
270
|
-
className
|
|
271
|
-
),
|
|
272
|
-
...restProps
|
|
273
|
-
},
|
|
274
|
-
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
275
|
-
import_Header.default,
|
|
276
|
-
{
|
|
277
|
-
prefixCls,
|
|
278
|
-
pathname,
|
|
279
|
-
iconUrl,
|
|
280
|
-
logoUrl,
|
|
281
|
-
simpleLogoUrl,
|
|
282
|
-
...topHeader
|
|
283
|
-
}
|
|
284
|
-
), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
269
|
+
banner && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-banner-wrapper`, children: banner }),
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
285
271
|
import_design2.Layout,
|
|
286
272
|
{
|
|
287
|
-
className:
|
|
288
|
-
|
|
289
|
-
marginTop: 48
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
(subSideMenus || menus) && /* @__PURE__ */ import_react.default.createElement(
|
|
293
|
-
Sider,
|
|
294
|
-
{
|
|
295
|
-
theme: "light",
|
|
296
|
-
width: siderWidth,
|
|
297
|
-
className: (0, import_classnames.default)(`${prefixCls}-sider`, {
|
|
298
|
-
[`${prefixCls}-sider-collapsed`]: collapsed,
|
|
299
|
-
[`${prefixCls}-sider-has-sub-sider`]: subSideMenus
|
|
300
|
-
})
|
|
301
|
-
},
|
|
302
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-sider-wrapper` }, subSideMenus && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-sub-sider` }, /* @__PURE__ */ import_react.default.createElement(
|
|
303
|
-
import_design2.Menu,
|
|
304
|
-
{
|
|
305
|
-
...subSideMenuProps,
|
|
306
|
-
mode: "vertical",
|
|
307
|
-
className: `${prefixCls}-menu-vertical`
|
|
308
|
-
},
|
|
309
|
-
renderCollapsedMenu(subSideMenus, true)
|
|
310
|
-
)), (sideHeader || menus) && /* @__PURE__ */ import_react.default.createElement(
|
|
311
|
-
"div",
|
|
273
|
+
className: (0, import_classnames.default)(
|
|
274
|
+
prefixCls,
|
|
312
275
|
{
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
width: "100%"
|
|
316
|
-
}
|
|
276
|
+
[`${prefixCls}-with-banner`]: banner,
|
|
277
|
+
[`${prefixCls}-sider-${siderWidth}`]: true
|
|
317
278
|
},
|
|
318
|
-
|
|
319
|
-
|
|
279
|
+
className
|
|
280
|
+
),
|
|
281
|
+
...restProps,
|
|
282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
284
|
+
import_Header.default,
|
|
320
285
|
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
286
|
+
prefixCls,
|
|
287
|
+
pathname,
|
|
288
|
+
iconUrl,
|
|
289
|
+
logoUrl,
|
|
290
|
+
simpleLogoUrl,
|
|
291
|
+
...topHeader
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
295
|
+
import_design2.Layout,
|
|
328
296
|
{
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
297
|
+
className: `${prefixCls}-content-layout`,
|
|
298
|
+
style: {
|
|
299
|
+
marginTop: 48
|
|
300
|
+
},
|
|
301
|
+
children: [
|
|
302
|
+
(subSideMenus || menus) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
303
|
+
Sider,
|
|
304
|
+
{
|
|
305
|
+
theme: "light",
|
|
306
|
+
width: siderWidth,
|
|
307
|
+
className: (0, import_classnames.default)(`${prefixCls}-sider`, {
|
|
308
|
+
[`${prefixCls}-sider-collapsed`]: collapsed,
|
|
309
|
+
[`${prefixCls}-sider-has-sub-sider`]: subSideMenus
|
|
310
|
+
}),
|
|
311
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-sider-wrapper`, children: [
|
|
312
|
+
subSideMenus && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-sub-sider`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
313
|
+
import_design2.Menu,
|
|
314
|
+
{
|
|
315
|
+
...subSideMenuProps,
|
|
316
|
+
mode: "vertical",
|
|
317
|
+
className: `${prefixCls}-menu-vertical`,
|
|
318
|
+
children: renderCollapsedMenu(subSideMenus, true)
|
|
319
|
+
}
|
|
320
|
+
) }),
|
|
321
|
+
(sideHeader || menus) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
322
|
+
"div",
|
|
323
|
+
{
|
|
324
|
+
style: {
|
|
325
|
+
display: "flex",
|
|
326
|
+
width: "100%"
|
|
327
|
+
},
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefixCls}-sider-content`, children: [
|
|
330
|
+
sideHeader && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-sider-header`, children: sideHeader }),
|
|
331
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-menu-wrapper`, children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-menu-collapsed`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
332
|
+
import_design2.Menu,
|
|
333
|
+
{
|
|
334
|
+
...menuProps,
|
|
335
|
+
mode: "vertical",
|
|
336
|
+
className: `${prefixCls}-menu-vertical`,
|
|
337
|
+
children: renderCollapsedMenu(menus, false)
|
|
338
|
+
}
|
|
339
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
340
|
+
import_design2.Menu,
|
|
341
|
+
{
|
|
342
|
+
...menuProps,
|
|
343
|
+
mode: "inline",
|
|
344
|
+
expandIcon: ({ isOpen }) => {
|
|
345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
346
|
+
import_icons.CaretRightFilled,
|
|
347
|
+
{
|
|
348
|
+
rotate: isOpen ? 90 : 0,
|
|
349
|
+
style: {
|
|
350
|
+
fontSize: 12
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
},
|
|
355
|
+
className: `${prefixCls}-menu`,
|
|
356
|
+
children: renderMenu(menus)
|
|
357
|
+
}
|
|
358
|
+
) })
|
|
359
|
+
] }),
|
|
360
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-sider-border`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
361
|
+
"div",
|
|
362
|
+
{
|
|
363
|
+
className: `${prefixCls}-sider-collapse`,
|
|
364
|
+
onClick: () => {
|
|
365
|
+
setCollapsed(!collapsed);
|
|
366
|
+
setOpenKeys([]);
|
|
367
|
+
},
|
|
368
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.RightOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.LeftOutlined, {})
|
|
369
|
+
}
|
|
370
|
+
) })
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
] })
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
378
|
+
Content,
|
|
334
379
|
{
|
|
335
|
-
|
|
380
|
+
className: (0, import_classnames.default)(`${prefixCls}-content`, `${prefixCls}-content-${siderWidth}`),
|
|
336
381
|
style: {
|
|
337
|
-
|
|
338
|
-
}
|
|
382
|
+
marginLeft: siderWidth
|
|
383
|
+
},
|
|
384
|
+
children
|
|
339
385
|
}
|
|
340
|
-
)
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
{
|
|
349
|
-
className: `${prefixCls}-sider-collapse`,
|
|
350
|
-
onClick: () => {
|
|
351
|
-
setCollapsed(!collapsed);
|
|
352
|
-
setOpenKeys([]);
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
collapsed ? /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null)
|
|
356
|
-
))
|
|
357
|
-
))
|
|
358
|
-
),
|
|
359
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
360
|
-
Content,
|
|
361
|
-
{
|
|
362
|
-
className: (0, import_classnames.default)(`${prefixCls}-content`, `${prefixCls}-content-${siderWidth}`),
|
|
363
|
-
style: {
|
|
364
|
-
marginLeft: siderWidth
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
children
|
|
368
|
-
)
|
|
369
|
-
)))
|
|
370
|
-
))
|
|
386
|
+
)
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
) })
|
|
390
|
+
] })
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
] })
|
|
371
394
|
);
|
|
372
395
|
};
|
|
373
396
|
var BasicLayout_default = (0, import_LocaleWrapper.default)({
|
|
@@ -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 =
|
|
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__ */
|
|
59
|
+
openIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {}),
|
|
59
60
|
hiddenText = locale == null ? void 0 : locale.hiddenText,
|
|
60
|
-
hiddenIcon = /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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__ */
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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 =
|
|
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__ */
|
|
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
|
-
|
|
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__ */
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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__ */
|
|
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
|
-
|
|
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;
|