@oceanbase/design 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 (86) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/genComponentStyleHook.d.ts +3 -1
  3. package/es/_util/genComponentStyleHook.js +2 -2
  4. package/es/alert/index.js +2 -3
  5. package/es/alert/style/index.js +21 -4
  6. package/es/button/index.d.ts +1 -1
  7. package/es/button/index.js +2 -3
  8. package/es/card/index.js +2 -3
  9. package/es/card/style/index.js +2 -2
  10. package/es/config-provider/index.d.ts +12 -3
  11. package/es/config-provider/index.js +3 -1
  12. package/es/descriptions/index.js +5 -7
  13. package/es/form/FormItem.d.ts +1 -1
  14. package/es/index.d.ts +1 -0
  15. package/es/index.js +1 -0
  16. package/es/lottie/index.d.ts +16 -0
  17. package/es/lottie/index.js +65 -0
  18. package/es/modal/Modal.d.ts +30 -0
  19. package/es/modal/Modal.js +50 -0
  20. package/es/modal/Progress.d.ts +10 -0
  21. package/es/modal/Progress.js +46 -0
  22. package/es/modal/index.d.ts +7 -30
  23. package/es/modal/index.js +4 -52
  24. package/es/modal/style/index.js +42 -5
  25. package/es/spin/assets/spin-gray.json +1 -0
  26. package/es/spin/assets/spin.json +1 -0
  27. package/es/spin/index.d.ts +11 -0
  28. package/es/spin/index.js +49 -1
  29. package/es/spin/style/index.d.ts +13 -0
  30. package/es/spin/style/index.js +70 -0
  31. package/es/table/index.d.ts +2 -2
  32. package/es/table/index.js +8 -4
  33. package/es/tabs/index.js +5 -4
  34. package/es/tabs/style/index.d.ts +2 -1
  35. package/es/theme/index.d.ts +0 -48
  36. package/es/theme/index.js +5 -3
  37. package/es/theme/internal.d.ts +1 -0
  38. package/es/theme/internal.js +1 -0
  39. package/es/tooltip/MouseTooltip.js +1 -1
  40. package/es/tooltip/index.d.ts +2 -0
  41. package/es/tooltip/index.js +70 -7
  42. package/es/tooltip/style/index.d.ts +9 -0
  43. package/es/tooltip/style/index.js +29 -0
  44. package/lib/_util/genComponentStyleHook.d.ts +3 -1
  45. package/lib/_util/genComponentStyleHook.js +8 -4
  46. package/lib/alert/index.js +2 -3
  47. package/lib/alert/style/index.js +20 -1
  48. package/lib/button/index.d.ts +1 -1
  49. package/lib/button/index.js +2 -2
  50. package/lib/card/index.js +2 -3
  51. package/lib/card/style/index.js +5 -7
  52. package/lib/config-provider/index.d.ts +12 -3
  53. package/lib/config-provider/index.js +2 -1
  54. package/lib/descriptions/index.js +4 -5
  55. package/lib/form/FormItem.d.ts +1 -1
  56. package/lib/index.d.ts +1 -0
  57. package/lib/index.js +3 -0
  58. package/lib/lottie/index.d.ts +16 -0
  59. package/lib/lottie/index.js +79 -0
  60. package/lib/modal/Modal.d.ts +30 -0
  61. package/lib/modal/Modal.js +59 -0
  62. package/lib/modal/Progress.d.ts +10 -0
  63. package/lib/modal/Progress.js +71 -0
  64. package/lib/modal/index.d.ts +7 -30
  65. package/lib/modal/index.js +5 -40
  66. package/lib/modal/style/index.js +60 -1
  67. package/lib/spin/assets/spin-gray.json +1 -0
  68. package/lib/spin/assets/spin.json +1 -0
  69. package/lib/spin/index.d.ts +11 -0
  70. package/lib/spin/index.js +63 -1
  71. package/lib/spin/style/index.d.ts +13 -0
  72. package/lib/spin/style/index.js +105 -0
  73. package/lib/table/index.d.ts +2 -2
  74. package/lib/table/index.js +7 -4
  75. package/lib/tabs/index.js +2 -2
  76. package/lib/tabs/style/index.d.ts +2 -1
  77. package/lib/theme/index.d.ts +0 -48
  78. package/lib/theme/index.js +3 -4
  79. package/lib/theme/internal.d.ts +1 -0
  80. package/lib/theme/internal.js +23 -0
  81. package/lib/tooltip/MouseTooltip.js +1 -1
  82. package/lib/tooltip/index.d.ts +2 -0
  83. package/lib/tooltip/index.js +44 -2
  84. package/lib/tooltip/style/index.d.ts +9 -0
  85. package/lib/tooltip/style/index.js +55 -0
  86. package/package.json +10 -9
