@oceanbase/ui 0.4.20 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.js +121 -15
- package/es/Action/style/index.js +8 -4
- package/es/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/es/BasicLayout/locale/ja-JP.js +12 -0
- package/es/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/es/BatchOperationBar/locale/ja-JP.js +6 -0
- package/es/Boundary/locale/ja-JP.d.ts +11 -0
- package/es/Boundary/locale/ja-JP.js +10 -0
- package/es/DateRanger/locale/ja-JP.d.ts +56 -0
- package/es/DateRanger/locale/ja-JP.js +20 -0
- package/es/Dialog/locale/ja-JP.d.ts +5 -0
- package/es/Dialog/locale/ja-JP.js +4 -0
- package/es/DocDialog/locale/ja-JP.d.ts +2 -0
- package/es/DocDialog/locale/ja-JP.js +1 -0
- package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/es/FullscreenBox/locale/ja-JP.js +1 -0
- package/es/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/es/GraphToolbar/locale/ja-JP.js +8 -0
- package/es/Highlight/locale/ja-JP.d.ts +4 -0
- package/es/Highlight/locale/ja-JP.js +3 -0
- package/es/Login/locale/ja-JP.d.ts +28 -0
- package/es/Login/locale/ja-JP.js +27 -0
- package/es/PageContainer/locale/ja-JP.d.ts +4 -0
- package/es/PageContainer/locale/ja-JP.js +3 -0
- package/es/Password/locale/ja-JP.d.ts +13 -0
- package/es/Password/locale/ja-JP.js +12 -0
- package/es/Ranger/locale/ja-JP.d.ts +28 -0
- package/es/Ranger/locale/ja-JP.js +29 -0
- package/es/SideTip/locale/ja-JP.d.ts +2 -0
- package/es/SideTip/locale/ja-JP.js +1 -0
- package/es/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/es/TaskGraph/locale/ja-JP.js +12 -0
- package/es/Welcome/locale/ja-JP.d.ts +5 -0
- package/es/Welcome/locale/ja-JP.js +4 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +42 -0
- package/lib/Action/Group.js +122 -46
- package/lib/Action/Item.js +14 -9
- package/lib/Action/style/index.js +16 -1
- 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/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/lib/BasicLayout/locale/ja-JP.js +36 -0
- package/lib/BatchOperationBar/index.js +59 -44
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +30 -0
- 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/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +34 -0
- 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/DateRanger/locale/ja-JP.d.ts +56 -0
- package/lib/DateRanger/locale/ja-JP.js +49 -0
- package/lib/Dialog/Anchor.js +8 -5
- package/lib/Dialog/EventProxy.js +3 -12
- package/lib/Dialog/index.js +132 -108
- package/lib/Dialog/locale/ja-JP.d.ts +5 -0
- package/lib/Dialog/locale/ja-JP.js +28 -0
- package/lib/DocDialog/index.js +3 -2
- package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
- package/lib/DocDialog/locale/ja-JP.js +25 -0
- package/lib/FooterToolbar/index.js +3 -2
- package/lib/FullscreenBox/index.js +16 -7
- package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/lib/FullscreenBox/locale/ja-JP.js +25 -0
- package/lib/GraphToolbar/index.js +70 -58
- package/lib/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/lib/GraphToolbar/locale/ja-JP.js +32 -0
- 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/Highlight/locale/ja-JP.d.ts +4 -0
- package/lib/Highlight/locale/ja-JP.js +27 -0
- 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/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +51 -0
- package/lib/NavMenu/index.js +9 -8
- package/lib/PageContainer/ItemRender.js +5 -5
- package/lib/PageContainer/index.js +8 -4
- package/lib/PageContainer/locale/ja-JP.d.ts +4 -0
- package/lib/PageContainer/locale/ja-JP.js +27 -0
- package/lib/PageLoading/index.js +6 -16
- package/lib/Password/Content.js +38 -42
- package/lib/Password/index.js +83 -68
- package/lib/Password/locale/ja-JP.d.ts +13 -0
- package/lib/Password/locale/ja-JP.js +36 -0
- package/lib/ProCard/index.js +4 -3
- package/lib/ProTable/index.js +5 -4
- package/lib/Ranger/QuickPicker.js +24 -15
- package/lib/Ranger/Ranger.js +37 -34
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +53 -0
- package/lib/SideTip/Dragger.js +5 -4
- package/lib/SideTip/IconLoading.js +25 -25
- package/lib/SideTip/index.js +19 -10
- package/lib/SideTip/locale/ja-JP.d.ts +2 -0
- package/lib/SideTip/locale/ja-JP.js +25 -0
- 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/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/lib/TaskGraph/locale/ja-JP.js +36 -0
- package/lib/TreeSearch/index.js +30 -35
- package/lib/Welcome/index.js +64 -37
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +28 -0
- package/lib/Welcome/step.js +11 -4
- package/lib/locale/LocaleWrapper.js +15 -14
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +71 -0
- package/package.json +5 -5
|
@@ -40,6 +40,7 @@ var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
|
40
40
|
var import_util = require("../_util");
|
|
41
41
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
44
|
var prefix = (0, import_util.getPrefix)("fullscreen-box");
|
|
44
45
|
var FullscreenBox = import_react.default.forwardRef(
|
|
45
46
|
({ style, header, className, defaultMode, children, onChange }, ref) => {
|
|
@@ -90,7 +91,7 @@ var FullscreenBox = import_react.default.forwardRef(
|
|
|
90
91
|
changeFullscreen(fullscreen);
|
|
91
92
|
}
|
|
92
93
|
}));
|
|
93
|
-
const icon = innerFullscreen ? /* @__PURE__ */
|
|
94
|
+
const icon = innerFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.FullscreenExitOutlined, { className: `${prefix}-header-icon`, onClick: toggleFullscreen }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.FullscreenOutlined, { className: `${prefix}-header-icon`, onClick: toggleFullscreen });
|
|
94
95
|
if (innerFullscreen) {
|
|
95
96
|
document.body.classList.add(`${prefix}-body-overflow-hidden`);
|
|
96
97
|
} else {
|
|
@@ -106,19 +107,27 @@ var FullscreenBox = import_react.default.forwardRef(
|
|
|
106
107
|
} else {
|
|
107
108
|
const title = isStringHeader ? header : isComplexHeader && header.title;
|
|
108
109
|
const extra = isComplexHeader && header.extra;
|
|
109
|
-
headerContent = /* @__PURE__ */
|
|
110
|
+
headerContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-header`, "data-testid": "header", children: [
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${prefix}-header-left`, children: [
|
|
112
|
+
icon,
|
|
113
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefix}-header-title `, children: title })
|
|
114
|
+
] }),
|
|
115
|
+
isComplexHeader && extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefix}-header-extra`, children: extra })
|
|
116
|
+
] });
|
|
110
117
|
}
|
|
111
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
112
119
|
"div",
|
|
113
120
|
{
|
|
114
121
|
ref: containerRef,
|
|
115
122
|
style,
|
|
116
123
|
className: (0, import_classnames.default)(prefix, className, {
|
|
117
124
|
[`${prefix}-fullscreen`]: innerFullscreen
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
}),
|
|
126
|
+
children: [
|
|
127
|
+
headerContent,
|
|
128
|
+
children
|
|
129
|
+
]
|
|
130
|
+
}
|
|
122
131
|
);
|
|
123
132
|
}
|
|
124
133
|
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/FullscreenBox/locale/ja-JP.ts
|
|
20
|
+
var ja_JP_exports = {};
|
|
21
|
+
__export(ja_JP_exports, {
|
|
22
|
+
default: () => ja_JP_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ja_JP_exports);
|
|
25
|
+
var ja_JP_default = {};
|
|
@@ -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",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/GraphToolbar/locale/ja-JP.ts
|
|
20
|
+
var ja_JP_exports = {};
|
|
21
|
+
__export(ja_JP_exports, {
|
|
22
|
+
default: () => ja_JP_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ja_JP_exports);
|
|
25
|
+
var ja_JP_default = {
|
|
26
|
+
fullscreen: "フルスクリーン",
|
|
27
|
+
shrink: "縮小",
|
|
28
|
+
enlarge: "拡大",
|
|
29
|
+
reset: "元の比率を表示",
|
|
30
|
+
fitView: "キャンバスに合わせる",
|
|
31
|
+
refresh: "更新"
|
|
32
|
+
};
|
|
@@ -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
|
};
|