@oceanbase/design 0.4.11 → 0.4.13

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 (47) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/es/anchor/index.d.ts +1 -0
  4. package/es/anchor/index.js +1 -0
  5. package/es/avatar/index.d.ts +1 -0
  6. package/es/avatar/index.js +1 -0
  7. package/es/button/index.d.ts +1 -1
  8. package/es/descriptions/hooks/useItems.d.ts +2 -3
  9. package/es/form/FormItem.d.ts +1 -1
  10. package/es/modal/Modal.d.ts +6 -6
  11. package/es/segmented/index.d.ts +3 -0
  12. package/es/segmented/index.js +26 -7
  13. package/es/segmented/style/index.js +13 -2
  14. package/es/slider/style/index.js +9 -2
  15. package/es/static-function/index.js +3 -2
  16. package/es/table/index.d.ts +2 -2
  17. package/es/tabs/TabPane.d.ts +4 -0
  18. package/es/tabs/index.d.ts +4 -0
  19. package/es/tabs/index.js +19 -4
  20. package/es/tabs/style/index.js +10 -3
  21. package/es/theme/default.js +2 -1
  22. package/es/theme/style/compact.less +2 -6
  23. package/es/theme/style/dark.less +5 -5
  24. package/es/theme/style/default.less +2 -6
  25. package/lib/anchor/index.d.ts +1 -0
  26. package/lib/anchor/index.js +2 -0
  27. package/lib/avatar/index.d.ts +1 -0
  28. package/lib/avatar/index.js +2 -0
  29. package/lib/button/index.d.ts +1 -1
  30. package/lib/descriptions/hooks/useItems.d.ts +2 -3
  31. package/lib/form/FormItem.d.ts +1 -1
  32. package/lib/modal/Modal.d.ts +6 -6
  33. package/lib/segmented/index.d.ts +3 -0
  34. package/lib/segmented/index.js +13 -3
  35. package/lib/segmented/style/index.js +26 -2
  36. package/lib/slider/style/index.js +5 -1
  37. package/lib/static-function/index.js +3 -2
  38. package/lib/table/index.d.ts +2 -2
  39. package/lib/tabs/TabPane.d.ts +4 -0
  40. package/lib/tabs/index.d.ts +4 -0
  41. package/lib/tabs/index.js +15 -2
  42. package/lib/tabs/style/index.js +14 -1
  43. package/lib/theme/default.js +2 -1
  44. package/lib/theme/style/compact.less +2 -6
  45. package/lib/theme/style/dark.less +5 -5
  46. package/lib/theme/style/default.less +2 -6
  47. package/package.json +10 -10
@@ -1 +1,2 @@
1
+ export * from 'antd/es/anchor/Anchor';
1
2
  export * from 'antd/es/anchor';
@@ -1 +1,2 @@
1
+ export * from 'antd/es/anchor/Anchor';
1
2
  export * from 'antd/es/anchor';
@@ -1 +1,2 @@
1
+ export * from 'antd/es/avatar/AvatarContext';
1
2
  export * from 'antd/es/avatar';
@@ -1 +1,2 @@
1
+ export * from 'antd/es/avatar/AvatarContext';
1
2
  export * from 'antd/es/avatar';
@@ -2,7 +2,7 @@ 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 _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
5
+ declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
6
6
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
7
  __ANT_BUTTON: boolean;
8
8
  };
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  import type { DescriptionsItemType } from '..';
3
3
  export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
4
4
  children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element;
5
+ key?: React.Key;
6
+ label?: React.ReactNode;
5
7
  span?: number | "filled" | {
6
8
  xxl?: number;
7
9
  xl?: number;
@@ -10,11 +12,8 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
10
12
  sm?: number;
11
13
  xs?: number;
12
14
  };
13
- label?: React.ReactNode;
14
15
  style?: React.CSSProperties;
15
- key?: React.Key;
16
16
  className?: string;
17
- prefixCls?: string;
18
17
  classNames?: Partial<Record<"label" | "content", string>>;
19
18
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
20
19
  labelStyle?: React.CSSProperties;
@@ -4,7 +4,7 @@ import type { FormItemProps as AntFormItemProps } from 'antd/es/form';
4
4
  import type { TooltipProps } from '../tooltip';
