@oceanbase/design 0.1.1 → 0.1.2

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 (75) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/es/BasicLayout/Header.d.ts +2 -2
  4. package/es/BasicLayout/Header.js +7 -7
  5. package/es/BasicLayout/index.d.ts +2 -2
  6. package/es/BasicLayout/index.js +9 -8
  7. package/es/BatchOperationBar/index.d.ts +1 -1
  8. package/es/Boundary/Components/Code.d.ts +1 -1
  9. package/es/Boundary/Components/Exception.d.ts +1 -1
  10. package/es/Boundary/index.d.ts +2 -2
  11. package/es/Dialog/index.d.ts +1 -1
  12. package/es/DocDialog/index.d.ts +2 -1
  13. package/es/DocDialog/index.js +4 -3
  14. package/es/FullscreenBox/index.d.ts +1 -1
  15. package/es/GraphToolbar/index.d.ts +2 -1
  16. package/es/Highlight/index.d.ts +1 -1
  17. package/es/Login/index.d.ts +1 -1
  18. package/es/NavMenu/index.js +6 -4
  19. package/es/PageContainer/ItemRender.d.ts +8 -0
  20. package/es/{_util/itemRender.js → PageContainer/ItemRender.js} +8 -4
  21. package/es/PageContainer/index.d.ts +2 -2
  22. package/es/PageContainer/index.js +14 -7
  23. package/es/PageContainer/index.less +4 -4
  24. package/es/Password/index.d.ts +2 -1
  25. package/es/Ranger/Ranger.d.ts +2 -1
  26. package/es/SideTip/index.d.ts +1 -1
  27. package/es/Table/index.d.ts +2 -1
  28. package/es/Table/style/index.js +1 -1
  29. package/es/TaskGraph/Graph.d.ts +2 -1
  30. package/es/TaskGraph/index.d.ts +2 -1
  31. package/es/Welcome/index.d.ts +1 -1
  32. package/es/Welcome/step.d.ts +2 -1
  33. package/es/_util/useHistory.d.ts +4 -0
  34. package/es/_util/useHistory.js +9 -0
  35. package/es/locale/LocaleWrapper.d.ts +2 -1
  36. package/lib/BasicLayout/Header.d.ts +2 -2
  37. package/lib/BasicLayout/Header.js +10 -10
  38. package/lib/BasicLayout/index.d.ts +2 -2
  39. package/lib/BasicLayout/index.js +10 -9
  40. package/lib/BatchOperationBar/index.d.ts +1 -1
  41. package/lib/Boundary/Components/Code.d.ts +1 -1
  42. package/lib/Boundary/Components/Exception.d.ts +1 -1
  43. package/lib/Boundary/index.d.ts +2 -2
  44. package/lib/Dialog/index.d.ts +1 -1
  45. package/lib/DocDialog/index.d.ts +2 -1
  46. package/lib/DocDialog/index.js +5 -4
  47. package/lib/FullscreenBox/index.d.ts +1 -1
  48. package/lib/GraphToolbar/index.d.ts +2 -1
  49. package/lib/Highlight/index.d.ts +1 -1
  50. package/lib/Login/index.d.ts +1 -1
  51. package/lib/NavMenu/index.js +8 -6
  52. package/lib/PageContainer/ItemRender.d.ts +8 -0
  53. package/lib/{_util/itemRender.js → PageContainer/ItemRender.js} +11 -11
  54. package/lib/PageContainer/index.d.ts +2 -2
  55. package/lib/PageContainer/index.js +7 -7
  56. package/lib/PageContainer/index.less +4 -4
  57. package/lib/Password/index.d.ts +2 -1
  58. package/lib/Ranger/Ranger.d.ts +2 -1
  59. package/lib/SideTip/index.d.ts +1 -1
  60. package/lib/Table/index.d.ts +2 -1
  61. package/lib/Table/style/index.js +1 -1
  62. package/lib/TaskGraph/Graph.d.ts +2 -1
  63. package/lib/TaskGraph/index.d.ts +2 -1
  64. package/lib/Welcome/index.d.ts +1 -1
  65. package/lib/Welcome/step.d.ts +2 -1
  66. package/lib/_util/useHistory.d.ts +4 -0
  67. package/lib/_util/{history.js → useHistory.js} +11 -11
  68. package/lib/locale/LocaleWrapper.d.ts +2 -1
  69. package/package.json +11 -7
  70. package/README.md +0 -22
  71. package/es/_util/history.d.ts +0 -5
  72. package/es/_util/history.js +0 -12
  73. package/es/_util/itemRender.d.ts +0 -2
  74. package/lib/_util/history.d.ts +0 -5
  75. package/lib/_util/itemRender.d.ts +0 -2
