@oceanbase/ui 1.0.0-alpha.4 → 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.
Files changed (219) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/Item.d.ts +6 -15
  4. package/es/Action/Item.js +85 -128
  5. package/es/Action/index.d.ts +6 -3
  6. package/es/BasicLayout/style/index.js +30 -18
  7. package/es/BatchOperationBar/index.d.ts +0 -1
  8. package/es/BatchOperationBar/index.js +17 -13
  9. package/es/BatchOperationBar/style/index.d.ts +10 -0
  10. package/es/BatchOperationBar/style/index.js +51 -0
  11. package/es/Boundary/Components/Code.js +11 -5
  12. package/es/Boundary/Components/Exception.js +85 -74
  13. package/es/Boundary/Components/Function.js +11 -5
  14. package/es/Boundary/index.d.ts +0 -1
  15. package/es/Boundary/index.js +0 -1
  16. package/es/Boundary/style/index.d.ts +10 -0
  17. package/es/Boundary/style/index.js +46 -0
  18. package/es/ContentWithIcon/index.d.ts +0 -1
  19. package/es/ContentWithIcon/index.js +29 -29
  20. package/es/ContentWithIcon/style/index.d.ts +10 -0
  21. package/es/ContentWithIcon/style/index.js +26 -0
  22. package/es/DateRanger/PickerPanel.js +5 -4
  23. package/es/DateRanger/Ranger.d.ts +0 -1
  24. package/es/DateRanger/Ranger.js +13 -8
  25. package/es/DateRanger/style/index.d.ts +10 -0
  26. package/es/DateRanger/style/index.js +126 -0
  27. package/es/Dialog/Anchor.d.ts +2 -10
  28. package/es/Dialog/Anchor.js +67 -96
  29. package/es/Dialog/index.d.ts +0 -1
  30. package/es/Dialog/index.js +537 -578
  31. package/es/Dialog/style/index.d.ts +10 -0
  32. package/es/Dialog/style/index.js +97 -0
  33. package/es/FullscreenBox/index.d.ts +0 -1
  34. package/es/FullscreenBox/index.js +46 -37
  35. package/es/FullscreenBox/style/index.d.ts +10 -0
  36. package/es/FullscreenBox/style/index.js +53 -0
  37. package/es/GraphToolbar/index.d.ts +0 -1
  38. package/es/GraphToolbar/index.js +19 -16
  39. package/es/GraphToolbar/style/index.d.ts +10 -0
  40. package/es/GraphToolbar/style/index.js +60 -0
  41. package/es/Highlight/DiffView/index.d.ts +0 -1
  42. package/es/Highlight/DiffView/index.js +5 -5
  43. package/es/Highlight/JsonView.d.ts +0 -1
  44. package/es/Highlight/JsonView.js +5 -5
  45. package/es/Highlight/index.d.ts +0 -1
  46. package/es/Highlight/index.js +23 -23
  47. package/es/Highlight/style/index.d.ts +10 -0
  48. package/es/Highlight/style/index.js +213 -0
  49. package/es/Login/ActivateForm.d.ts +0 -1
  50. package/es/Login/ActivateForm.js +12 -9
  51. package/es/Login/LoginForm.d.ts +0 -1
  52. package/es/Login/LoginForm.js +20 -15
  53. package/es/Login/RegisterForm.d.ts +0 -1
  54. package/es/Login/RegisterForm.js +14 -11
  55. package/es/Login/index.d.ts +0 -1
  56. package/es/Login/index.js +24 -22
  57. package/es/Login/style/index.d.ts +10 -0
  58. package/es/Login/style/index.js +182 -0
  59. package/es/NavMenu/index.d.ts +1 -2
  60. package/es/NavMenu/index.js +11 -8
  61. package/es/NavMenu/style/index.d.ts +10 -0
  62. package/es/NavMenu/style/index.js +47 -0
  63. package/es/Ranger/QuickPicker.js +8 -4
  64. package/es/Ranger/Ranger.d.ts +0 -1
  65. package/es/Ranger/Ranger.js +12 -9
  66. package/es/Ranger/style/index.d.ts +10 -0
  67. package/es/Ranger/style/index.js +44 -0
  68. package/es/SideTip/index.d.ts +0 -1
  69. package/es/SideTip/index.js +24 -22
  70. package/es/SideTip/style/index.d.ts +10 -0
  71. package/es/SideTip/style/index.js +162 -0
  72. package/es/TagSelect/Group.d.ts +6 -6
  73. package/es/TagSelect/Group.js +5 -3
  74. package/es/TagSelect/Item.js +5 -3
  75. package/es/TaskGraph/Graph/style/index.d.ts +10 -0
  76. package/es/TaskGraph/Graph/style/index.js +28 -0
  77. package/es/TaskGraph/Graph.d.ts +0 -1
  78. package/es/TaskGraph/Graph.js +26 -10
  79. package/es/TaskGraph/index.d.ts +0 -1
  80. package/es/TaskGraph/index.js +10 -7
  81. package/es/TaskGraph/style/index.d.ts +10 -0
  82. package/es/TaskGraph/style/index.js +102 -0
  83. package/es/Welcome/index.d.ts +0 -1
  84. package/es/Welcome/index.js +30 -26
  85. package/es/Welcome/step/style/index.d.ts +10 -0
  86. package/es/Welcome/step/style/index.js +44 -0
  87. package/es/Welcome/step.d.ts +0 -1
  88. package/es/Welcome/step.js +17 -14
  89. package/es/Welcome/style/index.d.ts +10 -0
  90. package/es/Welcome/style/index.js +141 -0
  91. package/es/index.d.ts +0 -1
  92. package/es/index.js +0 -1
  93. package/lib/Action/Item.d.ts +6 -15
  94. package/lib/Action/Item.js +66 -81
  95. package/lib/Action/index.d.ts +6 -3
  96. package/lib/BasicLayout/style/index.js +27 -18
  97. package/lib/BatchOperationBar/index.d.ts +0 -1
  98. package/lib/BatchOperationBar/index.js +54 -50
  99. package/lib/BatchOperationBar/style/index.d.ts +10 -0
  100. package/lib/BatchOperationBar/style/index.js +82 -0
  101. package/lib/Boundary/Components/Code.js +23 -17
  102. package/lib/Boundary/Components/Exception.js +40 -29
  103. package/lib/Boundary/Components/Function.js +18 -12
  104. package/lib/Boundary/index.d.ts +0 -1
  105. package/lib/Boundary/index.js +0 -1
  106. package/lib/Boundary/style/index.d.ts +10 -0
  107. package/lib/Boundary/style/index.js +74 -0
  108. package/lib/ContentWithIcon/index.d.ts +0 -1
  109. package/lib/ContentWithIcon/index.js +35 -32
  110. package/lib/ContentWithIcon/style/index.d.ts +10 -0
  111. package/lib/ContentWithIcon/style/index.js +57 -0
  112. package/lib/DateRanger/PickerPanel.js +2 -2
  113. package/lib/DateRanger/Ranger.d.ts +0 -1
  114. package/lib/DateRanger/Ranger.js +353 -348
  115. package/lib/DateRanger/style/index.d.ts +10 -0
  116. package/lib/DateRanger/style/index.js +195 -0
  117. package/lib/Dialog/Anchor.d.ts +2 -10
  118. package/lib/Dialog/Anchor.js +58 -60
  119. package/lib/Dialog/index.d.ts +0 -1
  120. package/lib/Dialog/index.js +446 -422
  121. package/lib/Dialog/style/index.d.ts +10 -0
  122. package/lib/Dialog/style/index.js +135 -0
  123. package/lib/FullscreenBox/index.d.ts +0 -1
  124. package/lib/FullscreenBox/index.js +47 -38
  125. package/lib/FullscreenBox/style/index.d.ts +10 -0
  126. package/lib/FullscreenBox/style/index.js +86 -0
  127. package/lib/GraphToolbar/index.d.ts +0 -1
  128. package/lib/GraphToolbar/index.js +69 -66
  129. package/lib/GraphToolbar/style/index.d.ts +10 -0
  130. package/lib/GraphToolbar/style/index.js +91 -0
  131. package/lib/Highlight/DiffView/index.d.ts +0 -1
  132. package/lib/Highlight/DiffView/index.js +3 -3
  133. package/lib/Highlight/JsonView.d.ts +0 -1
  134. package/lib/Highlight/JsonView.js +3 -3
  135. package/lib/Highlight/index.d.ts +0 -1
  136. package/lib/Highlight/index.js +32 -29
  137. package/lib/Highlight/style/index.d.ts +10 -0
  138. package/lib/Highlight/style/index.js +293 -0
  139. package/lib/Login/ActivateForm.d.ts +0 -1
  140. package/lib/Login/ActivateForm.js +17 -9
  141. package/lib/Login/LoginForm.d.ts +0 -1
  142. package/lib/Login/LoginForm.js +25 -13
  143. package/lib/Login/RegisterForm.d.ts +0 -1
  144. package/lib/Login/RegisterForm.js +17 -9
  145. package/lib/Login/index.d.ts +0 -1
  146. package/lib/Login/index.js +96 -94
  147. package/lib/Login/style/index.d.ts +10 -0
  148. package/lib/Login/style/index.js +267 -0
  149. package/lib/NavMenu/index.d.ts +1 -2
  150. package/lib/NavMenu/index.js +20 -17
  151. package/lib/NavMenu/style/index.d.ts +10 -0
  152. package/lib/NavMenu/style/index.js +78 -0
  153. package/lib/Ranger/QuickPicker.js +4 -2
  154. package/lib/Ranger/Ranger.d.ts +0 -1
  155. package/lib/Ranger/Ranger.js +48 -45
  156. package/lib/Ranger/style/index.d.ts +10 -0
  157. package/lib/Ranger/style/index.js +82 -0
  158. package/lib/SideTip/index.d.ts +0 -1
  159. package/lib/SideTip/index.js +46 -38
  160. package/lib/SideTip/style/index.d.ts +10 -0
  161. package/lib/SideTip/style/index.js +211 -0
  162. package/lib/TagSelect/Group.d.ts +6 -6
  163. package/lib/TagSelect/Group.js +3 -2
  164. package/lib/TagSelect/Item.js +3 -2
  165. package/lib/TaskGraph/Graph/style/index.d.ts +10 -0
  166. package/lib/TaskGraph/Graph/style/index.js +56 -0
  167. package/lib/TaskGraph/Graph.d.ts +0 -1
  168. package/lib/TaskGraph/Graph.js +16 -7
  169. package/lib/TaskGraph/index.d.ts +0 -1
  170. package/lib/TaskGraph/index.js +6 -5
  171. package/lib/TaskGraph/style/index.d.ts +10 -0
  172. package/lib/TaskGraph/style/index.js +143 -0
  173. package/lib/Welcome/index.d.ts +0 -1
  174. package/lib/Welcome/index.js +64 -59
  175. package/lib/Welcome/step/style/index.d.ts +10 -0
  176. package/lib/Welcome/step/style/index.js +74 -0
  177. package/lib/Welcome/step.d.ts +0 -1
  178. package/lib/Welcome/step.js +17 -13
  179. package/lib/Welcome/style/index.d.ts +10 -0
  180. package/lib/Welcome/style/index.js +188 -0
  181. package/lib/index.d.ts +0 -1
  182. package/lib/index.js +0 -1
  183. package/package.json +4 -7
  184. package/es/BatchOperationBar/index.less +0 -46
  185. package/es/BatchOperationBar/index.less.d.ts +0 -15
  186. package/es/Boundary/index.less +0 -36
  187. package/es/ContentWithIcon/index.less +0 -21
  188. package/es/DateRanger/index.less +0 -180
  189. package/es/Dialog/index.less +0 -116
  190. package/es/FullscreenBox/index.less +0 -51
  191. package/es/GraphToolbar/index.less +0 -65
  192. package/es/Highlight/index.less +0 -381
  193. package/es/Login/index.less +0 -268
  194. package/es/NavMenu/index.less +0 -50
  195. package/es/Ranger/index.less +0 -57
  196. package/es/SideTip/index.less +0 -180
  197. package/es/TaskGraph/graph.less +0 -23
  198. package/es/TaskGraph/index.less +0 -117
  199. package/es/Welcome/index.less +0 -185
  200. package/es/index.less +0 -1
  201. package/es/variable.less +0 -54
  202. package/lib/BatchOperationBar/index.less +0 -46
  203. package/lib/BatchOperationBar/index.less.d.ts +0 -15
  204. package/lib/Boundary/index.less +0 -36
  205. package/lib/ContentWithIcon/index.less +0 -21
  206. package/lib/DateRanger/index.less +0 -180
  207. package/lib/Dialog/index.less +0 -116
  208. package/lib/FullscreenBox/index.less +0 -51
  209. package/lib/GraphToolbar/index.less +0 -65
  210. package/lib/Highlight/index.less +0 -381
  211. package/lib/Login/index.less +0 -268
  212. package/lib/NavMenu/index.less +0 -50
  213. package/lib/Ranger/index.less +0 -57
  214. package/lib/SideTip/index.less +0 -180
  215. package/lib/TaskGraph/graph.less +0 -23
  216. package/lib/TaskGraph/index.less +0 -117
  217. package/lib/Welcome/index.less +0 -185
  218. package/lib/index.less +0 -1
  219. package/lib/variable.less +0 -54