5
5
  declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
6
6
  useStatus: () => {
7
- status?: "" | "success" | "error" | "warning" | "validating";
7
+ status?: "" | "error" | "warning" | "success" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
@@ -4,27 +4,27 @@ declare const Modal: {
4
4
  ({ footer, prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
5
  info(props: ModalFuncProps): {
6
6
  destroy: () => void;
7
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
7
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
8
8
  };
9
9
  success(props: ModalFuncProps): {
10
10
  destroy: () => void;
11
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
11
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
12
12
  };
13
13
  error(props: ModalFuncProps): {
14
14
  destroy: () => void;
15
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
15
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
16
16
  };
17
17
  warning(props: ModalFuncProps): {
18
18
  destroy: () => void;
19
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
19
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
20
20
  };
21
21
  warn(props: ModalFuncProps): {
22
22
  destroy: () => void;
23
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
23
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
24
24
  };
25
25
  confirm(props: ModalFuncProps): {
26
26
  destroy: () => void;
27
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
27
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
28
28
  };
29
29
  useModal: typeof import("antd/es/modal/useModal").default;
30
30
  destroyAll: () => void;
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { SegmentedProps as AntSegmentedProps, SegmentedLabeledOption as AntSegmentedLabeledOption } from 'antd/es/segmented';
3
3
  import type { EllipsisConfig } from '../typography';
4
+ import type { BadgeProps } from '../badge';
4
5
  import type { SegmentedRawOption } from 'rc-segmented';
5
6
  export * from 'antd/es/segmented';
7
+ type BadgeType = BadgeProps | BadgeProps['count'];
6
8
  export type SegmentedLabeledOption = AntSegmentedLabeledOption & {
7
9
  ellipsis?: EllipsisConfig;
10
+ badge?: BadgeType;
8
11
  };
9
12
  export interface SegmentedProps extends Omit<AntSegmentedProps, 'ref'> {
10
13
  options: (SegmentedRawOption | SegmentedLabeledOption)[];
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["prefixCls", "options"],
2
- _excluded2 = ["label"];
2
+ _excluded2 = ["label", "badge"];
3
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
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
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; }
@@ -8,13 +8,18 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
8
8
  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); }
9
9
  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; }
10
10
  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; }
11
- import React, { useContext } from 'react';
12
- import { Segmented as AntSegmented } from 'antd';
11
+ import React, { useCallback, useContext } from 'react';
12
+ import { Segmented as AntSegmented, Flex } from 'antd';
13
13
  import ConfigProvider from "../config-provider";
14
14
  import Typography from "../typography";
15
+ import Badge from "../badge";
15
16
  import useStyle from "./style";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
19
  export * from 'antd/es/segmented';
20
+ var isReactNode = function isReactNode(item) {
21
+ return /*#__PURE__*/React.isValidElement(item);
22
+ };
18
23
  var Segmented = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
19
24
  var customizePrefixCls = _ref.prefixCls,
20
25
  options = _ref.options,
@@ -24,14 +29,28 @@ var Segmented = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
24
29
  var prefixCls = getPrefixCls('segmented', customizePrefixCls);
25
30
  var _useStyle = useStyle(prefixCls),
26
31
  wrapSSR = _useStyle.wrapSSR;
