@oceanbase/design 0.2.25 → 0.2.27

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 (78) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/type.d.ts +4 -0
  3. package/es/_util/type.js +1 -0
  4. package/es/badge/index.d.ts +3 -4
  5. package/es/badge/index.js +7 -3
  6. package/es/button/index.d.ts +2 -4
  7. package/es/button/index.js +7 -5
  8. package/es/card/index.d.ts +2 -4
  9. package/es/card/index.js +7 -5
  10. package/es/config-provider/index.js +9 -11
  11. package/es/drawer/Drawer.d.ts +18 -0
  12. package/es/drawer/Drawer.js +69 -0
  13. package/es/drawer/index.d.ts +2 -0
  14. package/es/drawer/index.js +3 -1
  15. package/es/drawer/style/index.d.ts +9 -0
  16. package/es/drawer/style/index.js +31 -0
  17. package/es/index.d.ts +2 -1
  18. package/es/index.js +1 -0
  19. package/es/modal/style/index.js +3 -2
  20. package/es/select/index.d.ts +8 -2
  21. package/es/select/index.js +6 -6
  22. package/es/spin/index.js +1 -0
  23. package/es/static-function/index.d.ts +1 -1
  24. package/es/static-function/index.js +2 -2
  25. package/es/table/index.d.ts +17 -12
  26. package/es/table/index.js +19 -16
  27. package/es/tag/index.d.ts +2 -4
  28. package/es/tag/index.js +7 -5
  29. package/es/theme/dark.d.ts +56 -0
  30. package/es/theme/dark.js +10 -0
  31. package/es/theme/default.d.ts +94 -72
  32. package/es/theme/default.js +95 -72
  33. package/es/theme/index.d.ts +8 -13
  34. package/es/theme/index.js +15 -20
  35. package/es/theme/style/compact.less +211 -186
  36. package/es/theme/style/dark.less +194 -169
  37. package/es/theme/style/default.less +208 -183
  38. package/es/tooltip/index.d.ts +2 -2
  39. package/es/tooltip/index.js +3 -2
  40. package/lib/_util/type.d.ts +4 -0
  41. package/lib/_util/type.js +17 -0
  42. package/lib/badge/index.d.ts +3 -4
  43. package/lib/badge/index.js +56 -51
  44. package/lib/button/index.d.ts +2 -4
  45. package/lib/button/index.js +15 -10
  46. package/lib/card/index.d.ts +2 -4
  47. package/lib/card/index.js +40 -34
  48. package/lib/config-provider/index.js +8 -15
  49. package/lib/drawer/Drawer.d.ts +18 -0
  50. package/lib/drawer/Drawer.js +85 -0
  51. package/lib/drawer/index.d.ts +2 -0
  52. package/lib/drawer/index.js +19 -0
  53. package/lib/drawer/style/index.d.ts +9 -0
  54. package/lib/drawer/style/index.js +60 -0
  55. package/lib/index.d.ts +2 -1
  56. package/lib/index.js +3 -0
  57. package/lib/modal/style/index.js +3 -2
  58. package/lib/select/index.d.ts +8 -2
  59. package/lib/select/index.js +14 -10
  60. package/lib/spin/index.js +1 -0
  61. package/lib/static-function/index.d.ts +1 -1
  62. package/lib/static-function/index.js +1 -1
  63. package/lib/table/index.d.ts +17 -12
  64. package/lib/table/index.js +17 -14
  65. package/lib/tag/index.d.ts +2 -4
  66. package/lib/tag/index.js +25 -28
  67. package/lib/theme/dark.d.ts +56 -0
  68. package/lib/theme/dark.js +44 -0
  69. package/lib/theme/default.d.ts +94 -72
  70. package/lib/theme/default.js +94 -71
  71. package/lib/theme/index.d.ts +8 -13
  72. package/lib/theme/index.js +27 -21
  73. package/lib/theme/style/compact.less +211 -186
  74. package/lib/theme/style/dark.less +194 -169
  75. package/lib/theme/style/default.less +208 -183
  76. package/lib/tooltip/index.d.ts +2 -2
  77. package/lib/tooltip/index.js +83 -80
  78. package/package.json +6 -4
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export type LiteralUnion<T extends string> = T | (string & {});
3
+ export type AnyObject = Record<PropertyKey, any>;
4
+ export type CustomComponent<P = AnyObject> = React.ComponentType<P> | string;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,8 +4,7 @@ export * from 'antd/es/badge';
4
4
  export interface BadgeProps extends AntBadgeProps {
5
5
  icon?: boolean | React.ReactNode;
6
6
  }