@@ -11,25 +11,24 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { CloseOutlined } from '@oceanbase/icons';
14
- import { Badge, Tooltip } from '@oceanbase/design';
14
+ import { Badge, ConfigProvider, Tooltip } from '@oceanbase/design';
15
15
  import classnames from 'classnames';
16
- import React, { createRef, useEffect, useState } from 'react';
16
+ import React, { createRef, useCallback, useContext, useEffect, useState } from 'react';
17
17
  import LocaleWrapper from "../locale/LocaleWrapper";
18
- import { getPrefix } from "../_util";
18
+ import useStyle from "./style";
19
19
  import Dragger from "./Dragger";
20
20
  import IconLoading from "./IconLoading";
21
21
  import zhCN from "./locale/zh-CN";
22
- // @ts-ignore
23
- import "./index.less";
24
22
  import { jsx as _jsx } from "react/jsx-runtime";
25
23
  import { Fragment as _Fragment } from "react/jsx-runtime";
26
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
27
- var STORE_SIDETIP_HIDE = 'ob-sidetip-hide';
28
- var getLocalStorageKey = function getLocalStorageKey(id) {
29
- return ["".concat(STORE_SIDETIP_HIDE), id].join('-');
30
- };
31
25
  var SideTip = function SideTip(props) {
32
26
  var buttonRef = /*#__PURE__*/createRef();
27
+ var _useContext = useContext(ConfigProvider.ConfigContext),
28
+ getPrefixCls = _useContext.getPrefixCls;
29
+ var prefixCls = getPrefixCls('sidetip');
30
+ var _useStyle = useStyle(prefixCls),
31
+ wrapSSR = _useStyle.wrapSSR;
33
32
  var defaultHide = props.defaultHide,
34
33
  onClick = props.onClick,
35
34
  open = props.open,
@@ -57,6 +56,9 @@ var SideTip = function SideTip(props) {
57
56
  _props$draggable = props.draggable,
58
57
  draggable = _props$draggable === void 0 ? true : _props$draggable,
59
58
  getPopupContainer = props.getPopupContainer;
59
+ var getLocalStorageKey = useCallback(function (localId) {
60
+ return ["".concat(prefixCls, "-hide"), localId].join('-');
61
+ }, [prefixCls]);
60
62
  var _useState = useState(hideable ? defaultHide === undefined ? window.localStorage.getItem(getLocalStorageKey(id)) === 'true' : !!defaultHide : false),
61
63
  _useState2 = _slicedToArray(_useState, 2),
62
64
  hide = _useState2[0],
@@ -71,7 +73,7 @@ var SideTip = function SideTip(props) {
71
73
  } else {
72
74
  window.localStorage.removeItem(getLocalStorageKey(id));
73
75
  }
74
- }, [hide]);
76
+ }, [hide, id, getLocalStorageKey]);
75
77
  var hideSideTip = function hideSideTip() {
76
78
  setHide(true);
77
79
  };
