@oceanbase/ui 0.2.13 → 0.2.15

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 (124) hide show
  1. package/dist/ui.min.css +1 -1
  2. package/dist/ui.min.js +1 -1
  3. package/es/Action/Item.js +6 -8
  4. package/es/BackgroundTaskManager/index.d.ts +5 -5
  5. package/es/BackgroundTaskManager/index.js +1 -1
  6. package/es/BasicLayout/Header.d.ts +1 -1
  7. package/es/BasicLayout/Header.js +4 -4
  8. package/es/BasicLayout/index.d.ts +3 -2
  9. package/es/BasicLayout/index.js +6 -7
  10. package/es/BasicLayout/style/index.d.ts +7 -3
  11. package/es/BatchOperationBar/index.d.ts +3 -3
  12. package/es/Boundary/constant.d.ts +4 -4
  13. package/es/ContentWithIcon/index.d.ts +21 -0
  14. package/es/ContentWithIcon/index.js +110 -0
  15. package/{lib/ContentWithQuestion → es/ContentWithIcon}/index.less +5 -1
  16. package/es/DocDialog/index.js +1 -2
  17. package/es/FullscreenBox/index.d.ts +1 -1
  18. package/es/Highlight/index.d.ts +2 -2
  19. package/es/LocaleDropdown/index.d.ts +1 -1
  20. package/es/Login/ActivateForm.d.ts +1 -1
  21. package/es/Login/ActivateForm.js +5 -5
  22. package/es/Login/LoginForm.d.ts +1 -1
  23. package/es/Login/RegisterForm.d.ts +1 -1
  24. package/es/Login/RegisterForm.js +5 -5
  25. package/es/Login/index.d.ts +2 -2
  26. package/es/Lottie/index.d.ts +2 -1
  27. package/es/NavMenu/index.js +5 -6
  28. package/es/PageContainer/ItemRender.js +3 -3
  29. package/es/PageContainer/index.d.ts +2 -2
  30. package/es/PageContainer/index.js +2 -3
  31. package/es/PageContainer/style/index.d.ts +6 -2
  32. package/es/Password/index.d.ts +2 -2
  33. package/es/Ranger/QuickPicker.d.ts +2 -1
  34. package/es/Ranger/Ranger.d.ts +3 -3
  35. package/es/Ranger/index.d.ts +1 -32
  36. package/es/SideTip/index.d.ts +4 -4
  37. package/es/TagSelect/Group.d.ts +23 -0
  38. package/es/TagSelect/Group.js +121 -0
  39. package/es/TagSelect/Item.d.ts +17 -0
  40. package/es/TagSelect/Item.js +84 -0
  41. package/es/TagSelect/TagSelectContext.d.ts +13 -0
  42. package/es/TagSelect/TagSelectContext.js +3 -0
  43. package/es/TagSelect/index.d.ts +6 -0
  44. package/es/TagSelect/index.js +6 -0
  45. package/es/TagSelect/style/index.d.ts +9 -0
  46. package/es/TagSelect/style/index.js +98 -0
  47. package/es/TreeSearch/index.d.ts +1 -1
  48. package/es/Welcome/index.d.ts +2 -2
  49. package/es/_util/genComponentStyleHook.d.ts +6 -2
  50. package/es/_util/genComponentStyleHook.js +5 -5
  51. package/es/_util/useNavigate.d.ts +2 -0
  52. package/es/_util/useNavigate.js +7 -0
  53. package/es/index.d.ts +2 -1
  54. package/es/index.js +3 -2
  55. package/es/interface.d.ts +1 -1
  56. package/es/locale/en-US.js +2 -2
  57. package/es/locale/index.d.ts +2 -2
  58. package/es/locale/zh-CN.js +2 -2
  59. package/es/locale/zh-TW.js +2 -2
  60. package/lib/Action/Item.js +5 -7
  61. package/lib/BackgroundTaskManager/index.d.ts +5 -5
  62. package/lib/BackgroundTaskManager/index.js +1 -1
  63. package/lib/BasicLayout/Header.d.ts +1 -1
  64. package/lib/BasicLayout/Header.js +4 -4
  65. package/lib/BasicLayout/index.d.ts +3 -2
  66. package/lib/BasicLayout/index.js +6 -6
  67. package/lib/BasicLayout/style/index.d.ts +7 -3
  68. package/lib/BatchOperationBar/index.d.ts +3 -3
  69. package/lib/Boundary/constant.d.ts +4 -4
  70. package/lib/ContentWithIcon/index.d.ts +21 -0
  71. package/lib/ContentWithIcon/index.js +130 -0
  72. package/{es/ContentWithQuestion → lib/ContentWithIcon}/index.less +5 -1
  73. package/lib/DocDialog/index.js +1 -2
  74. package/lib/FullscreenBox/index.d.ts +1 -1
  75. package/lib/Highlight/index.d.ts +2 -2
  76. package/lib/LocaleDropdown/index.d.ts +1 -1
  77. package/lib/Login/ActivateForm.d.ts +1 -1
  78. package/lib/Login/ActivateForm.js +5 -5
  79. package/lib/Login/LoginForm.d.ts +1 -1
  80. package/lib/Login/RegisterForm.d.ts +1 -1
  81. package/lib/Login/RegisterForm.js +5 -5
  82. package/lib/Login/index.d.ts +2 -2
  83. package/lib/Lottie/index.d.ts +2 -1
  84. package/lib/NavMenu/index.js +5 -6
  85. package/lib/PageContainer/ItemRender.js +3 -3
  86. package/lib/PageContainer/index.d.ts +2 -2
  87. package/lib/PageContainer/index.js +2 -3
  88. package/lib/PageContainer/style/index.d.ts +6 -2
  89. package/lib/Password/index.d.ts +2 -2
  90. package/lib/Ranger/QuickPicker.d.ts +2 -1
  91. package/lib/Ranger/Ranger.d.ts +3 -3
  92. package/lib/Ranger/index.d.ts +1 -32
  93. package/lib/SideTip/index.d.ts +4 -4
  94. package/lib/TagSelect/Group.d.ts +23 -0
  95. package/lib/TagSelect/Group.js +128 -0
  96. package/lib/TagSelect/Item.d.ts +17 -0
  97. package/lib/TagSelect/Item.js +108 -0
  98. package/lib/TagSelect/TagSelectContext.d.ts +13 -0
  99. package/lib/TagSelect/TagSelectContext.js +27 -0
  100. package/lib/TagSelect/index.d.ts +6 -0
  101. package/lib/TagSelect/index.js +37 -0
  102. package/lib/TagSelect/style/index.d.ts +9 -0
  103. package/lib/TagSelect/style/index.js +152 -0
  104. package/lib/TreeSearch/index.d.ts +1 -1
  105. package/lib/Welcome/index.d.ts +2 -2
  106. package/lib/_util/genComponentStyleHook.d.ts +6 -2
  107. package/lib/_util/genComponentStyleHook.js +3 -3
  108. package/lib/_util/useNavigate.d.ts +2 -0
  109. package/lib/_util/{useHistory.js → useNavigate.js} +10 -11
  110. package/lib/index.d.ts +2 -1
  111. package/lib/index.js +6 -3
  112. package/lib/interface.d.ts +1 -1
  113. package/lib/locale/en-US.js +1 -1
  114. package/lib/locale/index.d.ts +2 -2
  115. package/lib/locale/zh-CN.js +1 -1
  116. package/lib/locale/zh-TW.js +1 -1
  117. package/package.json +10 -11
  118. package/es/ContentWithQuestion/index.d.ts +0 -13
  119. package/es/ContentWithQuestion/index.js +0 -46
  120. package/es/_util/useHistory.d.ts +0 -4
  121. package/es/_util/useHistory.js +0 -13
  122. package/lib/ContentWithQuestion/index.d.ts +0 -13
  123. package/lib/ContentWithQuestion/index.js +0 -76
  124. package/lib/_util/useHistory.d.ts +0 -4
