@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.
Files changed (100) hide show
  1. package/dist/ui.min.js +1 -1
  2. package/es/Action/Group.d.ts +1 -1
  3. package/es/Action/Group.js +50 -41
  4. package/es/Action/Item.d.ts +2 -2
  5. package/es/Action/Item.js +32 -26
  6. package/es/Action/index.d.ts +1 -2
  7. package/es/BackgroundTaskManager/RefreshMan.js +8 -3
  8. package/es/BackgroundTaskManager/index.js +8 -4
  9. package/es/BasicLayout/Header.js +193 -140
  10. package/es/BasicLayout/index.js +149 -108
  11. package/es/BatchOperationBar/index.js +46 -29
  12. package/es/Boundary/Components/Code.js +17 -10
  13. package/es/Boundary/Components/Exception.js +46 -31
  14. package/es/Boundary/Components/Function.js +17 -10
  15. package/es/ContentWithIcon/index.js +42 -26
  16. package/es/ContentWithIcon/index.less +0 -1
  17. package/es/Dialog/Anchor.d.ts +1 -1
  18. package/es/Dialog/Anchor.js +9 -6
  19. package/es/Dialog/EventProxy.d.ts +1 -1
  20. package/es/Dialog/EventProxy.js +3 -2
  21. package/es/Dialog/index.js +129 -108
  22. package/es/Dialog/index.less +3 -1
  23. package/es/DocDialog/index.d.ts +1 -1
  24. package/es/DocDialog/index.js +8 -3
  25. package/es/FullscreenBox/index.d.ts +1 -1
  26. package/es/FullscreenBox/index.js +22 -16
  27. package/es/GraphToolbar/index.js +79 -65
  28. package/es/Highlight/DiffView/DiffCells.d.ts +2 -2
  29. package/es/Highlight/DiffView/DiffCells.js +22 -15
  30. package/es/Highlight/DiffView/index.js +49 -40
  31. package/es/Highlight/HighlightCell.d.ts +1 -1
  32. package/es/Highlight/HighlightCell.js +19 -13
  33. package/es/Highlight/JsonView.d.ts +1 -2
  34. package/es/Highlight/JsonView.js +15 -13
  35. package/es/Highlight/index.d.ts +1 -1
  36. package/es/Highlight/index.js +66 -54
  37. package/es/IconFont/index.d.ts +1 -1
  38. package/es/IconFont/index.js +9 -3
  39. package/es/LocaleDropdown/index.js +38 -26
  40. package/es/Login/ActivateForm.js +63 -50
  41. package/es/Login/LoginForm.js +115 -99
  42. package/es/Login/RegisterForm.js +78 -67
  43. package/es/Login/index.js +122 -91
  44. package/es/Lottie/index.js +2 -1
  45. package/es/NavMenu/index.d.ts +2 -2
  46. package/es/NavMenu/index.js +34 -29
  47. package/es/PageContainer/ItemRender.d.ts +1 -2
  48. package/es/PageContainer/ItemRender.js +7 -3
  49. package/es/PageContainer/index.js +13 -10
  50. package/es/Password/Content.js +55 -47
  51. package/es/Password/index.js +62 -45
  52. package/es/Ranger/QuickPicker.d.ts +1 -2
  53. package/es/Ranger/QuickPicker.js +42 -31
  54. package/es/Ranger/Ranger.js +31 -27
  55. package/es/SideTip/Dragger.d.ts +1 -1
  56. package/es/SideTip/Dragger.js +5 -3
  57. package/es/SideTip/IconLoading.d.ts +1 -2
  58. package/es/SideTip/IconLoading.js +28 -20
  59. package/es/SideTip/index.js +43 -30
  60. package/es/SideTip/index.less +4 -1
  61. package/es/TagSelect/Group.d.ts +1 -1
  62. package/es/TagSelect/Group.js +16 -11
  63. package/es/TagSelect/Item.d.ts +1 -1
  64. package/es/TagSelect/Item.js +30 -23
  65. package/es/TagSelect/style/index.d.ts +1 -1
  66. package/es/TaskGraph/Graph.js +39 -31
  67. package/es/TaskGraph/index.js +68 -57
  68. package/es/TreeSearch/index.js +36 -32
  69. package/es/Welcome/index.js +113 -83
  70. package/es/Welcome/step.js +31 -23
  71. package/es/locale/LocaleWrapper.js +3 -3
  72. package/lib/Action/Group.d.ts +1 -1
  73. package/lib/Action/Item.d.ts +2 -2
  74. package/lib/Action/index.d.ts +1 -2
  75. package/lib/ContentWithIcon/index.less +0 -1
  76. package/lib/Dialog/Anchor.d.ts +1 -1
  77. package/lib/Dialog/EventProxy.d.ts +1 -1
  78. package/lib/Dialog/EventProxy.js +12 -2
  79. package/lib/Dialog/index.less +3 -1
  80. package/lib/DocDialog/index.d.ts +1 -1
  81. package/lib/FullscreenBox/index.d.ts +1 -1
  82. package/lib/FullscreenBox/index.js +76 -74
  83. package/lib/Highlight/DiffView/DiffCells.d.ts +2 -2
  84. package/lib/Highlight/DiffView/index.js +1 -1
  85. package/lib/Highlight/HighlightCell.d.ts +1 -1
  86. package/lib/Highlight/JsonView.d.ts +1 -2
  87. package/lib/Highlight/JsonView.js +3 -3
  88. package/lib/Highlight/index.d.ts +1 -1
  89. package/lib/IconFont/index.d.ts +1 -1
  90. package/lib/NavMenu/index.d.ts +2 -2
  91. package/lib/PageContainer/ItemRender.d.ts +1 -2
  92. package/lib/Ranger/QuickPicker.d.ts +1 -2
  93. package/lib/SideTip/Dragger.d.ts +1 -1
  94. package/lib/SideTip/IconLoading.d.ts +1 -2
  95. package/lib/SideTip/index.less +4 -1
  96. package/lib/TagSelect/Group.d.ts +1 -1
  97. package/lib/TagSelect/Group.js +4 -6
  98. package/lib/TagSelect/Item.d.ts +1 -1
  99. package/lib/TagSelect/style/index.d.ts +1 -1
  100. package/package.json +10 -9