@@ -107,23 +109,22 @@ var SideTip = function SideTip(props) {
107
109
  if (sizeCls === 'small') return 'small';
108
110
  return '';
109
111
  };
110
- var prefix = getPrefix('sidetip');
111
112
  var typeCls = getTypeCls(type);
112
113
  var sizeCls = getSizeCls(size);
113
- var buttonPrefix = "".concat(prefix, "-button");
114
+ var buttonPrefix = "".concat(prefixCls, "-button");
114
115
 
115
116
  // icon
116
117
  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));
117
118
  // 接受三种形式的icon
118
- var iconDom = /*#__PURE__*/_jsx("span", {
119
+ var iconDom = icon ? /*#__PURE__*/_jsx("span", {
119
120
  className: iconClassName,
120
- children: /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/_jsx("img", {
121
+ children: /*#__PURE__*/React.isValidElement(icon) ? icon : typeof icon === 'string' && icon ? /*#__PURE__*/_jsx("img", {
121
122
  src: icon,
122
123
  alt: "icon",
123
124
  width: "100%",
124
125
  height: "100%"
125
- })
126
- });
126
+ }) : null
127
+ }) : null;
127
128
 
128
129
  // close 按钮
129
130
  var closeClassName = classnames("".concat(buttonPrefix, "-close"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(buttonPrefix, "-close-show"), open || visible), "".concat(buttonPrefix, "-close-").concat(typeCls), typeCls), "".concat(buttonPrefix, "-close-").concat(sizeCls), sizeCls));
