@oceanbase/ui 0.2.18 → 0.2.20

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 +9 -8
@@ -10,5 +10,5 @@ export interface GroupProps {
10
10
  /** 更多操作的自定义展示 */
11
11
  moreText?: string | React.ReactElement;
12
12
  }
13
- declare const _default: ({ size, children, dropDownPlacement, shouldVisible, shouldDisabled, enableLoading, moreText, }: GroupProps) => React.JSX.Element;
13
+ declare const _default: ({ size, children, dropDownPlacement, shouldVisible, shouldDisabled, enableLoading, moreText, }: GroupProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
14
14
  export default _default;
@@ -1,5 +1,4 @@
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); }
3
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; }
4
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; }
5
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; }
@@ -9,6 +8,8 @@ import { Button, Dropdown, Menu, Space, Tooltip, Typography } from '@oceanbase/d
9
8
  import { EllipsisOutlined, LoadingOutlined } from '@oceanbase/icons';
10
9
  import { isBoolean, max, omit } from 'lodash';
11
10
  import React from 'react';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  var getOrder = function getOrder(_ref) {
13
14
  var type = _ref.type,
14
15
  fixed = _ref.fixed;
@@ -66,47 +67,55 @@ export default (function (_ref2) {
66
67
  };
67
68
  var moreDom;
68
69
  if (ellipsisType === 'default') {
69
- moreDom = /*#__PURE__*/React.createElement(Button, {
70
- type: ellipsisType
71
- }, moreText !== null && moreText !== void 0 ? moreText : /*#__PURE__*/React.createElement(EllipsisOutlined, {
72
- style: {
73
- cursor: 'pointer'
74
- }
75
- }));
70
+ moreDom = /*#__PURE__*/_jsx(Button, {
71
+ type: ellipsisType,
72
+ children: moreText !== null && moreText !== void 0 ? moreText : /*#__PURE__*/_jsx(EllipsisOutlined, {
73
+ style: {
74
+ cursor: 'pointer'
75
+ }
76
+ })
77
+ });
76
78
  } else {
77
- moreDom = /*#__PURE__*/React.createElement(Typography.Link, null, moreText !== null && moreText !== void 0 ? moreText : /*#__PURE__*/React.createElement(EllipsisOutlined, {
78
- style: {
79
- cursor: 'pointer'
80
- }
81
- }));
82
- }
83
- return /*#__PURE__*/React.createElement(Space, {
84
- size: 8
85
- }, mainActions.map(function (action) {
86
- return /*#__PURE__*/React.cloneElement(action, _objectSpread(_objectSpread({}, action.props), {}, {
87
- enableLoading: enableLoading,
88
- disabled: isBoolean(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key)
89
- }));
90
- }), ellipsisActions.length > 0 && /*#__PURE__*/React.createElement(Dropdown, {
91
- placement: dropDownPlacement,
92
- overlay: /*#__PURE__*/React.createElement(Menu, null, ellipsisActions.map(function (action, index) {
93
- var _ref3;
94
- var actionKey = action.key;
95
- var disabled = false;
96
- if (isBoolean(action.props.disabled)) disabled = action.props.disabled;else if (shouldDisabled) disabled = shouldDisabled(action.key);
97
- // 当用户传入loading 或者 传入 disabled 的情况都要禁用按钮
98
- var actionDisabled = action.props.loading || (isBoolean(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key));
99
- return /*#__PURE__*/React.createElement(Menu.Item, _extends({
100
- key: (_ref3 = actionKey) !== null && _ref3 !== void 0 ? _ref3 : index.toString(),
101
- onClick: action.props.onClick,
79
+ moreDom = /*#__PURE__*/_jsx(Typography.Link, {
80
+ children: moreText !== null && moreText !== void 0 ? moreText : /*#__PURE__*/_jsx(EllipsisOutlined, {
102
81
  style: {
103
- minWidth: 120
82
+ cursor: 'pointer'
104
83
  }
105
- }, omit(action.props, 'disabled'), {
106
- disabled: actionDisabled
107
- }), /*#__PURE__*/React.createElement(Tooltip, {
108
- title: action.props.tooltip
109
- }, action.props.loading && /*#__PURE__*/React.createElement(LoadingOutlined, null), " ", action.props.children));
110
- }))
111
- }, moreDom));
84
+ })
85
+ });
86
+ }
87
+ return /*#__PURE__*/_jsxs(Space, {
88
+ size: 8,
89
+ children: [mainActions.map(function (action) {
90
+ return /*#__PURE__*/React.cloneElement(action, _objectSpread(_objectSpread({}, action.props), {}, {
91
+ enableLoading: enableLoading,
92
+ disabled: isBoolean(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key)
93
+ }));
94
+ }), ellipsisActions.length > 0 && /*#__PURE__*/_jsx(Dropdown, {
95
+ placement: dropDownPlacement,
96
+ overlay: /*#__PURE__*/_jsx(Menu, {
97
+ children: ellipsisActions.map(function (action, index) {
98
+ var _ref3;
99
+ var actionKey = action.key;
100
+ var disabled = false;
101
+ if (isBoolean(action.props.disabled)) disabled = action.props.disabled;else if (shouldDisabled) disabled = shouldDisabled(action.key);
102
+ // 当用户传入loading 或者 传入 disabled 的情况都要禁用按钮
103
+ var actionDisabled = action.props.loading || (isBoolean(action.props.disabled) ? action.props.disabled : getDefaultDisabled(action.key));
104
+ return /*#__PURE__*/_jsx(Menu.Item, _objectSpread(_objectSpread({
105
+ onClick: action.props.onClick,
106
+ style: {
107
+ minWidth: 120
108
+ }
109
+ }, omit(action.props, 'disabled')), {}, {
110
+ disabled: actionDisabled,
111
+ children: /*#__PURE__*/_jsxs(Tooltip, {
112
+ title: action.props.tooltip,
113
+ children: [action.props.loading && /*#__PURE__*/_jsx(LoadingOutlined, {}), " ", action.props.children]
114
+ })
115
+ }), (_ref3 = actionKey) !== null && _ref3 !== void 0 ? _ref3 : index.toString());
116
+ })
117
+ }),
118
+ children: moreDom
119
+ })]
120
+ });
112
121
  });