package/es/Action/Item.js CHANGED
@@ -55,18 +55,16 @@ export var ActionButton = /*#__PURE__*/function (_React$PureComponent) {
55
55
  danger: danger,
56
56
  disabled: disabled,
57
57
  onClick: function onClick(_) {
58
- if (enableLoading) {
58
+ var handle = _onClick === null || _onClick === void 0 ? void 0 : _onClick();
59
+ if (enableLoading && handle !== null && handle !== void 0 && handle.then) {
59
60
  _this2.setState({
60
61
  loading: true
61
62
  });
62
- var handle = _onClick === null || _onClick === void 0 ? void 0 : _onClick();
63
- if (handle.then) {
64
- handle.then(function () {
65
- _this2.setState({
66
- loading: false
67
- });
63
+ handle.then(function () {
64
+ _this2.setState({
65
+ loading: false
68
66
  });
69
- }
67
+ });
70
68
  }
71
69
  }
72
70
  }, children));
@@ -1,5 +1,5 @@
1
- import type { GlobalConfigProps, NotificationInstance } from 'antd/es/notification/interface';
2
1
  import React from 'react';
2
+ import type { GlobalConfigProps, NotificationInstance } from '@oceanbase/design/es/notification/interface';
3
3
  export declare enum NotificationApi {
4
4
  success = "success",
5
5
  error = "error",
@@ -16,9 +16,9 @@ export declare const BackgroundTaskManagerConstants: {
16
16
  };
17
17
  NotificationApi: typeof NotificationApi;
18
18
  };
19
- declare type Namespace = string;
20
- export declare type TaskMgrID = string | number;
21
- export declare type ITaskMgrQueue = Record<TaskMgrID, Namespace>;
19
+ type Namespace = string;
20
+ export type TaskMgrID = string | number;
21
+ export type ITaskMgrQueue = Record<TaskMgrID, Namespace>;
22
22
  interface NotificationAction {
23
23
  api: (params: any) => Promise<any>;
24
24
  successCb: (response: any, id: TaskMgrID) => {
@@ -30,7 +30,7 @@ interface NotificationAction {
30
30
  config: GlobalConfigProps;
31
31
  } | null;
32
32
  }
33
- export declare type ITaskMgrPreset = Record<Namespace, NotificationAction>;
33
+ export type ITaskMgrPreset = Record<Namespace, NotificationAction>;
34
34
  export interface BackgroundTaskManagerRef {
35
35
  pushQueue: (queue: ITaskMgrQueue) => void;
36
36
  popQueue: (id: TaskMgrID) => void;
@@ -10,8 +10,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { notification } from '@oceanbase/design';
14
13
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
14
+ import { notification } from '@oceanbase/design';
15
15
  import { REFRESH_FREQUENCY } from "./constants";
16
16
  import { RefreshMan } from "./RefreshMan";
17
17
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { Locale } from '../interface';
3
3
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
4
4
  import './Header.less';
5
- export declare type OverlayFunc = () => React.ReactElement;
5
+ export type OverlayFunc = () => React.ReactElement;
6
6
  export interface HeaderLocale {
7
7
  help: string;
8
8
  welcome: string;
@@ -20,7 +20,7 @@ import React, { useState } from 'react';
20
20
  import { OB_SITE_LINK } from "../constant";
21
21
  import LocaleWrapper from "../locale/LocaleWrapper";
22
22
  import { directTo, getPrefix } from "../_util";
23
- import useHistory from "../_util/useHistory";
23
+ import useNavigate from "../_util/useNavigate";
24
24
  import zhCN from "./locale/zh-CN";
25
25
  // @ts-ignore
26
26
  import logoImg from "../assets/logo/oceanbase_logo.svg";
@@ -56,7 +56,7 @@ var Header = function Header(_ref) {
56
56
  locales = _ref.locales,
57
57
  langs = _ref.langs,
58
58
  restProps = _objectWithoutProperties(_ref, _excluded);
59
- var history = useHistory();
59
+ var navigate = useNavigate();
60
60
  var _useState = useState(false),
61
61
  _useState2 = _slicedToArray(_useState, 2),
62
62
  visible = _useState2[0],
@@ -69,7 +69,7 @@ var Header = function Header(_ref) {
69
69
  onClick: function onClick(_ref2) {
70
70
  var key = _ref2.key;
71
71
  if (key === 'welcome') {
72
- history.push(welcomePath);
72
+ navigate === null || navigate === void 0 ? void 0 : navigate(welcomePath);
73
73
  } else if (key === 'viewDocs') {
74
74
  directTo(docsPath);
75
75
  } else if (key === 'downloadDocs') {
@@ -98,7 +98,7 @@ var Header = function Header(_ref) {
98
98
  src: simpleLogoUrl,
99
99
  alt: "",
100
100
  onClick: function onClick() {
101
- history.push('/');
101
+ navigate === null || navigate === void 0 ? void 0 : navigate('/');
102
102
  },
103
103
  className: "".concat(prefix, "-logo")
104
104
  }), title && /*#__PURE__*/React.createElement("div", {
@@ -1,5 +1,5 @@
1
- import type { BadgeProps } from 'antd/es/badge';
2
- import type { MenuProps } from 'antd/es/menu';
1
+ import type { BadgeProps } from '@oceanbase/design/es/badge';
2
+ import type { MenuProps } from '@oceanbase/design/es/menu';
3
3
  import React from 'react';
4
4
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
5
5
  import type { HeaderProps } from './Header';
@@ -39,6 +39,7 @@ export interface BasicLayoutProps extends LocaleWrapperProps {
39
39
  sideHeader?: React.ReactNode;
40
40
  subSideMenus?: MenuItem[];
41
41
  subSideMenuProps?: MenuProps;
42
+ prefixCls?: string;
42
43
  style?: React.CSSProperties;
43
44
  }
44
45
  declare const _default: any;
@@ -23,7 +23,7 @@ import { pathToRegexp } from 'path-to-regexp';
23
23
  import React, { useContext, useEffect, useState } from 'react';
24
24
  import LocaleWrapper from "../locale/LocaleWrapper";
25
25
  import { getPrefix, isEnglish, urlToList } from "../_util";
26
- import useHistory from "../_util/useHistory";
26
+ import useNavigate from "../_util/useNavigate";
27
27
  import Header from "./Header";
28
28
  import zhCN from "./locale/zh-CN";
29
29
  import useStyle from "./style";
@@ -62,10 +62,9 @@ var BasicLayout = function BasicLayout(_ref) {
62
62
  getPrefixCls = _useContext.getPrefixCls;
63
63
  var prefixCls = getPrefixCls('basic-layout', customizePrefixCls);
64
64
  var _useStyle = useStyle(prefixCls),
65
- wrapSSR = _useStyle.wrapSSR,
66
- hashId = _useStyle.hashId;
67
- var basicLayoutCls = classNames(className, hashId);
68
- var history = useHistory();
65
+ wrapSSR = _useStyle.wrapSSR;
66
+ var basicLayoutCls = classNames(className);
67
+ var navigate = useNavigate();
69
68
  // 侧边栏导航是否收起
70
69
  var _useState = useState(defaultCollapsed),
71
70
  _useState2 = _slicedToArray(_useState, 2),
@@ -166,7 +165,7 @@ var BasicLayout = function BasicLayout(_ref) {
166
165
  key: item.link,
167
166
  onClick: function onClick() {
168
167
  if (pathname !== item.link) {
169
- history.push(item.link);
168
+ navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
170
169
  }
171
170
  }
172
171
  }, /*#__PURE__*/React.createElement(Tooltip, _extends({
@@ -218,7 +217,7 @@ var BasicLayout = function BasicLayout(_ref) {
218
217
  key: item.link,
219
218
  onClick: function onClick() {
220
219
  if (pathname !== item.link) {
221
- history.push(item.link);
220
+ navigate === null || navigate === void 0 ? void 0 : navigate(item.link);
222
221
  }
223
222
  }
224
223
  }, /*#__PURE__*/React.createElement(Tooltip, {
@@ -1,5 +1,9 @@
1
- import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
2
- export declare type BasicLayoutToken = FullToken<any>;
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from '@oceanbase/design/es/theme';
3
+ export type BasicLayoutToken = FullToken<any>;
3
4
  export declare const genBasicLayoutStyle: GenerateStyle<BasicLayoutToken>;
4
- declare const _default: (prefixCls: string) => any;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
7
+ hashId: string;
8
+ };
5
9
  export default _default;
@@ -7,9 +7,9 @@ export interface AlertRenderParams {
7
7
  setSelectedRows: (selectedRows: any[]) => void;
8
8
  cleanSelectedRows: (cleanSelectdRows?: any[]) => void;
9
9
  }
10
- export declare type RenderFun = ((props: AlertRenderParams) => ReactNode) | false;
11
- export declare type Vertical = 'top' | 'bottom';
12
- export declare type Horizontal = 'left' | 'right';
10
+ export type RenderFun = ((props: AlertRenderParams) => ReactNode) | false;
11
+ export type Vertical = 'top' | 'bottom';
12
+ export type Horizontal = 'left' | 'right';
13
13
  export interface Props extends LocaleWrapperProps {
14
14
  width?: number | string;
15
15
  title?: ReactNode;
@@ -4,10 +4,10 @@ export interface ConfigType {
4
4
  buttonText?: string;
5
5
  onClick?: () => void;
6
6
  }
7
- export declare type FunctionConfigType = Record<string, ConfigType>;
8
- export declare type FunctionStateType = keyof FunctionConfigType;
9
- export declare type CodeType = 404 | 403;
10
- export declare type CodePresetType = Record<CodeType, ConfigType>;
7
+ export type FunctionConfigType = Record<string, ConfigType>;
8
+ export type FunctionStateType = keyof FunctionConfigType;
9
+ export type CodeType = 404 | 403;
10
+ export type CodePresetType = Record<CodeType, ConfigType>;
11
11
  export declare const CODE_PRESET: (locale: any) => CodePresetType;
12
12
  export declare const EXCEPTION_PRESET: (locale: any) => {
13
13
  ERROR_BOUNDARY: {
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface ContentWithIconProps {
4
+ content?: React.ReactNode;
5
+ tooltip?: any;
6
+ prefixIcon?: React.ReactNode | boolean;
7
+ suffixIcon?: React.ReactNode;
8
+ className?: string;
9
+ iconType?: 'question' | 'info' | 'exclamation';
10
+ color?: string;
11
+ style?: React.CSSProperties;
12
+ onClick?: (e: React.SyntheticEvent) => void;
13
+ tooltipWithLink?: boolean;
14
+ textHidden?: boolean;
15
+ popOver?: any;
16
+ size?: number;
17
+ infoColor?: string;
18
+ exclamationColor?: string;
19
+ }
20
+ declare const ContentWithIcon: React.FC<ContentWithIconProps>;
21
+ export default ContentWithIcon;
@@ -0,0 +1,110 @@
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
+ var _excluded = ["content", "tooltip", "prefixIcon", "suffixIcon", "className", "children", "iconType", "color", "tooltipWithLink", "popOver", "textHidden", "size", "infoColor", "exclamationColor"];
3
+ 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); }
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); }
7
+ 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; }
8
+ 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; }
9
+ import React, { isValidElement } from 'react';
10
+ import { Tooltip, Space, Popover } from 'antd';
11
+ import { ExclamationCircleFilled, InfoCircleFilled, InfoCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
12
+ import classNames from 'classnames';
13
+ import { getPrefix } from "../_util";
14
+ import "./index.less";
15
+ var prefix = getPrefix('content-with-question');
16
+ var ContentWithIcon = function ContentWithIcon(_ref) {
17
+ var _classNames;
18
+ var content = _ref.content,
19
+ tooltip = _ref.tooltip,
20
+ _ref$prefixIcon = _ref.prefixIcon,
21
+ prefixIcon = _ref$prefixIcon === void 0 ? null : _ref$prefixIcon,
22
+ suffixIcon = _ref.suffixIcon,
23
+ className = _ref.className,
24
+ children = _ref.children,
25
+ iconType = _ref.iconType,
26
+ color = _ref.color,
27
+ _ref$tooltipWithLink = _ref.tooltipWithLink,
28
+ tooltipWithLink = _ref$tooltipWithLink === void 0 ? false : _ref$tooltipWithLink,
29
+ popOver = _ref.popOver,
30
+ _ref$textHidden = _ref.textHidden,
31
+ textHidden = _ref$textHidden === void 0 ? true : _ref$textHidden,
32
+ _ref$size = _ref.size,
33
+ size = _ref$size === void 0 ? 14 : _ref$size,
34
+ infoColor = _ref.infoColor,
35
+ _ref$exclamationColor = _ref.exclamationColor,
36
+ exclamationColor = _ref$exclamationColor === void 0 ? '#FAAD14' : _ref$exclamationColor,
37
+ restProps = _objectWithoutProperties(_ref, _excluded);
38
+ var defaultIconType = function defaultIconType() {
39
+ if (iconType === 'question') {
40
+ return /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
41
+ style: {
42
+ color: color === 'default' ? '#132039' : color,
43
+ fontSize: size
44
+ },
45
+ className: "".concat(prefix, "-help")
46
+ });
47
+ }
48
+ if (iconType === 'info') {
49
+ if (infoColor) {
50
+ return /*#__PURE__*/React.createElement(InfoCircleFilled, {
51
+ style: {
52
+ color: infoColor,
53
+ fontSize: size
54
+ },
55
+ className: "".concat(prefix, "-help")
56
+ });
57
+ } else {
58
+ return /*#__PURE__*/React.createElement(InfoCircleOutlined, {
59
+ style: {
60
+ color: '3333333',
61
+ fontSize: size
62
+ },
63
+ className: "".concat(prefix, "-help")
64
+ });
65
+ }
66
+ }
67
+ if (iconType === 'exclamation') {
68
+ return /*#__PURE__*/React.createElement(ExclamationCircleFilled, {
69
+ style: {
70
+ color: exclamationColor,
71
+ fontSize: size
72
+ },
73
+ className: "".concat(prefix, "-help")
74
+ });
75
+ }
76
+ };
77
+
78
+ // 图标在文字后
79
+ suffixIcon = suffixIcon !== null && iconType ? defaultIconType() : suffixIcon; // 自定义图标,非内置
80
+
81
+ // FIXME: antd 已经废弃 icon type 的用法,该组件也需要做相应处理,后面将会是传入 Icon 的形式而非 type
82
+ var getIcon = function getIcon(iconConfig) {
83
+ return iconConfig ? !textHidden && iconType === 'info' ?
84
+ /*#__PURE__*/
85
+ // 文本描述直接展示且只在 info 类型下生效
86
+ React.createElement(Space, {
87
+ size: 4
88
+ }, iconConfig, /*#__PURE__*/React.createElement("span", {
89
+ style: {
90
+ color: '#5C6B8A'
91
+ }
92
+ }, "\u6587\u672C\u793A\u610F\u4E0D\u8D85\u8FC7\u4E8C\u5341\u5B57\u6587\u672C\u793A\u610F\u4E0D\u8D85\u8FC7\u4E8C\u5341\u5B57")) :
93
+ // 提示文案描述带有链接
94
+ tooltipWithLink ? /*#__PURE__*/React.createElement(Popover, popOver, /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : defaultIconType()) : /*#__PURE__*/React.createElement(Tooltip, tooltip, /*#__PURE__*/isValidElement(iconConfig) ? iconConfig : defaultIconType()) : null;
95
+ };
96
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", _extends({
97
+ className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "-item"), true), _defineProperty(_classNames, className, !!className), _classNames))
98
+ }, restProps), /*#__PURE__*/React.createElement(Space, {
99
+ size: 4
100
+ }, getIcon(
101
+ // 图标在文字前
102
+ prefixIcon === true ? defaultIconType() : prefixIcon), /*#__PURE__*/React.createElement("span", {
103
+ "data-testid": "content",
104
+ style: {
105
+ color: color === 'default' ? '#5C6B8A' : color,
106
+ fontSize: size
107
+ }
108
+ }, content !== null && content !== void 0 ? content : children), getIcon(suffixIcon))));
109
+ };
110
+ export default ContentWithIcon;
@@ -1,4 +1,4 @@
1
- @prefix: ob-content-with-question;
1
+ @prefix: ob-content-with-icon;
2
2
 
3
3
  .@{prefix}-item {
4
4
  display: inline-flex;
@@ -15,4 +15,8 @@
15
15
  .@{prefix}-help {
16
16
  cursor: help;
17
17
  }
18
+ .@{prefix}-color {
19
+ color: red;
20
+
21
+ }
18
22
  }
@@ -12,7 +12,6 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { debounce } from 'lodash';
14
14
  import React, { useEffect, useMemo, useState } from 'react';
15
- import { useLocation } from 'react-router-dom';
16
15
  import Dialog from "../Dialog";
17
16
  import LocaleWrapper from "../locale/LocaleWrapper";
18
17
  import zhCN from "./locale/zh-CN";
@@ -45,7 +44,7 @@ var DocDialogComp = function DocDialogComp(props) {
45
44
  _useState4 = _slicedToArray(_useState3, 2),
46
45
  clientWidth = _useState4[0],
47
46
  setClientWidth = _useState4[1];
48
- var location = useLocation();
47
+ var location = window.location;
49
48
  var currentLink = useMemo(function () {
50
49
  var _link$;
51
50
  var pathname = location.pathname;
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
4
4
  import './index.less';
5
- export declare type FullscreenModeType = 'viewport' | 'browser';
5
+ export type FullscreenModeType = 'viewport' | 'browser';
6
6
  export interface FullscreenBoxRef {
7
7
  changeFullscreen: () => void;
8
8
  }
@@ -28,9 +28,9 @@ export declare const languageMap: {
28
28
  export declare const THEME_DARK = "dark";
29
29
  export declare const THEME_LIGHT = "light";
30
30
  declare const ThemeTypes: ["dark", "light"];
31
- export declare type ThemeType = (typeof ThemeTypes)[number];
31
+ export type ThemeType = (typeof ThemeTypes)[number];
32
32
  declare const supportedLanguages: ("ruby" | "json" | "javascript" | "typescript" | "css" | "groovy" | "java" | "python" | "bash" | "cpp" | "http" | "markdown" | "nginx" | "sql" | "xml" | "dockerfile" | "go" | "yaml" | "solidity" | "tsx" | "jsx")[];
33
- export declare type LanguageType = (typeof supportedLanguages)[number] | 'html';
33
+ export type LanguageType = (typeof supportedLanguages)[number] | 'html';
34
34
  export interface HighlightProps extends LocaleWrapperProps {
35
35
  /**
36
36
  * @description 样式
@@ -1,4 +1,4 @@
1
- import type { DropdownProps } from 'antd/es/dropdown';
1
+ import type { DropdownProps } from '@oceanbase/design/es/dropdown';
2
2
  import React from 'react';
3
3
  import type { Locale } from '../interface';
4
4
  export interface LocaleDropdownProps extends DropdownProps {
@@ -1,4 +1,4 @@
1
- import type { FormProps } from 'antd/es/form';
1
+ import type { FormProps } from '@oceanbase/design/es/form';
2
2
  import React from 'react';
3
3
  import type { LoginLocale } from './index';
4
4
  import './index.less';
@@ -24,19 +24,19 @@ var Activate = function Activate(_ref) {
24
24
  restProps = _objectWithoutProperties(_ref, _excluded);
25
25
  var _Form$useForm = Form.useForm(),
26
26
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
27
- formRef = _Form$useForm2[0];
27
+ form = _Form$useForm2[0];
28
28
  var handleValidateConfirmPassword = useCallback(function (rule, value, callback) {
29
- if (!formRef) {
29
+ if (!form) {
30
30
  callback();
31
31
  return;
32
32
  }
33
- var pwd = formRef.getFieldValue('password');
33
+ var pwd = form.getFieldValue('password');
34
34
  if (toString(value) !== toString(pwd)) {
35
35
  callback(locale.samePasswordMessage);
36
36
  return;
37
37
  }
38
38
  callback();
39
- }, [formRef]);
39
+ }, [form]);
40
40
  var passwordRegexpRule = passwordRule || {
41
41
  pattern: PASSWORD_REGEX,
42
42
  message: locale.passwordHelp
@@ -45,7 +45,7 @@ var Activate = function Activate(_ref) {
45
45
  layout: "vertical",
46
46
  requiredMark: false,
47
47
  className: "".concat(prefix, "-form"),
48
- form: formRef
48
+ form: form
49
49
  }, restProps, {
50
50
  "data-testid": "login.register"
51
51
  }), errorMessage && /*#__PURE__*/React.createElement(Alert, {
@@ -1,4 +1,4 @@
1
- import type { FormProps } from 'antd/es/form';
1
+ import type { FormProps } from '@oceanbase/design/es/form';
2
2
  import React from 'react';
3
3
  import type { LoginLocale } from '.';
4
4
  import './index.less';
@@ -1,4 +1,4 @@
1
- import type { FormProps } from 'antd/es/form';
1
+ import type { FormProps } from '@oceanbase/design/es/form';
2
2
  import React from 'react';
3
3
  import type { LoginLocale } from './index';
4
4
  import './index.less';
@@ -33,7 +33,7 @@ var Register = function Register(_ref) {
33
33
  restProps = _objectWithoutProperties(_ref, _excluded);
34
34
  var _Form$useForm = Form.useForm(),
35
35
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
36
- formRef = _Form$useForm2[0];
36
+ form = _Form$useForm2[0];
37
37
  var handleValidateAccount = useCallback( /*#__PURE__*/function () {
38
38
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(rule, value) {
39
39
  var isExists;
@@ -66,17 +66,17 @@ var Register = function Register(_ref) {
66
66
  };
67
67
  }(), [isUserExists]);
68
68
  var handleValidateConfirmPassword = useCallback(function (rule, value, callback) {
69
- if (!formRef) {
69
+ if (!form) {
70
70
  callback();
71
71
  return;
72
72
  }
73
- var pwd = formRef.getFieldValue('password');
73
+ var pwd = form.getFieldValue('password');
74
74
  if (toString(value) !== toString(pwd)) {
75
75
  callback(locale.samePasswordMessage);
76
76
  return;
77
77
  }
78
78
  callback();
79
- }, [formRef]);
79
+ }, [form]);
80
80
  var passwordRegexpRule = passwordRule || {
81
81
  pattern: PASSWORD_REGEX,
82
82
  message: locale.passwordHelp
@@ -85,7 +85,7 @@ var Register = function Register(_ref) {
85
85
  layout: "vertical",
86
86
  requiredMark: false,
87
87
  className: "".concat(prefix, "-form"),
88
- form: formRef
88
+ form: form
89
89
  }, restProps, {
90
90
  "data-testid": "login.register"
91
91
  }), errorMessage && /*#__PURE__*/React.createElement(Alert, {
@@ -1,5 +1,5 @@
1
- import type { AlertProps } from 'antd/es/alert';
2
- import type { FormProps } from 'antd/es/form';
1
+ import type { AlertProps } from '@oceanbase/design/es/alert';
2
+ import type { FormProps } from '@oceanbase/design/es/form';
3
3
  import React from 'react';
4
4
  import type { IActivateFormProps } from './ActivateForm';
5
5
  import type { ILoginFormProps } from './LoginForm';
@@ -1,7 +1,8 @@
1
1
  import type { AnimationConfig, AnimationItem } from 'lottie-web';
2
2
  import React from 'react';
3
3
  export interface LottieProps extends Omit<AnimationConfig, 'container'> {
4
- path: string;
4
+ path?: string;
5
+ animationData?: any;
5
6
  mode?: 'default' | 'icon';
6
7
  loop?: boolean;
7
8
  speed?: number;
@@ -8,9 +8,8 @@ import { Menu } from '@oceanbase/design';
8
8
  import { isArray } from 'lodash';
9
9
  import { pathToRegexp } from 'path-to-regexp';
10
10
  import React, { useCallback, useEffect, useState } from 'react';
11
- import { useLocation } from 'react-router-dom';
12
11
  import { getPrefix } from "../_util";
13
- import useHistory from "../_util/useHistory";
12
+ import useNavigate from "../_util/useNavigate";
14
13
  import "./index.less";
15
14
  var prefix = getPrefix('menu');
16
15
  export default (function (props) {
@@ -25,8 +24,8 @@ export default (function (props) {
25
24
  _useState4 = _slicedToArray(_useState3, 2),
26
25
  menus = _useState4[0],
27
26
  setMenus = _useState4[1];
28
- var location = useLocation();
29
- var history = useHistory();
27
+ var location = window.location;
28
+ var navigate = useNavigate();
30
29
  var preProcess = useCallback(function (list) {
31
30
  var pathname = location.pathname;
32
31
  try {
@@ -71,8 +70,8 @@ export default (function (props) {
71
70
  }, [setSelectedKeys, menus]);
72
71
  var onMenuClick = useCallback(function (link) {
73
72
  var linkList = isArray(link) ? link : [link];
74
- history.push(linkList[0]);
75
- }, [history]);
73
+ navigate === null || navigate === void 0 ? void 0 : navigate(linkList[0]);
74
+ }, [navigate]);
76
75
  return /*#__PURE__*/React.createElement("div", {
77
76
  className: "".concat(prefix, "-container ").concat(className),
78
77
  style: style
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import useHistory from "../_util/useHistory";
2
+ import useNavigate from "../_util/useNavigate";
3
3
  export default (function (_ref) {
4
4
  var route = _ref.route,
5
5
  params = _ref.params,
@@ -13,10 +13,10 @@ export default (function (_ref) {
13
13
  var path = route.href || routes.slice(0, routeIndex + 1).map(function (item) {
14
14
  return item.path;
15
15
  }).join('/');
16
- var history = useHistory();
16
+ var navigate = useNavigate();
17
17
  return last ? /*#__PURE__*/React.createElement("span", null, title) : /*#__PURE__*/React.createElement("a", {
18
18
  onClick: function onClick() {
19
- history.push(path);
19
+ navigate === null || navigate === void 0 ? void 0 : navigate(path);
20
20
  }
21
21
  }, title);
22
22
  });
@@ -1,11 +1,11 @@
1
1
  import type { IconComponentProps } from '@oceanbase/icons/es/components/Icon';
2
2
  import type { PageContainerProps as AntPageContainerProps, PageHeaderProps as AntPageHeaderProps } from '@ant-design/pro-components';
3
3
  import React from 'react';
4
- export declare type ReloadType = boolean | IconComponentProps | React.ReactNode;
4
+ export type ReloadType = boolean | IconComponentProps | React.ReactNode;
5
5
  export interface PageContainerLocale {
6
6
  reload?: string;
7
7
  }
8
- export declare type PageHeaderProps = AntPageHeaderProps & {
8
+ export type PageHeaderProps = AntPageHeaderProps & {
9
9
  reload?: ReloadType;
10
10
  };
11
11
  export interface PageContainerProps extends AntPageContainerProps {
@@ -33,8 +33,7 @@ var PageContainer = function PageContainer(_ref) {
33
33
  var rootPrefixCls = getPrefixCls();
34
34
  var prefixCls = getPrefixCls('pro-page-container', customizePrefixCls);
35
35
  var _useStyle = useStyle(prefixCls),
36
- wrapSSR = _useStyle.wrapSSR,
37
- hashId = _useStyle.hashId;
36
+ wrapSSR = _useStyle.wrapSSR;
38
37
  var _ref2 = header || {},
39
38
  reload = _ref2.reload,
40
39
  subTitle = _ref2.subTitle,
@@ -64,7 +63,7 @@ var PageContainer = function PageContainer(_ref) {
64
63
  var noHasHeader = ['title', 'subTitle', 'extra', 'tags', 'footer', 'avatar', 'backIcon', 'breadcrumb'].every(function (item) {
65
64
  return !(newHeader !== null && newHeader !== void 0 && newHeader[item]);
66
65
  }) && !content && !extraContent && !tabList && !tabBarExtraContent;
67
- var pageContainerCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-page-header"), noHasHeader), className, hashId);
66
+ var pageContainerCls = classNames(_defineProperty({}, "".concat(prefixCls, "-no-page-header"), noHasHeader), className);
68
67
  return wrapSSR( /*#__PURE__*/React.createElement(AntPageContainer, _extends({
69
68
  prefixCls: customizePrefixCls,
70
69
  className: pageContainerCls,
@@ -1,5 +1,9 @@
1
+ /// <reference types="react" />
1
2
  import type { PageContainerToken } from '@ant-design/pro-layout/es/components/PageContainer/style';
2
- import type { GenerateStyle } from 'antd/es/theme/internal';
3
+ import type { GenerateStyle } from '@oceanbase/design/es/theme';
3
4
  export declare const genPageContainerStyle: GenerateStyle<PageContainerToken>;
4
- declare const _default: (prefixCls: string) => any;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
7
+ hashId: string;
8
+ };
5
9
  export default _default;