32
+ var renderBadge = useCallback(function (badge) {
33
+ if (_typeof(badge) === 'object' && !isReactNode(badge)) {
34
+ return /*#__PURE__*/_jsx(Badge, _objectSpread({}, badge));
35
+ }
36
+ return /*#__PURE__*/_jsx(Badge, {
37
+ count: badge
38
+ });
39
+ }, []);
27
40
  var newOptions = options === null || options === void 0 ? void 0 : options.map(function (item) {
28
- if (_typeof(item) === 'object' && item !== null && item !== void 0 && item.ellipsis) {
41
+ if (_typeof(item) === 'object') {
29
42
  var label = item.label,
43
+ badge = item.badge,
30
44
  restItem = _objectWithoutProperties(item, _excluded2);
31
45
  return _objectSpread(_objectSpread({}, restItem), {}, {
32
- label: /*#__PURE__*/_jsx(Typography.Text, {
33
- ellipsis: item.ellipsis,
34
- children: label
46
+ label: /*#__PURE__*/_jsxs(Flex, {
47
+ gap: 4,
48
+ align: "center",
49
+ justify: "center",
50
+ children: [item !== null && item !== void 0 && item.ellipsis ? /*#__PURE__*/_jsx(Typography.Text, {
51
+ ellipsis: item.ellipsis,
52
+ children: label
53
+ }) : label, badge && renderBadge(badge)]
35
54
  })
36
55
  });
37
56
  }
@@ -4,8 +4,19 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genSegmentedStyle = function genSegmentedStyle(token) {
7
- var componentCls = token.componentCls;
8
- return _defineProperty({}, "".concat(componentCls), {});
7
+ var componentCls = token.componentCls,
8
+ antCls = token.antCls,
9
+ colorFill = token.colorFill,
10
+ colorFillSecondary = token.colorFillSecondary;
11
+ return _defineProperty({}, "".concat(componentCls, " >").concat(componentCls, "-group"), _defineProperty(_defineProperty({}, "&:not(:has(".concat(componentCls, "-thumb)) >").concat(componentCls, "-item"), _defineProperty({}, "&:not(.ant-segmented-item-selected) >".concat(componentCls, "-item-label"), _defineProperty(_defineProperty({}, '&:hover', _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
12
+ backgroundColor: colorFill
13
+ })), '&:active', _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
14
+ backgroundColor: colorFillSecondary
15
+ })))), ">".concat(componentCls, "-item"), _defineProperty({}, ">".concat(componentCls, "-item-label"), _defineProperty({}, "".concat(antCls, "-badge >").concat(antCls, "-badge-count"), {
16
+ backgroundColor: colorFillSecondary,
17
+ color: 'inherit',
18
+ boxShadow: 'none'
19
+ }))));
9
20
  };
10
21
  export default (function (prefixCls) {
11
22
  var useStyle = genComponentStyleHook('Segmented', function (token) {
@@ -2,15 +2,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
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
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ import { toNumber } from 'lodash';
5
6
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
7
  export var genSliderStyle = function genSliderStyle(token) {
7
8
  var componentCls = token.componentCls,
8
9
  _token$dotSize = token.dotSize,
9
- dotSize = _token$dotSize === void 0 ? 8 : _token$dotSize;
10
- return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-horizontal"), _defineProperty({}, "".concat(componentCls, "-mark"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-mark-text[style*=\"left: 0%;\"]"), {
10
+ dotSize = _token$dotSize === void 0 ? 8 : _token$dotSize,
11
+ _token$handleSize = token.handleSize,
12
+ handleSize = _token$handleSize === void 0 ? 10 : _token$handleSize,
13
+ _token$handleLineWidt = token.handleLineWidth,
14
+ handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt;
15
+ return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-horizontal"), _defineProperty({}, "".concat(componentCls, "-mark"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-mark-text[style*=\"left: 0%;\"]"), {
11
16
  transform: "translateX(calc(0% - ".concat(dotSize / 2, "px)) !important")
12
17
  }), "".concat(componentCls, "-mark-text[style*=\"left: 100%;\"]"), {
13
18
  transform: "translateX(calc(-100% + ".concat(dotSize / 2, "px)) !important")
19
+ }), "".concat(componentCls, "-mark-text[style=\"transform: translateX(-50%);\"]"), {
20
+ transform: "translateX(calc(0% - ".concat((handleSize + toNumber(handleLineWidth) * 2) / 2, "px)) !important")
14
21
  })));
15
22
  };
16
23
  export default (function (prefixCls) {
@@ -1,4 +1,4 @@
1
- var _defaultTheme$token, _defaultTheme$token2;
1
+ var _defaultTheme$token, _defaultTheme$token2, _defaultTheme$token3;
2
2
  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); }
