@oceanbase/ui 0.2.19 → 0.2.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.d.ts +1 -1
- package/es/Action/Group.js +50 -41
- package/es/Action/Item.d.ts +2 -2
- package/es/Action/Item.js +32 -26
- package/es/Action/index.d.ts +1 -2
- package/es/BackgroundTaskManager/RefreshMan.js +8 -3
- package/es/BackgroundTaskManager/index.js +8 -4
- package/es/BasicLayout/Header.js +193 -140
- package/es/BasicLayout/index.js +149 -108
- package/es/BatchOperationBar/index.js +46 -29
- package/es/Boundary/Components/Code.js +17 -10
- package/es/Boundary/Components/Exception.js +46 -31
- package/es/Boundary/Components/Function.js +17 -10
- package/es/ContentWithIcon/index.js +42 -26
- package/es/ContentWithIcon/index.less +0 -1
- package/es/Dialog/Anchor.d.ts +1 -1
- package/es/Dialog/Anchor.js +9 -6
- package/es/Dialog/EventProxy.d.ts +1 -1
- package/es/Dialog/EventProxy.js +3 -2
- package/es/Dialog/index.js +129 -108
- package/es/Dialog/index.less +3 -1
- package/es/DocDialog/index.d.ts +1 -1
- package/es/DocDialog/index.js +8 -3
- package/es/FullscreenBox/index.d.ts +1 -1
- package/es/FullscreenBox/index.js +22 -16
- package/es/GraphToolbar/index.js +79 -65
- package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
- package/es/Highlight/DiffView/DiffCells.js +22 -15
- package/es/Highlight/DiffView/index.js +49 -40
- package/es/Highlight/HighlightCell.d.ts +1 -1
- package/es/Highlight/HighlightCell.js +19 -13
- package/es/Highlight/JsonView.d.ts +1 -2
- package/es/Highlight/JsonView.js +15 -13
- package/es/Highlight/index.d.ts +1 -1
- package/es/Highlight/index.js +66 -54
- package/es/IconFont/index.d.ts +1 -1
- package/es/IconFont/index.js +9 -3
- package/es/LocaleDropdown/index.js +38 -26
- package/es/Login/ActivateForm.js +63 -50
- package/es/Login/LoginForm.js +115 -99
- package/es/Login/RegisterForm.js +78 -67
- package/es/Login/index.js +122 -91
- package/es/Lottie/index.js +2 -1
- package/es/NavMenu/index.d.ts +2 -2
- package/es/NavMenu/index.js +34 -29
- package/es/PageContainer/ItemRender.d.ts +1 -2
- package/es/PageContainer/ItemRender.js +7 -3
- package/es/PageContainer/index.js +13 -10
- package/es/Password/Content.js +55 -47
- package/es/Password/index.js +62 -45
- package/es/Ranger/QuickPicker.d.ts +1 -2
- package/es/Ranger/QuickPicker.js +42 -31
- package/es/Ranger/Ranger.js +31 -27
- package/es/SideTip/Dragger.d.ts +1 -1
- package/es/SideTip/Dragger.js +5 -3
- package/es/SideTip/IconLoading.d.ts +1 -2
- package/es/SideTip/IconLoading.js +28 -20
- package/es/SideTip/index.js +43 -30
- package/es/SideTip/index.less +4 -1
- package/es/TagSelect/Group.d.ts +1 -1
- package/es/TagSelect/Group.js +16 -11
- package/es/TagSelect/Item.d.ts +1 -1
- package/es/TagSelect/Item.js +30 -23
- package/es/TagSelect/style/index.d.ts +1 -1
- package/es/TaskGraph/Graph.js +39 -31
- package/es/TaskGraph/index.js +68 -57
- package/es/TreeSearch/index.js +36 -32
- package/es/Welcome/index.js +113 -83
- package/es/Welcome/step.js +31 -23
- package/es/locale/LocaleWrapper.js +3 -3
- package/lib/Action/Group.d.ts +1 -1
- package/lib/Action/Item.d.ts +2 -2
- package/lib/Action/index.d.ts +1 -2
- package/lib/ContentWithIcon/index.less +0 -1
- package/lib/Dialog/Anchor.d.ts +1 -1
- package/lib/Dialog/EventProxy.d.ts +1 -1
- package/lib/Dialog/EventProxy.js +12 -2
- package/lib/Dialog/index.less +3 -1
- package/lib/DocDialog/index.d.ts +1 -1
- package/lib/FullscreenBox/index.d.ts +1 -1
- package/lib/FullscreenBox/index.js +76 -74
- package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
- package/lib/Highlight/DiffView/index.js +1 -1
- package/lib/Highlight/HighlightCell.d.ts +1 -1
- package/lib/Highlight/JsonView.d.ts +1 -2
- package/lib/Highlight/JsonView.js +3 -3
- package/lib/Highlight/index.d.ts +1 -1
- package/lib/IconFont/index.d.ts +1 -1
- package/lib/NavMenu/index.d.ts +2 -2
- package/lib/PageContainer/ItemRender.d.ts +1 -2
- package/lib/Ranger/QuickPicker.d.ts +1 -2
- package/lib/SideTip/Dragger.d.ts +1 -1
- package/lib/SideTip/IconLoading.d.ts +1 -2
- package/lib/SideTip/index.less +4 -1
- package/lib/TagSelect/Group.d.ts +1 -1
- package/lib/TagSelect/Group.js +4 -6
- package/lib/TagSelect/Item.d.ts +1 -1
- package/lib/TagSelect/style/index.d.ts +1 -1
- package/package.json +10 -9
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
7
|
import React from 'react';
|
|
3
8
|
import Icon from '@oceanbase/icons';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
10
|
var LoadingSvg = function LoadingSvg() {
|
|
5
|
-
return /*#__PURE__*/
|
|
11
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
6
12
|
version: "1.1",
|
|
7
13
|
id: "dc-spinner",
|
|
8
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12,26 +18,28 @@ var LoadingSvg = function LoadingSvg() {
|
|
|
12
18
|
height: "1em",
|
|
13
19
|
stroke: "currentColor",
|
|
14
20
|
viewBox: "3 3 34 34",
|
|
15
|
-
preserveAspectRatio: "xMinYMin meet"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
preserveAspectRatio: "xMinYMin meet",
|
|
22
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
23
|
+
strokeWidth: "1",
|
|
24
|
+
strokeMiterlimit: "10",
|
|
25
|
+
d: "M5.203,20 c0-8.159,6.638-14.797,14.797-14.797V5C11.729,5,5,11.729,5,20s6.729,15,15,15v-0.203C11.841,34.797,5.203,28.159,5.203,20z",
|
|
26
|
+
transform: "rotate(278.217 20 20)",
|
|
27
|
+
children: /*#__PURE__*/_jsx("animateTransform", {
|
|
28
|
+
attributeName: "transform",
|
|
29
|
+
type: "rotate",
|
|
30
|
+
from: "0 20 20",
|
|
31
|
+
to: "360 20 20",
|
|
32
|
+
calcMode: "spline",
|
|
33
|
+
keySplines: "0.2, 0.2, 0.2, 0.2",
|
|
34
|
+
keyTimes: "0;1",
|
|
35
|
+
dur: "1.2s",
|
|
36
|
+
repeatCount: "indefinite"
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
});
|
|
32
40
|
};
|
|
33
41
|
var iconLoading = function iconLoading(props) {
|
|
34
|
-
return /*#__PURE__*/
|
|
42
|
+
return /*#__PURE__*/_jsx(Icon, _objectSpread({
|
|
35
43
|
component: LoadingSvg
|
|
36
44
|
}, props));
|
|
37
45
|
};
|
package/es/SideTip/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -20,6 +21,9 @@ import IconLoading from "./IconLoading";
|
|
|
20
21
|
import zhCN from "./locale/zh-CN";
|
|
21
22
|
// @ts-ignore
|
|
22
23
|
import "./index.less";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
27
|
var STORE_SIDETIP_HIDE = 'ob-sidetip-hide';
|
|
24
28
|
var getLocalStorageKey = function getLocalStorageKey(id) {
|
|
25
29
|
return ["".concat(STORE_SIDETIP_HIDE), id].join('-');
|
|
@@ -110,14 +114,15 @@ var SideTip = function SideTip(props) {
|
|
|
110
114
|
// icon
|
|
111
115
|
var iconClassName = classnames("".concat(buttonPrefix, "-icon"), (open || visible) && "".concat(buttonPrefix, "-icon-open"), disabled && "".concat(buttonPrefix, "-icon-disabled"), typeCls && "".concat(buttonPrefix, "-icon-").concat(typeCls), sizeCls && "".concat(buttonPrefix, "-icon-").concat(sizeCls));
|
|
112
116
|
// 接受三种形式的icon
|
|
113
|
-
var iconDom = /*#__PURE__*/
|
|
114
|
-
className: iconClassName
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
var iconDom = /*#__PURE__*/_jsx("span", {
|
|
118
|
+
className: iconClassName,
|
|
119
|
+
children: /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/_jsx("img", {
|
|
120
|
+
src: icon,
|
|
121
|
+
alt: "icon",
|
|
122
|
+
width: "100%",
|
|
123
|
+
height: "100%"
|
|
124
|
+
})
|
|
125
|
+
});
|
|
121
126
|
|
|
122
127
|
// close 按钮
|
|
123
128
|
var closeClassName = classnames("".concat(buttonPrefix, "-close"), (_classnames = {}, _defineProperty(_classnames, "".concat(buttonPrefix, "-close-show"), open || visible), _defineProperty(_classnames, "".concat(buttonPrefix, "-close-").concat(typeCls), typeCls), _defineProperty(_classnames, "".concat(buttonPrefix, "-close-").concat(sizeCls), sizeCls), _classnames));
|
|
@@ -125,31 +130,37 @@ var SideTip = function SideTip(props) {
|
|
|
125
130
|
var loadingClassName = classnames("".concat(buttonPrefix, "-loading"), (_classnames3 = {}, _defineProperty(_classnames3, "".concat(buttonPrefix, "-loading-").concat(typeCls), typeCls), _defineProperty(_classnames3, "".concat(buttonPrefix, "-loading-").concat(sizeCls), sizeCls), _classnames3));
|
|
126
131
|
|
|
127
132
|
// 内部 Icon
|
|
128
|
-
var InnerButton = /*#__PURE__*/
|
|
133
|
+
var InnerButton = /*#__PURE__*/_jsxs("div", {
|
|
129
134
|
className: buttonClassName,
|
|
130
135
|
ref: buttonRef,
|
|
131
|
-
style: buttonStyle
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
style: buttonStyle,
|
|
137
|
+
children: [loading && /*#__PURE__*/_jsx(IconLoading, {
|
|
138
|
+
className: loadingClassName
|
|
139
|
+
}), /*#__PURE__*/_jsxs(_Fragment, {
|
|
140
|
+
children: [iconDom, /*#__PURE__*/_jsx(CloseOutlined, {
|
|
141
|
+
className: closeClassName
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
137
145
|
|
|
138
146
|
// 徽标
|
|
139
|
-
var BadgeButton = badge ? /*#__PURE__*/
|
|
147
|
+
var BadgeButton = badge ? /*#__PURE__*/_jsx(Badge, _objectSpread(_objectSpread({
|
|
140
148
|
offset: [-6, 6]
|
|
141
|
-
}, badge),
|
|
149
|
+
}, badge), {}, {
|
|
150
|
+
children: InnerButton
|
|
151
|
+
})) : InnerButton;
|
|
142
152
|
var hideIconClassName = classnames("".concat(prefix, "-hide"), _defineProperty({}, "".concat(prefix, "-hide-hovered"), hovered));
|
|
143
153
|
|
|
144
154
|
// 隐藏按钮
|
|
145
|
-
var hideIcon = /*#__PURE__*/
|
|
155
|
+
var hideIcon = /*#__PURE__*/_jsx("div", {
|
|
146
156
|
id: "ui-mini-hide",
|
|
147
157
|
onClick: hideSideTip,
|
|
148
|
-
className: hideIconClassName
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
158
|
+
className: hideIconClassName,
|
|
159
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
160
|
+
className: "".concat(prefix, "-hide-icon")
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
return /*#__PURE__*/_jsxs(Dragger, {
|
|
153
164
|
id: id,
|
|
154
165
|
open: open || visible,
|
|
155
166
|
hide: hide,
|
|
@@ -164,12 +175,14 @@ var SideTip = function SideTip(props) {
|
|
|
164
175
|
onDragEnd: onDragEnd,
|
|
165
176
|
onDrag: onDrag,
|
|
166
177
|
getPopupContainer: getPopupContainer,
|
|
167
|
-
className: className
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
className: className,
|
|
179
|
+
children: [tooltip && tooltip.title ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip), {}, {
|
|
180
|
+
getPopupContainer: function getPopupContainer() {
|
|
181
|
+
return buttonRef.current;
|
|
182
|
+
},
|
|
183
|
+
children: BadgeButton
|
|
184
|
+
})) : BadgeButton, hideable && hideIcon, children]
|
|
185
|
+
});
|
|
173
186
|
};
|
|
174
187
|
export default LocaleWrapper({
|
|
175
188
|
componentName: 'SideTip',
|
package/es/SideTip/index.less
CHANGED
|
@@ -71,7 +71,10 @@
|
|
|
71
71
|
border-radius: 50%;
|
|
72
72
|
box-shadow: @boxShadowSecondary;
|
|
73
73
|
cursor: pointer;
|
|
74
|
-
transition:
|
|
74
|
+
transition:
|
|
75
|
+
background-color 0.2s ease 0.1s,
|
|
76
|
+
opacity 0.2s ease 0s,
|
|
77
|
+
transform 0.2s ease 0.1s;
|
|
75
78
|
user-select: none;
|
|
76
79
|
|
|
77
80
|
&.@{prefix}-button-primary {
|
package/es/TagSelect/Group.d.ts
CHANGED
package/es/TagSelect/Group.js
CHANGED
|
@@ -17,6 +17,8 @@ import React, { useMemo, useState, useEffect } from 'react';
|
|
|
17
17
|
import TagSelectContext from "./TagSelectContext";
|
|
18
18
|
import Item from "./Item";
|
|
19
19
|
import useStyle from "./style";
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
22
|
function toArray(value) {
|
|
21
23
|
var res = value;
|
|
22
24
|
if (value === undefined) {
|
|
@@ -100,22 +102,25 @@ var Group = function Group(_ref) {
|
|
|
100
102
|
});
|
|
101
103
|
}, [options]);
|
|
102
104
|
var childrenNode = options.length ? memoOptions.map(function (option) {
|
|
103
|
-
return /*#__PURE__*/
|
|
104
|
-
key: option.value.toString(),
|
|
105
|
+
return /*#__PURE__*/_jsx(Item, {
|
|
105
106
|
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
|
|
106
107
|
value: option.value,
|
|
107
108
|
onChange: option.onChange,
|
|
108
109
|
style: option.style,
|
|
109
|
-
checked: value === null || value === void 0 ? void 0 : value.includes(option.value)
|
|
110
|
-
|
|
110
|
+
checked: value === null || value === void 0 ? void 0 : value.includes(option.value),
|
|
111
|
+
children: option.label
|
|
112
|
+
}, option.value.toString());
|
|
111
113
|
}) : children;
|
|
112
114
|
var groupCls = classNames("".concat(prefix, "-container"), hashId, className);
|
|
113
|
-
return wrapSSR( /*#__PURE__*/
|
|
114
|
-
value: contextValue
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
return wrapSSR( /*#__PURE__*/_jsx(TagSelectContext.Provider, {
|
|
116
|
+
value: contextValue,
|
|
117
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
118
|
+
className: groupCls,
|
|
119
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
120
|
+
className: "".concat(prefix, "-title"),
|
|
121
|
+
children: title
|
|
122
|
+
}), childrenNode]
|
|
123
|
+
})
|
|
124
|
+
}));
|
|
120
125
|
};
|
|
121
126
|
export default Group;
|
package/es/TagSelect/Item.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { TagSelectValueType } from './Group';
|
|
|
3
3
|
export interface TagSelectItemProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
cover?: React.ReactNode;
|
|
6
|
-
value?:
|
|
6
|
+
value?: TagSelectValueType;
|
|
7
7
|
defaultChecked?: boolean;
|
|
8
8
|
checked?: boolean;
|
|
9
9
|
title?: string;
|
package/es/TagSelect/Item.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var _excluded = ["children", "handleChange", "onChange", "cover"];
|
|
2
|
-
function
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -19,6 +20,8 @@ import React, { useEffect, useState } from 'react';
|
|
|
19
20
|
import useStyle from "./style";
|
|
20
21
|
import { getPrefix } from "../_util";
|
|
21
22
|
import TagSelectContext from "./TagSelectContext";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
25
|
var Item = function Item(_ref) {
|
|
23
26
|
var _classNames;
|
|
24
27
|
var children = _ref.children,
|
|
@@ -55,30 +58,34 @@ var Item = function Item(_ref) {
|
|
|
55
58
|
}
|
|
56
59
|
}, [tagSelectGroup.value, restProps.value]);
|
|
57
60
|
var renderCover = function renderCover() {
|
|
58
|
-
return coverType === 'string' ? /*#__PURE__*/
|
|
59
|
-
className: "".concat(prefixCls, "-cover")
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
return coverType === 'string' ? /*#__PURE__*/_jsx("div", {
|
|
62
|
+
className: "".concat(prefixCls, "-cover"),
|
|
63
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
64
|
+
src: cover,
|
|
65
|
+
alt: "tagselect"
|
|
66
|
+
})
|
|
67
|
+
}) : cover;
|
|
64
68
|
};
|
|
65
|
-
return wrapSSR( /*#__PURE__*/
|
|
69
|
+
return wrapSSR( /*#__PURE__*/_jsxs("label", {
|
|
66
70
|
className: wrapperClassName,
|
|
67
|
-
style: restProps.style
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
style: restProps.style,
|
|
72
|
+
children: [/*#__PURE__*/_jsx(RcCheckBox, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
73
|
+
checked: checked,
|
|
74
|
+
prefixCls: prefixCls,
|
|
75
|
+
onChange: function onChange(e) {
|
|
76
|
+
if (!('checked' in restProps) && !Object.keys(tagSelectGroup).length) {
|
|
77
|
+
setChecked(e.target.checked);
|
|
78
|
+
}
|
|
79
|
+
if (_onChange) {
|
|
80
|
+
_onChange(e);
|
|
81
|
+
}
|
|
82
|
+
if (tagSelectGroup.handleValueChange) {
|
|
83
|
+
tagSelectGroup.handleValueChange(e.target.value);
|
|
84
|
+
}
|
|
74
85
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
tagSelectGroup.handleValueChange(e.target.value);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
})), cover ? renderCover() : /*#__PURE__*/React.createElement("span", null, children)));
|
|
86
|
+
})), cover ? renderCover() : /*#__PURE__*/_jsx("span", {
|
|
87
|
+
children: children
|
|
88
|
+
})]
|
|
89
|
+
}));
|
|
83
90
|
};
|
|
84
91
|
export default Item;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from 'antd/
|
|
2
|
+
import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
|
|
3
3
|
export type TagSelectToken = FullToken<any>;
|
|
4
4
|
export declare const genTagSelectStyle: GenerateStyle<TagSelectToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
package/es/TaskGraph/Graph.js
CHANGED
|
@@ -24,6 +24,8 @@ import { getPrefix } from "../_util";
|
|
|
24
24
|
import zhCN from "./locale/zh-CN";
|
|
25
25
|
import register from "./register";
|
|
26
26
|
import "./graph.less";
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
29
|
var Text = Typography.Text;
|
|
28
30
|
var prefix = getPrefix('task-graph-item');
|
|
29
31
|
var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -214,42 +216,48 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
214
216
|
var filterMenus = menus.filter(function (item) {
|
|
215
217
|
return operations.includes(item.value);
|
|
216
218
|
});
|
|
217
|
-
var menu = /*#__PURE__*/
|
|
219
|
+
var menu = /*#__PURE__*/_jsx(Menu, {
|
|
218
220
|
id: "menu",
|
|
219
221
|
onClick: this.handleMenuClick,
|
|
220
222
|
style: {
|
|
221
223
|
left: -1500
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
},
|
|
225
|
+
children: filterMenus.map(function (item) {
|
|
226
|
+
return item.value === 'taskId' ? /*#__PURE__*/_jsx("div", {
|
|
227
|
+
className: "".concat(prefix, "-task-id-wrapper")
|
|
228
|
+
// 下拉菜单数 > 1 时才有下边框
|
|
229
|
+
,
|
|
230
|
+
style: filterMenus.length > 1 ? {
|
|
231
|
+
borderBottom: '1px solid #e8e8e8'
|
|
232
|
+
} : {},
|
|
233
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
234
|
+
copyable: true,
|
|
235
|
+
children: "ID: ".concat(currentSubTask && currentSubTask.id)
|
|
236
|
+
})
|
|
237
|
+
}) : /*#__PURE__*/_jsx(Menu.Item, {
|
|
238
|
+
children: item.label
|
|
239
|
+
}, item.value);
|
|
240
|
+
})
|
|
241
|
+
});
|
|
242
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
243
|
+
children: [this.graph && /*#__PURE__*/_jsx(GraphToolbar, {
|
|
244
|
+
mode: "fixed",
|
|
245
|
+
graph: this.graph
|
|
246
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
247
|
+
id: "container",
|
|
248
|
+
ref: function ref(node) {
|
|
249
|
+
_this2.main = node;
|
|
250
|
+
}
|
|
251
|
+
}), /*#__PURE__*/_jsx(Dropdown, {
|
|
252
|
+
visible: true
|
|
253
|
+
// Support for antd 5.0
|
|
227
254
|
,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
key: item.value
|
|
235
|
-
}, item.label);
|
|
236
|
-
}));
|
|
237
|
-
return /*#__PURE__*/React.createElement("div", null, this.graph && /*#__PURE__*/React.createElement(GraphToolbar, {
|
|
238
|
-
mode: "fixed",
|
|
239
|
-
graph: this.graph
|
|
240
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
241
|
-
id: "container",
|
|
242
|
-
ref: function ref(node) {
|
|
243
|
-
_this2.main = node;
|
|
244
|
-
}
|
|
245
|
-
}), /*#__PURE__*/React.createElement(Dropdown, {
|
|
246
|
-
visible: true
|
|
247
|
-
// Support for antd 5.0
|
|
248
|
-
,
|
|
249
|
-
open: true,
|
|
250
|
-
overlay: menu,
|
|
251
|
-
overlayClassName: "".concat(prefix, "-menu")
|
|
252
|
-
}, /*#__PURE__*/React.createElement("span", null)));
|
|
255
|
+
open: true,
|
|
256
|
+
overlay: menu,
|
|
257
|
+
overlayClassName: "".concat(prefix, "-menu"),
|
|
258
|
+
children: /*#__PURE__*/_jsx("span", {})
|
|
259
|
+
})]
|
|
260
|
+
});
|
|
253
261
|
}
|
|
254
262
|
}]);
|
|
255
263
|
return TaskGraph;
|
package/es/TaskGraph/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
var _excluded = ["logLoading", "subTaskLog", "onTabsChange", "onTabsEdit"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
8
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
9
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -23,6 +28,8 @@ import { getPrefix } from "../_util";
|
|
|
23
28
|
import Graph from "./Graph";
|
|
24
29
|
import "./index.less";
|
|
25
30
|
import zhCN from "./locale/zh-CN";
|
|
31
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
33
|
var TabPane = Tabs.TabPane;
|
|
27
34
|
var MIN_SIZE = 56;
|
|
28
35
|
var DEFAULT_SIZE = 240;
|
|
@@ -86,7 +93,7 @@ var TaskGraph = function TaskGraph(_ref) {
|
|
|
86
93
|
onTabsEdit(targetKey, action);
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/_jsxs(SplitPane, {
|
|
90
97
|
split: "horizontal",
|
|
91
98
|
primary: "second"
|
|
92
99
|
// 折叠状态最小高度为 MIN_SIZE,否则为 160
|
|
@@ -104,62 +111,66 @@ var TaskGraph = function TaskGraph(_ref) {
|
|
|
104
111
|
setCollapsed(false);
|
|
105
112
|
}
|
|
106
113
|
},
|
|
107
|
-
className: "".concat(prefix, "-split-pane")
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
}, restProps))), /*#__PURE__*/React.createElement("div", {
|
|
128
|
-
className: "".concat(prefix, "-tabs-wrapper")
|
|
129
|
-
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
130
|
-
type: "editable-card",
|
|
131
|
-
hideAdd: true,
|
|
132
|
-
activeKey: activeKey,
|
|
133
|
-
onChange: function onChange(key) {
|
|
134
|
-
setActiveKey(key);
|
|
135
|
-
if (onTabsChange) {
|
|
136
|
-
onTabsChange(key);
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
onEdit: handleEditLogWindow,
|
|
140
|
-
tabBarExtraContent: collapsed ? /*#__PURE__*/React.createElement(UpOutlined, {
|
|
141
|
-
onClick: function onClick() {
|
|
142
|
-
setCollapsed(!collapsed);
|
|
143
|
-
if (size === MIN_SIZE) {
|
|
144
|
-
setSize(DEFAULT_SIZE);
|
|
114
|
+
className: "".concat(prefix, "-split-pane"),
|
|
115
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
116
|
+
style: {
|
|
117
|
+
position: 'absolute',
|
|
118
|
+
width: '100%'
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/_jsx(Graph, _objectSpread({
|
|
121
|
+
onLogAdd: function onLogAdd(subTask) {
|
|
122
|
+
var isExisted = find(panes, function (item) {
|
|
123
|
+
return item.id === subTask.id;
|
|
124
|
+
});
|
|
125
|
+
if (!isExisted) {
|
|
126
|
+
setPanes([].concat(_toConsumableArray(panes), [subTask]));
|
|
127
|
+
}
|
|
128
|
+
setCollapsed(false);
|
|
129
|
+
if (size === MIN_SIZE) {
|
|
130
|
+
setSize(DEFAULT_SIZE);
|
|
131
|
+
}
|
|
132
|
+
setActiveKey(subTask && "".concat(subTask.id));
|
|
145
133
|
}
|
|
146
|
-
}
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
134
|
+
}, restProps))
|
|
135
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
136
|
+
className: "".concat(prefix, "-tabs-wrapper"),
|
|
137
|
+
children: /*#__PURE__*/_jsx(Tabs, {
|
|
138
|
+
type: "editable-card",
|
|
139
|
+
hideAdd: true,
|
|
140
|
+
activeKey: activeKey,
|
|
141
|
+
onChange: function onChange(key) {
|
|
142
|
+
setActiveKey(key);
|
|
143
|
+
if (onTabsChange) {
|
|
144
|
+
onTabsChange(key);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
onEdit: handleEditLogWindow,
|
|
148
|
+
tabBarExtraContent: collapsed ? /*#__PURE__*/_jsx(UpOutlined, {
|
|
149
|
+
onClick: function onClick() {
|
|
150
|
+
setCollapsed(!collapsed);
|
|
151
|
+
if (size === MIN_SIZE) {
|
|
152
|
+
setSize(DEFAULT_SIZE);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}) : /*#__PURE__*/_jsx(DownOutlined, {
|
|
156
|
+
onClick: function onClick() {
|
|
157
|
+
setCollapsed(!collapsed);
|
|
158
|
+
if (size === MIN_SIZE) {
|
|
159
|
+
setSize(DEFAULT_SIZE);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
children: panes.map(function (item) {
|
|
164
|
+
return /*#__PURE__*/_jsxs(TabPane, {
|
|
165
|
+
tab: "".concat(item.name, " (ID: ").concat(item.id, ")"),
|
|
166
|
+
children: [logLoading && item.status !== 'RUNNING' ? /*#__PURE__*/_jsx(Spin, {}) : subTaskLog, /*#__PURE__*/_jsx(Spin, {
|
|
167
|
+
spinning: item.status === 'RUNNING'
|
|
168
|
+
})]
|
|
169
|
+
}, "".concat(item.id));
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
163
174
|
};
|
|
164
175
|
export default LocaleWrapper({
|
|
165
176
|
componentName: 'TaskGraph',
|