@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.
- 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/FooterToolbar/style/index.d.ts +0 -2
- package/es/FooterToolbar/style/index.js +0 -12
- package/es/Highlight/index.d.ts +1 -1
- package/es/ProCard/style/index.d.ts +2 -2
- package/es/ProCard/style/index.js +3 -2
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +6 -5
- 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.js +349 -313
- 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.d.ts +1 -1
- 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 +9 -5
- 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 +5 -4
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +3 -2
- package/lib/ProTable/index.js +5 -4
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +6 -7
- 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 +3 -3
|
@@ -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 =
|
|
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__ */
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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__ */
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
};
|
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)({
|