3
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
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; }
@@ -18,7 +18,8 @@ var mapToken = _objectSpread(_objectSpread(_objectSpread({}, defaultAlgorithm(de
18
18
  // 需要覆盖部分 Alias Token 的值
19
19
  override: {
20
20
  boxShadow: (_defaultTheme$token = defaultTheme.token) === null || _defaultTheme$token === void 0 ? void 0 : _defaultTheme$token.boxShadow,
21
- boxShadowSecondary: (_defaultTheme$token2 = defaultTheme.token) === null || _defaultTheme$token2 === void 0 ? void 0 : _defaultTheme$token2.boxShadowSecondary
21
+ boxShadowSecondary: (_defaultTheme$token2 = defaultTheme.token) === null || _defaultTheme$token2 === void 0 ? void 0 : _defaultTheme$token2.boxShadowSecondary,
22
+ boxShadowTertiary: (_defaultTheme$token3 = defaultTheme.token) === null || _defaultTheme$token3 === void 0 ? void 0 : _defaultTheme$token3.boxShadowTertiary
22
23
  }
23
24
  });
24
25
  var token = formatToken(mapToken);
@@ -38,8 +38,8 @@ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: Table
38
38
  SELECTION_ALL: "SELECT_ALL";
39
39
  SELECTION_INVERT: "SELECT_INVERT";
40
40
  SELECTION_NONE: "SELECT_NONE";
41
- Column: <RecordType extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType>) => null;
42
- ColumnGroup: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_1>) => null;
41
+ Column: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType_1>) => null;
42
+ ColumnGroup: <RecordType_2 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_2>) => null;
43
43
  Summary: typeof Summary;
44
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -1,8 +1,12 @@
1
1
  import type { TabPaneProps as AntTabPaneProps } from 'antd/es/tabs/TabPane';
2
2
  import type React from 'react';
3
+ import type { BadgeProps } from '../badge';
4
+ type BadgeType = BadgeProps | BadgeProps['count'];
3
5
  export interface TabPaneProps extends AntTabPaneProps {
6
+ /** @deprecated please use `badge` instead */
4
7
  tag?: React.ReactNode;
5
8
  divider?: boolean;
9
+ badge?: BadgeType;
6
10
  }
7
11
  declare const _default: React.FC<TabPaneProps>;
8
12
  export default _default;
@@ -2,15 +2,19 @@ import React from 'react';
2
2
  import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition } from 'antd/es/tabs';
3
3
  import type { Tab as AntTab } from 'rc-tabs/es/interface';
4
4
  import type { TabPaneProps } from './TabPane';
5
+ import type { BadgeProps } from '../badge';
5
6
  export * from 'antd/es/tabs';
6
7
  export type { TabPaneProps };
8
+ type BadgeType = BadgeProps | BadgeProps['count'];
7
9
  export interface AntTabOptional extends Omit<AntTab, 'key' | 'label'> {
8
10
  key?: string;
9
11
  label?: React.ReactNode;
10
12
  }
11
13
  export type Tab = {
14
+ /** @deprecated please use `badge` instead */
12
15
  tag?: React.ReactNode;
13
16
  divider?: boolean;
17
+ badge?: BadgeType;
14
18
  } & (AntTab | AntTabOptional);
15
19
  export interface TabsProps extends Omit<AntTabsProps, 'items'> {
16
20
  items?: Tab[];
package/es/tabs/index.js CHANGED
@@ -1,16 +1,17 @@
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
1
  var _excluded = ["children", "items", "type", "tabPosition", "prefixCls", "className"];
3
2
  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
3
  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
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; }
6
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ 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); }
8
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
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
10
  import { isNullValue } from '@oceanbase/util';
11
11
  import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
12
- import React, { useContext } from 'react';
12
+ import React, { useCallback, useContext } from 'react';
13
13
  import classNames from 'classnames';
14
+ import Badge from "../badge";
14
15
  import ConfigProvider from "../config-provider";
15
16
  import useLegacyItems from "./hooks/useLegacyItems";
16
17
  import useStyle, { genTabsStyle } from "./style";
@@ -18,6 +19,9 @@ import TabPane from "./TabPane";
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
21
  export * from 'antd/es/tabs';