@@ -24,12 +24,12 @@ export interface TableProps<T> extends AntTableProps<T> {
24
24
  declare function Table<T>(props: TableProps<T>): ReactElement<any, string | React.JSXElementConstructor<any>>;
25
25
  declare namespace Table {
26
26
  var SELECTION_COLUMN: {};
27
- var EXPAND_COLUMN: any;
27
+ var EXPAND_COLUMN: {};
28
28
  var SELECTION_ALL: "SELECT_ALL";
29
29
  var SELECTION_INVERT: "SELECT_INVERT";
30
30
  var SELECTION_NONE: "SELECT_NONE";
31
31
  var Column: typeof import("antd/es/table/Column").default;
32
32
  var ColumnGroup: typeof import("antd/es/table/ColumnGroup").default;
33
- var Summary: any;
33
+ var Summary;
34
34
  }
35
35
  export default Table;
@@ -65,13 +65,12 @@ function Table(props) {
65
65
  };
66
66
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
67
67
  const prefixCls = getPrefixCls("table", customizePrefixCls);
68
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
68
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
69
69
  const tableCls = (0, import_classnames.default)(
70
70
  {
71
71
  [`${prefixCls}-expandable`]: !(0, import_lodash.isEmpty)(expandable)
72
72
  },
73
- className,
74
- hashId
73
+ className
75
74
  );
76
75
  const [openPopver, setOpenPopver] = (0, import_react.useState)(false);
77
76
  const [currentSelectedRowKeys, setCurrentSelectedRowKeys] = (0, import_react.useState)();
@@ -121,7 +120,10 @@ function Table(props) {
121
120
  }, [currentSelectedRows]);