@@ -150,7 +151,7 @@ var SideTip = function SideTip(props) {
150
151
  }, badge), {}, {
151
152
  children: InnerButton
152
153
  })) : InnerButton;
153
- var hideIconClassName = classnames("".concat(prefix, "-hide"), _defineProperty({}, "".concat(prefix, "-hide-hovered"), hovered));
154
+ var hideIconClassName = classnames("".concat(prefixCls, "-hide"), _defineProperty({}, "".concat(prefixCls, "-hide-hovered"), hovered));
154
155
 
155
156
  // 隐藏按钮
156
157
  var hideIcon = /*#__PURE__*/_jsx("div", {
@@ -158,10 +159,11 @@ var SideTip = function SideTip(props) {
158
159
  onClick: hideSideTip,
159
160
  className: hideIconClassName,
160
161
  children: /*#__PURE__*/_jsx("div", {
161
- className: "".concat(prefix, "-hide-icon")
162
+ className: "".concat(prefixCls, "-hide-icon")
162
163
  })
163
164
  });
164
- return /*#__PURE__*/_jsxs(Dragger, {
165
+ var containerClassName = classnames(className, _defineProperty({}, "".concat(prefixCls, "-container-disabled"), disabled));
166
+ return wrapSSR( /*#__PURE__*/_jsxs(Dragger, {
165
167
  id: id,
166
168
  open: open || visible,
167
169
  hide: hide,
@@ -171,12 +173,12 @@ var SideTip = function SideTip(props) {
171
173
  onMouseLeave: handleMouseLeave,
172
174
  style: style,
173
175
  position: position,
174
- prefix: prefix,
176
+ prefix: prefixCls,
175
177
  onDragStart: onDragStart,
176
178
  onDragEnd: onDragEnd,
177
179
  onDrag: onDrag,
178
180
  getPopupContainer: getPopupContainer,
179
- className: className,
181
+ className: containerClassName,
180
182
  draggable: draggable,
181
183
  children: [tooltip && tooltip.title ? /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, tooltip), {}, {
182
184
  getPopupContainer: function getPopupContainer() {
@@ -184,7 +186,7 @@ var SideTip = function SideTip(props) {
184
186
  },
185
187
  children: BadgeButton
186
188
  })) : BadgeButton, hideable && hideIcon, children]
187
- });
189
+ }));
188
190
  };
