@oceanbase/ui 1.0.0-alpha.3 → 1.0.0-alpha.5
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/Group.js +121 -15
- package/es/Action/Item.d.ts +6 -15
- package/es/Action/Item.js +85 -128
- package/es/Action/index.d.ts +6 -3
- 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/BasicLayout/style/index.js +35 -23
- package/es/BatchOperationBar/index.d.ts +0 -1
- package/es/BatchOperationBar/index.js +17 -13
- package/es/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/es/BatchOperationBar/locale/ja-JP.js +6 -0
- package/es/BatchOperationBar/style/index.d.ts +10 -0
- package/es/BatchOperationBar/style/index.js +51 -0
- package/es/Boundary/Components/Code.js +11 -5
- package/es/Boundary/Components/Exception.js +85 -74
- package/es/Boundary/Components/Function.js +11 -5
- package/es/Boundary/index.d.ts +0 -1
- package/es/Boundary/index.js +0 -1
- package/es/Boundary/locale/ja-JP.d.ts +11 -0
- package/es/Boundary/locale/ja-JP.js +10 -0
- package/es/Boundary/style/index.d.ts +10 -0
- package/es/Boundary/style/index.js +46 -0
- package/es/ContentWithIcon/index.d.ts +0 -1
- package/es/ContentWithIcon/index.js +29 -29
- package/es/ContentWithIcon/style/index.d.ts +10 -0
- package/es/ContentWithIcon/style/index.js +26 -0
- package/es/DateRanger/PickerPanel.js +5 -4
- package/es/DateRanger/Ranger.d.ts +0 -1
- package/es/DateRanger/Ranger.js +13 -8
- package/es/DateRanger/locale/ja-JP.d.ts +56 -0
- package/es/DateRanger/locale/ja-JP.js +20 -0
- package/es/DateRanger/style/index.d.ts +10 -0
- package/es/DateRanger/style/index.js +126 -0
- package/es/Dialog/Anchor.d.ts +2 -10
- package/es/Dialog/Anchor.js +67 -96
- package/es/Dialog/index.d.ts +0 -1
- package/es/Dialog/index.js +537 -578
- package/es/Dialog/locale/ja-JP.d.ts +5 -0
- package/es/Dialog/locale/ja-JP.js +4 -0
- package/es/Dialog/style/index.d.ts +10 -0
- package/es/Dialog/style/index.js +97 -0
- package/es/DocDialog/locale/ja-JP.d.ts +2 -0
- package/es/DocDialog/locale/ja-JP.js +1 -0
- package/es/FooterToolbar/style/index.js +7 -1
- package/es/FullscreenBox/index.d.ts +0 -1
- package/es/FullscreenBox/index.js +46 -37
- package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/es/FullscreenBox/locale/ja-JP.js +1 -0
- package/es/FullscreenBox/style/index.d.ts +10 -0
- package/es/FullscreenBox/style/index.js +53 -0
- package/es/GraphToolbar/index.d.ts +0 -1
- package/es/GraphToolbar/index.js +19 -16
- package/es/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/es/GraphToolbar/locale/ja-JP.js +8 -0
- package/es/GraphToolbar/style/index.d.ts +10 -0
- package/es/GraphToolbar/style/index.js +60 -0
- package/es/Highlight/DiffView/index.d.ts +0 -1
- package/es/Highlight/DiffView/index.js +5 -5
- package/es/Highlight/JsonView.d.ts +0 -1
- package/es/Highlight/JsonView.js +5 -5
- package/es/Highlight/index.d.ts +0 -1
- package/es/Highlight/index.js +23 -23
- package/es/Highlight/locale/ja-JP.d.ts +4 -0
- package/es/Highlight/locale/ja-JP.js +3 -0
- package/es/Highlight/style/index.d.ts +10 -0
- package/es/Highlight/style/index.js +213 -0
- package/es/LocaleDropdown/index.js +4 -2
- package/es/Login/ActivateForm.d.ts +0 -1
- package/es/Login/ActivateForm.js +12 -9
- package/es/Login/LoginForm.d.ts +0 -1
- package/es/Login/LoginForm.js +20 -15
- package/es/Login/RegisterForm.d.ts +0 -1
- package/es/Login/RegisterForm.js +14 -11
- package/es/Login/index.d.ts +0 -1
- package/es/Login/index.js +24 -22
- package/es/Login/locale/ja-JP.d.ts +28 -0
- package/es/Login/locale/ja-JP.js +27 -0
- package/es/Login/style/index.d.ts +10 -0
- package/es/Login/style/index.js +182 -0
- package/es/NavMenu/index.d.ts +1 -2
- package/es/NavMenu/index.js +11 -8
- package/es/NavMenu/style/index.d.ts +10 -0
- package/es/NavMenu/style/index.js +47 -0
- package/es/PageContainer/locale/ja-JP.d.ts +4 -0
- package/es/PageContainer/locale/ja-JP.js +3 -0
- package/es/PageContainer/style/index.js +5 -5
- package/es/Password/locale/ja-JP.d.ts +13 -0
- package/es/Password/locale/ja-JP.js +12 -0
- package/es/Ranger/QuickPicker.js +8 -4
- package/es/Ranger/Ranger.d.ts +0 -1
- package/es/Ranger/Ranger.js +12 -9
- package/es/Ranger/locale/ja-JP.d.ts +28 -0
- package/es/Ranger/locale/ja-JP.js +29 -0
- package/es/Ranger/style/index.d.ts +10 -0
- package/es/Ranger/style/index.js +44 -0
- package/es/SideTip/index.d.ts +0 -1
- package/es/SideTip/index.js +24 -22
- package/es/SideTip/locale/ja-JP.d.ts +2 -0
- package/es/SideTip/locale/ja-JP.js +1 -0
- package/es/SideTip/style/index.d.ts +10 -0
- package/es/SideTip/style/index.js +162 -0
- package/es/TagSelect/Group.d.ts +6 -6
- package/es/TagSelect/Group.js +5 -3
- package/es/TagSelect/Item.js +5 -3
- package/es/TaskGraph/Graph/style/index.d.ts +10 -0
- package/es/TaskGraph/Graph/style/index.js +28 -0
- package/es/TaskGraph/Graph.d.ts +0 -1
- package/es/TaskGraph/Graph.js +26 -10
- package/es/TaskGraph/index.d.ts +0 -1
- package/es/TaskGraph/index.js +10 -7
- package/es/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/es/TaskGraph/locale/ja-JP.js +12 -0
- package/es/TaskGraph/style/index.d.ts +10 -0
- package/es/TaskGraph/style/index.js +102 -0
- package/es/Welcome/index.d.ts +0 -1
- package/es/Welcome/index.js +30 -26
- package/es/Welcome/locale/ja-JP.d.ts +5 -0
- package/es/Welcome/locale/ja-JP.js +4 -0
- package/es/Welcome/step/style/index.d.ts +10 -0
- package/es/Welcome/step/style/index.js +44 -0
- package/es/Welcome/step.d.ts +0 -1
- package/es/Welcome/step.js +17 -14
- package/es/Welcome/style/index.d.ts +10 -0
- package/es/Welcome/style/index.js +141 -0
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +42 -0
- package/lib/Action/Group.js +85 -20
- package/lib/Action/Item.d.ts +6 -15
- package/lib/Action/Item.js +66 -81
- package/lib/Action/index.d.ts +6 -3
- package/lib/Action/style/index.js +16 -1
- package/lib/BasicLayout/locale/ja-JP.d.ts +13 -0
- package/lib/BasicLayout/locale/ja-JP.js +36 -0
- package/lib/BasicLayout/style/index.js +32 -23
- package/lib/BatchOperationBar/index.d.ts +0 -1
- package/lib/BatchOperationBar/index.js +54 -50
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +30 -0
- package/lib/BatchOperationBar/style/index.d.ts +10 -0
- package/lib/BatchOperationBar/style/index.js +82 -0
- package/lib/Boundary/Components/Code.js +23 -17
- package/lib/Boundary/Components/Exception.js +40 -29
- package/lib/Boundary/Components/Function.js +18 -12
- package/lib/Boundary/index.d.ts +0 -1
- package/lib/Boundary/index.js +0 -1
- package/lib/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +34 -0
- package/lib/Boundary/style/index.d.ts +10 -0
- package/lib/Boundary/style/index.js +74 -0
- package/lib/ContentWithIcon/index.d.ts +0 -1
- package/lib/ContentWithIcon/index.js +35 -32
- package/lib/ContentWithIcon/style/index.d.ts +10 -0
- package/lib/ContentWithIcon/style/index.js +57 -0
- package/lib/DateRanger/PickerPanel.js +2 -2
- package/lib/DateRanger/Ranger.d.ts +0 -1
- package/lib/DateRanger/Ranger.js +353 -348
- package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
- package/lib/DateRanger/locale/ja-JP.js +49 -0
- package/lib/DateRanger/style/index.d.ts +10 -0
- package/lib/DateRanger/style/index.js +195 -0
- package/lib/Dialog/Anchor.d.ts +2 -10
- package/lib/Dialog/Anchor.js +58 -60
- package/lib/Dialog/index.d.ts +0 -1
- package/lib/Dialog/index.js +446 -422
- package/lib/Dialog/locale/ja-JP.d.ts +5 -0
- package/lib/Dialog/locale/ja-JP.js +28 -0
- package/lib/Dialog/style/index.d.ts +10 -0
- package/lib/Dialog/style/index.js +135 -0
- package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
- package/lib/DocDialog/locale/ja-JP.js +25 -0
- package/lib/FooterToolbar/style/index.js +7 -1
- package/lib/FullscreenBox/index.d.ts +0 -1
- package/lib/FullscreenBox/index.js +47 -38
- package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
- package/lib/FullscreenBox/locale/ja-JP.js +25 -0
- package/lib/FullscreenBox/style/index.d.ts +10 -0
- package/lib/FullscreenBox/style/index.js +86 -0
- package/lib/GraphToolbar/index.d.ts +0 -1
- package/lib/GraphToolbar/index.js +69 -66
- package/lib/GraphToolbar/locale/ja-JP.d.ts +9 -0
- package/lib/GraphToolbar/locale/ja-JP.js +32 -0
- package/lib/GraphToolbar/style/index.d.ts +10 -0
- package/lib/GraphToolbar/style/index.js +91 -0
- package/lib/Highlight/DiffView/index.d.ts +0 -1
- package/lib/Highlight/DiffView/index.js +3 -3
- package/lib/Highlight/JsonView.d.ts +0 -1
- package/lib/Highlight/JsonView.js +3 -3
- package/lib/Highlight/index.d.ts +0 -1
- package/lib/Highlight/index.js +32 -29
- package/lib/Highlight/locale/ja-JP.d.ts +4 -0
- package/lib/Highlight/locale/ja-JP.js +27 -0
- package/lib/Highlight/style/index.d.ts +10 -0
- package/lib/Highlight/style/index.js +293 -0
- package/lib/LocaleDropdown/index.js +2 -1
- package/lib/Login/ActivateForm.d.ts +0 -1
- package/lib/Login/ActivateForm.js +17 -9
- package/lib/Login/LoginForm.d.ts +0 -1
- package/lib/Login/LoginForm.js +25 -13
- package/lib/Login/RegisterForm.d.ts +0 -1
- package/lib/Login/RegisterForm.js +17 -9
- package/lib/Login/index.d.ts +0 -1
- package/lib/Login/index.js +96 -94
- package/lib/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +51 -0
- package/lib/Login/style/index.d.ts +10 -0
- package/lib/Login/style/index.js +267 -0
- package/lib/NavMenu/index.d.ts +1 -2
- package/lib/NavMenu/index.js +20 -17
- package/lib/NavMenu/style/index.d.ts +10 -0
- package/lib/NavMenu/style/index.js +78 -0
- package/lib/PageContainer/locale/ja-JP.d.ts +4 -0
- package/lib/PageContainer/locale/ja-JP.js +27 -0
- package/lib/PageContainer/style/index.js +5 -5
- package/lib/Password/locale/ja-JP.d.ts +13 -0
- package/lib/Password/locale/ja-JP.js +36 -0
- package/lib/Ranger/QuickPicker.js +4 -2
- package/lib/Ranger/Ranger.d.ts +0 -1
- package/lib/Ranger/Ranger.js +48 -45
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +53 -0
- package/lib/Ranger/style/index.d.ts +10 -0
- package/lib/Ranger/style/index.js +82 -0
- package/lib/SideTip/index.d.ts +0 -1
- package/lib/SideTip/index.js +46 -38
- package/lib/SideTip/locale/ja-JP.d.ts +2 -0
- package/lib/SideTip/locale/ja-JP.js +25 -0
- package/lib/SideTip/style/index.d.ts +10 -0
- package/lib/SideTip/style/index.js +211 -0
- package/lib/TagSelect/Group.d.ts +6 -6
- package/lib/TagSelect/Group.js +3 -2
- package/lib/TagSelect/Item.js +3 -2
- package/lib/TaskGraph/Graph/style/index.d.ts +10 -0
- package/lib/TaskGraph/Graph/style/index.js +56 -0
- package/lib/TaskGraph/Graph.d.ts +0 -1
- package/lib/TaskGraph/Graph.js +16 -7
- package/lib/TaskGraph/index.d.ts +0 -1
- package/lib/TaskGraph/index.js +6 -5
- package/lib/TaskGraph/locale/ja-JP.d.ts +13 -0
- package/lib/TaskGraph/locale/ja-JP.js +36 -0
- package/lib/TaskGraph/style/index.d.ts +10 -0
- package/lib/TaskGraph/style/index.js +143 -0
- package/lib/Welcome/index.d.ts +0 -1
- package/lib/Welcome/index.js +64 -59
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +28 -0
- package/lib/Welcome/step/style/index.d.ts +10 -0
- package/lib/Welcome/step/style/index.js +74 -0
- package/lib/Welcome/step.d.ts +0 -1
- package/lib/Welcome/step.js +17 -13
- package/lib/Welcome/style/index.d.ts +10 -0
- package/lib/Welcome/style/index.js +188 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +71 -0
- package/package.json +6 -9
- package/es/BatchOperationBar/index.less +0 -46
- package/es/BatchOperationBar/index.less.d.ts +0 -15
- package/es/Boundary/index.less +0 -36
- package/es/ContentWithIcon/index.less +0 -21
- package/es/DateRanger/index.less +0 -180
- package/es/Dialog/index.less +0 -116
- package/es/FullscreenBox/index.less +0 -49
- package/es/GraphToolbar/index.less +0 -65
- package/es/Highlight/index.less +0 -381
- package/es/Login/index.less +0 -268
- package/es/NavMenu/index.less +0 -50
- package/es/Ranger/index.less +0 -57
- package/es/SideTip/index.less +0 -180
- package/es/TaskGraph/graph.less +0 -23
- package/es/TaskGraph/index.less +0 -117
- package/es/Welcome/index.less +0 -185
- package/es/index.less +0 -1
- package/es/variable.less +0 -54
- package/lib/BatchOperationBar/index.less +0 -46
- package/lib/BatchOperationBar/index.less.d.ts +0 -15
- package/lib/Boundary/index.less +0 -36
- package/lib/ContentWithIcon/index.less +0 -21
- package/lib/DateRanger/index.less +0 -180
- package/lib/Dialog/index.less +0 -116
- package/lib/FullscreenBox/index.less +0 -49
- package/lib/GraphToolbar/index.less +0 -65
- package/lib/Highlight/index.less +0 -381
- package/lib/Login/index.less +0 -268
- package/lib/NavMenu/index.less +0 -50
- package/lib/Ranger/index.less +0 -57
- package/lib/SideTip/index.less +0 -180
- package/lib/TaskGraph/graph.less +0 -23
- package/lib/TaskGraph/index.less +0 -117
- package/lib/Welcome/index.less +0 -185
- package/lib/index.less +0 -1
- package/lib/variable.less +0 -54
package/lib/SideTip/index.js
CHANGED
|
@@ -37,18 +37,16 @@ var import_design = require("@oceanbase/design");
|
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
39
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
40
|
-
var
|
|
40
|
+
var import_style = __toESM(require("./style"));
|
|
41
41
|
var import_Dragger = __toESM(require("./Dragger"));
|
|
42
42
|
var import_IconLoading = __toESM(require("./IconLoading"));
|
|
43
43
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
44
|
-
var import_index = require("./index.less");
|
|
45
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
-
var STORE_SIDETIP_HIDE = "ob-sidetip-hide";
|
|
47
|
-
var getLocalStorageKey = (id) => {
|
|
48
|
-
return [`${STORE_SIDETIP_HIDE}`, id].join("-");
|
|
49
|
-
};
|
|
50
45
|
var SideTip = (props) => {
|
|
51
46
|
const buttonRef = (0, import_react.createRef)();
|
|
47
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
48
|
+
const prefixCls = getPrefixCls("sidetip");
|
|
49
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
52
50
|
const {
|
|
53
51
|
defaultHide,
|
|
54
52
|
onClick,
|
|
@@ -75,6 +73,12 @@ var SideTip = (props) => {
|
|
|
75
73
|
draggable = true,
|
|
76
74
|
getPopupContainer
|
|
77
75
|
} = props;
|
|
76
|
+
const getLocalStorageKey = (0, import_react.useCallback)(
|
|
77
|
+
(localId) => {
|
|
78
|
+
return [`${prefixCls}-hide`, localId].join("-");
|
|
79
|
+
},
|
|
80
|
+
[prefixCls]
|
|
81
|
+
);
|
|
78
82
|
const [hide, setHide] = (0, import_react.useState)(
|
|
79
83
|
hideable ? defaultHide === void 0 ? window.localStorage.getItem(getLocalStorageKey(id)) === "true" : !!defaultHide : false
|
|
80
84
|
);
|
|
@@ -85,7 +89,7 @@ var SideTip = (props) => {
|
|
|
85
89
|
} else {
|
|
86
90
|
window.localStorage.removeItem(getLocalStorageKey(id));
|
|
87
91
|
}
|
|
88
|
-
}, [hide]);
|
|
92
|
+
}, [hide, id, getLocalStorageKey]);
|
|
89
93
|
const hideSideTip = () => {
|
|
90
94
|
setHide(true);
|
|
91
95
|
};
|
|
@@ -122,10 +126,9 @@ var SideTip = (props) => {
|
|
|
122
126
|
return "small";
|
|
123
127
|
return "";
|
|
124
128
|
};
|
|
125
|
-
const prefix = (0, import_util.getPrefix)("sidetip");
|
|
126
129
|
const typeCls = getTypeCls(type);
|
|
127
130
|
const sizeCls = getSizeCls(size);
|
|
128
|
-
const buttonPrefix = `${
|
|
131
|
+
const buttonPrefix = `${prefixCls}-button`;
|
|
129
132
|
const iconClassName = (0, import_classnames.default)(
|
|
130
133
|
`${buttonPrefix}-icon`,
|
|
131
134
|
(open || visible) && `${buttonPrefix}-icon-open`,
|
|
@@ -133,7 +136,7 @@ var SideTip = (props) => {
|
|
|
133
136
|
typeCls && `${buttonPrefix}-icon-${typeCls}`,
|
|
134
137
|
sizeCls && `${buttonPrefix}-icon-${sizeCls}`
|
|
135
138
|
);
|
|
136
|
-
const iconDom = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: iconClassName, children: import_react.default.isValidElement(icon) ? icon : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: icon, alt: "icon", width: "100%", height: "100%" }) });
|
|
139
|
+
const iconDom = icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: iconClassName, children: import_react.default.isValidElement(icon) ? icon : typeof icon === "string" && icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: icon, alt: "icon", width: "100%", height: "100%" }) : null }) : null;
|
|
137
140
|
const closeClassName = (0, import_classnames.default)(`${buttonPrefix}-close`, {
|
|
138
141
|
[`${buttonPrefix}-close-show`]: open || visible,
|
|
139
142
|
[`${buttonPrefix}-close-${typeCls}`]: typeCls,
|
|
@@ -156,35 +159,40 @@ var SideTip = (props) => {
|
|
|
156
159
|
] })
|
|
157
160
|
] });
|
|
158
161
|
const BadgeButton = badge ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Badge, { offset: [-6, 6], ...badge, children: InnerButton }) : InnerButton;
|
|
159
|
-
const hideIconClassName = (0, import_classnames.default)(`${
|
|
160
|
-
[`${
|
|
162
|
+
const hideIconClassName = (0, import_classnames.default)(`${prefixCls}-hide`, {
|
|
163
|
+
[`${prefixCls}-hide-hovered`]: hovered
|
|
161
164
|
});
|
|
162
|
-
const hideIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "ui-mini-hide", onClick: hideSideTip, className: hideIconClassName, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
165
|
+
const hideIcon = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "ui-mini-hide", onClick: hideSideTip, className: hideIconClassName, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-hide-icon` }) });
|
|
166
|
+
const containerClassName = (0, import_classnames.default)(className, {
|
|
167
|
+
[`${prefixCls}-container-disabled`]: disabled
|
|
168
|
+
});
|
|
169
|
+
return wrapSSR(
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
171
|
+
import_Dragger.default,
|
|
172
|
+
{
|
|
173
|
+
id,
|
|
174
|
+
open: open || visible,
|
|
175
|
+
hide,
|
|
176
|
+
onClick: onButtonClick,
|
|
177
|
+
onOverlap: hideSideTip,
|
|
178
|
+
onMouseEnter: handleMouseEnter,
|
|
179
|
+
onMouseLeave: handleMouseLeave,
|
|
180
|
+
style,
|
|
181
|
+
position,
|
|
182
|
+
prefix: prefixCls,
|
|
183
|
+
onDragStart,
|
|
184
|
+
onDragEnd,
|
|
185
|
+
onDrag,
|
|
186
|
+
getPopupContainer,
|
|
187
|
+
className: containerClassName,
|
|
188
|
+
draggable,
|
|
189
|
+
children: [
|
|
190
|
+
tooltip && tooltip.title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Tooltip, { ...tooltip, getPopupContainer: () => buttonRef.current, children: BadgeButton }) : BadgeButton,
|
|
191
|
+
hideable && hideIcon,
|
|
192
|
+
children
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
)
|
|
188
196
|
);
|
|
189
197
|
};
|
|
190
198
|
var SideTip_default = (0, import_LocaleWrapper.default)({
|
|
@@ -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/SideTip/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 = {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
import type { OBToken } from '../../_util/genComponentStyleHook';
|
|
4
|
+
export type SideTipToken = OBToken;
|
|
5
|
+
export declare const genSideTipStyle: GenerateStyle<SideTipToken>;
|
|
6
|
+
declare const _default: (prefixCls: string) => {
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
8
|
+
hashId: string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,211 @@
|
|
|
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/SideTip/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genSideTipStyle: () => genSideTipStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
|
+
var genSideTipStyle = (token) => {
|
|
28
|
+
const { componentCls, boxShadowSecondary, colorTextQuaternary, colorTextSecondary } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}-container`]: {
|
|
31
|
+
position: "fixed",
|
|
32
|
+
zIndex: 0,
|
|
33
|
+
fontSize: 14,
|
|
34
|
+
cursor: "pointer",
|
|
35
|
+
insetInlineEnd: 24,
|
|
36
|
+
insetBlockEnd: 24,
|
|
37
|
+
[`&.${componentCls}-container-dragged`]: {
|
|
38
|
+
cursor: "grab"
|
|
39
|
+
},
|
|
40
|
+
[`&.${componentCls}-container-disabled`]: {
|
|
41
|
+
cursor: "not-allowed"
|
|
42
|
+
},
|
|
43
|
+
[`&.${componentCls}-container-hide`]: {
|
|
44
|
+
transition: "all 0.3s"
|
|
45
|
+
},
|
|
46
|
+
"@media screen and (max-width: 768px)": {
|
|
47
|
+
display: "none"
|
|
48
|
+
},
|
|
49
|
+
[`&.${componentCls}-container-hide-not-dragged:hover`]: {
|
|
50
|
+
insetInlineEnd: "0 !important"
|
|
51
|
+
},
|
|
52
|
+
[`${componentCls}-hide`]: {
|
|
53
|
+
position: "absolute",
|
|
54
|
+
zIndex: 0,
|
|
55
|
+
display: "flex",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
width: 20,
|
|
59
|
+
height: 20,
|
|
60
|
+
background: "rgba(0, 0, 0, 0.15)",
|
|
61
|
+
borderRadius: 20,
|
|
62
|
+
transform: "scale(0)",
|
|
63
|
+
cursor: "pointer",
|
|
64
|
+
opacity: 0,
|
|
65
|
+
transition: "all 0.18s ease-out 0.18s",
|
|
66
|
+
insetBlockStart: 0,
|
|
67
|
+
insetInlineEnd: -22,
|
|
68
|
+
"&:hover": {
|
|
69
|
+
background: "rgba(0, 0, 0, 0.35)"
|
|
70
|
+
},
|
|
71
|
+
[`${componentCls}-hide-icon`]: {
|
|
72
|
+
width: 6,
|
|
73
|
+
height: 2,
|
|
74
|
+
background: "#fff",
|
|
75
|
+
borderRadius: 4
|
|
76
|
+
},
|
|
77
|
+
[`&.${componentCls}-hide-hovered`]: {
|
|
78
|
+
transform: "scale(1)",
|
|
79
|
+
opacity: 1
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[`${componentCls}-button`]: {
|
|
83
|
+
position: "relative",
|
|
84
|
+
display: "flex",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
justifyContent: "center",
|
|
87
|
+
width: 56,
|
|
88
|
+
height: 56,
|
|
89
|
+
backgroundColor: "#fff",
|
|
90
|
+
borderRadius: "50%",
|
|
91
|
+
boxShadow: boxShadowSecondary,
|
|
92
|
+
cursor: "pointer",
|
|
93
|
+
transition: "background-color 0.2s ease 0.1s, opacity 0.2s ease 0s, transform 0.2s ease 0.1s",
|
|
94
|
+
userSelect: "none",
|
|
95
|
+
[`&${componentCls}-button-primary`]: {
|
|
96
|
+
backgroundColor: `${token.colorPrimary} !important`
|
|
97
|
+
},
|
|
98
|
+
[`&${componentCls}-button-small`]: {
|
|
99
|
+
width: 40,
|
|
100
|
+
height: 40
|
|
101
|
+
},
|
|
102
|
+
[`&${componentCls}-button-disabled`]: {
|
|
103
|
+
backgroundColor: `${colorTextQuaternary} !important`,
|
|
104
|
+
cursor: "not-allowed"
|
|
105
|
+
},
|
|
106
|
+
"&:hover": {
|
|
107
|
+
opacity: 1
|
|
108
|
+
},
|
|
109
|
+
[`${componentCls}-button-loading`]: {
|
|
110
|
+
position: "absolute",
|
|
111
|
+
width: 56,
|
|
112
|
+
height: 56,
|
|
113
|
+
color: token.colorPrimary,
|
|
114
|
+
fontSize: 56,
|
|
115
|
+
insetBlockStart: 0,
|
|
116
|
+
insetInlineEnd: 0,
|
|
117
|
+
[`&${componentCls}-button-loading-primary`]: {
|
|
118
|
+
color: "#fff"
|
|
119
|
+
},
|
|
120
|
+
[`&${componentCls}-button-loading-small`]: {
|
|
121
|
+
width: 40,
|
|
122
|
+
height: 40,
|
|
123
|
+
fontSize: 40,
|
|
124
|
+
lineHeight: 40
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
[`${componentCls}-button-close`]: {
|
|
128
|
+
position: "absolute",
|
|
129
|
+
width: 24,
|
|
130
|
+
height: 24,
|
|
131
|
+
color: colorTextSecondary,
|
|
132
|
+
fontSize: 24,
|
|
133
|
+
transform: "translate(-50%, -50%) scale(0.4) rotate(-45deg)",
|
|
134
|
+
opacity: 0,
|
|
135
|
+
transition: "all 0.3s linear",
|
|
136
|
+
userSelect: "none",
|
|
137
|
+
insetBlockStart: "50%",
|
|
138
|
+
insetInlineStart: "50%",
|
|
139
|
+
[`&.${componentCls}-button-close-primary`]: {
|
|
140
|
+
color: "#fff"
|
|
141
|
+
},
|
|
142
|
+
[`&.${componentCls}-button-close-show`]: {
|
|
143
|
+
transform: "translate(-50%, -50%)",
|
|
144
|
+
opacity: 1
|
|
145
|
+
},
|
|
146
|
+
[`&.${componentCls}-button-close-small`]: {
|
|
147
|
+
width: 16,
|
|
148
|
+
height: 16,
|
|
149
|
+
fontSize: 16,
|
|
150
|
+
lineHeight: 16
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
[`${componentCls}-button-icon`]: {
|
|
154
|
+
position: "absolute",
|
|
155
|
+
display: "flex",
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
width: 24,
|
|
159
|
+
height: 24,
|
|
160
|
+
color: colorTextSecondary,
|
|
161
|
+
fontSize: 24,
|
|
162
|
+
lineHeight: 24,
|
|
163
|
+
transform: "translate(-50%, -50%)",
|
|
164
|
+
opacity: 1,
|
|
165
|
+
transition: "all 0.3s linear",
|
|
166
|
+
userSelect: "none",
|
|
167
|
+
insetBlockStart: "50%",
|
|
168
|
+
insetInlineStart: "50%",
|
|
169
|
+
"> *": {
|
|
170
|
+
fontSize: "inherit",
|
|
171
|
+
color: "inherit"
|
|
172
|
+
},
|
|
173
|
+
img: {
|
|
174
|
+
width: "100%",
|
|
175
|
+
height: "100%",
|
|
176
|
+
objectFit: "contain"
|
|
177
|
+
},
|
|
178
|
+
[`&.${componentCls}-button-icon-open`]: {
|
|
179
|
+
transform: "translate(-50%, -50%) scale(0.4) rotate(45deg)",
|
|
180
|
+
opacity: 0
|
|
181
|
+
},
|
|
182
|
+
[`&.${componentCls}-button-icon-disabled`]: {
|
|
183
|
+
color: colorTextQuaternary
|
|
184
|
+
},
|
|
185
|
+
[`&${componentCls}-button-icon-primary`]: {
|
|
186
|
+
color: "#fff !important",
|
|
187
|
+
"> *": {
|
|
188
|
+
color: "#fff !important"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
[`&${componentCls}-button-icon-small`]: {
|
|
192
|
+
width: 16,
|
|
193
|
+
height: 16,
|
|
194
|
+
fontSize: 16,
|
|
195
|
+
lineHeight: 16
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
var style_default = (prefixCls) => {
|
|
203
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("SideTip", (token) => {
|
|
204
|
+
return [genSideTipStyle(token)];
|
|
205
|
+
});
|
|
206
|
+
return useStyle(prefixCls);
|
|
207
|
+
};
|
|
208
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
209
|
+
0 && (module.exports = {
|
|
210
|
+
genSideTipStyle
|
|
211
|
+
});
|
package/lib/TagSelect/Group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export type TagSelectValueType = string | number | readonly string[];
|
|
3
3
|
export interface TagSelectOptionType {
|
|
4
4
|
label: React.ReactNode;
|
|
@@ -9,15 +9,15 @@ export interface TagSelectOptionType {
|
|
|
9
9
|
}
|
|
10
10
|
export interface TagSelectGroupProps {
|
|
11
11
|
title?: string;
|
|
12
|
-
children?: ReactNode;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
className?: string;
|
|
15
15
|
multiple?: boolean;
|
|
16
|
-
defaultValue?: TagSelectValueType |
|
|
17
|
-
value?: TagSelectValueType |
|
|
16
|
+
defaultValue?: TagSelectValueType | TagSelectValueType[];
|
|
17
|
+
value?: TagSelectValueType | TagSelectValueType[];
|
|
18
18
|
size?: string;
|
|
19
|
-
options?:
|
|
20
|
-
onChange?: (value:
|
|
19
|
+
options?: (TagSelectOptionType | string | number)[];
|
|
20
|
+
onChange?: (value: TagSelectValueType[] | TagSelectValueType) => void;
|
|
21
21
|
}
|
|
22
22
|
declare const Group: React.FC<TagSelectGroupProps>;
|
|
23
23
|
export default Group;
|
package/lib/TagSelect/Group.js
CHANGED
|
@@ -33,7 +33,7 @@ __export(Group_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Group_exports);
|
|
35
35
|
var import_classnames = __toESM(require("classnames"));
|
|
36
|
-
var
|
|
36
|
+
var import_design = require("@oceanbase/design");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_TagSelectContext = __toESM(require("./TagSelectContext"));
|
|
39
39
|
var import_Item = __toESM(require("./Item"));
|
|
@@ -58,7 +58,8 @@ var Group = ({
|
|
|
58
58
|
className,
|
|
59
59
|
...restProps
|
|
60
60
|
}) => {
|
|
61
|
-
const
|
|
61
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
62
|
+
const prefix = getPrefixCls("tag-select");
|
|
62
63
|
const { wrapSSR, hashId } = (0, import_style.default)(prefix);
|
|
63
64
|
const [value, setValue] = (0, import_react.useState)(
|
|
64
65
|
toArray(defaultValue || restProps.value)
|
package/lib/TagSelect/Item.js
CHANGED
|
@@ -36,8 +36,8 @@ var import_rc_checkbox = __toESM(require("rc-checkbox"));
|
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_lodash = require("lodash");
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_design = require("@oceanbase/design");
|
|
39
40
|
var import_style = __toESM(require("./style"));
|
|
40
|
-
var import_util = require("../_util");
|
|
41
41
|
var import_TagSelectContext = __toESM(require("./TagSelectContext"));
|
|
42
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
43
|
var Item = ({
|
|
@@ -49,7 +49,8 @@ var Item = ({
|
|
|
49
49
|
}) => {
|
|
50
50
|
const [checked, setChecked] = (0, import_react.useState)(restProps.defaultChecked);
|
|
51
51
|
const coverType = typeof cover;
|
|
52
|
-
const
|
|
52
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
53
|
+
const prefixCls = getPrefixCls("tag-select");
|
|
53
54
|
const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
|
|
54
55
|
const tagSelectGroup = import_react.default.useContext(import_TagSelectContext.default);
|
|
55
56
|
const wrapperClassName = (0, import_classnames.default)(
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { GenerateStyle } from '@oceanbase/design/es/theme';
|
|
3
|
+
import type { OBToken } from '../../../_util/genComponentStyleHook';
|
|
4
|
+
export type TaskGraphItemToken = OBToken;
|
|
5
|
+
export declare const genTaskGraphItemStyle: GenerateStyle<TaskGraphItemToken>;
|
|
6
|
+
declare const _default: (prefixCls: string) => {
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
|
|
8
|
+
hashId: string;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
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/TaskGraph/Graph/style/index.ts
|
|
20
|
+
var style_exports = {};
|
|
21
|
+
__export(style_exports, {
|
|
22
|
+
default: () => style_default,
|
|
23
|
+
genTaskGraphItemStyle: () => genTaskGraphItemStyle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_genComponentStyleHook = require("../../../_util/genComponentStyleHook");
|
|
27
|
+
var genTaskGraphItemStyle = (token) => {
|
|
28
|
+
const { componentCls, antCls, colorTextTertiary } = token;
|
|
29
|
+
return {
|
|
30
|
+
[`${componentCls}-menu`]: {
|
|
31
|
+
position: "fixed",
|
|
32
|
+
[`${componentCls}-task-id-wrapper`]: {
|
|
33
|
+
padding: "5px 12px",
|
|
34
|
+
[`${antCls}-typography`]: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "space-between",
|
|
38
|
+
color: colorTextTertiary,
|
|
39
|
+
[`${antCls}-typography-copy`]: {
|
|
40
|
+
color: colorTextTertiary
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
var style_default = (prefixCls) => {
|
|
48
|
+
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("TaskGraphItem", (token) => {
|
|
49
|
+
return [genTaskGraphItemStyle(token)];
|
|
50
|
+
});
|
|
51
|
+
return useStyle(prefixCls);
|
|
52
|
+
};
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
genTaskGraphItemStyle
|
|
56
|
+
});
|
package/lib/TaskGraph/Graph.d.ts
CHANGED
package/lib/TaskGraph/Graph.js
CHANGED
|
@@ -39,12 +39,17 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_design2 = require("@oceanbase/design");
|
|
40
40
|
var import_GraphToolbar = __toESM(require("../GraphToolbar"));
|
|
41
41
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
42
|
-
var
|
|
42
|
+
var import_style = __toESM(require("./Graph/style"));
|
|
43
43
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
44
|
-
var import_graph = require("./graph.less");
|
|
45
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
45
|
var { Text } = import_design.Typography;
|
|
47
|
-
var
|
|
46
|
+
var GraphWrapper = ({
|
|
47
|
+
prefixCls,
|
|
48
|
+
children
|
|
49
|
+
}) => {
|
|
50
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
51
|
+
return wrapSSR(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }));
|
|
52
|
+
};
|
|
48
53
|
var TaskGraph = class extends import_react.default.PureComponent {
|
|
49
54
|
constructor(props) {
|
|
50
55
|
super(props);
|
|
@@ -198,6 +203,8 @@ var TaskGraph = class extends import_react.default.PureComponent {
|
|
|
198
203
|
render() {
|
|
199
204
|
const { locale } = this.props;
|
|
200
205
|
const { statusList, currentSubTask } = this.state;
|
|
206
|
+
const { getPrefixCls } = this.context || {};
|
|
207
|
+
const prefixCls = getPrefixCls == null ? void 0 : getPrefixCls("task-graph-item");
|
|
201
208
|
const operations = (0, import_util.findByValue)(statusList, currentSubTask && currentSubTask.status).operations || [];
|
|
202
209
|
const menus = [
|
|
203
210
|
{
|
|
@@ -230,13 +237,14 @@ var TaskGraph = class extends import_react.default.PureComponent {
|
|
|
230
237
|
(item) => item.value === "taskId" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
231
238
|
"div",
|
|
232
239
|
{
|
|
233
|
-
className: `${
|
|
240
|
+
className: `${prefixCls}-task-id-wrapper`,
|
|
234
241
|
style: filterMenus.length > 1 ? { borderBottom: "1px solid #e8e8e8" } : {},
|
|
235
242
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { copyable: true, children: `ID: ${currentSubTask && currentSubTask.id}` })
|
|
236
|
-
}
|
|
243
|
+
},
|
|
244
|
+
"task-id"
|
|
237
245
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design.Menu.Item, { children: item.label }, item.value)
|
|
238
246
|
) });
|
|
239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(GraphWrapper, { prefixCls, children: [
|
|
240
248
|
this.graph && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_GraphToolbar.default, { mode: "fixed", graph: this.graph }),
|
|
241
249
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
242
250
|
"div",
|
|
@@ -253,13 +261,14 @@ var TaskGraph = class extends import_react.default.PureComponent {
|
|
|
253
261
|
visible: true,
|
|
254
262
|
open: true,
|
|
255
263
|
overlay: menu,
|
|
256
|
-
overlayClassName: `${
|
|
264
|
+
overlayClassName: `${prefixCls}-menu`,
|
|
257
265
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {})
|
|
258
266
|
}
|
|
259
267
|
)
|
|
260
268
|
] });
|
|
261
269
|
}
|
|
262
270
|
};
|
|
271
|
+
TaskGraph.contextType = import_design.ConfigProvider.ConfigContext;
|
|
263
272
|
var Graph_default = (0, import_LocaleWrapper.default)({
|
|
264
273
|
componentName: "TaskGraph",
|
|
265
274
|
defaultLocale: import_zh_CN.default
|
package/lib/TaskGraph/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { GraphData } from '@antv/g6/lib/types';
|
|
2
2
|
import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
|
|
3
3
|
import type { TaskGraphLocale } from './Graph';
|
|
4
|
-
import './index.less';
|
|
5
4
|
export interface TaskGraphProps extends LocaleWrapperProps {
|
|
6
5
|
data: GraphData;
|
|
7
6
|
logLoading?: boolean;
|
package/lib/TaskGraph/index.js
CHANGED
|
@@ -38,15 +38,13 @@ var import_lodash = require("lodash");
|
|
|
38
38
|
var import_react = require("react");
|
|
39
39
|
var import_react_split_pane = __toESM(require("react-split-pane"));
|
|
40
40
|
var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
|
|
41
|
-
var
|
|
41
|
+
var import_style = __toESM(require("./style"));
|
|
42
42
|
var import_Graph = __toESM(require("./Graph"));
|
|
43
|
-
var import_index = require("./index.less");
|
|
44
43
|
var import_zh_CN = __toESM(require("./locale/zh-CN"));
|
|
45
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
45
|
var { TabPane } = import_design.Tabs;
|
|
47
46
|
var MIN_SIZE = 56;
|
|
48
47
|
var DEFAULT_SIZE = 240;
|
|
49
|
-
var prefix = (0, import_util.getPrefix)("task-graph");
|
|
50
48
|
var TaskGraph = ({
|
|
51
49
|
logLoading = false,
|
|
52
50
|
subTaskLog,
|
|
@@ -54,6 +52,9 @@ var TaskGraph = ({
|
|
|
54
52
|
onTabsEdit = import_lodash.noop,
|
|
55
53
|
...restProps
|
|
56
54
|
}) => {
|
|
55
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
|
|
56
|
+
const prefixCls = getPrefixCls("task-graph");
|
|
57
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
57
58
|
const [size, setSize] = (0, import_react.useState)(DEFAULT_SIZE);
|
|
58
59
|
const [activeKey, setActiveKey] = (0, import_react.useState)(void 0);
|
|
59
60
|
const [panes, setPanes] = (0, import_react.useState)([]);
|
|
@@ -101,7 +102,7 @@ var TaskGraph = ({
|
|
|
101
102
|
setCollapsed(false);
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
|
-
className: `${
|
|
105
|
+
className: `${prefixCls}-split-pane`,
|
|
105
106
|
children: [
|
|
106
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
108
|
import_Graph.default,
|
|
@@ -120,7 +121,7 @@ var TaskGraph = ({
|
|
|
120
121
|
...restProps
|
|
121
122
|
}
|
|
122
123
|
) }),
|
|
123
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-tabs-wrapper`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
125
|
import_design.Tabs,
|
|
125
126
|
{
|
|
126
127
|
type: "editable-card",
|