@@ -19,7 +19,7 @@ export declare class ActionButton extends React.PureComponent<BaseProps> {
19
19
  state: {
20
20
  loading: boolean;
21
21
  };
22
- render(): React.JSX.Element;
22
+ render(): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
23
23
  }
24
24
  export declare class ActionLink extends React.PureComponent<BaseProps> {
25
25
  static __DISPLAY_NAME: string;
@@ -27,5 +27,5 @@ export declare class ActionLink extends React.PureComponent<BaseProps> {
27
27
  loading: boolean;
28
28
  disabled: boolean;
29
29
  };
30
- render(): React.JSX.Element;
30
+ render(): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
31
31
  }
package/es/Action/Item.js CHANGED
@@ -15,6 +15,8 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
15
15
  import { LoadingOutlined } from '@oceanbase/icons';
16
16
  import { Button, Tooltip, Typography } from '@oceanbase/design';
17
17
  import React from 'react';
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
20
  export var ActionButton = /*#__PURE__*/function (_React$PureComponent) {
19
21
  _inherits(ActionButton, _React$PureComponent);
20
22
  var _super = _createSuper(ActionButton);
@@ -45,29 +47,31 @@ export var ActionButton = /*#__PURE__*/function (_React$PureComponent) {
45
47
  tooltip = _this$props.tooltip,
46
48
  loading = _this$props.loading,
47
49
  danger = _this$props.danger;
48
- return /*#__PURE__*/React.createElement(Tooltip, {
50
+ return /*#__PURE__*/_jsx(Tooltip, {
49
51
  placement: "top",
50
- title: tooltip
51
- }, /*#__PURE__*/React.createElement(Button, {
52
- className: className,
53
- loading: enableLoading && (loading || this.state.loading),
54
- type: type,
55
- danger: danger,
56
- disabled: disabled,
57
- onClick: function onClick(_) {
58
- var handle = _onClick === null || _onClick === void 0 ? void 0 : _onClick();
59
- if (enableLoading && handle !== null && handle !== void 0 && handle.then) {
60
- _this2.setState({
61
- loading: true
62
- });
63
- handle.then(function () {
52
+ title: tooltip,
53
+ children: /*#__PURE__*/_jsx(Button, {
54
+ className: className,
55
+ loading: enableLoading && (loading || this.state.loading),
56
+ type: type,
57
+ danger: danger,
58
+ disabled: disabled,
59
+ onClick: function onClick(_) {
60
+ var handle = _onClick === null || _onClick === void 0 ? void 0 : _onClick();
61
+ if (enableLoading && handle !== null && handle !== void 0 && handle.then) {
64
62
  _this2.setState({
65
- loading: false
63
+ loading: true
66
64
  });
67
- });
68
- }
69
- }
70
- }, children));
65
+ handle.then(function () {
66
+ _this2.setState({
67
+ loading: false
68
+ });
69
+ });
70
+ }
71
+ },
72
+ children: children
73
+ })
74
+ });
71
75
  }
72
76
  }]);