@@ -32,21 +32,21 @@ __export(BasicLayout_exports, {
32
32
  default: () => BasicLayout_default
33
33
  });
34
34
  module.exports = __toCommonJS(BasicLayout_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
37
- var import_util = require("@oceanbase/util");
38
35
  var import_icons = require("@ant-design/icons");
39
36
  var import_pro_components = require("@ant-design/pro-components");
37
+ var import_util = require("@oceanbase/util");
38
+ var import_antd = require("antd");
39
+ var import_classnames = __toESM(require("classnames"));
40
40
  var import_lodash = require("lodash");
41
41
  var import_path_to_regexp = require("path-to-regexp");
42
+ var import_react = __toESM(require("react"));
42
43
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
43
- var import_zh_CN = __toESM(require("./locale/zh-CN"));
44
+ var import_StaticFunction = require("../StaticFunction");
44
45
  var import_util2 = require("../_util");
45
- var import_history = __toESM(require("../_util/history"));
46
+ var import_useHistory = __toESM(require("../_util/useHistory"));
46
47
  var import_Header = __toESM(require("./Header"));
47
- var import_classnames = __toESM(require("classnames"));
48
48
  var import_index = require("./index.less");
49
- var import_StaticFunction = require("../StaticFunction");
49
+ var import_zh_CN = __toESM(require("./locale/zh-CN"));
50
50
  var { Content, Sider } = import_antd.Layout;
51
51
  var { SubMenu, Item } = import_antd.Menu;
52
52
  var prefix = (0, import_util2.getPrefix)("layout");
@@ -68,6 +68,7 @@ var BasicLayout = ({
68
68
  className,
69
69
  ...restProps
70
70
  }) => {
71
+ const history = (0, import_useHistory.default)();
71
72
  const [collapsed, setCollapsed] = (0, import_react.useState)(defaultCollapsed);
72
73
  const [selectedKeys, setSelectedKeys] = (0, import_react.useState)(defaultSelectedKeys);
73
74
  const [openKeys, setOpenKeys] = (0, import_react.useState)(defaultOpenKeys);
@@ -150,7 +151,7 @@ var BasicLayout = ({
150
151
  key: item.link,
151
152
  onClick: () => {
152
153
  if (pathname !== item.link) {
153
- import_history.default.push(item.link);
154
+ history.push(item.link);
154
155
  }
155
156
  }
156
157
  },
@@ -210,7 +211,7 @@ var BasicLayout = ({
210
211
  key: item.link,
211
212
  onClick: () => {
212
213
  if (pathname !== item.link) {
213
- import_history.default.push(item.link);
214
+ history.push(item.link);
214
215
  }
215
216
  }
216
217
  },
@@ -29,5 +29,5 @@ export interface Props extends LocaleWrapperProps {
29
29
  position?: [Vertical, Horizontal];
30
30
  barStyle?: React.CSSProperties;
31
31
  }
32
- declare const _default: any;
32
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<React.ComponentType<Props>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<Props>, {}>;
33
33
  export default _default;
@@ -11,4 +11,4 @@ export interface IBoundaryCode extends LocaleWrapperProps {
11
11
  buttonText?: string;
12
12
  locale?: BoundaryLocale;
13
13
  }
14
- export declare const Code: any;
14
+ export declare const Code: React.ForwardRefExoticComponent<IBoundaryCode & React.RefAttributes<React.ComponentType<IBoundaryCode>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<IBoundaryCode>, {}>;
@@ -14,4 +14,4 @@ export interface ExceptionProps extends LocaleWrapperProps {
14
14
  hasButton?: boolean;
15
15
  locale?: BoundaryLocale;
16
16
  }
17
- export declare const Exception: any;
17
+ export declare const Exception: React.ForwardRefExoticComponent<ExceptionProps & React.RefAttributes<React.ComponentType<ExceptionProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<ExceptionProps>, {}>;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import './index.less';
3
3
  declare const _default: {
4
- Code: any;
4
+ Code: import("react").ForwardRefExoticComponent<import("./Components").IBoundaryCode & import("react").RefAttributes<import("react").ComponentType<import("./Components").IBoundaryCode>>> & import("hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("./Components").IBoundaryCode>, {}>;
5
5
  Function: import("react").FC<import("./Components").IBoundaryFunction>;
6
- Exception: any;
6
+ Exception: import("react").ForwardRefExoticComponent<import("./Components").ExceptionProps & import("react").RefAttributes<import("react").ComponentType<import("./Components").ExceptionProps>>> & import("hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("./Components").ExceptionProps>, {}>;
7
7
  };
8
8
  export default _default;
@@ -31,5 +31,5 @@ export interface IDialogProps extends LocaleWrapperProps {
31
31
  setRootWidth?: (newWidth: string) => void;
32
32
  isEmbed?: boolean;
33
33
  }
34
- declare const _default: any;
34
+ declare const _default: React.ForwardRefExoticComponent<IDialogProps & React.RefAttributes<React.ComponentType<IDialogProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<IDialogProps>, {}>;
35
35
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
2
3
  interface IDialogConfig {
3
4
  height?: number;
@@ -20,5 +21,5 @@ export interface IDocDialogProps extends LocaleWrapperProps {
20
21
  setRootWidth: (newWidth: string) => void;
21
22
  setVisible: (payload: boolean) => void;
22
23
  }
23
- declare const _default: any;
24
+ declare const _default: import("react").ForwardRefExoticComponent<IDocDialogProps & import("react").RefAttributes<import("react").ComponentType<IDocDialogProps>>> & import("hoist-non-react-statics").NonReactStatics<import("react").ComponentType<IDocDialogProps>, {}>;
24
25
  export default _default;
@@ -32,9 +32,10 @@ __export(DocDialog_exports, {
32
32
  default: () => DocDialog_default
33
33
  });
34
34
  module.exports = __toCommonJS(DocDialog_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_Dialog = __toESM(require("../Dialog"));
37
35
  var import_lodash = require("lodash");
36
+ var import_react = require("react");
37
+ var import_react_router_dom = require("react-router-dom");
38
+ var import_Dialog = __toESM(require("../Dialog"));
38
39
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
39
40
  var import_zh_CN = __toESM(require("./locale/zh-CN"));
40
41
  var DEFAULT_EMBDED_WIDTH = 0.4;
@@ -58,7 +59,7 @@ var DocDialogComp = (props) => {
58
59
  } = props;
59
60
  const [clientHeight, setClientHeight] = (0, import_react.useState)(document.body.clientHeight);
60
61
  const [clientWidth, setClientWidth] = (0, import_react.useState)(document.body.clientWidth);
61
- const location = window.location;
62
+ const location = (0, import_react_router_dom.useLocation)();
62
63
  const currentLink = (0, import_react.useMemo)(() => {
63
64
  const { pathname } = location;
64
65
  const link = Object.entries(docUrls).find((set) => pathname.indexOf(set[0]) > -1);
@@ -126,7 +127,7 @@ var DocDialogComp = (props) => {
126
127
  setRootWidth,
127
128
  setVisible
128
129
  ]);
129
- return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_Dialog.default, { ...DialogProps }, /* @__PURE__ */ import_react.default.createElement("iframe", { src: currentLink })));
130
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(import_Dialog.default, { ...DialogProps }, /* @__PURE__ */ React.createElement("iframe", { src: currentLink })));
130
131
  };
131
132
  var DocDialog_default = (0, import_LocaleWrapper.default)({
132
133
  componentName: "DocDialog",
@@ -38,5 +38,5 @@ export interface FullscreenBoxProps extends LocaleWrapperProps {
38
38
  */
39
39
  children?: any;
40
40
  }
41
- declare const _default: any;
41
+ declare const _default: React.ForwardRefExoticComponent<FullscreenBoxProps & React.RefAttributes<React.ComponentType<FullscreenBoxProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<FullscreenBoxProps>, {}>;
42
42
  export default _default;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Graph } from '@antv/g6';
2
3
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
3
4
  import './index.less';
@@ -22,5 +23,5 @@ export interface GraphToolbarProps extends LocaleWrapperProps {
22
23
  locale?: GraphToolbarLocale;
23
24
  className?: string;
24
25
  }
25
- declare const _default: any;
26
+ declare const _default: React.ForwardRefExoticComponent<GraphToolbarProps & React.RefAttributes<React.ComponentType<GraphToolbarProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<GraphToolbarProps>, {}>;
26
27
  export default _default;
@@ -99,5 +99,5 @@ export interface HighlightProps extends LocaleWrapperProps {
99
99
  onCopyChange?: (value: string | Object) => void | Function;
100
100
  }
101
101
  export declare const renderHightlight: (language: any, content: any) => import("highlight.js").HighlightResult;
102
- declare const _default: any;
102
+ declare const _default: React.ForwardRefExoticComponent<HighlightProps & React.RefAttributes<React.ComponentType<HighlightProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<HighlightProps>, {}>;
103
103
  export default _default;
@@ -62,5 +62,5 @@ export interface LoginProps extends FormProps {
62
62
  onShowActivateChange?: (isShow: boolean) => void;
63
63
  onAuthCodeImgChange?: () => void;
64
64
  }
65
- declare const _default: any;
65
+ declare const _default: React.ForwardRefExoticComponent<LoginProps & React.RefAttributes<React.ComponentType<LoginProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<LoginProps>, {}>;
66
66
  export default _default;
@@ -33,18 +33,20 @@ __export(NavMenu_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(NavMenu_exports);
35
35
  var import_antd = require("antd");
36
- var import_react = __toESM(require("react"));
37
- var import_path_to_regexp = require("path-to-regexp");
38
36
  var import_lodash = require("lodash");
37
+ var import_path_to_regexp = require("path-to-regexp");
38
+ var import_react = __toESM(require("react"));
39
+ var import_react_router_dom = require("react-router-dom");
39
40
  var import_util = require("../_util");
40
- var import_history = __toESM(require("../_util/history"));
41
+ var import_useHistory = __toESM(require("../_util/useHistory"));
41
42
  var import_index = require("./index.less");
42
43
  var prefix = (0, import_util.getPrefix)("menu");
43
44
  var NavMenu_default = (props) => {
44
45
  const { menuList, className, style } = props;
45
46
  const [selectedKeys, setSelectedKeys] = (0, import_react.useState)(["0"]);
46
47
  const [menus, setMenus] = (0, import_react.useState)([]);
47
- const location = window.location;
48
+ const location = (0, import_react_router_dom.useLocation)();
49
+ const history = (0, import_useHistory.default)();
48
50
  const preProcess = (0, import_react.useCallback)(
49
51
  (list) => {
50
52
  const { pathname } = location;
@@ -81,9 +83,9 @@ var NavMenu_default = (props) => {
81
83
  const onMenuClick = (0, import_react.useCallback)(
82
84
  (link) => {
83
85
  const linkList = (0, import_lodash.isArray)(link) ? link : [link];
84
- import_history.default.push(linkList[0]);
86
+ history.push(linkList[0]);
85
87
  },
86
- [import_history.default]
88
+ [history]
87
89
  );
88
90
  return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-container ${className}`, style }, /* @__PURE__ */ import_react.default.createElement(
89
91
  import_antd.Menu,
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const _default: ({ route, params, routes, paths }: {
3
+ route: any;
4
+ params: any;
5
+ routes: any;
6
+ paths: any;
7
+ }) => import("react").JSX.Element;
8
+ export default _default;
@@ -26,26 +26,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // src/_util/itemRender.tsx
30
- var itemRender_exports = {};
31
- __export(itemRender_exports, {
32
- default: () => itemRender
29
+ // src/PageContainer/ItemRender.tsx
30
+ var ItemRender_exports = {};
31
+ __export(ItemRender_exports, {
32
+ default: () => ItemRender_default
33
33
  });
34
- module.exports = __toCommonJS(itemRender_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_history = __toESM(require("../_util/history"));
37
- function itemRender(route, params, routes, paths) {
34
+ module.exports = __toCommonJS(ItemRender_exports);
35
+ var import_useHistory = __toESM(require("../_util/useHistory"));
36
+ var ItemRender_default = ({ route, params, routes, paths }) => {
38
37
  const routeIndex = routes.indexOf(route);
39
38
  const last = routeIndex === routes.length - 1;
40
39
  const title = route.title || route.breadcrumbName;
41
40
  const path = route.href || routes.slice(0, routeIndex + 1).map((item) => item.path).join("/");
42
- return last ? /* @__PURE__ */ import_react.default.createElement("span", null, title) : /* @__PURE__ */ import_react.default.createElement(
41
+ const history = (0, import_useHistory.default)();
42
+ return last ? /* @__PURE__ */ React.createElement("span", null, title) : /* @__PURE__ */ React.createElement(
43
43
  "a",
44
44
  {
45
45
  onClick: () => {
46
- import_history.default.push(path);
46
+ history.push(path);
47
47
  }
48
48
  },
49
49
  title
50
50
  );
51
- }
51
+ };
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
1
  import type { IconComponentProps } from '@ant-design/icons/es/components/Icon';
3
2
  import type { PageContainerProps as AntPageContainerProps, PageHeaderProps as AntPageHeaderProps } from '@ant-design/pro-components';
3
+ import React from 'react';
4
4
  import './index.less';
5
5
  export declare type ReloadType = boolean | IconComponentProps | React.ReactNode;
6
6
  export interface PageContainerLocale {
@@ -13,5 +13,5 @@ export interface PageContainerProps extends AntPageContainerProps {
13
13
  header?: PageHeaderProps;
14
14
  locale?: PageContainerLocale;
15
15
  }
16
- declare const _default: any;
16
+ declare const _default: React.ForwardRefExoticComponent<PageContainerProps & React.RefAttributes<React.ComponentType<PageContainerProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<PageContainerProps>, {}>;
17
17
  export default _default;
@@ -32,18 +32,18 @@ __export(PageContainer_exports, {
32
32
  default: () => PageContainer_default
33
33
  });
34
34
  module.exports = __toCommonJS(PageContainer_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
37
35
  var import_icons = require("@ant-design/icons");
38
36
  var import_pro_components = require("@ant-design/pro-components");
39
- var import_lodash = require("lodash");
37
+ var import_antd = require("antd");
40
38
  var import_classnames = __toESM(require("classnames"));
41
- var import_itemRender = __toESM(require("../_util/itemRender"));
39
+ var import_lodash = require("lodash");
40
+ var import_react = __toESM(require("react"));
42
41
  var import_ConfigProvider = require("../ConfigProvider");
43
- var import_Tooltip = __toESM(require("../Tooltip"));
44
42
  var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
45
- var import_zh_CN = __toESM(require("./locale/zh-CN"));
43
+ var import_Tooltip = __toESM(require("../Tooltip"));
46
44
  var import_index = require("./index.less");
45
+ var import_ItemRender = __toESM(require("./ItemRender"));
46
+ var import_zh_CN = __toESM(require("./locale/zh-CN"));
47
47
  var PageContainer = ({ header, locale, className, ...restProps }) => {
48
48
  const rootPrefixCls = (0, import_ConfigProvider.globalConfig)().getRootPrefixCls();
49
49
  const { reload, subTitle, breadcrumb } = header || {};
@@ -57,7 +57,7 @@ var PageContainer = ({ header, locale, className, ...restProps }) => {
57
57
  ...header,
58
58
  subTitle: newSubTitle,
59
59
  breadcrumb: {
60
- itemRender: import_itemRender.default,
60
+ itemRender: (route, params, routes, paths) => /* @__PURE__ */ import_react.default.createElement(import_ItemRender.default, { route, params, routes, paths }),
61
61
  ...breadcrumb
62
62
  }
63
63
  };
@@ -44,10 +44,10 @@
44
44
  padding-inline: 24px;
45
45
  padding-block: 16px;
46
46
  }
47
- .@{prefixCls}-pro-page-container-children-content {
48
- padding-inline: 24px !important;
49
- padding-block-start: 0 !important;
50
- padding-block-end: 24px !important;
47
+ .@{prefixCls}-pro-page-container-children-container {
48
+ padding-inline: 24px;
49
+ padding-block-start: 0;
50
+ padding-block-end: 24px;
51
51
  }
52
52
  }
53
53
 
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { PasswordProps as AntdPasswordProps } from 'antd/es/input';
2
3
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
3
4
  import type { Validator } from './Content';
@@ -21,5 +22,5 @@ export interface PasswordProps extends LocaleWrapperProps, Omit<AntdPasswordProp
21
22
  generatePasswordRegex?: RegExp;
22
23
  locale?: PasswordLocale;
23
24
  }
24
- declare const _default: any;
25
+ declare const _default: React.ForwardRefExoticComponent<PasswordProps & React.RefAttributes<React.ComponentType<PasswordProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<PasswordProps>, {}>;
25
26
  export default _default;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Moment } from 'moment';
2
3
  import type { Dayjs } from 'dayjs';
3
4
  import './index.less';
@@ -7,5 +8,5 @@ export declare type RangeDateValue = {
7
8
  name: RangeName;
8
9
  range: RangeValue;
9
10
  };
10
- declare const _default: any;
11
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<React.ComponentType<any>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<any>, {}>;
11
12
  export default _default;
@@ -152,5 +152,5 @@ export interface SideTipState {
152
152
  hide?: boolean;
153
153
  hovered?: boolean;
154
154
  }
155
- declare const _default: any;
155
+ declare const _default: React.ForwardRefExoticComponent<SideTipProps & React.RefAttributes<React.ComponentType<SideTipProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<SideTipProps>, {}>;
156
156
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import React from 'react';
2
3
  import type { TableProps as AntTableProps } from 'antd';
3
4
  import type { ColumnsType } from 'antd/es/table';
4
5
  export interface TableProps<T> extends AntTableProps<T> {
@@ -12,5 +13,5 @@ export interface TableProps<T> extends AntTableProps<T> {
12
13
  toolAlertRender?: false | ((selectedRowKeys: any, selectedRows: any) => ReactNode);
13
14
  toolSelectedContent?: (selectedRowKeys: any, selectedRows: any) => ReactNode;
14
15
  }
15
- declare const _default: any;
16
+ declare const _default: React.ForwardRefExoticComponent<TableProps<unknown> & React.RefAttributes<React.ComponentType<TableProps<unknown>>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<TableProps<unknown>>, {}>;
16
17
  export default _default;
@@ -157,7 +157,7 @@ var genTableStyle = (token) => {
157
157
  [`${componentCls}`]: {
158
158
  [`${componentCls}-tbody`]: {
159
159
  // 去掉斑马纹
160
- [`tr:nth-child(2n):not(${componentCls}-placeholder):not(${componentCls}-expanded-row)`]: {
160
+ [`tr:nth-child(2n):not(${componentCls}-placeholder):not(${componentCls}-row-selected):not(${componentCls}-expanded-row)`]: {
161
161
  td: {
162
162
  backgroundColor: colorBgBase
163
163
  },
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { GraphData } from '@antv/g6/lib/types';
2
3
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
3
4
  import './graph.less';
@@ -20,5 +21,5 @@ export interface TaskGraphProps extends LocaleWrapperProps {
20
21
  assetsPath?: string;
21
22
  locale?: TaskGraphLocale;
22
23
  }
23
- declare const _default: any;
24
+ declare const _default: React.ForwardRefExoticComponent<TaskGraphProps & React.RefAttributes<React.ComponentType<TaskGraphProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<TaskGraphProps>, {}>;
24
25
  export default _default;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { GraphData } from '@antv/g6/lib/types';
2
3
  import type { LocaleWrapperProps } from '../locale/LocaleWrapper';
3
4
  import type { TaskGraphLocale } from './Graph';
@@ -12,5 +13,5 @@ export interface TaskGraphProps extends LocaleWrapperProps {
12
13
  assetsPath?: string;
13
14
  locale?: TaskGraphLocale;
14
15
  }
15
- declare const _default: any;
16
+ declare const _default: React.ForwardRefExoticComponent<TaskGraphProps & React.RefAttributes<React.ComponentType<TaskGraphProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<TaskGraphProps>, {}>;
16
17
  export default _default;
@@ -34,5 +34,5 @@ export interface WelcomeProps {
34
34
  className?: string;
35
35
  style?: React.CSSProperties;
36
36
  }
37
- declare const _default: any;
37
+ declare const _default: React.ForwardRefExoticComponent<WelcomeProps & React.RefAttributes<React.ComponentType<WelcomeProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<WelcomeProps>, {}>;
38
38
  export default _default;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './index.less';
2
3
  export interface OperationProps {
3
4
  text: string;
@@ -14,5 +15,5 @@ export interface WelcomeStepProps {
14
15
  operations?: OperationProps[];
15
16
  locale?: WelcomeStepLocale;
16
17
  }
17
- declare const _default: any;
18
+ declare const _default: React.ForwardRefExoticComponent<WelcomeStepProps & React.RefAttributes<React.ComponentType<WelcomeStepProps>>> & import("hoist-non-react-statics").NonReactStatics<React.ComponentType<WelcomeStepProps>, {}>;
18
19
  export default _default;
@@ -0,0 +1,4 @@
1
+ declare const _default: () => {
2
+ push: any;
3
+ };
4
+ export default _default;
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // src/_util/history.ts
20
- var history_exports = {};
21
- __export(history_exports, {
22
- default: () => history_default
19
+ // src/_util/useHistory.ts
20
+ var useHistory_exports = {};
21
+ __export(useHistory_exports, {
22
+ default: () => useHistory_default
23
23
  });
24
- module.exports = __toCommonJS(history_exports);
25
- function push(path) {
26
- const { pathname, hash = "" } = window.location || {};
27
- const isHashHistory = hash.startsWith("#/");
28
- history.pushState({}, "", isHashHistory ? `${pathname}#${path}` : path);
29
- }
30
- var history_default = { push };
24
+ module.exports = __toCommonJS(useHistory_exports);
25
+ var import_react_router_dom = require("react-router-dom");
26
+ var useHistory_default = () => {
27
+ return {
28
+ push: import_react_router_dom.useHistory ? (0, import_react_router_dom.useHistory)().push : import_react_router_dom.useNavigate ? (0, import_react_router_dom.useNavigate)() : null
29
+ };
30
+ };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import hoistNonReactStatic from 'hoist-non-react-statics';
2
3
  export interface LocaleWrapperProps {
3
4
  locale?: any;
4
5
  }
@@ -6,5 +7,5 @@ export interface LocaleWrapperInput {
6
7
  componentName: string;
7
8
  defaultLocale: any;
8
9
  }
9
- declare const _default: ({ componentName, defaultLocale }: LocaleWrapperInput) => <BaseProps extends LocaleWrapperProps>(BaseComponent: React.ComponentType<BaseProps>) => any;
10
+ declare const _default: ({ componentName, defaultLocale }: LocaleWrapperInput) => <BaseProps extends LocaleWrapperProps>(BaseComponent: React.ComponentType<BaseProps>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<BaseProps> & React.RefAttributes<React.ComponentType<BaseProps>>> & hoistNonReactStatic.NonReactStatics<React.ComponentType<BaseProps>, {}>;
10
11
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "The Design System for OceanBase",
5
5
  "keywords": [
6
6
  "OceanBase",
@@ -30,13 +30,14 @@
30
30
  "build": "father build",
31
31
  "build:watch": "father build --watch",
32
32
  "ci": "npm run build",
33
- "deploy": "npm run docs:build && npm run docs:deploy",
34
- "dev": "npx babel --presets @babel/preset-env ./src/theme/index.ts --out-file ./src/.umi/plugin-theme-less/theme.js && UMI_ENV=theme dumi dev",
35
- "docs:build": "dumi build",
36
- "docs:deploy": "gh-pages -d docs-dist",
33
+ "deploy": "npm run site:build && npm run site:deploy",
34
+ "dev": "npx babel --presets @babel/preset-env ./src/theme/index.ts --out-file ./.dumi/tmp/plugin-theme-less/theme.js && UMI_ENV=theme dumi dev",
35
+ "prepare": "dumi setup",
37
36
  "prepublishOnly": "npm run build",
38
37
  "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
39
38
  "publish": "npm publish --access public",
39
+ "site:build": "dumi build",
40
+ "site:deploy": "gh-pages -d site-dist",
40
41
  "start": "npm run dev",
41
42
  "test": "umi-test",
42
43
  "test:coverage": "umi-test --coverage",
@@ -59,6 +60,7 @@
59
60
  "classnames": "^2.2.6",
60
61
  "dayjs": "^1.11.6",
61
62
  "diff": "^5.1.0",
63
+ "dumi-theme-antd": "^0.2.5",
62
64
  "highlight.js": "^11.7.0",
63
65
  "highlightjs-solidity": "^2.0.6",
64
66
  "hoist-non-react-statics": "^3.3.2",
@@ -84,7 +86,7 @@
84
86
  "@umijs/test": "^3.0.5",
85
87
  "antd": "^5.0.0",
86
88
  "antd-token-previewer": "^1.1.0-22",
87
- "dumi": "^1.1.0",
89
+ "dumi": "^2.0.0",
88
90
  "father": "^4.0.0-rc.2",
89
91
  "gh-pages": "^3.0.0",
90
92
  "lint-staged": "^10.0.7",
@@ -94,13 +96,15 @@
94
96
  "react-color": "^2.19.3",
95
97
  "react-dom": "^16.9.0",
96
98
  "react-fast-marquee": "^1.5.2",
99
+ "react-router-dom": "^5.2.0",
97
100
  "yorkie": "^2.0.0"
98
101
  },
99
102
  "peerDependencies": {
100
103
  "@antv/g6": "3.4.10",
101
104
  "antd": "^5.0.0",
102
105
  "react": "^16.9.0",
103
- "react-dom": "^16.9.0"
106
+ "react-dom": "^16.9.0",
107
+ "react-router-dom": ">=5.2.0"
104
108
  },
105
109
  "gitHooks": {
106
110
  "pre-commit": "lint-staged"
package/README.md DELETED
@@ -1,22 +0,0 @@
1
- # OceanBase 组件库
2
-
3
- ## 准备工作
4
-
5
- - 安装 [Node.js](https://nodejs.org/en/)
6
-
7
- ## 开发
8
-
9
- ```bash
10
- # 安装依赖
11
- $ npm install
12
-
13
- # 开发 library
14
- $ npm run dev
15
-
16
- # 打包 library
17
- $ npm run build
18
- ```
19
-
20
- ## 参考
21
-
22
- - [Dumi 组件库文档工具](https://v1.d.umijs.org/)
@@ -1,5 +0,0 @@
1
- declare function push(path: string): void;
2
- declare const _default: {
3
- push: typeof push;
4
- };
5
- export default _default;
@@ -1,12 +0,0 @@
1
- function push(path) {
2
- var _ref = window.location || {},
3
- pathname = _ref.pathname,
4
- _ref$hash = _ref.hash,
5
- hash = _ref$hash === void 0 ? '' : _ref$hash;
6
- // 是否为 hash 路由
7
- var isHashHistory = hash.startsWith('#/');
8
- history.pushState({}, '', isHashHistory ? "".concat(pathname, "#").concat(path) : path);
9
- }
10
- export default {
11
- push: push
12
- };
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export default function itemRender(route: any, params: any, routes: any, paths: any): React.JSX.Element;
@@ -1,5 +0,0 @@
1
- declare function push(path: string): void;
2
- declare const _default: {
3
- push: typeof push;
4
- };
5
- export default _default;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export default function itemRender(route: any, params: any, routes: any, paths: any): React.JSX.Element;