@@ -1,8 +1,14 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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__*/React.createElement("svg", {
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
- }, /*#__PURE__*/React.createElement("path", {
17
- strokeWidth: "1",
18
- strokeMiterlimit: "10",
19
- 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",
20
- transform: "rotate(278.217 20 20)"
21
- }, /*#__PURE__*/React.createElement("animateTransform", {
22
- attributeName: "transform",
23
- type: "rotate",
24
- from: "0 20 20",
25
- to: "360 20 20",
26
- calcMode: "spline",
27
- keySplines: "0.2, 0.2, 0.2, 0.2",
28
- keyTimes: "0;1",
29
- dur: "1.2s",
30
- repeatCount: "indefinite"
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__*/React.createElement(Icon, _extends({
42
+ return /*#__PURE__*/_jsx(Icon, _objectSpread({
35
43
  component: LoadingSvg
36
44
  }, props));
37
45
  };
@@ -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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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__*/React.createElement("span", {
114
- className: iconClassName
115
- }, /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement("img", {
116
- src: icon,
117
- alt: "icon",
118
- width: "100%",
119
- height: "100%"
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__*/React.createElement("div", {
133
+ var InnerButton = /*#__PURE__*/_jsxs("div", {
129
134
  className: buttonClassName,
130
135
  ref: buttonRef,
131
- style: buttonStyle
132
- }, loading && /*#__PURE__*/React.createElement(IconLoading, {
133
- className: loadingClassName
134
- }), /*#__PURE__*/React.createElement(React.Fragment, null, iconDom, /*#__PURE__*/React.createElement(CloseOutlined, {
135
- className: closeClassName
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__*/React.createElement(Badge, _extends({
147
+ var BadgeButton = badge ? /*#__PURE__*/_jsx(Badge, _objectSpread(_objectSpread({
140
148
  offset: [-6, 6]
141
- }, badge), InnerButton) : InnerButton;
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__*/React.createElement("div", {
155
+ var hideIcon = /*#__PURE__*/_jsx("div", {
146
156
  id: "ui-mini-hide",
147
157
  onClick: hideSideTip,
148
- className: hideIconClassName
149
- }, /*#__PURE__*/React.createElement("div", {
150
- className: "".concat(prefix, "-hide-icon")
151
- }));
152
- return /*#__PURE__*/React.createElement(Dragger, {
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
- }, tooltip && tooltip.title ? /*#__PURE__*/React.createElement(Tooltip, _extends({}, tooltip, {
169
- getPopupContainer: function getPopupContainer() {
170
- return buttonRef.current;
171
- }
172
- }), BadgeButton) : BadgeButton, hideable && hideIcon, children);
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',
@@ -71,7 +71,10 @@
71
71
  border-radius: 50%;
72
72
  box-shadow: @boxShadowSecondary;
73
73
  cursor: pointer;
74
- transition: background-color 0.2s ease 0.1s, opacity 0.2s ease 0s, transform 0.2s ease 0.1s;
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 {
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- export type TagSelectValueType = string | number;
2
+ export type TagSelectValueType = string | number | readonly string[];
3
3
  export interface TagSelectOptionType {
4
4
  label: React.ReactNode;
5
5
  value: TagSelectValueType;
@@ -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__*/React.createElement(Item, {
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
- }, option.label);
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__*/React.createElement(TagSelectContext.Provider, {
114
- value: contextValue
115
- }, /*#__PURE__*/React.createElement("div", {
116
- className: groupCls
117
- }, /*#__PURE__*/React.createElement("div", {
118
- className: "".concat(prefix, "-title")
119
- }, title), childrenNode)));
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;
@@ -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?: string | number;
6
+ value?: TagSelectValueType;
7
7
  defaultChecked?: boolean;
8
8
  checked?: boolean;
9
9
  title?: string;
@@ -1,5 +1,6 @@
1
1
  var _excluded = ["children", "handleChange", "onChange", "cover"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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__*/React.createElement("div", {
59
- className: "".concat(prefixCls, "-cover")
60
- }, /*#__PURE__*/React.createElement("img", {
61
- src: cover,
62
- alt: "tagselect"
63
- })) : cover;
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__*/React.createElement("label", {
69
+ return wrapSSR( /*#__PURE__*/_jsxs("label", {
66
70
  className: wrapperClassName,
67
- style: restProps.style
68
- }, /*#__PURE__*/React.createElement(RcCheckBox, _extends({}, restProps, {
69
- checked: checked,
70
- prefixCls: prefixCls,
71
- onChange: function onChange(e) {
72
- if (!('checked' in restProps) && !Object.keys(tagSelectGroup).length) {
73
- setChecked(e.target.checked);
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
- if (_onChange) {
76
- _onChange(e);
77
- }
78
- if (tagSelectGroup.handleValueChange) {
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/lib/theme/internal';
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) => {
@@ -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__*/React.createElement(Menu, {
219
+ var menu = /*#__PURE__*/_jsx(Menu, {
218
220
  id: "menu",
219
221
  onClick: this.handleMenuClick,
220
222
  style: {
221
223
  left: -1500
222
- }
223
- }, filterMenus.map(function (item) {
224
- return item.value === 'taskId' ? /*#__PURE__*/React.createElement("div", {
225
- className: "".concat(prefix, "-task-id-wrapper")
226
- // 下拉菜单数 > 1 时才有下边框
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
- style: filterMenus.length > 1 ? {
229
- borderBottom: '1px solid #e8e8e8'
230
- } : {}
231
- }, /*#__PURE__*/React.createElement(Text, {
232
- copyable: true
233
- }, "ID: ".concat(currentSubTask && currentSubTask.id))) : /*#__PURE__*/React.createElement(Menu.Item, {
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;
@@ -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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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__*/React.createElement(SplitPane, {
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
- }, /*#__PURE__*/React.createElement("div", {
109
- style: {
110
- position: 'absolute',
111
- width: '100%'
112
- }
113
- }, /*#__PURE__*/React.createElement(Graph, _extends({
114
- onLogAdd: function onLogAdd(subTask) {
115
- var isExisted = find(panes, function (item) {
116
- return item.id === subTask.id;
117
- });
118
- if (!isExisted) {
119
- setPanes([].concat(_toConsumableArray(panes), [subTask]));
120
- }
121
- setCollapsed(false);
122
- if (size === MIN_SIZE) {
123
- setSize(DEFAULT_SIZE);
124
- }
125
- setActiveKey(subTask && "".concat(subTask.id));
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
- }) : /*#__PURE__*/React.createElement(DownOutlined, {
148
- onClick: function onClick() {
149
- setCollapsed(!collapsed);
150
- if (size === MIN_SIZE) {
151
- setSize(DEFAULT_SIZE);
152
- }
153
- }
154
- })
155
- }, panes.map(function (item) {
156
- return /*#__PURE__*/React.createElement(TabPane, {
157
- key: "".concat(item.id),
158
- tab: "".concat(item.name, " (ID: ").concat(item.id, ")")
159
- }, logLoading && item.status !== 'RUNNING' ? /*#__PURE__*/React.createElement(Spin, null) : subTaskLog, /*#__PURE__*/React.createElement(Spin, {
160
- spinning: item.status === 'RUNNING'
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',