73
77
  return ActionButton;
@@ -102,7 +106,7 @@ export var ActionLink = /*#__PURE__*/function (_React$PureComponent2) {
102
106
  enableLoading = _this$props2$enableLo === void 0 ? true : _this$props2$enableLo,
103
107
  tooltip = _this$props2.tooltip,
104
108
  loading = _this$props2.loading;
105
- return /*#__PURE__*/React.createElement(Typography.Link, {
109
+ return /*#__PURE__*/_jsx(Typography.Link, {
106
110
  className: className,
107
111
  style: {
108
112
  padding: 0
@@ -122,11 +126,13 @@ export var ActionLink = /*#__PURE__*/function (_React$PureComponent2) {
122
126
  });
123
127
  });
124
128
  }
125
- }
126
- }, /*#__PURE__*/React.createElement(Tooltip, {
127
- placement: "top",
128
- title: tooltip
129
- }, loading || this.state.disabled ? /*#__PURE__*/React.createElement(LoadingOutlined, null) : '', " ", children));
129
+ },
130
+ children: /*#__PURE__*/_jsxs(Tooltip, {
131
+ placement: "top",
132
+ title: tooltip,
133
+ children: [loading || this.state.disabled ? /*#__PURE__*/_jsx(LoadingOutlined, {}) : '', " ", children]
134
+ })
135
+ });
130
136
  }
131
137
  }]);
132
138
  return ActionLink;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { ActionButton, ActionLink } from './Item';
3
2
  declare const _default: {
4
- Group: ({ size, children, dropDownPlacement, shouldVisible, shouldDisabled, enableLoading, moreText, }: import("./Group").GroupProps) => import("react").JSX.Element;
3
+ Group: ({ size, children, dropDownPlacement, shouldVisible, shouldDisabled, enableLoading, moreText, }: import("./Group").GroupProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
5
4
  Button: typeof ActionButton;
6
5
  Link: typeof ActionLink;
7
6
  };
@@ -8,6 +8,8 @@ import { useInterval, useTimeout } from 'ahooks';
8
8
  import { Spin } from '@oceanbase/design';
9
9
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';
10
10
  import { REFRESH_FREQUENCY } from "./constants";
11
+ import { Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
11
13
  export var RefreshMan = /*#__PURE__*/forwardRef(function (props, ref) {
12
14
  var run = props.run,
13
15
  _props$timeout = props.timeout,
@@ -60,7 +62,10 @@ export var RefreshMan = /*#__PURE__*/forwardRef(function (props, ref) {
60
62
  stopLoop();
61
63
  };
62
64
  }, [startLoop, stopLoop, timeout]);
63
- return /*#__PURE__*/React.createElement(Spin, {
64
- spinning: spinning && refreshManLoading
65
- }, /*#__PURE__*/React.createElement(React.Fragment, null, children));
65
+ return /*#__PURE__*/_jsx(Spin, {
66
+ spinning: spinning && refreshManLoading,
67
+ children: /*#__PURE__*/_jsx(_Fragment, {
68
+ children: children
69
+ })
70
+ });
66
71
  });
@@ -16,6 +16,8 @@ import { REFRESH_FREQUENCY } from "./constants";
16
16
  import { RefreshMan } from "./RefreshMan";
17
17
 
18
18
  // antd Notification组件支持的api种类
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { Fragment as _Fragment } from "react/jsx-runtime";
19
21
  export var NotificationApi = /*#__PURE__*/function (NotificationApi) {
20
22
  NotificationApi["success"] = "success";
21
23
  NotificationApi["error"] = "error";
@@ -148,8 +150,10 @@ export default /*#__PURE__*/forwardRef(function (props, ref) {
148
150
  window.removeEventListener('beforeunload', onUnload);
149
151
  };
150
152
  }, [queue, preset]);
151
- return /*#__PURE__*/React.createElement(React.Fragment, null, !!taskQueue.length && /*#__PURE__*/React.createElement(RefreshMan, {
152
- run: run,
153
- rollingFrequency: rollingFrequency
154
- }));
153
+ return /*#__PURE__*/_jsx(_Fragment, {
154
+ children: !!taskQueue.length && /*#__PURE__*/_jsx(RefreshMan, {
155
+ run: run,
156
+ rollingFrequency: rollingFrequency
157
+ })
158
+ });
155
159
  });