122
121
  const renderOptionsBar = (total, range) => {
123
122
  if ((0, import_lodash.isEmpty)(rowSelection) || (0, import_lodash.isEmpty)(currentSelectedRowKeys)) {
124
- return /* @__PURE__ */ import_react.default.createElement("span", null, pagination && (pagination == null ? void 0 : pagination.showTotal) && (pagination == null ? void 0 : pagination.showTotal(total, range)));
123
+ return (
124
+ // @ts-ignore
125
+ /* @__PURE__ */ import_react.default.createElement("span", null, pagination && (pagination == null ? void 0 : pagination.showTotal) && (pagination == null ? void 0 : pagination.showTotal(total, range)))
126
+ );
125
127
  }
126
128
  return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-batch-operation-bar` }, /* @__PURE__ */ import_react.default.createElement(
127
129
  import_antd.Space,
@@ -165,6 +167,7 @@ function Table(props) {
165
167
  } : void 0,
166
168
  pagination: pagination === false ? false : {
167
169
  ...pagination,
170
+ // @ts-ignore
168
171
  showTotal: renderOptionsBar
169
172
  }
170
173
  }
package/lib/tabs/index.js CHANGED
@@ -60,8 +60,8 @@ var Tabs = ({
60
60
  var _a;
61
61
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
62
62
  const prefixCls = getPrefixCls("tabs", customizePrefixCls);
63
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
64
- const tabsCls = (0, import_classnames.default)(className, hashId);
63
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
64
+ const tabsCls = (0, import_classnames.default)(className);
65
65
  const ref = (0, import_react.useRef)();
66
66
  const isHorizontal = !tabPosition || tabPosition === "top" || tabPosition === "bottom";
67
67
  let newItems = items == null ? void 0 : items.map((item) => {
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
3
3
  export type TabsToken = FullToken<'Tabs'>;
4
- export declare const genTagStyle: GenerateStyle<TabsToken>;
4
+ export type CardToken = FullToken<'Card'>;
5
+ export declare const genTagStyle: GenerateStyle<TabsToken | CardToken>;
5
6
  declare const _default: (prefixCls: string) => {
6
7
  wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
8
  hashId: string;
@@ -50,54 +50,6 @@ declare const _default: {
50
50
  gold: string;
51
51
  };
52
52
  defaultConfig: {
53
- defaultSeed: {
54
- colorPrimary: string;
55
- colorInfo: string;
56
- colorSuccess: string;
57
- colorWarning: string;
58
- colorError: string;
59
- borderRadius: number;
60
- blue: string;
61
- green: string;
62
- yellow: string;
63
- red: string;
64
- colorTextBase: string;
65
- colorBgBase: string;
66
- colorLink: string;
67
- fontFamily: string;
68
- fontFamilyCode: string;
69
- fontSize: number;
70
- lineWidth: number;
71
- lineType: string;
72
- sizeUnit: number;
73
- sizeStep: number;
74
- sizePopupArrow: number;
75
- controlHeight: number;
76
- zIndexBase: number;
77
- zIndexPopupBase: number;
78
- opacityImage: number;
79
- motionUnit: number;
80
- motionBase: number;
81
- motionEaseOutCirc: string;
82
- motionEaseInOutCirc: string;
83
- motionEaseInOut: string;
84
- motionEaseOutBack: string;
85
- motionEaseInBack: string;
86
- motionEaseInQuint: string;
87
- motionEaseOutQuint: string;
88
- motionEaseOut: string;
89
- wireframe: boolean;
90
- motion: boolean;
91
- purple: string;
92
- cyan: string;
93
- magenta: string;
94
- pink: string;
95
- orange: string;
96
- volcano: string;
97
- geekblue: string;
98
- lime: string;
99
- gold: string;
100
- };
101
53
  token: import("antd/es/theme/internal").SeedToken;
102
54
  hashed: boolean;
103
55
  };
@@ -40,13 +40,12 @@ var defaultSeed = {
40
40
  yellow: "#ffac33",
41
41
  red: "#ff4b4b"
42
42
  };
43
+ var defaultConfig = import_antd.theme.defaultConfig;
44
+ defaultConfig.token = defaultSeed;
43
45
  var theme_default = {
44
46
  ...import_antd.theme,
45
47
  defaultSeed,
46
- defaultConfig: {
47
- ...import_antd.theme.defaultConfig,
48
- defaultSeed
49
- },
48
+ defaultConfig,
50
49
  components: {
51
50
  InputNumber: {
52
51
  handleVisible: true
@@ -0,0 +1 @@
1
+ export * from 'antd/es/theme/internal';
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/theme/internal.ts
17
+ var internal_exports = {};
18
+ module.exports = __toCommonJS(internal_exports);
19
+ __reExport(internal_exports, require("antd/es/theme/internal"), module.exports);
20
+ // Annotate the CommonJS export names for ESM import in node:
21
+ 0 && (module.exports = {
22
+ ...require("antd/es/theme/internal")
23
+ });
@@ -101,7 +101,7 @@ var MouseTooltip = ({
101
101
  },
102
102
  ...restProps
103
103
  },
104
- /* @__PURE__ */ import_react.default.createElement("div", { ref }, title)
104
+ /* @__PURE__ */ import_react.default.createElement("div", { ref }, typeof title === "function" ? title() : title)
105
105
  ));
106
106
  };
107
107
  if (process.env.NODE_ENV !== "production") {
@@ -5,6 +5,8 @@ export type TooltipType = 'default' | 'light' | 'success' | 'info' | 'warning' |
5
5
  export interface TooltipProps extends AntTooltipPropsWithTitle {
6
6
  type?: TooltipType;
7
7
  mouseFollow?: boolean;
8
+ closeIcon?: boolean | React.ReactNode;
9
+ onClose?: (e: React.MouseEvent<HTMLElement>) => void;
8
10
  }
9
11
  export declare const getTooltipTypeList: () => {
10
12
  type: string;
@@ -36,8 +36,13 @@ __export(tooltip_exports, {
36
36
  module.exports = __toCommonJS(tooltip_exports);
37
37
  var import_antd = require("antd");
38
38
  var import_react = __toESM(require("react"));
39
+ var import_icons = require("@oceanbase/icons");
40
+ var import_lodash = require("lodash");
39
41
  var import_static_function = require("../static-function");
40
42
  var import_MouseTooltip = __toESM(require("./MouseTooltip"));
43
+ var import_config_provider = __toESM(require("../config-provider"));
44
+ var import_style = __toESM(require("./style"));
45
+ var import_classnames = __toESM(require("classnames"));
41
46
  __reExport(tooltip_exports, require("antd/es/tooltip"), module.exports);
42
47
  var getTooltipTypeList = () => [
43
48
  {
@@ -72,33 +77,70 @@ var Tooltip = ({
72
77
  color,
73
78
  overlayInnerStyle,
74
79
  mouseFollow,
80
+ closeIcon = false,
81
+ onClose,
82
+ title,
83
+ className,
84
+ open: propOpen,
75
85
  ...restProps
76
86
  }) => {
87
+ const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
88
+ const { prefixCls: customizePrefixCls } = restProps;
89
+ const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
90
+ const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
91
+ const tooltipCls = (0, import_classnames.default)(className, hashId);
92
+ const [innerOpen, setInnerOpen] = (0, import_react.useState)(void 0);
93
+ const open = (0, import_lodash.isNil)(propOpen) ? innerOpen : propOpen;
94
+ const handleCloseClick = (e) => {
95
+ e.stopPropagation();
96
+ onClose == null ? void 0 : onClose(e);
97
+ if (e.defaultPrevented) {
98
+ return;
99
+ }
100
+ setInnerOpen(false);
101
+ };
102
+ const hasCloseIcon = !!closeIcon;
103
+ const CloseIconNode = (0, import_react.useMemo)(() => {
104
+ if (!hasCloseIcon) {
105
+ return null;
106
+ }
107
+ return closeIcon === true ? /* @__PURE__ */ import_react.default.createElement(import_icons.CloseOutlined, { className: `${prefixCls}-close-icon`, onClick: handleCloseClick }) : /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-close-icon`, onClick: handleCloseClick }, closeIcon);
108
+ }, [closeIcon]);
109
+ const titleNode = typeof title === "function" ? title() : title;
110
+ const titleWithCloseIcon = /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: `${prefixCls}-close-icon-wrap` }, titleNode, CloseIconNode);
77
111
  const typeList = getTooltipTypeList();