189
191
  export default LocaleWrapper({
190
192
  componentName: 'SideTip',
@@ -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,162 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ 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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genSideTipStyle = function genSideTipStyle(token) {
7
+ var componentCls = token.componentCls,
8
+ boxShadowSecondary = token.boxShadowSecondary,
9
+ colorTextQuaternary = token.colorTextQuaternary,
10
+ colorTextSecondary = token.colorTextSecondary;
11
+ return _defineProperty({}, "".concat(componentCls, "-container"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
12
+ position: 'fixed',
13
+ zIndex: 0,
14
+ fontSize: 14,
15
+ cursor: 'pointer',
16
+ insetInlineEnd: 24,
17
+ insetBlockEnd: 24
18
+ }, "&.".concat(componentCls, "-container-dragged"), {
19
+ cursor: 'grab'
20
+ }), "&.".concat(componentCls, "-container-disabled"), {
21
+ cursor: 'not-allowed'
22
+ }), "&.".concat(componentCls, "-container-hide"), {
23
+ transition: 'all 0.3s'
24
+ }), '@media screen and (max-width: 768px)', {
25
+ display: 'none'
26
+ }), "&.".concat(componentCls, "-container-hide-not-dragged:hover"), {
27
+ insetInlineEnd: '0 !important'
28
+ }), "".concat(componentCls, "-hide"), _defineProperty(_defineProperty({
29
+ position: 'absolute',
30
+ zIndex: 0,
31
+ display: 'flex',
32
+ alignItems: 'center',
33
+ justifyContent: 'center',
34
+ width: 20,
35
+ height: 20,
36
+ background: 'rgba(0, 0, 0, 0.15)',
37
+ borderRadius: 20,
38
+ transform: 'scale(0)',
39
+ cursor: 'pointer',
40
+ opacity: 0,
41
+ transition: 'all 0.18s ease-out 0.18s',
42
+ insetBlockStart: 0,
43
+ insetInlineEnd: -22,
44
+ '&:hover': {
45
+ background: 'rgba(0, 0, 0, 0.35)'
46
+ }
47
+ }, "".concat(componentCls, "-hide-icon"), {
48
+ width: 6,
49
+ height: 2,
50
+ background: '#fff',
51
+ borderRadius: 4
52
+ }), "&.".concat(componentCls, "-hide-hovered"), {
53
+ transform: 'scale(1)',
54
+ opacity: 1
55
+ })), "".concat(componentCls, "-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
56
+ position: 'relative',
57
+ display: 'flex',
58
+ alignItems: 'center',
59
+ justifyContent: 'center',
60
+ width: 56,
61
+ height: 56,
62
+ backgroundColor: '#fff',
63
+ borderRadius: '50%',
64
+ boxShadow: boxShadowSecondary,
65
+ cursor: 'pointer',
66
+ transition: 'background-color 0.2s ease 0.1s, opacity 0.2s ease 0s, transform 0.2s ease 0.1s',
67
+ userSelect: 'none'
68
+ }, "&".concat(componentCls, "-button-primary"), {
69
+ backgroundColor: "".concat(token.colorPrimary, " !important")
70
+ }), "&".concat(componentCls, "-button-small"), {
71
+ width: 40,
72
+ height: 40
73
+ }), "&".concat(componentCls, "-button-disabled"), {
74
+ backgroundColor: "".concat(colorTextQuaternary, " !important"),
75
+ cursor: 'not-allowed'
76
+ }), '&:hover', {
77
+ opacity: 1
78
+ }), "".concat(componentCls, "-button-loading"), _defineProperty(_defineProperty({
79
+ position: 'absolute',
80
+ width: 56,
81
+ height: 56,
82
+ color: token.colorPrimary,
83
+ fontSize: 56,
84
+ insetBlockStart: 0,
85
+ insetInlineEnd: 0
86
+ }, "&".concat(componentCls, "-button-loading-primary"), {
87
+ color: '#fff'
88
+ }), "&".concat(componentCls, "-button-loading-small"), {
89
+ width: 40,
90
+ height: 40,
91
+ fontSize: 40,
92
+ lineHeight: 40
93
+ })), "".concat(componentCls, "-button-close"), _defineProperty(_defineProperty(_defineProperty({
94
+ position: 'absolute',
95
+ width: 24,
96
+ height: 24,
97
+ color: colorTextSecondary,
98
+ fontSize: 24,
99
+ transform: 'translate(-50%, -50%) scale(0.4) rotate(-45deg)',
100
+ opacity: 0,
101
+ transition: 'all 0.3s linear',
102
+ userSelect: 'none',
103
+ insetBlockStart: '50%',
104
+ insetInlineStart: '50%'
105
+ }, "&.".concat(componentCls, "-button-close-primary"), {
106
+ color: '#fff'
107
+ }), "&.".concat(componentCls, "-button-close-show"), {
108
+ transform: 'translate(-50%, -50%)',
109
+ opacity: 1
110
+ }), "&.".concat(componentCls, "-button-close-small"), {
111
+ width: 16,
112
+ height: 16,
113
+ fontSize: 16,
114
+ lineHeight: 16
115
+ })), "".concat(componentCls, "-button-icon"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
116
+ position: 'absolute',
117
+ display: 'flex',
118
+ alignItems: 'center',
119
+ justifyContent: 'center',
120
+ width: 24,
121
+ height: 24,
122
+ color: colorTextSecondary,
123
+ fontSize: 24,
124
+ lineHeight: 24,
125
+ transform: 'translate(-50%, -50%)',
126
+ opacity: 1,
127
+ transition: 'all 0.3s linear',
128
+ userSelect: 'none',
129
+ insetBlockStart: '50%',
130
+ insetInlineStart: '50%',
131
+ '> *': {
132
+ fontSize: 'inherit',
133
+ color: 'inherit'
134
+ },
135
+ img: {
136
+ width: '100%',
137
+ height: '100%',
138
+ objectFit: 'contain'
139
+ }
140
+ }, "&.".concat(componentCls, "-button-icon-open"), {
141
+ transform: 'translate(-50%, -50%) scale(0.4) rotate(45deg)',
142
+ opacity: 0
143
+ }), "&.".concat(componentCls, "-button-icon-disabled"), {
144
+ color: colorTextQuaternary
145
+ }), "&".concat(componentCls, "-button-icon-primary"), {
146
+ color: '#fff !important',
147
+ '> *': {
148
+ color: '#fff !important'
149
+ }
150
+ }), "&".concat(componentCls, "-button-icon-small"), {
151
+ width: 16,
152
+ height: 16,
153
+ fontSize: 16,
154
+ lineHeight: 16
155
+ }))));
156
+ };
157
+ export default (function (prefixCls) {
158
+ var useStyle = genComponentStyleHook('SideTip', function (token) {
159
+ return [genSideTipStyle(token)];
160
+ });
161
+ return useStyle(prefixCls);
162
+ });
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from '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 | Array<TagSelectValueType>;
17
- value?: TagSelectValueType | Array<TagSelectValueType>;
16
+ defaultValue?: TagSelectValueType | TagSelectValueType[];
17
+ value?: TagSelectValueType | TagSelectValueType[];
18
18
  size?: string;