7
- declare const Badge: {
8
- ({ prefixCls: customizePrefixCls, className, status, text, icon, ...restProps }: BadgeProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
9
- displayName: string;
7
+ declare const _default: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>> & {
8
+ Ribbon: React.FC<import("antd/es/badge/Ribbon").RibbonProps>;
10
9
  };
11
- export default Badge;
10
+ export default _default;
package/es/badge/index.js CHANGED
@@ -17,7 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
17
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
18
  import { Fragment as _Fragment } from "react/jsx-runtime";
19
19
  export * from 'antd/es/badge';
20
- var Badge = function Badge(_ref) {
20
+ var Badge = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
21
21
  var customizePrefixCls = _ref.prefixCls,
22
22
  className = _ref.className,
23
23
  status = _ref.status,
@@ -46,6 +46,7 @@ var Badge = function Badge(_ref) {
46
46
  };
47
47
  return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {
48
48
  children: status && icon ? /*#__PURE__*/_jsxs("span", _objectSpread(_objectSpread({
49
+ ref: ref,
49
50
  className: classNames(badgeCls, "".concat(prefixCls, "-status"), hashId),
50
51
  style: {
51
52
  display: 'inline-block'
@@ -59,14 +60,17 @@ var Badge = function Badge(_ref) {
59
60
  children: text
60
61
  })]
61
62
  })) : /*#__PURE__*/_jsx(AntBadge, _objectSpread({
63
+ ref: ref,
62
64
  prefixCls: customizePrefixCls,
63
65
  className: badgeCls,
64
66
  status: status,
65
67
  text: text
66
68
  }, restProps))
67
69
  }));
68
- };
70
+ });
69
71
  if (process.env.NODE_ENV !== 'production') {
70
72
  Badge.displayName = AntBadge.displayName;
71
73
  }
72
- export default Badge;
74
+ export default Object.assign(Badge, {
75
+ Ribbon: AntBadge.Ribbon
76
+ });
@@ -2,10 +2,8 @@ import type { ButtonProps as AntButtonProps } from 'antd/es/button';
2
2
  import React from 'react';
3
3
  export * from 'antd/es/button';
4
4
  export type ButtonProps = AntButtonProps;
5
- declare const Button: {
6
- ({ prefixCls: customizePrefixCls, className, ...restProps }: ButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
+ declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
7
6
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
8
7
  __ANT_BUTTON: boolean;
9
- displayName: string;
10
8
  };
11
- export default Button;
9
+ export default _default;
@@ -14,7 +14,7 @@ import ConfigProvider from "../config-provider";
14
14
  import useStyle from "./style";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  export * from 'antd/es/button';
17
- var Button = function Button(_ref) {
17
+ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
18
18
  var customizePrefixCls = _ref.prefixCls,
19
19
  className = _ref.className,
20
20
  restProps = _objectWithoutProperties(_ref, _excluded);
@@ -25,13 +25,15 @@ var Button = function Button(_ref) {
25
25
  wrapSSR = _useStyle.wrapSSR;
26
26
  var buttonCls = classNames(className);
27
27
  return wrapSSR( /*#__PURE__*/_jsx(AntButton, _objectSpread({
28
+ ref: ref,
28
29
  prefixCls: customizePrefixCls,
29
30
  className: buttonCls
30
31
  }, restProps)));
31
- };
32
- Button.Group = AntButton.Group;
33
- Button.__ANT_BUTTON = AntButton.__ANT_BUTTON;
32
+ });
34
33
  if (process.env.NODE_ENV !== 'production') {
35
34
  Button.displayName = AntButton.displayName;
36
35
  }
37
- export default Button;
36
+ export default Object.assign(Button, {
37
+ Group: AntButton.Group,
38
+ __ANT_BUTTON: AntButton.__ANT_BUTTON
39
+ });
@@ -9,10 +9,8 @@ export interface CardProps extends AntCardProps {
9
9
  divided?: boolean;
10
10
  tabList?: CardTabListType[];
11
11
  }
