@oceanbase/design 0.4.15 → 0.4.17

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 (43) hide show
  1. package/dist/design.min.css +1 -1
  2. package/dist/design.min.js +1 -1
  3. package/es/card/style/index.js +4 -2
  4. package/es/descriptions/hooks/useItems.js +3 -2
  5. package/es/descriptions/style/index.js +1 -3
  6. package/es/form/FormItem.d.ts +1 -0
  7. package/es/form/FormItem.js +1 -0
  8. package/es/global.css +7 -7
  9. package/es/table/index.d.ts +2 -2
  10. package/es/table/style/index.js +1 -3
  11. package/es/tabs/index.d.ts +8 -6
  12. package/es/tabs/index.js +10 -7
  13. package/es/tabs/style/index.js +2 -3
  14. package/es/typography/Link.d.ts +5 -1
  15. package/es/typography/Link.js +1 -0
  16. package/es/typography/Paragraph.d.ts +5 -1
  17. package/es/typography/Paragraph.js +1 -0
  18. package/es/typography/Text.d.ts +5 -1
  19. package/es/typography/Text.js +1 -0
  20. package/es/typography/Title.d.ts +5 -1
  21. package/es/typography/Title.js +1 -0
  22. package/es/typography/style/index.js +2 -6
  23. package/lib/card/style/index.js +9 -1
  24. package/lib/descriptions/hooks/useItems.js +3 -2
  25. package/lib/descriptions/style/index.js +0 -2
  26. package/lib/form/FormItem.d.ts +1 -0
  27. package/lib/form/FormItem.js +6 -0
  28. package/lib/global.css +7 -7
  29. package/lib/table/index.d.ts +2 -2
  30. package/lib/table/style/index.js +2 -4
  31. package/lib/tabs/index.d.ts +8 -6
  32. package/lib/tabs/index.js +68 -62
  33. package/lib/tabs/style/index.js +6 -4
  34. package/lib/typography/Link.d.ts +5 -1
  35. package/lib/typography/Link.js +1 -0
  36. package/lib/typography/Paragraph.d.ts +5 -1
  37. package/lib/typography/Paragraph.js +1 -0
  38. package/lib/typography/Text.d.ts +5 -1
  39. package/lib/typography/Text.js +1 -0
  40. package/lib/typography/Title.d.ts +5 -1
  41. package/lib/typography/Title.js +1 -0
  42. package/lib/typography/style/index.js +2 -9
  43. package/package.json +8 -9
@@ -30,10 +30,12 @@ export var genCardStyle = function genCardStyle(token) {
30
30
  var tableComponentCls = "".concat(antCls, "-table");
31
31
  return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
32
32
  boxShadow: 'none'
33
- })), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
33
+ })), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), _defineProperty({
34
34
  // should not remove border-bottom to avoid tabs inkbar display correctly
35
35
  borderBottomColor: 'transparent'
36
- })), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
36
+ }, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
37
+ border: 'none'
38
+ }))))), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
37
39
  padding: "0 ".concat(paddingLG, "px ").concat(paddingLG, "px ").concat(paddingLG, "px")
38
40
  })), "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
39
41
  padding: "0 ".concat(paddingSM, "px ").concat(paddingSM, "px ").concat(paddingSM, "px")