19
- options?: Array<TagSelectOptionType | string | number>;
20
- onChange?: (value: Array<TagSelectValueType> | TagSelectValueType) => void;
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;
@@ -12,8 +12,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
14
  import classNames from 'classnames';
15
- import { getPrefix } from "../_util";
16
- import React, { useMemo, useState, useEffect } from 'react';
15
+ import { ConfigProvider } from '@oceanbase/design';
16
+ import React, { useContext, useMemo, useState, useEffect } from 'react';
17
17
  import TagSelectContext from "./TagSelectContext";
18
18
  import Item from "./Item";
19
19
  import useStyle from "./style";
@@ -39,7 +39,9 @@ var Group = function Group(_ref) {
39
39
  children = _ref.children,
40
40
  className = _ref.className,
41
41
  restProps = _objectWithoutProperties(_ref, _excluded);
42
- var prefix = getPrefix('tag-select');
42
+ var _useContext = useContext(ConfigProvider.ConfigContext),
43
+ getPrefixCls = _useContext.getPrefixCls;
44
+ var prefix = getPrefixCls('tag-select');
43
45
  var _useStyle = useStyle(prefix),
44
46
  wrapSSR = _useStyle.wrapSSR,
45
47
  hashId = _useStyle.hashId;
@@ -16,9 +16,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import RcCheckBox from 'rc-checkbox';
17
17
  import classNames from 'classnames';
18
18
  import { isBoolean } from 'lodash';
19
- import React, { useEffect, useState } from 'react';
19
+ import React, { useContext, useEffect, useState } from 'react';
20
+ import { ConfigProvider } from '@oceanbase/design';
20
21
  import useStyle from "./style";
21
- import { getPrefix } from "../_util";
22
22
  import TagSelectContext from "./TagSelectContext";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -33,7 +33,9 @@ var Item = function Item(_ref) {
33
33
  checked = _useState2[0],
34
34
  setChecked = _useState2[1];
35
35
  var coverType = _typeof(cover);
36
- var prefixCls = getPrefix('tag-select');
36
+ var _useContext = useContext(ConfigProvider.ConfigContext),
37
+ getPrefixCls = _useContext.getPrefixCls;
38
+ var prefixCls = getPrefixCls('tag-select');
37
39
  var _useStyle = useStyle(prefixCls),
38
40
  wrapSSR = _useStyle.wrapSSR,
39
41
  hashId = _useStyle.hashId;
@@ -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,28 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ 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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import { genComponentStyleHook } from "../../../_util/genComponentStyleHook";
6
+ export var genTaskGraphItemStyle = function genTaskGraphItemStyle(token) {
7
+ var componentCls = token.componentCls,
8
+ antCls = token.antCls,
9
+ colorTextTertiary = token.colorTextTertiary;
10
+ return _defineProperty({}, "".concat(componentCls, "-menu"), _defineProperty({
11
+ position: 'fixed'
12
+ }, "".concat(componentCls, "-task-id-wrapper"), _defineProperty({
13
+ padding: '5px 12px'
14
+ }, "".concat(antCls, "-typography"), _defineProperty({
15
+ display: 'flex',
16
+ alignItems: 'center',
17
+ justifyContent: 'space-between',
18
+ color: colorTextTertiary
19
+ }, "".concat(antCls, "-typography-copy"), {
20
+ color: colorTextTertiary
21
+ }))));
22
+ };
23
+ export default (function (prefixCls) {
24
+ var useStyle = genComponentStyleHook('TaskGraphItem', function (token) {
25
+ return [genTaskGraphItemStyle(token)];
26
+ });
27
+ return useStyle(prefixCls);
28
+ });
@@ -1,6 +1,5 @@
1
1
  import type { GraphData } from '@antv/g6/lib/types';
2
2
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
3
- import './graph.less';
4
3
  export interface TaskGraphLocale {
5
4
  successful: string;
6
5
  running: string;
@@ -13,19 +13,29 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
14
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  import { findByValue } from '@oceanbase/util';
16
- import { Dropdown, Menu, Typography } from '@oceanbase/design';
16
+ import { ConfigProvider, Dropdown, Menu, Typography } from '@oceanbase/design';
17
17
  import { isEqual } from 'lodash';
18
18
  import React from 'react';
19
19
  import { token } from '@oceanbase/design';
20
20
  import GraphToolbar from "../GraphToolbar";
21
21
  import LocaleWrapper from "../locale/LocaleWrapper";
22
- import { getPrefix } from "../_util";
22
+ import useStyle from "./Graph/style";
23
23
  import zhCN from "./locale/zh-CN";
24
- import "./graph.less";
24
+ import { Fragment as _Fragment } from "react/jsx-runtime";
25
25
  import { jsx as _jsx } from "react/jsx-runtime";
26
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
27
27
  var Text = Typography.Text;
28
- var prefix = getPrefix('task-graph-item');
28
+
29
+ // Wrapper component to use hooks for styling
30
+ var GraphWrapper = function GraphWrapper(_ref) {
31
+ var prefixCls = _ref.prefixCls,
32
+ children = _ref.children;
33
+ var _useStyle = useStyle(prefixCls),
34
+ wrapSSR = _useStyle.wrapSSR;
35
+ return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {
36
+ children: children
37
+ }));
38
+ };
29
39
  var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
30
40
  _inherits(TaskGraph, _React$PureComponent);
31
41
  var _super = _createSuper(TaskGraph);
@@ -113,8 +123,8 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
113
123
  });