12
- declare const Card: {
13
- ({ children, divided, tabList, prefixCls: customizePrefixCls, className, ...restProps }: CardProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
12
+ declare const _default: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
14
13
  Grid: React.FC<import("antd/es/card").CardGridProps>;
15
14
  Meta: React.FC<import("antd/es/card").CardMetaProps>;
16
- displayName: string;
17
15
  };
18
- export default Card;
16
+ export default _default;
package/es/card/index.js CHANGED
@@ -17,7 +17,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
17
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
18
  export * from 'antd/es/card/Card';
19
19
  export * from 'antd/es/card';
20
- var Card = function Card(_ref) {
20
+ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
21
21
  var children = _ref.children,
22
22
  _ref$divided = _ref.divided,
23
23
  divided = _ref$divided === void 0 ? true : _ref$divided,
@@ -48,16 +48,18 @@ var Card = function Card(_ref) {
48
48
  return item;
49
49
  });
50
50
  return wrapSSR( /*#__PURE__*/_jsx(AntCard, _objectSpread(_objectSpread({
51
+ ref: ref,
51
52
  tabList: newTabList,
52
53
  prefixCls: customizePrefixCls,
53
54
  className: cardCls
54
55
  }, restProps), {}, {
55
56
  children: children
56
57
  })));
57
- };
58
- Card.Grid = AntCard.Grid;
59
- Card.Meta = AntCard.Meta;
58
+ });
60
59
  if (process.env.NODE_ENV !== 'production') {
61
60
  Card.displayName = AntCard.displayName;
62
61
  }
63
- export default Card;
62
+ export default Object.assign(Card, {
63
+ Grid: AntCard.Grid,
64
+ Meta: AntCard.Meta
65
+ });
@@ -11,8 +11,9 @@ import React from 'react';
11
11
  import { App, ConfigProvider as AntConfigProvider } from 'antd';
12
12
  import { merge } from 'lodash';
13
13
  import StaticFunction from "../static-function";
14
- import defaultTheme from "../theme";
15
- import defaultThemeToken from "../theme/default";
14
+ import themeConfig from "../theme";
15
+ import defaultTheme from "../theme/default";
16
+ import darkTheme from "../theme/dark";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
19
  export * from "./navigate";
@@ -23,8 +24,7 @@ export * from 'antd/es/config-provider';
23
24
  var ExtendedConfigContext = /*#__PURE__*/React.createContext({
24
25
  navigate: undefined
25
26
  });