@@ -35,6 +35,7 @@ function convertItem(props, bordered) {
35
35
  var itemChildren = props.children,
36
36
  contentProps = props.contentProps,
37
37
  restItemProps = _objectWithoutProperties(props, _excluded);
38
+ var itemChildrenType = itemChildren === null || itemChildren === void 0 ? void 0 : itemChildren.type;
38
39
  var defaultEllipsis = {
39
40
  tooltip: {
40
41
  placement: 'topLeft',
@@ -47,8 +48,8 @@ function convertItem(props, bordered) {
47
48
  editable = _ref.editable,
48
49
  restContentProps = _objectWithoutProperties(_ref, _excluded2);
49
50
  return _objectSpread(_objectSpread({}, restItemProps), {}, {
50
- // 仅无边框时定制 children
51
- children: bordered ? itemChildren : /*#__PURE__*/_jsx(Typography.Text, _objectSpread(_objectSpread({}, restContentProps), {}, {
51
+ // 无边框并且子元素非 Typography 时外面包一层 Typography.Text,以实现自动省略
52
+ children: bordered || itemChildrenType !== null && itemChildrenType !== void 0 && itemChildrenType.__ANT_TYPOGRAPHY ? itemChildren : /*#__PURE__*/_jsx(Typography.Text, _objectSpread(_objectSpread({}, restContentProps), {}, {
52
53
  ellipsis: getEllipsisConfig(ellipsis, itemChildren),
53
54
  editable:
54
55
  // disable autoSize by default to avoid over height
@@ -32,9 +32,7 @@ export var genDescriptionsStyle = function genDescriptionsStyle(token) {
32
32
  var componentCls = token.componentCls,
33
33
  typographyComponentCls = token.typographyComponentCls;
34
34
  return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _objectSpread(_objectSpread({}, genVerticalStyle('default', token)), {}, _defineProperty(_defineProperty({}, "".concat(componentCls, "-item-container"), _defineProperty({}, "".concat(componentCls, "-item-content"), _defineProperty({
35
- paddingRight: 12,
36
- // 为了保证内部的 Text ellipsis 生效
37
- overflow: 'hidden'
35
+ paddingRight: 12
38
36
  }, "".concat(typographyComponentCls, "-edit-content"), {
39
37
  insetInlineStart: 0,
40
38
  marginTop: 0,
@@ -9,6 +9,7 @@ declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => R
9
9
  warnings: React.ReactNode[];
10
10
  };
11
11
  };
12
+ export * from 'antd/es/form/FormItem';
12
13
  export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
13
14
  icon?: React.ReactElement;
14
15
  };
@@ -20,6 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { Fragment as _Fragment } from "react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
22
  var AntFormItem = AntForm.Item;
23
+ export * from 'antd/es/form/FormItem';
23
24
  var FormItem = function FormItem(_ref) {
24
25
  var _children$type;
25
26
  var children = _ref.children,
package/es/global.css CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  @font-face {
4
4
  font-family: 'Inter';
5
- /* load priority: local font > remote font > self-hosting font */
5
+ /* load priority: local font > self-hosting font > remote font */
6
6
  src:
7
7
  local('Inter'),
8
+ url('./fonts/Inter.woff2') format('woff2'),
8
9
  url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2')
9
- format('woff2'),
10
- url('./fonts/Inter.woff2') format('woff2');
10
+ format('woff2');
11
11
  /* load strategy: use default font as fallback */
12
12
  font-display: swap;
13
13
  }
@@ -16,9 +16,9 @@
16
16
  font-family: 'Consolas';
17
17
  src:
18
18
  local('Consolas'),
19
+ url('./fonts/Consolas.woff2') format('woff2'),
19
20
  url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2')
20
- format('woff2'),
21
- url('./fonts/Consolas.woff2') format('woff2');
21
+ format('woff2');
22
22
  font-display: swap;
23
23
  }
24
24
 
@@ -26,9 +26,9 @@
26
26
  font-family: 'Helvetica Neue';
27
27
  src:
28
28
  local('Helvetica Neue'),
29
+ url('./fonts/HelveticaNeue.woff2') format('woff2'),
29
30
  url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2')
30
- format('woff2'),
31
- url('./fonts/HelveticaNeue.woff2') format('woff2');
31
+ format('woff2');
32
32
  font-display: swap;
33
33
  }
34
34
 
@@ -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_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;
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;
43
43
  Summary: typeof Summary;
44
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -54,9 +54,7 @@ export var genTableStyle = function genTableStyle(token) {
54
54
  borderBottom: 'none'
55
55
  })), "tr > td", {
56
56
  transition: "background ".concat(token.motionDurationMid)
57
- }), "".concat(componentCls, "-placeholder td"), {
58
- borderBottom: 'none'
59
- }), "".concat(componentCls, "-empty-wrapper"), {
57
+ }), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
60
58
  minHeight: 360 - token.paddingSM * 2,
61
59
  display: 'flex',
62
60
  justifyContent: 'center',
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition } from 'antd/es/tabs';
2
+ import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition, TabsRef } from 'antd/es/tabs';
3
3
  import type { Tab as AntTab } from 'rc-tabs/es/interface';
4
+ import { genTabsStyle } from './style';
5
+ import TabPane from './TabPane';
4
6
  import type { TabPaneProps } from './TabPane';
5
7
  import type { BadgeProps } from '../badge';
6
8
  export * from 'antd/es/tabs';
@@ -17,13 +19,13 @@ export type Tab = {
17
19
  badge?: BadgeType;
18
20
  } & (AntTab | AntTabOptional);
19
21
  export interface TabsProps extends Omit<AntTabsProps, 'items'> {
22
+ divider?: boolean;
20
23
  items?: Tab[];
21
24
  }
22
25
  export type TabsPosition = AntTabsPosition;
23
- declare const Tabs: {
24
- ({ children, items, type, tabPosition, prefixCls: customizePrefixCls, className, ...restProps }: TabsProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
25
- TabPane: React.FC<TabPaneProps>;
26
- genTabsStyle: (token: Partial<import("./style").TabsToken>) => import("@ant-design/cssinjs").CSSObject;
27
- displayName: string;
26
+ type CompoundedComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsRef>> & {
27
+ TabPane: typeof TabPane;
28
+ genTabsStyle: typeof genTabsStyle;
28
29
  };
30
+ declare const Tabs: CompoundedComponent;
29
31
  export default Tabs;
package/es/tabs/index.js CHANGED
@@ -1,15 +1,15 @@
1
- var _excluded = ["children", "items", "type", "tabPosition", "prefixCls", "className"];
1
+ var _excluded = ["children", "divider", "items", "type", "tabPosition", "prefixCls", "className"];
2
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; }
3
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; }
4
+ 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); }
4
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; }
5
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
7
  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
- import { isNullValue } from '@oceanbase/util';
11
- import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
12
10
  import React, { useCallback, useContext } from 'react';
11
+ import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
12
+ import { isNullValue } from '@oceanbase/util';
13
13
  import classNames from 'classnames';
14
14
  import Badge from "../badge";
15
15
  import ConfigProvider from "../config-provider";
@@ -22,9 +22,11 @@ export * from 'antd/es/tabs';
22
22
  var isReactNode = function isReactNode(item) {
23
23
  return /*#__PURE__*/React.isValidElement(item);
24
24
  };
25
- var Tabs = function Tabs(_ref) {
25
+ var Tabs = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
26
26
  var _newItems;
27
27
  var children = _ref.children,
28
+ _ref$divider = _ref.divider,
29
+ divider = _ref$divider === void 0 ? false : _ref$divider,
28
30
  items = _ref.items,
29
31
  type = _ref.type,
30
32
  tabPosition = _ref.tabPosition,
@@ -36,7 +38,7 @@ var Tabs = function Tabs(_ref) {
36
38
  var prefixCls = getPrefixCls('tabs', customizePrefixCls);
37
39
  var _useStyle = useStyle(prefixCls),
38
40
  wrapSSR = _useStyle.wrapSSR;
39
- var tabsCls = classNames(className);
41
+ var tabsCls = classNames(className, _defineProperty({}, "".concat(prefixCls, "-no-divider"), !divider));
40
42
  var isHorizontal = !tabPosition || tabPosition === 'top' || tabPosition === 'bottom';
41
43
  var dividerList = (items === null || items === void 0 ? void 0 : items.filter(function (item) {
42
44
  return item.divider;
@@ -80,13 +82,14 @@ var Tabs = function Tabs(_ref) {
80
82
  return item;
81
83
  });
82
84
  return wrapSSR( /*#__PURE__*/_jsx(AntTabs, _objectSpread({
85
+ ref: ref,
83
86
  items: newItems,
84
87
  type: type,
85
88
  tabPosition: tabPosition,
86
89
  prefixCls: customizePrefixCls,
87
90
  className: tabsCls
88
91
  }, restProps)));
89
- };
92
+ });
90
93
  Tabs.TabPane = TabPane;
91
94
  Tabs.genTabsStyle = genTabsStyle;
92
95
  if (process.env.NODE_ENV !== 'production') {
@@ -10,10 +10,9 @@ export var genTabsStyle = function genTabsStyle(token) {
10
10
  colorInfoBg = token.colorInfoBg,
11
11
  colorTextSecondary = token.colorTextSecondary,
12
12
  colorFillQuaternary = token.colorFillQuaternary;
13
- return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
14
- // 页签位置为 top 和 bottom 时,去掉分割线
13
+ return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-no-divider"), _defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
15
14
  border: 'none'
16
- })), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
15
+ }))), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
17
16
  color: colorTextSecondary,
18
17
  fontFamily: 'PingFangSC',
19
18
  fontSize: 12,
@@ -3,5 +3,9 @@ import type { LinkProps as AntLinkProps } from 'antd/es/typography/Link';
3
3
  export * from 'antd/es/typography/Link';
4
4
  export interface LinkProps extends AntLinkProps {
5
5
  }
6
- declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Link: CompoundedComponent;
7
11
  export default Link;
@@ -39,4 +39,5 @@ var Link = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
39
39
  if (process.env.NODE_ENV !== 'production') {
40
40
  Link.displayName = AntLink.displayName;
41
41
  }
42
+ Link.__ANT_TYPOGRAPHY = true;
42
43
  export default Link;
@@ -3,5 +3,9 @@ import type { ParagraphProps as AntParagraphProps } from 'antd/es/typography/Par
3
3
  export * from 'antd/es/typography/Paragraph';
4
4
  export interface ParagraphProps extends AntParagraphProps {
5
5
  }
6
- declare const Paragraph: React.ForwardRefExoticComponent<ParagraphProps & React.RefAttributes<HTMLElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<ParagraphProps & React.RefAttributes<HTMLElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Paragraph: CompoundedComponent;
7
11
  export default Paragraph;
@@ -39,4 +39,5 @@ var Paragraph = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
39
39
  if (process.env.NODE_ENV !== 'production') {
40
40
  Paragraph.displayName = AntParagraph.displayName;
41
41
  }
42
+ Paragraph.__ANT_TYPOGRAPHY = true;
42
43
  export default Paragraph;
@@ -3,5 +3,9 @@ import type { TextProps as AntTextProps } from 'antd/es/typography/Text';
3
3
  export * from 'antd/es/typography/Text';
4
4
  export interface TextProps extends AntTextProps {
5
5
  }
6
- declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Text: CompoundedComponent;
7
11
  export default Text;
@@ -39,4 +39,5 @@ var Text = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
39
39
  if (process.env.NODE_ENV !== 'production') {
40
40
  Text.displayName = AntText.displayName;
41
41
  }
42
+ Text.__ANT_TYPOGRAPHY = true;
42
43
  export default Text;
@@ -3,5 +3,9 @@ import type { TitleProps as AntTitleProps } from 'antd/es/typography/Title';
3
3
  export * from 'antd/es/typography/Title';
4
4
  export interface TitleProps extends AntTitleProps {
5
5
  }
6
- declare const Title: React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLElement>>;
6
+ type CompoundedComponent = React.ForwardRefExoticComponent<TitleProps & React.RefAttributes<HTMLElement>> & {
7
+ /** @internal */
8
+ __ANT_TYPOGRAPHY: boolean;
9
+ };
10
+ declare const Title: CompoundedComponent;
7
11
  export default Title;
@@ -39,4 +39,5 @@ var Title = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
39
39
  if (process.env.NODE_ENV !== 'production') {
40
40
  Title.displayName = AntTitle.displayName;
41
41
  }
42
+ Title.__ANT_TYPOGRAPHY = true;
42
43
  export default Title;
@@ -9,15 +9,11 @@ export var genTypographyStyle = function genTypographyStyle(token) {
9
9
  fontSize = token.fontSize,
10
10
  lineHeight = token.lineHeight;
11
11
  var marginOffset = (controlHeight - fontSize * lineHeight) / 2;
12
- return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "span".concat(componentCls), {
12
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({
13
13
  lineHeight: 'inherit',
14
14
  color: 'inherit',
15
15
  fontSize: 'inherit'
16
- }), "div".concat(componentCls), {
17
- lineHeight: 'inherit',
18
- color: 'inherit',
19
- fontSize: 'inherit'
20
- }), "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-edit"), {
16
+ }, "".concat(componentCls, "-edit"), {
21
17
  fontSize: token.fontSize
22
18
  })), "".concat(componentCls).concat(componentCls, "-editable-text:not(").concat(componentCls, "-edit-content)"), {
23
19
  '&:hover': {
@@ -67,7 +67,15 @@ var genCardStyle = (token) => {
67
67
  [`${componentCls}${componentCls}-no-divider`]: {
68
68
  [`${componentCls}-head`]: {
69
69
  // should not remove border-bottom to avoid tabs inkbar display correctly
70
- borderBottomColor: "transparent"
70
+ borderBottomColor: "transparent",
71
+ // remove divider for top and bottom tabs
72
+ [tabsComponentCls]: {
73
+ [`&${tabsComponentCls}-top, &${tabsComponentCls}-bottom`]: {
74
+ [`${tabsComponentCls}-nav::before`]: {
75
+ border: "none"
76
+ }
77
+ }
78
+ }
71
79
  }
72
80
  },
73
81
  [`${componentCls}${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
@@ -52,6 +52,7 @@ var children2Items = (children) => {
52
52
  };
53
53
  function convertItem(props, bordered) {
54
54
  const { children: itemChildren, contentProps, ...restItemProps } = props;
55
+ const itemChildrenType = itemChildren == null ? void 0 : itemChildren.type;
55
56
  const defaultEllipsis = {
56
57
  tooltip: {
57
58
  placement: "topLeft",
@@ -61,8 +62,8 @@ function convertItem(props, bordered) {
61
62
  const { ellipsis = defaultEllipsis, editable, ...restContentProps } = contentProps || {};
62
63
  return {
63
64
  ...restItemProps,
64
- // 仅无边框时定制 children
65
- children: bordered ? itemChildren : /* @__PURE__ */ import_react.default.createElement(
65
+ // 无边框并且子元素非 Typography 时外面包一层 Typography.Text,以实现自动省略
66
+ children: bordered || (itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TYPOGRAPHY) ? itemChildren : /* @__PURE__ */ import_react.default.createElement(
66
67
  import_typography.default.Text,
67
68
  {
68
69
  ...restContentProps,
@@ -66,8 +66,6 @@ var genDescriptionsStyle = (token) => {
66
66
  [`${componentCls}-item-container`]: {
67
67
  [`${componentCls}-item-content`]: {
68
68
  paddingRight: 12,
69
- // 为了保证内部的 Text ellipsis 生效
70
- overflow: "hidden",
71
69
  [`${typographyComponentCls}-edit-content`]: {
72
70
  insetInlineStart: 0,
73
71
  marginTop: 0,
@@ -9,6 +9,7 @@ declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => R
9
9
  warnings: React.ReactNode[];
10
10
  };
11
11
  };
12
+ export * from 'antd/es/form/FormItem';
12
13
  export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
13
14
  icon?: React.ReactElement;
14
15
  };
@@ -16,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  }
17
17
  return to;
18
18
  };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
21
  // If the importer is in node compatibility mode or this is not an ESM
21
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -40,6 +41,7 @@ var import_classnames = __toESM(require("classnames"));
40
41
  var import_config_provider = __toESM(require("../config-provider"));
41
42
  var import_useTooltipTypeList = require("../tooltip/hooks/useTooltipTypeList");
42
43
  var import_style = __toESM(require("./style"));
44
+ __reExport(FormItem_exports, require("antd/es/form/FormItem"), module.exports);
43
45
  var AntFormItem = import_antd.Form.Item;
44
46
  var FormItem = ({
45
47
  children,
@@ -95,3 +97,7 @@ var FormItem = ({
95
97
  };
96
98
  FormItem.useStatus = AntFormItem.useStatus;
97
99
  var FormItem_default = FormItem;
100
+ // Annotate the CommonJS export names for ESM import in node:
101
+ 0 && (module.exports = {
102
+ ...require("antd/es/form/FormItem")
103
+ });
package/lib/global.css CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  @font-face {
4
4
  font-family: 'Inter';
5
- /* load priority: local font > remote font > self-hosting font */
5
+ /* load priority: local font > self-hosting font > remote font */
6
6
  src:
7
7
  local('Inter'),
8
+ url('./fonts/Inter.woff2') format('woff2'),
8
9
  url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2')
9
- format('woff2'),
10
- url('./fonts/Inter.woff2') format('woff2');
10
+ format('woff2');
11
11
  /* load strategy: use default font as fallback */
12
12
  font-display: swap;
13
13
  }
@@ -16,9 +16,9 @@
16
16
  font-family: 'Consolas';
17
17
  src:
18
18
  local('Consolas'),
19
+ url('./fonts/Consolas.woff2') format('woff2'),
19
20
  url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2')
20
- format('woff2'),
21
- url('./fonts/Consolas.woff2') format('woff2');
21
+ format('woff2');
22
22
  font-display: swap;
23
23
  }
24
24
 
@@ -26,9 +26,9 @@
26
26
  font-family: 'Helvetica Neue';
27
27
  src:
28
28
  local('Helvetica Neue'),
29
+ url('./fonts/HelveticaNeue.woff2') format('woff2'),
29
30
  url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2')
30
- format('woff2'),
31
- url('./fonts/HelveticaNeue.woff2') format('woff2');
31
+ format('woff2');
32
32
  font-display: swap;
33
33
  }
34
34
 
@@ -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_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;
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;
43
43
  Summary: typeof Summary;
44
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -106,9 +106,7 @@ var genTableStyle = (token) => {
106
106
  transition: `background ${token.motionDurationMid}`
107
107
  },
108
108
  // empty style
109
- [`${componentCls}-placeholder td`]: {
110
- borderBottom: "none"
111
- },
109
+ [`${componentCls}-placeholder td`]: {},
112
110
  [`${componentCls}-empty-wrapper`]: {
113
111
  minHeight: 360 - token.paddingSM * 2,
114
112
  display: "flex",
@@ -178,7 +176,7 @@ var genTableStyle = (token) => {
178
176
  borderRadius: `0px 0px ${token.borderRadiusLG}px ${token.borderRadiusLG}px`
179
177
  }
180
178
  },
181
- // 带边框的表格样式
179
+ // 带内部边框的表格样式
182
180
  [`${componentCls}-wrapper${componentCls}-inner-bordered ${componentCls}-bordered`]: {
183
181
  [`${componentCls}-container`]: {
184
182
  borderInlineStart: "none",
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
- import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition } from 'antd/es/tabs';
2
+ import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition, TabsRef } from 'antd/es/tabs';
3
3
  import type { Tab as AntTab } from 'rc-tabs/es/interface';
4
+ import { genTabsStyle } from './style';
5
+ import TabPane from './TabPane';
4
6
  import type { TabPaneProps } from './TabPane';
5
7
  import type { BadgeProps } from '../badge';
6
8
  export * from 'antd/es/tabs';
@@ -17,13 +19,13 @@ export type Tab = {
17
19
  badge?: BadgeType;
18
20
  } & (AntTab | AntTabOptional);
19
21
  export interface TabsProps extends Omit<AntTabsProps, 'items'> {
22
+ divider?: boolean;
20
23
  items?: Tab[];
21
24
  }
22
25
  export type TabsPosition = AntTabsPosition;
23
- declare const Tabs: {
24
- ({ children, items, type, tabPosition, prefixCls: customizePrefixCls, className, ...restProps }: TabsProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
25
- TabPane: React.FC<TabPaneProps>;
26
- genTabsStyle: (token: Partial<import("./style").TabsToken>) => import("@ant-design/cssinjs").CSSObject;
27
- displayName: string;
26
+ type CompoundedComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsRef>> & {
27
+ TabPane: typeof TabPane;
28
+ genTabsStyle: typeof genTabsStyle;
28
29
  };
30
+ declare const Tabs: CompoundedComponent;
29
31
  export default Tabs;