22
+ var isReactNode = function isReactNode(item) {
23
+ return /*#__PURE__*/React.isValidElement(item);
24
+ };
21
25
  var Tabs = function Tabs(_ref) {
22
26
  var _newItems;
23
27
  var children = _ref.children,
@@ -37,6 +41,17 @@ var Tabs = function Tabs(_ref) {
37
41
  var dividerList = (items === null || items === void 0 ? void 0 : items.filter(function (item) {
38
42
  return item.divider;
39
43
  })) || [];
44
+ var renderBadge = useCallback(function (badge) {
45
+ if (_typeof(badge) === 'object' && !isReactNode(badge)) {
46
+ return /*#__PURE__*/_jsx(Badge, _objectSpread(_objectSpread({}, badge), {}, {
47
+ className: classNames("".concat(prefixCls, "-tab-badge"), badge.className)
48
+ }));
49
+ }
50
+ return /*#__PURE__*/_jsx(Badge, {
51
+ className: "".concat(prefixCls, "-tab-badge"),
52
+ count: badge
53
+ });
54
+ }, [prefixCls]);
40
55
  var newItems = useLegacyItems(items, children);
41
56
  newItems = (_newItems = newItems) === null || _newItems === void 0 ? void 0 : _newItems.map(function (item) {
42
57
  if (!isNullValue(item.divider)) {
@@ -50,11 +65,11 @@ var Tabs = function Tabs(_ref) {
50
65
  }),
51
66
  disabled: true
52
67
  });
53
- } else if (!isNullValue(item.tag)) {
68
+ } else if (!isNullValue(item.tag) || !isNullValue(item.badge)) {
54
69
  return _objectSpread(_objectSpread({}, item), {}, {
55
70
  label: /*#__PURE__*/_jsxs(Space, {
56
71
  size: 4,
57
- children: [item.label, /*#__PURE__*/_jsx(Tag, {
72
+ children: [item.label, item.badge && renderBadge(item.badge), !isNullValue(item.tag) && /*#__PURE__*/_jsx(Tag, {
58
73
  bordered: false,
59
74
  className: "".concat(prefixCls, "-tab-tag"),
60
75
  children: item.tag
@@ -8,18 +8,25 @@ export var genTabsStyle = function genTabsStyle(token) {
8
8
  componentCls = token.componentCls,
9
9
  colorInfo = token.colorInfo,
10
10
  colorInfoBg = token.colorInfoBg,
11
- colorTextSecondary = token.colorTextSecondary;
11
+ colorTextSecondary = token.colorTextSecondary,
12
+ colorFillQuaternary = token.colorFillQuaternary;
12
13
  return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
13
14
  // 页签位置为 top 和 bottom 时,去掉分割线
14
15
  border: 'none'
15
- })), "".concat(componentCls, "-tab"), _defineProperty({}, "".concat(componentCls, "-tab-tag"), {
16
+ })), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
16
17
  color: colorTextSecondary,
17
18
  fontFamily: 'PingFangSC',
18
19
  fontSize: 12,
19
20
  borderRadius: 12,
20
21
  marginInlineEnd: 0,
21
22
  height: 20
22
- })), "".concat(componentCls, "-tab-active"), _defineProperty({}, "".concat(componentCls, "-tab-tag"), {
23
+ }), "".concat(componentCls, "-tab-badge"), _defineProperty(_defineProperty({}, ">".concat(antCls, "-badge-count"), {
24
+ color: colorTextSecondary,
25
+ backgroundColor: colorFillQuaternary
26
+ }), "borderRadius", 12))), "".concat(componentCls, "-tab-active"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
27
+ color: colorInfo,
28
+ backgroundColor: colorInfoBg
29
+ }), "".concat(componentCls, "-tab-badge >").concat(antCls, "-badge-count"), {
23
30
  color: colorInfo,
24
31
  backgroundColor: colorInfoBg
25
32
  })), "".concat(componentCls, "-tab[data-node-key^=divider-]"), _defineProperty({
@@ -81,8 +81,9 @@ var defaultTheme = {
81
81
  colorBgMask: 'rgba(19, 32, 57, 0.45)',
82
82
  colorBgElevated: '#ffffff',
83
83
  colorBgSpotlight: '#ffffff',
84
+ boxShadow: '0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05)',
84
85
  boxShadowSecondary: '0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05)',
85
- boxShadow: '0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02)',
86
+ boxShadowTertiary: '0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02)',
86
87
  borderRadius: 6,
87
88
  wireframe: false,
88
89
  // Remove focus outline
@@ -412,8 +412,9 @@
412
412
  @borderRadiusSM: 4;
413
413
  @borderRadiusLG: 8;
414
414
  @borderRadiusOuter: 4;
415
+ @boxShadow: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
415
416
  @boxShadowSecondary: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
416
- @boxShadow: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
417
+ @boxShadowTertiary: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
417
418
  @lineWidthFocus: 3;
418
419
  @colorFillContent: #e2e8f3;
419
420
  @colorFillContentHover: #cdd5e4;
@@ -471,11 +472,6 @@
471
472
  @marginLG: 16;
472
473
  @marginXL: 32;
473
474
  @marginXXL: 48;
474
- @boxShadowTertiary:
475
- 0 1px 2px 0 rgba(0, 0, 0, 0.03),
476
- 0 1px 6px -1px rgba(0, 0, 0, 0.02),
477
- 0 2px 4px 0 rgba(0, 0, 0, 0.02)
478
- ;
479
475
  @screenXS: 480;
480
476
  @screenXSMin: 480;
481
477
  @screenXSMax: 575;
@@ -322,8 +322,8 @@
322
322
  @colorBgBlur: rgba(255,255,255,0.04);
323
323
  @colorBorder: #424242;
324
324
  @colorBorderSecondary: #303030;
325
- @colorPrimaryBg: #111a2c;
326
- @colorPrimaryBgHover: #0f2445;
325
+ @colorPrimaryBg: #0e2e5b;
326
+ @colorPrimaryBgHover: #0b3b7e;
327
327
  @colorPrimaryBorder: #0e2e5b;
328
328
  @colorPrimaryBorderHover: #0b3b7e;
329
329
  @colorPrimaryHover: #277de8;
@@ -436,11 +436,11 @@
436
436
  @controlOutlineWidth: 2;
437
437
  @controlInteractiveSize: 16;
438
438
  @controlItemBgHover: rgba(255,255,255,0.08);
439
- @controlItemBgActive: #111a2c;
440
- @controlItemBgActiveHover: #0f2445;
439
+ @controlItemBgActive: #0e2e5b;
440
+ @controlItemBgActiveHover: #0b3b7e;
441
441
  @controlItemBgActiveDisabled: rgba(255,255,255,0.18);
442
442
  @controlTmpOutline: rgba(255,255,255,0.04);
443
- @controlOutline: rgba(0,60,180,0.15);
443
+ @controlOutline: rgba(1,104,249,0.31);
444
444
  @fontWeightStrong: 600;
445
445
  @opacityLoading: 0.65;
446
446
  @linkDecoration: none;
@@ -412,8 +412,9 @@
412
412
  @borderRadiusSM: 4;
413
413
  @borderRadiusLG: 8;
414
414
  @borderRadiusOuter: 4;
415
+ @boxShadow: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
415
416
  @boxShadowSecondary: 0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05);
416
- @boxShadow: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
417
+ @boxShadowTertiary: 0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02);
417
418
  @lineWidthFocus: 3;
418
419
  @colorFillContent: #e2e8f3;
419
420
  @colorFillContentHover: #cdd5e4;
@@ -471,11 +472,6 @@
471
472
  @marginLG: 24;
472
473
  @marginXL: 32;
473
474
  @marginXXL: 48;
474
- @boxShadowTertiary:
475
- 0 1px 2px 0 rgba(0, 0, 0, 0.03),
476
- 0 1px 6px -1px rgba(0, 0, 0, 0.02),
477
- 0 2px 4px 0 rgba(0, 0, 0, 0.02)
478
- ;
479
475
  @screenXS: 480;
480
476
  @screenXSMin: 480;
481
477
  @screenXSMax: 575;
@@ -1 +1,2 @@
1
+ export * from 'antd/es/anchor/Anchor';
1
2
  export * from 'antd/es/anchor';
@@ -16,8 +16,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // src/anchor/index.ts
17
17
  var anchor_exports = {};
18
18
  module.exports = __toCommonJS(anchor_exports);
19
+ __reExport(anchor_exports, require("antd/es/anchor/Anchor"), module.exports);
19
20
  __reExport(anchor_exports, require("antd/es/anchor"), module.exports);
20
21
  // Annotate the CommonJS export names for ESM import in node:
21
22
  0 && (module.exports = {
23
+ ...require("antd/es/anchor/Anchor"),
22
24
  ...require("antd/es/anchor")
23
25
  });
@@ -1 +1,2 @@
1
+ export * from 'antd/es/avatar/AvatarContext';
1
2
  export * from 'antd/es/avatar';
@@ -16,8 +16,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // src/avatar/index.ts
17
17
  var avatar_exports = {};
18
18
  module.exports = __toCommonJS(avatar_exports);
19
+ __reExport(avatar_exports, require("antd/es/avatar/AvatarContext"), module.exports);
19
20
  __reExport(avatar_exports, require("antd/es/avatar"), module.exports);
20
21
  // Annotate the CommonJS export names for ESM import in node:
21
22
  0 && (module.exports = {
23
+ ...require("antd/es/avatar/AvatarContext"),
22
24
  ...require("antd/es/avatar")
23
25
  });
@@ -2,7 +2,7 @@ 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 _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
5
+ declare const _default: React.ForwardRefExoticComponent<AntButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
6
6
  Group: React.FC<import("antd/es/button").ButtonGroupProps>;
7
7
  __ANT_BUTTON: boolean;
8
8
  };
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  import type { DescriptionsItemType } from '..';
3
3
  export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
4
4
  children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element;
5
+ key?: React.Key;
6
+ label?: React.ReactNode;
5
7
  span?: number | "filled" | {
6
8
  xxl?: number;
7
9
  xl?: number;
@@ -10,11 +12,8 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
10
12
  sm?: number;
11
13
  xs?: number;
12
14
  };
13
- label?: React.ReactNode;
14
15
  style?: React.CSSProperties;
15
- key?: React.Key;
16
16
  className?: string;
17
- prefixCls?: string;
18
17
  classNames?: Partial<Record<"label" | "content", string>>;
19
18
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
20
19
  labelStyle?: React.CSSProperties;
@@ -4,7 +4,7 @@ import type { FormItemProps as AntFormItemProps } from 'antd/es/form';
4
4
  import type { TooltipProps } from '../tooltip';
5
5
  declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
6
6
  useStatus: () => {
7
- status?: "" | "success" | "error" | "warning" | "validating";
7
+ status?: "" | "error" | "warning" | "success" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
@@ -4,27 +4,27 @@ declare const Modal: {
4
4
  ({ footer, prefixCls: customizePrefixCls, className, ...restProps }: ModalProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
5
  info(props: ModalFuncProps): {
6
6
  destroy: () => void;
7
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
7
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
8
8
  };
9
9
  success(props: ModalFuncProps): {
10
10
  destroy: () => void;
11
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
11
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
12
12
  };
13
13
  error(props: ModalFuncProps): {
14
14
  destroy: () => void;
15
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
15
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
16
16
  };
17
17
  warning(props: ModalFuncProps): {
18
18
  destroy: () => void;
19
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
19
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
20
20
  };
21
21
  warn(props: ModalFuncProps): {
22
22
  destroy: () => void;
23
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
23
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
24
24
  };
25
25
  confirm(props: ModalFuncProps): {
26
26
  destroy: () => void;
27
- update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
27
+ update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
28
28
  };
29
29
  useModal: typeof import("antd/es/modal/useModal").default;
30
30
  destroyAll: () => void;
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { SegmentedProps as AntSegmentedProps, SegmentedLabeledOption as AntSegmentedLabeledOption } from 'antd/es/segmented';
3
3
  import type { EllipsisConfig } from '../typography';
4
+ import type { BadgeProps } from '../badge';
4
5
  import type { SegmentedRawOption } from 'rc-segmented';
5
6
  export * from 'antd/es/segmented';
7
+ type BadgeType = BadgeProps | BadgeProps['count'];
6
8
  export type SegmentedLabeledOption = AntSegmentedLabeledOption & {
7
9
  ellipsis?: EllipsisConfig;
10
+ badge?: BadgeType;
8
11
  };
9
12
  export interface SegmentedProps extends Omit<AntSegmentedProps, 'ref'> {
10
13
  options: (SegmentedRawOption | SegmentedLabeledOption)[];