26
- var defaultSeed = defaultTheme.defaultSeed,
27
- components = defaultTheme.components;
27
+ var defaultSeed = themeConfig.defaultSeed;
28
28
  var ConfigProvider = function ConfigProvider(_ref) {
29
29
  var children = _ref.children,
30
30
  theme = _ref.theme,
@@ -35,6 +35,8 @@ var ConfigProvider = function ConfigProvider(_ref) {
35
35
  // inherit from parent ConfigProvider
36
36
  var parentContext = React.useContext(AntConfigProvider.ConfigContext);
37
37
  var parentExtendedContext = React.useContext(ExtendedConfigContext);
38
+ var mergedTheme = merge(parentContext.theme, theme);
39
+ var currentTheme = mergedTheme.isDark ? darkTheme : defaultTheme;
38
40
  return /*#__PURE__*/_jsx(AntConfigProvider, _objectSpread(_objectSpread({
39
41
  spin: merge(parentContext.spin, spin),
40
42
  tabs: merge({
@@ -43,13 +45,9 @@ var ConfigProvider = function ConfigProvider(_ref) {
43
45
  }
44
46
  }, parentContext.tabs, tabs),
45
47
  theme: merge({
46
- // Only set seed token for dark theme
47
- // Because defaultThemeToken is designed for light theme
48
- token: theme !== null && theme !== void 0 && theme.isDark ? _objectSpread({}, defaultSeed) : _objectSpread(_objectSpread({}, defaultSeed), defaultThemeToken),
49
- components: _objectSpread(_objectSpread({}, components), {}, {
50
- InputNumber: _objectSpread({}, components === null || components === void 0 ? void 0 : components.InputNumber)
51
- })
52
- }, parentContext.theme, theme)
48
+ token: _objectSpread(_objectSpread({}, defaultSeed), currentTheme.token),
49
+ components: currentTheme.components
50
+ }, mergedTheme)
53
51
  }, restProps), {}, {
54
52
  children: /*#__PURE__*/_jsx(ExtendedConfigContext.Provider, {
55
53
  value: {
@@ -0,0 +1,18 @@
1
+ import type { DrawerProps as AntDrawerProps } from 'antd/es/drawer';
2
+ import type { ButtonProps } from "../button";
3
+ import React from 'react';
4
+ export * from 'antd/es/drawer';
5
+ export interface DrawerProps extends AntDrawerProps {
6
+ onOk?: (e: any) => void;
7
+ onCancel?: (e: any) => void;
8
+ confirmLoading?: boolean;
9
+ footer?: React.ReactNode | boolean;
10
+ cancelText?: string;
11
+ okText?: string;
12
+ okButtonProps?: ButtonProps;
13
+ }
14
+ declare const Drawer: {
15
+ ({ children, onOk, onCancel, cancelText, okText, okButtonProps, confirmLoading, footer, className, prefixCls: customizePrefixCls, style, ...restProps }: DrawerProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
16
+ displayName: string;
17
+ };
18
+ export default Drawer;
@@ -0,0 +1,69 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["children", "onOk", "onCancel", "cancelText", "okText", "okButtonProps", "confirmLoading", "footer", "className", "prefixCls", "style"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ 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; }
9
+ 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; }
10
+ import { Drawer as AntDrawer } from 'antd';
11
+ import { Button, Space } from "./..";
12
+ import React, { useContext } from 'react';
13
+ import { isBoolean } from 'lodash';
14
+ import classNames from 'classnames';
15
+ import ConfigProvider from "../config-provider";
16
+ import useStyle from "./style";
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ export * from 'antd/es/drawer';
20
+ var Drawer = function Drawer(_ref) {
21
+ var children = _ref.children,
22
+ onOk = _ref.onOk,
23
+ onCancel = _ref.onCancel,
24
+ _ref$cancelText = _ref.cancelText,
25
+ cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
26
+ _ref$okText = _ref.okText,
27
+ okText = _ref$okText === void 0 ? '确定' : _ref$okText,
28
+ okButtonProps = _ref.okButtonProps,
29
+ _ref$confirmLoading = _ref.confirmLoading,
30
+ confirmLoading = _ref$confirmLoading === void 0 ? false : _ref$confirmLoading,
31
+ _ref$footer = _ref.footer,
32
+ footer = _ref$footer === void 0 ? true : _ref$footer,
33
+ className = _ref.className,
34
+ customizePrefixCls = _ref.prefixCls,
35
+ _ref$style = _ref.style,
36
+ style = _ref$style === void 0 ? {} : _ref$style,
37
+ restProps = _objectWithoutProperties(_ref, _excluded);
38
+ var _useContext = useContext(ConfigProvider.ConfigContext),
39
+ getPrefixCls = _useContext.getPrefixCls;
40
+ var prefixCls = getPrefixCls('drawer', customizePrefixCls);
41
+ var _useStyle = useStyle(prefixCls),
42
+ wrapSSR = _useStyle.wrapSSR;
43
+ var drawerCls = classNames(prefixCls, className);
44
+ return wrapSSR( /*#__PURE__*/_jsxs(AntDrawer, _objectSpread(_objectSpread({
45
+ className: "".concat(drawerCls),
46
+ prefixCls: customizePrefixCls,
47
+ style: _objectSpread({}, style)
48
+ }, restProps), {}, {
49
+ children: [children, footer && /*#__PURE__*/_jsx("div", {
50
+ className: "".concat(prefixCls, "-footer-content"),
51
+ children: isBoolean(footer) ? /*#__PURE__*/_jsxs(Space, {
52
+ children: [/*#__PURE__*/_jsx(Button, {
53
+ onClick: onCancel,
54
+ children: cancelText
55
+ }), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
56
+ onClick: onOk,
57
+ type: "primary",
58
+ loading: confirmLoading
59
+ }, okButtonProps), {}, {
60
+ children: okText
61
+ }))]
62
+ }) : footer
63
+ })]
64
+ })));
65
+ };
66
+ if (process.env.NODE_ENV !== 'production') {
67
+ Drawer.displayName = AntDrawer.displayName;
68
+ }
69
+ export default Drawer;
@@ -1 +1,3 @@
1
1
  export * from 'antd/es/drawer';
2
+ import Drawer from './Drawer';
3
+ export default Drawer;
@@ -1 +1,3 @@
1
- export * from 'antd/es/drawer';
1
+ export * from 'antd/es/drawer';
2
+ import Drawer from "./Drawer";
3
+ export default Drawer;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
3
+ export type DrawerToken = FullToken<'Drawer'>;
4
+ export declare const genDrawerStyle: GenerateStyle<DrawerToken>;
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,31 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ 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); }
5
+ import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
+ export var genDrawerStyle = function genDrawerStyle(token) {
7
+ var _$concat;
8
+ var componentCls = token.componentCls;
9
+ return _defineProperty({}, "".concat(componentCls), (_$concat = {}, _defineProperty(_$concat, "".concat(componentCls, "-header"), {
10
+ padding: '20px 24px 0',
11
+ borderBottom: 'none'
12
+ }), _defineProperty(_$concat, "".concat(componentCls, "-footer-content"), {
13
+ position: 'absolute',
14
+ right: 0,
15
+ bottom: 0,
16
+ width: 'calc(100% - 32px)',
17
+ padding: 24,
18
+ paddingLeft: 0,
19
+ background: token.colorBgContainer,
20
+ zIndex: 10,
21
+ display: 'flex',
22
+ justifyContent: 'end',
23
+ alignItems: 'center'
24
+ }), _$concat));
25
+ };
26
+ export default (function (prefixCls) {
27
+ var useStyle = genComponentStyleHook('Drawer', function (token) {
28
+ return [genDrawerStyle(token)];
29
+ });
30
+ return useStyle(prefixCls);
31
+ });
package/es/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { default as ConfigProvider } from './config-provider';
8
8
  export { default as Descriptions } from './descriptions';
