@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
|
@@ -37,13 +37,14 @@ var import_icons = require("@oceanbase/icons");
|
|
|
37
37
|
var import_util = require("@oceanbase/util");
|
|
38
38
|
var import_design = require("@oceanbase/design");
|
|
39
39
|
var import_lodash = require("lodash");
|
|
40
|
-
var import_react =
|
|
40
|
+
var import_react = require("react");
|
|
41
41
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
42
42
|
var import_util2 = require("../_util");
|
|
43
43
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
44
44
|
var import_graph_fit_view_icon = __toESM(require("../assets/graph_fit_view_icon.svg"));
|
|
45
45
|
var import_graph_reset_icon = __toESM(require("../assets/graph_reset_icon.svg"));
|
|
46
46
|
var import_index = require("./index.less");
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
48
|
function getCenterPointByGraph(graph) {
|
|
48
49
|
const group = graph == null ? void 0 : graph.get("group");
|
|
49
50
|
if (group) {
|
|
@@ -79,70 +80,81 @@ var GraphToolbar = ({
|
|
|
79
80
|
}, 16)
|
|
80
81
|
);
|
|
81
82
|
}, [graph]);
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
onFullscreen
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_design.Space, { size: 16, className: `${prefix} ${`${prefix}-${mode}`} ${className}`, children: [
|
|
84
|
+
showFullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.fullscreen, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
import_icons.FullscreenOutlined,
|
|
86
|
+
{
|
|
87
|
+
className: "pointable",
|
|
88
|
+
onClick: () => {
|
|
89
|
+
if (onFullscreen) {
|
|
90
|
+
onFullscreen();
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
) }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `${prefix}-zoom-wrapper`, children: [
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.shrink, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
import_icons.MinusOutlined,
|
|
98
|
+
{
|
|
99
|
+
className: zoom >= 0.3 ? `${prefix}-pointable` : `${prefix}-disabled`,
|
|
100
|
+
onClick: () => {
|
|
101
|
+
if (zoom >= 0.3) {
|
|
102
|
+
const newZoom = zoom - 0.1;
|
|
103
|
+
setZoom(newZoom);
|
|
104
|
+
graph == null ? void 0 : graph.zoomTo(newZoom, getCenterPointByGraph(graph));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
101
107
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
) }),
|
|
109
|
+
(0, import_util.toPercent)(zoom),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.enlarge, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
import_icons.PlusOutlined,
|
|
112
|
+
{
|
|
113
|
+
className: zoom <= 0.9 ? `${prefix}-pointable` : `${prefix}-disabled`,
|
|
114
|
+
onClick: () => {
|
|
115
|
+
if (zoom <= 0.9) {
|
|
116
|
+
const newZoom = zoom + 0.1;
|
|
117
|
+
setZoom(newZoom);
|
|
118
|
+
graph == null ? void 0 : graph.zoomTo(newZoom, getCenterPointByGraph(graph));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
) })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.reset, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
"img",
|
|
126
|
+
{
|
|
127
|
+
src: import_graph_reset_icon.default,
|
|
128
|
+
alt: "",
|
|
129
|
+
className: `${prefix}-pointable`,
|
|
130
|
+
onClick: () => {
|
|
131
|
+
setZoom(1);
|
|
132
|
+
graph == null ? void 0 : graph.zoomTo(1, getCenterPointByGraph(graph));
|
|
113
133
|
}
|
|
114
134
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
)), /* @__PURE__ */ import_react.default.createElement(import_design.Tooltip, { title: locale.fitView }, /* @__PURE__ */ import_react.default.createElement(
|
|
128
|
-
"img",
|
|
129
|
-
{
|
|
130
|
-
src: import_graph_fit_view_icon.default,
|
|
131
|
-
alt: "",
|
|
132
|
-
className: `${prefix}-pointable`,
|
|
133
|
-
onClick: () => {
|
|
134
|
-
graph == null ? void 0 : graph.fitView();
|
|
135
|
+
) }),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.fitView, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
"img",
|
|
138
|
+
{
|
|
139
|
+
src: import_graph_fit_view_icon.default,
|
|
140
|
+
alt: "",
|
|
141
|
+
className: `${prefix}-pointable`,
|
|
142
|
+
onClick: () => {
|
|
143
|
+
graph == null ? void 0 : graph.fitView();
|
|
144
|
+
}
|
|
135
145
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
) }),
|
|
147
|
+
onReload && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Divider, { type: "vertical", className: `${prefix}-divider` }) }),
|
|
148
|
+
onReload && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { title: locale.refresh, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
import_icons.SyncOutlined,
|
|
150
|
+
{
|
|
151
|
+
className: `${prefix}-pointable`,
|
|
152
|
+
onClick: () => {
|
|
153
|
+
onReload();
|
|
154
|
+
}
|
|
143
155
|
}
|
|
144
|
-
}
|
|
145
|
-
)
|
|
156
|
+
) }) })
|
|
157
|
+
] });
|
|
146
158
|
};
|
|
147
159
|
var GraphToolbar_default = (0, import_LocaleWrapper.default)({
|
|
148
160
|
componentName: "GraphToolbar",
|
|
@@ -33,7 +33,7 @@ __export(DiffCells_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(DiffCells_exports);
|
|
35
35
|
var import_classnames = __toESM(require("classnames"));
|
|
36
|
-
var
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
function DiffCells({
|
|
38
38
|
diffPrefixCls,
|
|
39
39
|
data,
|
|
@@ -58,13 +58,20 @@ function DiffCells({
|
|
|
58
58
|
if (rowIndex !== void 0) {
|
|
59
59
|
rowIndex += rowOffset;
|
|
60
60
|
}
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
"td",
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_classnames.default)(`${diffPrefixCls}-index`, mergedClassName, hashId), children: rowIndex }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", { className: (0, import_classnames.default)(`${diffPrefixCls}-mark`, mergedClassName, hashId), children: [
|
|
64
|
+
add && "+",
|
|
65
|
+
remove && "-"
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
"td",
|
|
69
|
+
{
|
|
70
|
+
onMouseDown,
|
|
71
|
+
style: { width, userSelect: lock ? "none" : void 0 },
|
|
72
|
+
className: (0, import_classnames.default)(`${diffPrefixCls}-code`, mergedClassName, hashId),
|
|
73
|
+
dangerouslySetInnerHTML: { __html: (data == null ? void 0 : data.value) ?? (emptyText || "") }
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] });
|
|
70
77
|
}
|
|
@@ -42,6 +42,7 @@ var import_util = require("../../_util");
|
|
|
42
42
|
var import_useKeyDownCopyEvent = require("../useKeyDownCopyEvent");
|
|
43
43
|
var import_DiffCells = __toESM(require("./DiffCells"));
|
|
44
44
|
var import__2 = require("../index.less");
|
|
45
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
46
|
var MAX_MERGE_TIMES = 1e4;
|
|
46
47
|
var EMPTY_TEXT = `<span class="hljs-comment">// 没有数据</span>`;
|
|
47
48
|
function getHighlightRows(language, code) {
|
|
@@ -221,7 +222,7 @@ var DiffView = ({
|
|
|
221
222
|
}, [diffData]);
|
|
222
223
|
let viewRows;
|
|
223
224
|
if (!report) {
|
|
224
|
-
viewRows = /* @__PURE__ */
|
|
225
|
+
viewRows = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
226
|
import_DiffCells.default,
|
|
226
227
|
{
|
|
227
228
|
width: "100%",
|
|
@@ -232,34 +233,37 @@ var DiffView = ({
|
|
|
232
233
|
type: "keep"
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
));
|
|
236
|
+
) });
|
|
236
237
|
} else if (split) {
|
|
237
|
-
viewRows = mergedData.rows.map(({ source: src, target: tgt }, index) => /* @__PURE__ */
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
238
|
+
viewRows = mergedData.rows.map(({ source: src, target: tgt }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
240
|
+
import_DiffCells.default,
|
|
241
|
+
{
|
|
242
|
+
width: "50%",
|
|
243
|
+
diffPrefixCls,
|
|
244
|
+
data: src,
|
|
245
|
+
emptyText: index === 0 && mergedData.sourceEmpty && EMPTY_TEXT,
|
|
246
|
+
onMouseDown: onSourceMouseDown,
|
|
247
|
+
lock: selectable !== "source",
|
|
248
|
+
rowOffset: rowOffsetSrc
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
252
|
+
import_DiffCells.default,
|
|
253
|
+
{
|
|
254
|
+
width: "50%",
|
|
255
|
+
diffPrefixCls,
|
|
256
|
+
data: tgt,
|
|
257
|
+
emptyText: index === 0 && mergedData.targetEmpty && EMPTY_TEXT,
|
|
258
|
+
onMouseDown: onTargetMouseDown,
|
|
259
|
+
lock: selectable !== "target",
|
|
260
|
+
rowOffset: rowOffsetTgt
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] }, index));
|
|
260
264
|
} else {
|
|
261
265
|
viewRows = diffData.sourceRows.map((src, index) => {
|
|
262
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
263
267
|
import_DiffCells.default,
|
|
264
268
|
{
|
|
265
269
|
width: "100%",
|
|
@@ -267,12 +271,12 @@ var DiffView = ({
|
|
|
267
271
|
data: src ?? diffData.targetRows[index],
|
|
268
272
|
rowOffset: rowOffsetTgt
|
|
269
273
|
}
|
|
270
|
-
));
|
|
274
|
+
) }, index);
|
|
271
275
|
});
|
|
272
276
|
}
|
|
273
277
|
const codeRef = import_react.default.useRef();
|
|
274
278
|
(0, import_useKeyDownCopyEvent.useKeyDownCopyEvent)(codeRef);
|
|
275
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
276
280
|
"div",
|
|
277
281
|
{
|
|
278
282
|
style: {
|
|
@@ -289,9 +293,9 @@ var DiffView = ({
|
|
|
289
293
|
[`${diffPrefixCls}-split`]: split
|
|
290
294
|
},
|
|
291
295
|
className
|
|
292
|
-
)
|
|
293
|
-
|
|
294
|
-
|
|
296
|
+
),
|
|
297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: viewRows }) })
|
|
298
|
+
}
|
|
295
299
|
);
|
|
296
300
|
};
|
|
297
301
|
var DiffView_default = DiffView;
|
|
@@ -33,7 +33,7 @@ __export(HighlightCell_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(HighlightCell_exports);
|
|
35
35
|
var import_classnames = __toESM(require("classnames"));
|
|
36
|
-
var
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
function HighlightCell({
|
|
38
38
|
prefixCls,
|
|
39
39
|
theme,
|
|
@@ -46,13 +46,16 @@ function HighlightCell({
|
|
|
46
46
|
hashId
|
|
47
47
|
}) {
|
|
48
48
|
const rowIndex = data == null ? void 0 : data.index;
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
"td",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
50
|
+
lineNumber ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: (0, import_classnames.default)(`${prefixCls}-${theme}-index`, `${prefixCls}-index`, hashId), children: rowIndex }) : null,
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
"td",
|
|
53
|
+
{
|
|
54
|
+
onMouseDown,
|
|
55
|
+
style: { width, userSelect: lock ? "none" : void 0 },
|
|
56
|
+
className: (0, import_classnames.default)(`${prefixCls}-content`, hashId),
|
|
57
|
+
dangerouslySetInnerHTML: { __html: (data == null ? void 0 : data.value) ?? (emptyText || "") }
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] });
|
|
58
61
|
}
|
|
@@ -33,12 +33,13 @@ __export(JsonView_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(JsonView_exports);
|
|
35
35
|
var import_classnames = __toESM(require("classnames"));
|
|
36
|
-
var import_react =
|
|
36
|
+
var import_react = require("react");
|
|
37
37
|
var import_react_json_view = __toESM(require("react-json-view"));
|
|
38
38
|
var import_util = require("../_util");
|
|
39
39
|
var import__ = require(".");
|
|
40
40
|
var import_useKeyDownCopyEvent = require("./useKeyDownCopyEvent");
|
|
41
41
|
var import_index = require("./index.less");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var JsonView_default = ({
|
|
43
44
|
json,
|
|
44
45
|
theme,
|
|
@@ -53,7 +54,7 @@ var JsonView_default = ({
|
|
|
53
54
|
const isDarkTheme = theme === import__.THEME_DARK;
|
|
54
55
|
const codeRef = (0, import_react.useRef)();
|
|
55
56
|
(0, import_useKeyDownCopyEvent.useKeyDownCopyEvent)(codeRef);
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
58
|
"div",
|
|
58
59
|
{
|
|
59
60
|
style,
|
|
@@ -66,18 +67,18 @@ var JsonView_default = ({
|
|
|
66
67
|
[`${prefixCls}-light`]: !isDarkTheme
|
|
67
68
|
},
|
|
68
69
|
className
|
|
70
|
+
),
|
|
71
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
import_react_json_view.default,
|
|
73
|
+
{
|
|
74
|
+
enableClipboard: copyable && onCopyChange,
|
|
75
|
+
src: json,
|
|
76
|
+
theme: isDarkTheme ? "ocean" : void 0,
|
|
77
|
+
displayDataTypes: false,
|
|
78
|
+
style: { height },
|
|
79
|
+
name: false
|
|
80
|
+
}
|
|
69
81
|
)
|
|
70
|
-
}
|
|
71
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
72
|
-
import_react_json_view.default,
|
|
73
|
-
{
|
|
74
|
-
enableClipboard: copyable && onCopyChange,
|
|
75
|
-
src: json,
|
|
76
|
-
theme: isDarkTheme ? "ocean" : void 0,
|
|
77
|
-
displayDataTypes: false,
|
|
78
|
-
style: { height },
|
|
79
|
-
name: false
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
+
}
|
|
82
83
|
);
|
|
83
84
|
};
|
package/lib/Highlight/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const THEME_DARK = "dark";
|
|
|
29
29
|
export declare const THEME_LIGHT = "light";
|
|
30
30
|
declare const ThemeTypes: ["dark", "light"];
|
|
31
31
|
export type ThemeType = (typeof ThemeTypes)[number];
|
|
32
|
-
declare const supportedLanguages: ("
|
|
32
|
+
declare const supportedLanguages: ("ruby" | "css" | "json" | "jsx" | "tsx" | "javascript" | "typescript" | "groovy" | "java" | "python" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity")[];
|
|
33
33
|
export type LanguageType = (typeof supportedLanguages)[number] | 'html';
|
|
34
34
|
export interface HighlightProps extends LocaleWrapperProps {
|
|
35
35
|
/**
|
package/lib/Highlight/index.js
CHANGED
|
@@ -70,6 +70,7 @@ var import_yaml = __toESM(require("./languages/yaml"));
|
|
|
70
70
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
71
71
|
var import_useKeyDownCopyEvent = require("./useKeyDownCopyEvent");
|
|
72
72
|
var import_index = require("./index.less");
|
|
73
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
73
74
|
var languageMap = {
|
|
74
75
|
javascript: import_javascript.default,
|
|
75
76
|
typescript: import_typescript.default,
|
|
@@ -143,7 +144,7 @@ var Highlight = (props) => {
|
|
|
143
144
|
}));
|
|
144
145
|
setCodeBlock(
|
|
145
146
|
rowList.map((src, index) => {
|
|
146
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
147
148
|
import_HighlightCell.default,
|
|
148
149
|
{
|
|
149
150
|
lineNumber,
|
|
@@ -152,7 +153,7 @@ var Highlight = (props) => {
|
|
|
152
153
|
theme,
|
|
153
154
|
prefixCls
|
|
154
155
|
}
|
|
155
|
-
));
|
|
156
|
+
) }, index);
|
|
156
157
|
})
|
|
157
158
|
);
|
|
158
159
|
};
|
|
@@ -168,7 +169,7 @@ var Highlight = (props) => {
|
|
|
168
169
|
};
|
|
169
170
|
if (innerHTML) {
|
|
170
171
|
customProps.dangerouslySetInnerHTML = { __html: children };
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...customProps });
|
|
172
173
|
}
|
|
173
174
|
const CopyButton = () => {
|
|
174
175
|
const [copyId, setCopyId] = (0, import_react.useState)();
|
|
@@ -178,7 +179,7 @@ var Highlight = (props) => {
|
|
|
178
179
|
};
|
|
179
180
|
});
|
|
180
181
|
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
183
|
import_react_copy_to_clipboard.default,
|
|
183
184
|
{
|
|
184
185
|
text: children && children.length ? children : "",
|
|
@@ -190,35 +191,37 @@ var Highlight = (props) => {
|
|
|
190
191
|
setCopied(false);
|
|
191
192
|
}, 2e3);
|
|
192
193
|
setCopyId(tempCopyId);
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
196
|
-
"button",
|
|
197
|
-
{
|
|
198
|
-
disabled: copied,
|
|
199
|
-
className: (0, import_classnames.default)(`${prefixCls}-copy`),
|
|
200
|
-
style: {
|
|
201
|
-
background: `${theme === THEME_DARK ? `#2b303b` : token.colorBgLayout}`
|
|
202
|
-
}
|
|
203
194
|
},
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
206
|
-
{
|
|
207
|
-
className: (0, import_classnames.default)(`${prefixCls}-copy-icon`, { scoll: copied }),
|
|
208
|
-
style: { color: `${theme === THEME_DARK ? token.colorBgLayout : `#2b303b`}` }
|
|
209
|
-
}
|
|
210
|
-
),
|
|
211
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
212
|
-
import_icons.CheckOutlined,
|
|
195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
196
|
+
"button",
|
|
213
197
|
{
|
|
214
|
-
|
|
215
|
-
|
|
198
|
+
disabled: copied,
|
|
199
|
+
className: (0, import_classnames.default)(`${prefixCls}-copy`),
|
|
200
|
+
style: {
|
|
201
|
+
background: `${theme === THEME_DARK ? `#2b303b` : token.colorBgLayout}`
|
|
202
|
+
},
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
205
|
+
import_icons.CopyOutlined,
|
|
206
|
+
{
|
|
207
|
+
className: (0, import_classnames.default)(`${prefixCls}-copy-icon`, { scoll: copied }),
|
|
208
|
+
style: { color: `${theme === THEME_DARK ? token.colorBgLayout : `#2b303b`}` }
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
212
|
+
import_icons.CheckOutlined,
|
|
213
|
+
{
|
|
214
|
+
className: (0, import_classnames.default)(`${prefixCls}-copy-icon`),
|
|
215
|
+
style: { color: "rgb(63,177,99)" }
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
]
|
|
216
219
|
}
|
|
217
220
|
)
|
|
218
|
-
|
|
219
|
-
));
|
|
221
|
+
}
|
|
222
|
+
) });
|
|
220
223
|
};
|
|
221
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
222
225
|
"pre",
|
|
223
226
|
{
|
|
224
227
|
...customProps,
|
|
@@ -226,29 +229,31 @@ var Highlight = (props) => {
|
|
|
226
229
|
...customStyle,
|
|
227
230
|
position: "relative"
|
|
228
231
|
},
|
|
229
|
-
className: (0, import_classnames.default)(`${prefixCls}`, className, themeClass)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
className: (0, import_classnames.default)(`${prefixCls}`, className, themeClass),
|
|
233
|
+
children: [
|
|
234
|
+
copyable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, {}),
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
236
|
+
"table",
|
|
237
|
+
{
|
|
238
|
+
style: {
|
|
239
|
+
height
|
|
240
|
+
},
|
|
241
|
+
className: (0, import_classnames.default)(
|
|
242
|
+
`${theme === THEME_DARK ? `${prefixCls}-dark` : `${prefixCls}-light`}`
|
|
243
|
+
),
|
|
244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: codeBlock })
|
|
245
|
+
}
|
|
240
246
|
)
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
));
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
) });
|
|
245
250
|
};
|
|
246
251
|
var HighlightWrapper = (props) => {
|
|
247
252
|
const { language, children } = props;
|
|
248
253
|
if (language === "json" && children && typeof children === "object" && !import_react.default.isValidElement(children)) {
|
|
249
|
-
return /* @__PURE__ */
|
|
254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_JsonView.default, { ...props, json: children });
|
|
250
255
|
}
|
|
251
|
-
return /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Highlight, { ...props });
|
|
252
257
|
};
|
|
253
258
|
HighlightWrapper.Diff = import_DiffView.default;
|
|
254
259
|
var Highlight_default = (0, import_LocaleWrapper.default)({
|
package/lib/IconFont/index.js
CHANGED
|
@@ -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/IconFont/index.tsx
|
|
@@ -32,10 +22,10 @@ __export(IconFont_exports, {
|
|
|
32
22
|
default: () => IconFont_default
|
|
33
23
|
});
|
|
34
24
|
module.exports = __toCommonJS(IconFont_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
25
|
var import_iconfont = require("./font/iconfont.css");
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
27
|
var IconFont = (props) => {
|
|
38
28
|
const { type, className, ...restProps } = props;
|
|
39
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: `iconfont ${type} ${className}`, ...restProps });
|
|
40
30
|
};
|
|
41
31
|
var IconFont_default = IconFont;
|
package/lib/LightFilter/index.js
CHANGED
|
@@ -32,14 +32,15 @@ __export(LightFilter_exports, {
|
|
|
32
32
|
default: () => LightFilter_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(LightFilter_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import_pro_components = require("@ant-design/pro-components");
|
|
37
37
|
var import_design = require("@oceanbase/design");
|
|
38
38
|
var import_style = __toESM(require("./style"));
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
40
|
function LightFilter({ prefixCls: customizePrefixCls, ...restProps }) {
|
|
40
41
|
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
41
42
|
const prefixCls = getPrefixCls("pro-form-light-filter", customizePrefixCls);
|
|
42
43
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
43
|
-
return wrapSSR(/* @__PURE__ */
|
|
44
|
+
return wrapSSR(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pro_components.LightFilter, { prefixCls: customizePrefixCls, ...restProps }));
|
|
44
45
|
}
|
|
45
46
|
var LightFilter_default = LightFilter;
|