78
112
  const typeItem = typeList.find((item) => item.type === type);
79
- return mouseFollow ? /* @__PURE__ */ import_react.default.createElement(
113
+ return wrapSSR(mouseFollow ? /* @__PURE__ */ import_react.default.createElement(
80
114
  import_MouseTooltip.default,
81
115
  {
116
+ title,
82
117
  color: color || (typeItem == null ? void 0 : typeItem.backgroundColor),
83
118
  overlayInnerStyle: {
84
119
  color: typeItem == null ? void 0 : typeItem.color,
85
120
  ...overlayInnerStyle
86
121
  },
122
+ className: tooltipCls,
87
123
  ...restProps
88
124
  },
89
125
  children
90
126
  ) : /* @__PURE__ */ import_react.default.createElement(
91
127
  import_antd.Tooltip,
92
128
  {
129
+ title: hasCloseIcon ? titleWithCloseIcon : title,
93
130
  color: color || (typeItem == null ? void 0 : typeItem.backgroundColor),
131
+ open,
132
+ onOpenChange: (open2) => {
133
+ setInnerOpen(open2);
134
+ },
94
135
  overlayInnerStyle: {
95
136
  color: typeItem == null ? void 0 : typeItem.color,
96
137
  ...overlayInnerStyle
97
138
  },
139
+ className: tooltipCls,
98
140
  ...restProps
99
141
  },
100
142
  children
101
- );
143
+ ));
102
144
  };