9
9
  export { default as Form } from './form';
10
10
  export { default as Modal } from './modal';
11
+ export { default as Drawer } from './drawer';
11
12
  export { message, notification, token } from './static-function';
12
13
  export { default as Table } from './table';
13
14
  export { default as Tabs } from './tabs';
@@ -20,7 +21,7 @@ export { default as Breadcrumb } from './breadcrumb';
20
21
  export { default as Spin } from './spin';
21
22
  export { default as Badge } from './badge';
22
23
  declare const useToken: () => {
23
- theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/interface/seeds").SeedToken, import("antd/es/theme/interface").MapToken>;
24
+ theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/internal").SeedToken, import("antd/es/theme/interface").MapToken>;
24
25
  token: import("antd").GlobalToken;
25
26
  hashId: string;
26
27
  };
package/es/index.js CHANGED
@@ -10,6 +10,7 @@ export { default as ConfigProvider } from "./config-provider";
10
10
  export { default as Descriptions } from "./descriptions";
11
11
  export { default as Form } from "./form";
12
12
  export { default as Modal } from "./modal";
13
+ export { default as Drawer } from "./drawer";
13
14
  export { message, notification, token } from "./static-function";
14
15
  export { default as Table } from "./table";
15
16
  export { default as Tabs } from "./tabs";
@@ -7,7 +7,7 @@ export var genModalStyle = function genModalStyle(token) {
7
7
  var _$concat$concat, _$concat2, _$concat3, _$concat4, _ref;
8
8
  var antCls = token.antCls,
9
9
  componentCls = token.componentCls,
10
- marginSM = token.marginSM,
10
+ marginXXS = token.marginXXS,
11
11
  marginLG = token.marginLG,
12
12
  paddingMD = token.paddingMD,
13
13
  borderRadius = token.borderRadius,
@@ -45,7 +45,8 @@ export var genModalStyle = function genModalStyle(token) {
45
45
  }), _$concat2)), _defineProperty(_$concat3, "".concat(componentCls, "-footer"), {
46
46
  textAlign: 'center'
47
47
  }), _$concat3))), _defineProperty(_ref, "".concat(componentCls, "-confirm"), (_$concat4 = {}, _defineProperty(_$concat4, "".concat(componentCls, "-body ").concat(componentCls, "-confirm-title +").concat(componentCls, "-confirm-content"), {
48
- marginBlockStart: marginSM
48
+ marginBlockStart: marginXXS,
49
+ color: token.colorTextSecondary
49
50
  }), _defineProperty(_$concat4, "".concat(componentCls, "-confirm-btns"), {
50
51
  marginTop: marginLG
51
52
  }), _$concat4)), _ref;