114
124
  }
115
125
  });
116
- _defineProperty(_assertThisInitialized(_this), "handleMenuClick", function (_ref) {
117
- var key = _ref.key;
126
+ _defineProperty(_assertThisInitialized(_this), "handleMenuClick", function (_ref2) {
127
+ var key = _ref2.key;
118
128
  var onMenuClick = _this.props.onMenuClick;
119
129
  var currentSubTask = _this.state.currentSubTask;
120
130
  // 成功的回调
@@ -196,6 +206,10 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
196
206
  var _this$state = this.state,
197
207
  statusList = _this$state.statusList,
198
208
  currentSubTask = _this$state.currentSubTask;
209
+ // @ts-ignore
210
+ var _ref3 = this.context || {},
211
+ getPrefixCls = _ref3.getPrefixCls;
212
+ var prefixCls = getPrefixCls === null || getPrefixCls === void 0 ? void 0 : getPrefixCls('task-graph-item');
199
213
  var operations = findByValue(statusList, currentSubTask && currentSubTask.status).operations || [];
200
214
  var menus = [{
201
215
  label: locale.taskId,
@@ -227,7 +241,7 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
227
241
  },
228
242
  children: filterMenus.map(function (item) {
229
243
  return item.value === 'taskId' ? /*#__PURE__*/_jsx("div", {
230
- className: "".concat(prefix, "-task-id-wrapper")
244
+ className: "".concat(prefixCls, "-task-id-wrapper")
231
245
  // 下拉菜单数 > 1 时才有下边框
232
246
  ,
233
247
  style: filterMenus.length > 1 ? {
@@ -237,12 +251,13 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
237
251
  copyable: true,
238
252
  children: "ID: ".concat(currentSubTask && currentSubTask.id)
239
253
  })
240
- }) : /*#__PURE__*/_jsx(Menu.Item, {
254
+ }, "task-id") : /*#__PURE__*/_jsx(Menu.Item, {
241
255
  children: item.label
242
256
  }, item.value);
243
257
  })
244
258
  });
245
- return /*#__PURE__*/_jsxs("div", {
259
+ return /*#__PURE__*/_jsxs(GraphWrapper, {
260
+ prefixCls: prefixCls,
246
261
  children: [this.graph && /*#__PURE__*/_jsx(GraphToolbar, {
247
262
  mode: "fixed",
248
263
  graph: this.graph
@@ -257,7 +272,7 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
257
272
  ,
258
273
  open: true,
259
274
  overlay: menu,
260
- overlayClassName: "".concat(prefix, "-menu"),
275
+ overlayClassName: "".concat(prefixCls, "-menu"),
261
276
  children: /*#__PURE__*/_jsx("span", {})
262
277
  })]
263
278
  });
@@ -265,6 +280,7 @@ var TaskGraph = /*#__PURE__*/function (_React$PureComponent) {
265
280
  }]);
266
281
  return TaskGraph;
267
282
  }(React.PureComponent);
283
+ _defineProperty(TaskGraph, "contextType", ConfigProvider.ConfigContext);
268
284
  export default LocaleWrapper({
269
285
  componentName: 'TaskGraph',
270
286
  defaultLocale: zhCN
@@ -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;
@@ -19,21 +19,19 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
20
  //@ts-nocheck
21
21
  import { DownOutlined, UpOutlined } from '@oceanbase/icons';
22
- import { Spin, Tabs } from '@oceanbase/design';
22
+ import { ConfigProvider, Spin, Tabs } from '@oceanbase/design';
23
23
  import { find, noop } from 'lodash';
24
- import React, { useState } from 'react';
24
+ import React, { useContext, useState } from 'react';
25
25
  import SplitPane from 'react-split-pane';
26
26
  import LocaleWrapper from "../locale/LocaleWrapper";
27
- import { getPrefix } from "../_util";
27
+ import useStyle from "./style";
28
28
  import Graph from "./Graph";
29
- import "./index.less";
30
29
  import zhCN from "./locale/zh-CN";
31
30
  import { jsx as _jsx } from "react/jsx-runtime";
32
31
  import { jsxs as _jsxs } from "react/jsx-runtime";
33
32
  var TabPane = Tabs.TabPane;
34
33
  var MIN_SIZE = 56;
35
34
  var DEFAULT_SIZE = 240;
36
- var prefix = getPrefix('task-graph');
37
35
  var TaskGraph = function TaskGraph(_ref) {
38
36
  var _ref$logLoading = _ref.logLoading,
39
37
  logLoading = _ref$logLoading === void 0 ? false : _ref$logLoading,
@@ -43,6 +41,11 @@ var TaskGraph = function TaskGraph(_ref) {
43
41
  _ref$onTabsEdit = _ref.onTabsEdit,
44
42
  onTabsEdit = _ref$onTabsEdit === void 0 ? noop : _ref$onTabsEdit,
45
43
  restProps = _objectWithoutProperties(_ref, _excluded);
44
+ var _useContext = useContext(ConfigProvider.ConfigContext),
45
+ getPrefixCls = _useContext.getPrefixCls;
46
+ var prefixCls = getPrefixCls('task-graph');
47
+ var _useStyle = useStyle(prefixCls),
48
+ wrapSSR = _useStyle.wrapSSR;
46
49
  var _useState = useState(DEFAULT_SIZE),
47
50
  _useState2 = _slicedToArray(_useState, 2),
48
51
  size = _useState2[0],
@@ -111,7 +114,7 @@ var TaskGraph = function TaskGraph(_ref) {
111
114
  setCollapsed(false);
112
115
  }
113
116
  },
114
- className: "".concat(prefix, "-split-pane"),
117
+ className: "".concat(prefixCls, "-split-pane"),
115
118
  children: [/*#__PURE__*/_jsx("div", {
116
119
  style: {
117
120
  position: 'absolute',
@@ -133,7 +136,7 @@ var TaskGraph = function TaskGraph(_ref) {
133
136
  }
134
137
  }, restProps))
135
138
  }), /*#__PURE__*/_jsx("div", {
136
- className: "".concat(prefix, "-tabs-wrapper"),
139
+ className: "".concat(prefixCls, "-tabs-wrapper"),
137
140
  children: /*#__PURE__*/_jsx(Tabs, {
138
141
  type: "editable-card",
139
142
  hideAdd: true,
@@ -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 TaskGraphToken = OBToken;
5
+ export declare const genTaskGraphStyle: GenerateStyle<TaskGraphToken>;
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;