103
145
  if (process.env.NODE_ENV !== "production") {
104
146
  Tooltip.displayName = import_antd.Tooltip.displayName;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
3
+ export type TooltipToken = FullToken<'Tooltip'>;
4
+ export declare const genTooltipStyle: GenerateStyle<TooltipToken>;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ hashId: string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,55 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/tooltip/style/index.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ default: () => style_default,
23
+ genTooltipStyle: () => genTooltipStyle
24
+ });
25
+ module.exports = __toCommonJS(style_exports);
26
+ var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
+ var genTooltipStyle = (token) => {
28
+ const { componentCls } = token;
29
+ return {
30
+ [componentCls]: {
31
+ [`${componentCls}-close-icon-wrap`]: {
32
+ display: "flex",
33
+ justifyContent: "space-between",
34
+ alignItems: "flex-start",
35
+ wordBreak: "break-all",
36
+ [`${componentCls}-close-icon`]: {
37
+ cursor: "pointer"
38
+ }
39
+ }
40
+ }
41
+ };
42
+ };
43
+ var style_default = (prefixCls) => {
44
+ const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Tooltip", (token) => {
45
+ return [genTooltipStyle(token)];
46
+ }, ({ zIndexPopupBase, colorBgSpotlight }) => ({
47
+ zIndexPopup: zIndexPopupBase + 70,
48
+ colorBgDefault: colorBgSpotlight
49
+ }));
50
+ return useStyle(prefixCls);
51
+ };
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ genTooltipStyle
55
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "OceanBase",
@@ -36,24 +36,25 @@
36
36
  "postbuild": "cp src/style/reset.css dist/"
37
37
  },
38
38
  "dependencies": {
39
- "@ant-design/cssinjs": "^1.16.1",
40
- "@oceanbase/icons": "^0.2.3",
41
- "@oceanbase/util": "^0.2.5",
39
+ "@ant-design/cssinjs": "^1.17.0",
40
+ "@oceanbase/icons": "^0.2.5",
41
+ "@oceanbase/util": "^0.2.7",
42
42
  "ahooks": "^2.10.14",
43
- "antd": "^5.8.0",
43
+ "antd": "^5.8.6",
44
44
  "classnames": "^2.3.2",
45
45
  "lodash": "^4.17.21",
46
- "rc-util": "^5.35.0",
46
+ "lottie-web": "^5.12.2",
47
+ "rc-util": "^5.37.0",
47
48
  "react-sticky-mouse-tooltip": "^0.0.1"
48
49
  },
49
50
  "devDependencies": {
50
- "@babel/cli": "^7.22.9",
51
- "@babel/preset-env": "^7.22.9",
51
+ "@babel/cli": "^7.22.15",
52
+ "@babel/preset-env": "^7.22.15",
52
53
  "antd-token-previewer": "^1.1.0"
53
54
  },
54
55
  "peerDependencies": {
55
56
  "react": "^16.9.0",
56
57
  "react-dom": "^16.9.0"
57
58
  },
58
- "gitHead": "7444bbf570d5d05c83bf86f54543ae0cdf97b6e0"
59
+ "gitHead": "32a30c6e5c9a3d01a0e3052d37c29b8124967247"
59
60
  }