@@ -1,5 +1,11 @@
1
- import type { SelectProps as AntSelectProps } from 'antd/es/select';
1
+ import type { SelectProps as AntSelectProps, RefSelectProps } from 'antd/es/select';
2
+ import type { OptGroup, Option } from 'rc-select';
3
+ import React from 'react';
2
4
  export * from 'antd/es/select';
3
5
  export type SelectProps = AntSelectProps;
4
- declare const Select: any;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<RefSelectProps>> & {
7
+ Option: typeof Option;
8
+ OptGroup: typeof OptGroup;
9
+ };
10
+ declare const Select: CompoundedComponent;
5
11
  export default Select;
@@ -13,10 +13,8 @@ import React, { useContext } from 'react';
13
13
  import ConfigProvider from "../config-provider";
14
14
  import useStyle from "./style";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
- var Option = AntSelect.Option,
17
- OptGroup = AntSelect.OptGroup;
18
16
  export * from 'antd/es/select';
19
- var Select = function Select(_ref) {
17
+ var InternalSelect = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20
18
  var customizePrefixCls = _ref.prefixCls,
21
19
  className = _ref.className,
22
20
  restProps = _objectWithoutProperties(_ref, _excluded);
@@ -27,12 +25,14 @@ var Select = function Select(_ref) {
27
25
  wrapSSR = _useStyle.wrapSSR;
28
26
  var selectCls = classNames(className);
29
27
  return wrapSSR( /*#__PURE__*/_jsx(AntSelect, _objectSpread({
28
+ ref: ref,
30
29
  prefixCls: customizePrefixCls,
31
30
  className: selectCls
32
31
  }, restProps)));
33
- };
34
- Select.Option = Option;
35
- Select.OptGroup = OptGroup;
32
+ });
33
+ var Select = InternalSelect;
34
+ Select.Option = AntSelect.Option;
35
+ Select.OptGroup = AntSelect.OptGroup;
36
36
  if (process.env.NODE_ENV !== 'production') {
37
37
  Select.displayName = AntSelect.displayName;
38
38
  }
package/es/spin/index.js CHANGED
@@ -45,6 +45,7 @@ var Spin = function Spin(_ref) {
45
45
  }, restProps)));
46
46
  };
47
47
  Spin.setDefaultIndicator = AntSpin.setDefaultIndicator;
48
+ Spin.setDefaultIndicator( /*#__PURE__*/_jsx(Spin, {}));
48
49
  if (process.env.NODE_ENV !== 'production') {
49
50
  Spin.displayName = AntSpin.displayName;
50
51
  }
@@ -2,7 +2,7 @@ import { message as antMessage, Modal as AntModal, notification as antNotificati
2
2
  import type { MessageInstance } from 'antd/es/message/interface';
3
3
  import type { ModalStaticFunctions } from 'antd/es/modal/confirm';
4
4
  import type { NotificationInstance } from 'antd/es/notification/interface';
5
- declare let token: import("antd/lib/theme/internal").AliasToken;
5
+ declare let token: import("antd/lib/theme/interface/alias").AliasToken;
6
6
  declare let message: MessageInstance & {
7
7
  useMessage: typeof antMessage.useMessage;
8
8
  };
@@ -7,13 +7,13 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  import { App, message as antMessage, Modal as AntModal, notification as antNotification } from 'antd';
8
8
  import formatToken from 'antd/lib/theme/util/alias';
9
9
  import theme from "../theme";
10
- import defaultThemeToken from "../theme/default";
10
+ import defaultTheme from "../theme/default";
11
11
  var defaultAlgorithm = theme.defaultAlgorithm,
12
12
  defaultSeed = theme.defaultSeed,
13
13
  useToken = theme.useToken;
14
14
 
15
15
  // 设置默认 token
16
- var mapToken = _objectSpread(_objectSpread(_objectSpread({}, defaultAlgorithm(defaultSeed)), defaultThemeToken), {}, {
16
+ var mapToken = _objectSpread(_objectSpread(_objectSpread({}, defaultAlgorithm(defaultSeed)), defaultTheme.token), {}, {
17
17
  override: {}
18
18
  });
19
19
  var token = formatToken(mapToken);
@@ -1,8 +1,10 @@
1
1
  import type { TableProps as AntTableProps } from 'antd';
2
2
  import type { ColumnsType } from 'antd/es/table';
3
3
  import type { TableLocale as AntTableLocale } from 'antd/es/table/interface';
4
+ import type { Reference } from 'rc-table';
4
5
  import type { ReactElement, ReactNode } from 'react';
5
6
  import React from 'react';
7
+ import type { AnyObject } from '../_util/type';
6
8
  export * from 'antd/es/table';
7
9
  export interface TableLocale extends AntTableLocale {
8
10
  batchOperationBar?: {
@@ -21,15 +23,18 @@ export interface TableProps<T> extends AntTableProps<T> {
21
23
  toolSelectedContent?: (selectedRowKeys: any, selectedRows: any) => ReactNode;
22
24
  locale?: TableLocale;
23
25
  }
24
- declare function Table<T>(props: TableProps<T>): ReactElement<any, string | React.JSXElementConstructor<any>>;
25
- declare namespace Table {
26
- var SELECTION_COLUMN: {};
27
- var EXPAND_COLUMN: {};
28
- var SELECTION_ALL: "SELECT_ALL";
29
- var SELECTION_INVERT: "SELECT_INVERT";
30
- var SELECTION_NONE: "SELECT_NONE";
31
- var Column: typeof import("antd/es/table/Column").default;
32
- var ColumnGroup: typeof import("antd/es/table/ColumnGroup").default;
33
- var Summary;
34
- }
35
- export default Table;
26
+ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: TableProps<RecordType> & {
27
+ children?: ReactNode;
28
+ } & {
29
+ ref?: React.Ref<Reference>;
30
+ }) => ReactElement<any, string | React.JSXElementConstructor<any>>) & {
31
+ SELECTION_COLUMN: {};
32
+ EXPAND_COLUMN: {};
33
+ SELECTION_ALL: "SELECT_ALL";
34
+ SELECTION_INVERT: "SELECT_INVERT";
35
+ SELECTION_NONE: "SELECT_NONE";
36
+ Column: typeof import("antd/es/table/Column").default;
37
+ ColumnGroup: typeof import("antd/es/table/ColumnGroup").default;
38
+ Summary: typeof import("rc-table/lib/Footer/Summary").default;
39
+ };
40
+ export default _default;
package/es/table/index.js CHANGED
@@ -23,7 +23,7 @@ import useStyle from "./style";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
25
  export * from 'antd/es/table';
26
- function Table(props) {
26
+ function Table(props, ref) {
27
27
  var _enUS$Table;
28
28
  var customLocale = props.locale,
29
29
  columns = props.columns,
@@ -50,8 +50,8 @@ function Table(props) {
50
50
  var tableCls = classNames(_defineProperty({}, "".concat(prefixCls, "-expandable"), !isEmpty(expandable)), className);
51
51
  var _useState = useState(false),
52
52
  _useState2 = _slicedToArray(_useState, 2),
53
- openPopver = _useState2[0],
54
- setOpenPopver = _useState2[1];
53
+ openPopover = _useState2[0],
54
+ setOpenPopover = _useState2[1];
55
55
  var _useState3 = useState(),
56
56
  _useState4 = _slicedToArray(_useState3, 2),
57
57
  currentSelectedRowKeys = _useState4[0],
@@ -101,7 +101,7 @@ function Table(props) {
101
101
  };
102
102
  useEffect(function () {
103
103
  if (isEmpty(currentSelectedRows) && toolSelectedContent) {
104
- setOpenPopver(false);
104
+ setOpenPopover(false);
105
105
  }
106
106
  }, [currentSelectedRows]);
107
107
  var renderOptionsBar = function renderOptionsBar(total, range) {
@@ -140,12 +140,12 @@ function Table(props) {
140
140
  overlayClassName: "".concat(prefixCls, "-batch-operation-selection-popover"),
141
141
  content: toolSelectedContent === null || toolSelectedContent === void 0 ? void 0 : toolSelectedContent(currentSelectedRowKeys, currentSelectedRows),
142
142
  trigger: "click",
143
- open: openPopver,
143
+ open: openPopover,
144
144
  children: /*#__PURE__*/_jsx("a", {
145
145
  onClick: function onClick() {
146
- return setOpenPopver(!openPopver);
146
+ return setOpenPopover(!openPopover);
147
147
  },
148
- children: openPopver ? batchOperationBar === null || batchOperationBar === void 0 ? void 0 : batchOperationBar.collapse : batchOperationBar === null || batchOperationBar === void 0 ? void 0 : batchOperationBar.open
148
+ children: openPopover ? batchOperationBar === null || batchOperationBar === void 0 ? void 0 : batchOperationBar.collapse : batchOperationBar === null || batchOperationBar === void 0 ? void 0 : batchOperationBar.open
149
149
  })
150
150
  })]
151
151
  }), toolOptionsRender && /*#__PURE__*/_jsx(Space, {
@@ -158,6 +158,7 @@ function Table(props) {
158
158
  });
159
159
  };
160
160
  return wrapSSR( /*#__PURE__*/_jsx(AntTable, _objectSpread(_objectSpread({}, props), {}, {
161
+ ref: ref,
161
162
  prefixCls: customizePrefixCls,
162
163
  className: tableCls,
163
164
  locale: restLocale,
@@ -174,12 +175,14 @@ function Table(props) {
174
175
  })
175
176
  })));
176
177
  }
177
- Table.SELECTION_COLUMN = AntTable.SELECTION_COLUMN;
178
- Table.EXPAND_COLUMN = AntTable.EXPAND_COLUMN;
179
- Table.SELECTION_ALL = AntTable.SELECTION_ALL;
180
- Table.SELECTION_INVERT = AntTable.SELECTION_INVERT;
181
- Table.SELECTION_NONE = AntTable.SELECTION_NONE;
182
- Table.Column = AntTable.Column;
183
- Table.ColumnGroup = AntTable.ColumnGroup;
184
- Table.Summary = AntTable.Summary;
185
- export default Table;
178
+ var ForwardTable = /*#__PURE__*/React.forwardRef(Table);
179
+ export default Object.assign(ForwardTable, {
180
+ SELECTION_COLUMN: AntTable.SELECTION_COLUMN,
181
+ EXPAND_COLUMN: AntTable.EXPAND_COLUMN,
182
+ SELECTION_ALL: AntTable.SELECTION_ALL,
183
+ SELECTION_INVERT: AntTable.SELECTION_INVERT,
184
+ SELECTION_NONE: AntTable.SELECTION_NONE,
185
+ Column: AntTable.Column,
186
+ ColumnGroup: AntTable.ColumnGroup,
187
+ Summary: AntTable.Summary
188
+ });
package/es/tag/index.d.ts CHANGED
@@ -4,9 +4,7 @@ export * from 'antd/es/tag';
4
4
  export interface TagProps extends AntTagProps {
5
5
  ellipsis?: boolean;
6
6
  }
7
- declare const Tag: {
8
- ({ prefixCls: customizePrefixCls, className, ellipsis, ...restProps }: TagProps): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
9
- displayName: string;
7
+ declare const _default: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>> & {
10
8
  CheckableTag: React.ForwardRefExoticComponent<import("antd/es/tag").CheckableTagProps & React.RefAttributes<HTMLSpanElement>>;
11
9
  };
12
- export default Tag;
10
+ export default _default;
package/es/tag/index.js CHANGED
@@ -15,8 +15,7 @@ import ConfigProvider from "../config-provider";
15
15
  import useStyle from "./style";
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  export * from 'antd/es/tag';
18
- var CheckableTag = AntTag.CheckableTag;
19
- var Tag = function Tag(_ref) {
18
+ var Tag = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
20
19
  var _restProps$children, _restProps$children2;
21
20
  var customizePrefixCls = _ref.prefixCls,
22
21
  className = _ref.className,
@@ -39,16 +38,19 @@ var Tag = function Tag(_ref) {
39
38
  return ellipsis ? wrapSSR( /*#__PURE__*/_jsx(Typography.Text, {
40
39
  ellipsis: _objectSpread({}, ellipsisConfig),
41
40
  children: /*#__PURE__*/_jsx(AntTag, _objectSpread({
41
+ ref: ref,
42
42
  prefixCls: customizePrefixCls,
43
43
  className: tagCls
44
44
  }, restProps))
45
45
  })) : /*#__PURE__*/_jsx(AntTag, _objectSpread({
46
+ ref: ref,
46
47
  prefixCls: customizePrefixCls,
47
48
  className: tagCls
48
49
  }, restProps));
49
- };
50
+ });
50
51
  if (process.env.NODE_ENV !== 'production') {
51
52
  Tag.displayName = AntTag.displayName;
52
53
  }
53
- Tag.CheckableTag = CheckableTag;
54
- export default Tag;
54
+ export default Object.assign(Tag, {
55
+ CheckableTag: AntTag.CheckableTag
56
+ });