@oceanbase/design 0.4.8 → 0.4.10

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 (73) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/index.d.ts +1 -0
  3. package/es/_util/index.js +25 -0
  4. package/es/alert/index.d.ts +2 -2
  5. package/es/alert/index.js +13 -3
  6. package/es/card/index.js +5 -4
  7. package/es/card/style/index.js +9 -7
  8. package/es/config-provider/index.d.ts +1 -1
  9. package/es/config-provider/index.js +7 -6
  10. package/es/descriptions/hooks/useItems.d.ts +6 -6
  11. package/es/descriptions/hooks/useItems.js +9 -1
  12. package/es/descriptions/index.js +3 -2
  13. package/es/descriptions/style/index.d.ts +3 -0
  14. package/es/descriptions/style/index.js +30 -3
  15. package/es/dropdown/dropdown-button.d.ts +8 -0
  16. package/es/dropdown/dropdown-button.js +23 -0
  17. package/es/dropdown/index.d.ts +10 -0
  18. package/es/dropdown/index.js +17 -1
  19. package/es/empty/colored.js +7 -4
  20. package/es/empty/database.js +7 -4
  21. package/es/empty/guide.js +7 -4
  22. package/es/form/FormItem.d.ts +13 -8
  23. package/es/form/FormItem.js +34 -8
  24. package/es/form/index.js +22 -12
  25. package/es/form/style/index.d.ts +9 -0
  26. package/es/form/style/index.js +20 -0
  27. package/es/index.d.ts +2 -0
  28. package/es/index.js +1 -0
  29. package/es/list/index.d.ts +1 -1
  30. package/es/modal/Progress.d.ts +1 -1
  31. package/es/result/404.js +14 -8
  32. package/es/result/500.js +7 -4
  33. package/es/result/Error.js +9 -5
  34. package/es/result/Processing.js +9 -5
  35. package/es/result/Success.js +39 -24
  36. package/es/result/Warning.js +9 -5
  37. package/es/table/index.d.ts +1 -0
  38. package/es/table/index.js +7 -2
  39. package/es/table/style/index.js +17 -6
  40. package/es/tooltip/ReactStickyMouseTooltip.d.ts +1 -1
  41. package/es/tree-select/index.d.ts +1 -1
  42. package/lib/_util/index.d.ts +1 -0
  43. package/lib/_util/index.js +49 -0
  44. package/lib/alert/index.d.ts +2 -2
  45. package/lib/alert/index.js +21 -2
  46. package/lib/card/index.js +3 -3
  47. package/lib/card/style/index.js +15 -16
  48. package/lib/config-provider/index.d.ts +1 -1
  49. package/lib/config-provider/index.js +6 -4
  50. package/lib/descriptions/hooks/useItems.d.ts +6 -6
  51. package/lib/descriptions/hooks/useItems.js +18 -2
  52. package/lib/descriptions/index.js +5 -2
  53. package/lib/descriptions/style/index.d.ts +3 -0
  54. package/lib/descriptions/style/index.js +47 -4
  55. package/lib/dropdown/dropdown-button.d.ts +8 -0
  56. package/lib/dropdown/dropdown-button.js +42 -0
  57. package/lib/dropdown/index.d.ts +10 -0
  58. package/lib/dropdown/index.js +27 -1
  59. package/lib/form/FormItem.d.ts +13 -8
  60. package/lib/form/FormItem.js +34 -12
  61. package/lib/form/index.js +15 -3
  62. package/lib/form/style/index.d.ts +9 -0
  63. package/lib/form/style/index.js +52 -0
  64. package/lib/index.d.ts +2 -0
  65. package/lib/index.js +3 -0
  66. package/lib/list/index.d.ts +1 -1
  67. package/lib/modal/Progress.d.ts +1 -1
  68. package/lib/table/index.d.ts +3 -2
  69. package/lib/table/index.js +8 -2
  70. package/lib/table/style/index.js +26 -3
  71. package/lib/tooltip/ReactStickyMouseTooltip.d.ts +1 -1
  72. package/lib/tree-select/index.d.ts +1 -1
  73. package/package.json +8 -7
@@ -17,6 +17,7 @@ export interface TableLocale extends AntTableLocale {
17
17
  };
18
18
  }
19
19
  export interface TableProps<T> extends AntTableProps<T> {
20
+ innerBordered?: boolean;
20
21
  columns?: ColumnsType<T>;
21
22
  cancelText?: string;
22
23
  collapseText?: string;
package/es/table/index.js CHANGED
@@ -30,6 +30,9 @@ export * from 'antd/es/table';
30
30
  function Table(props, ref) {
31
31
  var _enUS$Table, _locale$Table;
32
32
  var customLocale = props.locale,
33
+ size = props.size,
34
+ bordered = props.bordered,
35
+ innerBordered = props.innerBordered,
33
36
  columns = props.columns,
34
37
  footer = props.footer,
35
38
  customPagination = props.pagination,
@@ -64,7 +67,7 @@ function Table(props, ref) {
64
67
  var prefixCls = getPrefixCls('table', customizePrefixCls);
65
68
  var _useStyle = useStyle(prefixCls),
66
69
  wrapSSR = _useStyle.wrapSSR;
67
- var tableCls = classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-expandable"), !isEmpty(expandable)), "".concat(prefixCls, "-selectable"), !!rowSelection), "".concat(prefixCls, "-has-footer"), !!footer), className);
70
+ var tableCls = classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-expandable"), !isEmpty(expandable)), "".concat(prefixCls, "-selectable"), !!rowSelection), "".concat(prefixCls, "-has-footer"), !!footer), "".concat(prefixCls, "-inner-bordered"), innerBordered), className);
68
71
  var _useState = useState(false),
69
72
  _useState2 = _slicedToArray(_useState, 2),
70
73
  openPopover = _useState2[0],
@@ -188,12 +191,14 @@ function Table(props, ref) {
188
191
  children: typeof emptyText === 'function' ? emptyText() : emptyText
189
192
  })
190
193
  }),
194
+ size: size,
195
+ bordered: bordered || innerBordered,
191
196
  columns: newColumns,
192
197
  rowClassName: function rowClassName() {
193
198
  return classNames(typeof _rowClassName === 'function' ? _rowClassName.apply(void 0, arguments) : _rowClassName, _defineProperty({}, "".concat(prefixCls, "-expand-row-by-click"), expandable === null || expandable === void 0 ? void 0 : expandable.expandRowByClick));
194
199
  },
195
200
  expandable: expandable ? _objectSpread({
196
- columnWidth: 32
201
+ columnWidth: !size || size === 'large' ? 40 : 32
197
202
  }, expandable) : undefined,
198
203
  rowSelection: rowSelection ? _objectSpread(_objectSpread({
199
204
  columnWidth: table === null || table === void 0 ? void 0 : table.selectionColumnWidth
@@ -77,9 +77,16 @@ export var genTableStyle = function genTableStyle(token) {
77
77
  backgroundColor: colorFillQuaternary
78
78
  }), "tr:nth-child(2n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row):not(").concat(antCls, "-descriptions-row) > td"), {
79
79
  backgroundColor: colorBgBase
80
- }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-footer"), {
80
+ }))), "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-bordered"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-thead > tr"), _defineProperty({}, 'th', {
81
+ backgroundColor: colorFillQuaternary
82
+ })), "".concat(componentCls, "-footer"), {
81
83
  borderRadius: "0px 0px ".concat(token.borderRadiusLG, "px ").concat(token.borderRadiusLG, "px")
82
- })), "".concat(componentCls, "-wrapper ").concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-thead, ").concat(componentCls, "-tbody"), _defineProperty({}, 'td, th', _defineProperty(_defineProperty({}, "&".concat(componentCls, "-row-expand-icon-cell"), {
84
+ })), "".concat(componentCls, "-wrapper").concat(componentCls, "-inner-bordered ").concat(componentCls, "-bordered"), _defineProperty({}, "".concat(componentCls, "-container"), _defineProperty({
85
+ borderInlineStart: 'none',
86
+ borderTop: 'none'
87
+ }, "".concat(componentCls, "-thead > tr > th, ").concat(componentCls, "-tbody > tr > td"), _defineProperty({}, '&:last-child', {
88
+ borderInlineEnd: 'none'
89
+ })))), "".concat(componentCls, "-wrapper ").concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-thead, ").concat(componentCls, "-tbody"), _defineProperty({}, 'td, th', _defineProperty(_defineProperty({}, "&".concat(componentCls, "-row-expand-icon-cell"), {
83
90
  backgroundColor: colorBgBase,
84
91
  // 设置 paddingRight 即可
85
92
  paddingRight: token.paddingXS
@@ -91,25 +98,29 @@ export var genTableStyle = function genTableStyle(token) {
91
98
  borderBottomRightRadius: 0
92
99
  }), "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-expandable)"), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:not(".concat(componentCls, "-measure-row) > td"), {
93
100
  border: 'none'
94
- })))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty({}, "tr:nth-child(2n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row)"), _defineProperty(_defineProperty({}, '& > td', {
101
+ })))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty(_defineProperty({}, "tr:nth-child(n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row)"), _defineProperty(_defineProperty({}, '& > td', {
95
102
  backgroundColor: colorBgBase
96
103
  }), '&:hover', {
97
104
  td: {
98
105
  backgroundColor: colorPrimaryBg
99
106
  }
100
- })), "".concat(componentCls, "-expanded-row > td"), _defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper)"), {
107
+ })), "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
101
108
  marginLeft: token.marginXL + token.lineWidth * 2
109
+ }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
110
+ paddingLeft: token.marginXL + token.lineWidth * 2 + token.padding
102
111
  })), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
103
112
  marginLeft: token.margin + token.lineWidth * 2
104
113
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
105
114
  marginLeft: token.margin + token.lineWidth * 2 + token.margin
106
- })))), "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable").concat(componentCls, "-selectable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper)"), {
115
+ })))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable").concat(componentCls, "-selectable"), _defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-expanded-row > td"), _defineProperty(_defineProperty({}, "& > *:not(".concat(componentCls, "-wrapper):not(").concat(componentCls, "-expanded-row-fixed)"), {
107
116
  marginLeft: token.marginXL + token.marginXL + token.lineWidth * 2
117
+ }), "& > *".concat(componentCls, "-expanded-row-fixed"), {
118
+ paddingLeft: token.marginXL + token.marginXL + token.lineWidth * 2 + token.padding
108
119
  })), "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
109
120
  marginLeft: token.margin + token.marginXL + token.lineWidth * 2
110
121
  }))), "".concat(componentCls, "-middle, ").concat(componentCls, "-small"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr > td > ".concat(componentCls, "-wrapper:only-child ").concat(componentCls), {
111
122
  marginLeft: token.margin + token.marginXL + token.lineWidth * 2 + token.margin
112
- })))), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, "".concat(componentCls, "-wrapper ").concat(antCls, "-spin-blur"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-placeholder"), {
123
+ })))), "".concat(componentCls, "-wrapper ").concat(antCls, "-spin-blur"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "".concat(componentCls, "-placeholder"), {
113
124
  // hide empty when Table loading
114
125
  visibility: 'hidden'
115
126
  }))), "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), _defineProperty(_defineProperty({}, "&".concat(antCls, "-pagination"), {
@@ -35,6 +35,6 @@ declare class ReactStickyMouseTooltip extends React.PureComponent<ReactStickyMou
35
35
  addListener: () => void;
36
36
  removeListener: () => void;
37
37
  updateListener: () => void;
38
- render(): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
38
+ render(): import("@emotion/react/jsx-runtime").JSX.Element;
39
39
  }
40
40
  export default ReactStickyMouseTooltip;
@@ -1,6 +1,6 @@
1
1
  import { TreeSelect as AntTreeSelect } from 'antd';
2
2
  import type { TreeSelectProps as AntTreeSelectProps } from 'antd/es/tree-select';
3
- import { TreeNode as AntTreeNode } from 'rc-tree-select';
3
+ import type { TreeNode as AntTreeNode } from 'rc-tree-select';
4
4
  import type { BaseSelectRef } from 'rc-select';
5
5
  import React from 'react';
6
6
  export * from 'antd/es/tree-select';
@@ -0,0 +1 @@
1
+ export declare const isHorizontalPaddingZero: (padding?: string | number) => boolean;
@@ -0,0 +1,49 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/_util/index.ts
20
+ var util_exports = {};
21
+ __export(util_exports, {
22
+ isHorizontalPaddingZero: () => isHorizontalPaddingZero
23
+ });
24
+ module.exports = __toCommonJS(util_exports);
25
+ var isHorizontalPaddingZero = (padding) => {
26
+ if (typeof padding === "number") {
27
+ return padding === 0;
28
+ }
29
+ if (typeof padding === "string") {
30
+ const parts = padding.trim().split(/\s+/);
31
+ switch (parts.length) {
32
+ case 1:
33
+ return parseFloat(parts[0]) === 0;
34
+ case 2:
35
+ return parseFloat(parts[1]) === 0;
36
+ case 3:
37
+ return parseFloat(parts[1]) === 0;
38
+ case 4:
39
+ return parseFloat(parts[1]) === 0 && parseFloat(parts[3]) === 0;
40
+ default:
41
+ return false;
42
+ }
43
+ }
44
+ return false;
45
+ };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ isHorizontalPaddingZero
49
+ });
@@ -1,12 +1,12 @@
1
- import type { AlertProps as AntAlertProps } from 'antd/es/alert';
2
1
  import React from 'react';
2
+ import type { AlertProps as AntAlertProps } from 'antd/es/alert';
3
3
  export * from 'antd/es/alert';
4
4
  export interface AlertProps extends AntAlertProps {
5
5
  ghost?: boolean;
6
6
  colored?: boolean;
7
7
  }
8
8
  declare const Alert: {
9
- ({ ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
9
+ ({ type, ghost, colored, prefixCls: customizePrefixCls, className, ...restProps }: AlertProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
10
10
  ErrorBoundary: typeof import("antd/es/alert/ErrorBoundary").default;
11
11
  displayName: string;
12
12
  };
@@ -33,13 +33,21 @@ __export(alert_exports, {
33
33
  default: () => alert_default
34
34
  });
35
35
  module.exports = __toCommonJS(alert_exports);
36
+ var import_react = __toESM(require("react"));
36
37
  var import_antd = require("antd");
38
+ var import_icons = require("@oceanbase/icons");
37
39
  var import_classnames = __toESM(require("classnames"));
38
- var import_react = __toESM(require("react"));
39
40
  var import_config_provider = __toESM(require("../config-provider"));
40
41
  var import_style = __toESM(require("./style"));
41
42
  __reExport(alert_exports, require("antd/es/alert"), module.exports);
43
+ var iconMapOutlined = {
44
+ success: /* @__PURE__ */ import_react.default.createElement(import_icons.CheckCircleOutlined, null),
45
+ info: /* @__PURE__ */ import_react.default.createElement(import_icons.InfoCircleOutlined, null),
46
+ error: /* @__PURE__ */ import_react.default.createElement(import_icons.CloseCircleOutlined, null),
47
+ warning: /* @__PURE__ */ import_react.default.createElement(import_icons.ExclamationCircleOutlined, null)
48
+ };
42
49
  var Alert = ({
50
+ type,
43
51
  ghost,
44
52
  colored,
45
53
  prefixCls: customizePrefixCls,
@@ -56,7 +64,18 @@ var Alert = ({
56
64
  },
57
65
  className
58
66
  );
59
- return wrapSSR(/* @__PURE__ */ import_react.default.createElement(import_antd.Alert, { prefixCls: customizePrefixCls, className: alertCls, ...restProps }));
67
+ return wrapSSR(
68
+ /* @__PURE__ */ import_react.default.createElement(
69
+ import_antd.Alert,
70
+ {
71
+ type,
72
+ icon: iconMapOutlined[type],
73
+ prefixCls: customizePrefixCls,
74
+ className: alertCls,
75
+ ...restProps
76
+ }
77
+ )
78
+ );
60
79
  };
61
80
  Alert.ErrorBoundary = import_antd.Alert.ErrorBoundary;
62
81
  if (process.env.NODE_ENV !== "production") {
package/lib/card/index.js CHANGED
@@ -38,6 +38,7 @@ var import_antd = require("antd");
38
38
  var import_classnames = __toESM(require("classnames"));
39
39
  var import_react = __toESM(require("react"));
40
40
  var import_config_provider = __toESM(require("../config-provider"));
41
+ var import_util2 = require("../_util");
41
42
  var import_style = __toESM(require("./style"));
42
43
  __reExport(card_exports, require("antd/es/card/Card"), module.exports);
43
44
  __reExport(card_exports, require("antd/es/card"), module.exports);
@@ -60,13 +61,12 @@ var Card = import_react.default.forwardRef(
60
61
  const prefixCls = getPrefixCls("card", customizePrefixCls);
61
62
  const tabsPrefixCls = getPrefixCls("tabs", customizePrefixCls);
62
63
  const { wrapSSR } = (0, import_style.default)(prefixCls, tabsPrefixCls);
63
- const zeroPaddingList = [0, "0", "0px"];
64
- const noBodyPadding = zeroPaddingList.includes(bodyStyle == null ? void 0 : bodyStyle.padding) || zeroPaddingList.includes((_a = styles == null ? void 0 : styles.body) == null ? void 0 : _a.padding);
64
+ const noBodyHorizontalPadding = (0, import_util2.isHorizontalPaddingZero)(bodyStyle == null ? void 0 : bodyStyle.padding) || (0, import_util2.isHorizontalPaddingZero)((_a = styles == null ? void 0 : styles.body) == null ? void 0 : _a.padding);
65
65
  const cardCls = (0, import_classnames.default)(
66
66
  {
67
67
  [`${prefixCls}-has-title`]: !!title,
68
68
  [`${prefixCls}-no-divider`]: !divided,
69
- [`${prefixCls}-no-body-padding`]: noBodyPadding
69
+ [`${prefixCls}-no-body-horizontal-padding`]: noBodyHorizontalPadding
70
70
  },
71
71
  className
72
72
  );
@@ -27,7 +27,7 @@ module.exports = __toCommonJS(style_exports);
27
27
  var import_style = require("../../tabs/style");
28
28
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
29
29
  var genTableStyle = (padding, token) => {
30
- const { componentCls, antCls } = token;
30
+ const { antCls } = token;
31
31
  const tableComponentCls = `${antCls}-table`;
32
32
  return {
33
33
  [`${tableComponentCls}-wrapper`]: {
@@ -51,18 +51,12 @@ var genTableStyle = (padding, token) => {
51
51
  marginRight: padding
52
52
  }
53
53
  }
54
- },
55
- [`&${componentCls}-has-title${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
56
- [`${componentCls}-body`]: {
57
- [`& > ${tableComponentCls}-wrapper ${tableComponentCls}:not(${tableComponentCls}-bordered):first-child`]: {
58
- marginTop: -token.marginSM
59
- }
60
- }
61
54
  }
62
55
  };
63
56
  };
64
57
  var genCardStyle = (token) => {
65
- const { componentCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG } = token;
58
+ const { componentCls, antCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG } = token;
59
+ const tableComponentCls = `${antCls}-table`;
66
60
  return {
67
61
  [`${componentCls}`]: {
68
62
  // nested Card style
@@ -110,13 +104,18 @@ var genCardStyle = (token) => {
110
104
  marginBottom: 0
111
105
  }
112
106
  },
113
- // no body padding card
114
- [`${componentCls}${componentCls}-no-body-padding`]: genTableStyle(paddingLG, token),
115
- // no body padding small card
116
- [`${componentCls}${componentCls}-no-body-padding${componentCls}-small`]: genTableStyle(
117
- paddingSM,
118
- token
119
- )
107
+ // reduce margin between card title and table
108
+ [`&${componentCls}-has-title${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
109
+ [`${componentCls}-body`]: {
110
+ [`& > ${tableComponentCls}-wrapper ${tableComponentCls}:not(${tableComponentCls}-bordered):first-child`]: {
111
+ marginTop: -token.marginSM
112
+ }
113
+ }
114
+ },
115
+ // no body horizontal padding card
116
+ [`${componentCls}${componentCls}-no-body-horizontal-padding`]: genTableStyle(paddingLG, token),
117
+ // no body horizontal padding small card
118
+ [`${componentCls}${componentCls}-no-body-horizontal-padding${componentCls}-small`]: genTableStyle(paddingSM, token)
120
119
  };
121
120
  };
122
121
  var style_default = (prefixCls, tabsPrefixCls) => {
@@ -45,13 +45,13 @@ export interface ConfigProviderProps extends AntConfigProviderProps {
45
45
  pagination?: PaginationConfig;
46
46
  spin?: SpinConfig;
47
47
  table?: TableConfig;
48
- injectStaticFunction?: boolean;
49
48
  styleProviderProps?: StyleProviderProps;
50
49
  appProps?: AppProps;
51
50
  }
52
51
  export interface ExtendedConfigConsumerProps {
53
52
  navigate?: NavigateFunction;
54
53
  hideOnSinglePage?: boolean;
54
+ injectStaticFunction?: boolean;
55
55
  }
56
56
  declare const ExtendedConfigContext: React.Context<ExtendedConfigConsumerProps>;
57
57
  export type ConfigProviderType = React.FC<ConfigProviderProps> & {
@@ -52,7 +52,8 @@ __reExport(config_provider_exports, require("antd/es/config-provider/DisabledCon
52
52
  __reExport(config_provider_exports, require("antd/es/config-provider"), module.exports);
53
53
  var ExtendedConfigContext = import_react.default.createContext({
54
54
  navigate: void 0,
55
- hideOnSinglePage: false
55
+ hideOnSinglePage: false,
56
+ injectStaticFunction: true
56
57
  });
57
58
  var ConfigProvider = ({
58
59
  children,
@@ -66,7 +67,6 @@ var ConfigProvider = ({
66
67
  spin,
67
68
  table,
68
69
  tabs,
69
- injectStaticFunction = true,
70
70
  styleProviderProps,
71
71
  appProps,
72
72
  ...restProps
@@ -138,10 +138,12 @@ var ConfigProvider = ({
138
138
  {
139
139
  value: {
140
140
  navigate: navigate === void 0 ? parentExtendedContext.navigate : navigate,
141
- hideOnSinglePage: ((_b = parentContext.pagination) == null ? void 0 : _b.showSizeChanger) ? false : hideOnSinglePage !== void 0 ? hideOnSinglePage : parentExtendedContext.hideOnSinglePage
141
+ hideOnSinglePage: ((_b = parentContext.pagination) == null ? void 0 : _b.showSizeChanger) ? false : hideOnSinglePage !== void 0 ? hideOnSinglePage : parentExtendedContext.hideOnSinglePage,
142
+ // inject static function to outermost ConfigProvider only
143
+ injectStaticFunction: false
142
144
  }
143
145
  },
144
- /* @__PURE__ */ import_react.default.createElement(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps }, /* @__PURE__ */ import_react.default.createElement(import_antd.App, { component: false, ...appProps }, children, injectStaticFunction && /* @__PURE__ */ import_react.default.createElement(import_static_function.default, null)))
146
+ /* @__PURE__ */ import_react.default.createElement(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps }, /* @__PURE__ */ import_react.default.createElement(import_antd.App, { component: false, ...appProps }, children, parentExtendedContext.injectStaticFunction && /* @__PURE__ */ import_react.default.createElement(import_static_function.default, null)))
145
147
  )
146
148
  );
147
149
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { DescriptionsItemType } from '..';
3
3
  export default function useItems(items?: DescriptionsItemType[], children?: React.ReactNode, bordered?: boolean): {
4
- children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
4
+ children: string | number | boolean | Iterable<React.ReactNode> | import("@emotion/react/jsx-runtime").JSX.Element;
5
5
  span?: number | "filled" | {
6
6
  xxl?: number;
7
7
  xl?: number;
@@ -10,13 +10,13 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
10
10
  sm?: number;
11
11
  xs?: number;
12
12
  };
13
- prefixCls?: string;
14
- style?: React.CSSProperties;
15
13
  label?: React.ReactNode;
16
- className?: string;
14
+ style?: React.CSSProperties;
17
15
  key?: React.Key;
18
- classNames?: Partial<Record<"content" | "label", string>>;
19
- styles?: Partial<Record<"content" | "label", React.CSSProperties>>;
16
+ className?: string;
17
+ prefixCls?: string;
18
+ classNames?: Partial<Record<"label" | "content", string>>;
19
+ styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
20
20
  labelStyle?: React.CSSProperties;
21
21
  contentStyle?: React.CSSProperties;
22
22
  }[];
@@ -58,11 +58,27 @@ function convertItem(props, bordered) {
58
58
  title: itemChildren
59
59
  }
60
60
  };
61
- const { ellipsis = defaultEllipsis, ...restContentProps } = contentProps || {};
61
+ const { ellipsis = defaultEllipsis, editable, ...restContentProps } = contentProps || {};
62
62
  return {
63
63
  ...restItemProps,
64
64
  // 仅无边框时定制 children
65
- children: bordered ? itemChildren : /* @__PURE__ */ import_react.default.createElement(import_typography.default.Text, { ...restContentProps, ellipsis: (0, import_getEllipsisConfig.getEllipsisConfig)(ellipsis, itemChildren) }, itemChildren)
65
+ children: bordered ? itemChildren : /* @__PURE__ */ import_react.default.createElement(
66
+ import_typography.default.Text,
67
+ {
68
+ ...restContentProps,
69
+ ellipsis: (0, import_getEllipsisConfig.getEllipsisConfig)(ellipsis, itemChildren),
70
+ editable: (
71
+ // disable autoSize by default to avoid over height
72
+ typeof editable === "object" ? {
73
+ autoSize: false,
74
+ ...editable
75
+ } : editable === true ? {
76
+ autoSize: false
77
+ } : editable
78
+ )
79
+ },
80
+ itemChildren
81
+ )
66
82
  };
67
83
  }
68
84
  function useItems(items, children, bordered) {
@@ -44,7 +44,7 @@ __reExport(descriptions_exports, require("antd/es/descriptions"), module.exports
44
44
  var Descriptions = ({
45
45
  children,
46
46
  bordered,
47
- layout,
47
+ layout = "horizontal",
48
48
  colon = layout === "vertical" ? false : void 0,
49
49
  items,
50
50
  prefixCls: customizePrefixCls,
@@ -55,7 +55,10 @@ var Descriptions = ({
55
55
  const prefixCls = getPrefixCls("descriptions", customizePrefixCls);
56
56
  const typographyPrefixCls = getPrefixCls("typography", customizePrefixCls);
57
57
  const { wrapSSR } = (0, import_style.default)(prefixCls, typographyPrefixCls);
58
- const descriptionsCls = (0, import_classnames.default)(className);
58
+ const descriptionsCls = (0, import_classnames.default)(className, {
59
+ [`${prefixCls}-vertical`]: layout === "vertical",
60
+ [`${prefixCls}-horizontal`]: layout === "horizontal"
61
+ });
59
62
  const newItems = (0, import_useItems.default)(items, children, bordered);
60
63
  return wrapSSR(
61
64
  /* @__PURE__ */ import_react.default.createElement(
@@ -1,9 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import type { CSSObject } from '@ant-design/cssinjs';
2
3
  import type { FullToken, GenerateStyle } from 'antd/es/theme/internal';
4
+ import type { DescriptionsProps } from '..';
3
5
  export type DescriptionsToken = FullToken<'Alert'> & {
4
6
  typographyPrefixCls: string;
5
7
  typographyComponentCls: string;
6
8
  };
9
+ export declare const genVerticalStyle: (size: DescriptionsProps['size'], token: Partial<DescriptionsToken>) => CSSObject;
7
10
  export declare const genDescriptionsStyle: GenerateStyle<DescriptionsToken>;
8
11
  declare const _default: (prefixCls: string, typographyPrefixCls: string) => {
9
12
  wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -20,14 +20,49 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  var style_exports = {};
21
21
  __export(style_exports, {
22
22
  default: () => style_default,
23
- genDescriptionsStyle: () => genDescriptionsStyle
23
+ genDescriptionsStyle: () => genDescriptionsStyle,
24
+ genVerticalStyle: () => genVerticalStyle
24
25
  });
25
26
  module.exports = __toCommonJS(style_exports);
26
27
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
28
+ var genVerticalStyle = (size, token) => {
29
+ const { componentCls } = token;
30
+ const paddingMap = {
31
+ default: {
32
+ paddingIn: token.paddingXS,
33
+ paddingOut: token.paddingLG
34
+ },
35
+ middle: {
36
+ paddingIn: token.paddingXXS,
37
+ paddingOut: token.padding
38
+ },
39
+ small: {
40
+ paddingIn: token.paddingXXS,
41
+ paddingOut: token.paddingSM
42
+ }
43
+ };
44
+ const paddingConfig = paddingMap[size];
45
+ return {
46
+ // vertical Descriptions without border
47
+ [`&${componentCls}${componentCls}-vertical:not(${componentCls}-bordered)`]: {
48
+ [`${componentCls}-row:nth-child(2n + 1)`]: {
49
+ [`& > th, & > td`]: {
50
+ paddingBottom: paddingConfig.paddingIn
51
+ }
52
+ },
53
+ [`${componentCls}-row:nth-child(2n)`]: {
54
+ [`& > th, & > td`]: {
55
+ paddingBottom: paddingConfig.paddingOut
56
+ }
57
+ }
58
+ }
59
+ };
60
+ };
27
61
  var genDescriptionsStyle = (token) => {
28
62
  const { componentCls, typographyComponentCls } = token;
29
63
  return {
30
64
  [`${componentCls}`]: {
65
+ ...genVerticalStyle("default", token),
31
66
  [`${componentCls}-item-container`]: {
32
67
  [`${componentCls}-item-content`]: {
33
68
  paddingRight: 12,
@@ -35,11 +70,18 @@ var genDescriptionsStyle = (token) => {
35
70
  overflow: "hidden",
36
71
  [`${typographyComponentCls}-edit-content`]: {
37
72
  insetInlineStart: 0,
38
- marginTop: 0
73
+ marginTop: 0,
74
+ marginBottom: 0
39
75
  }
40
76
  }
77
+ },
78
+ [`${componentCls}-item-container:has(${`${typographyComponentCls}-edit-content`})`]: {
79
+ alignItems: "center",
80
+ height: token.fontSize * token.lineHeight
41
81
  }
42
- }
82
+ },
83
+ [`${componentCls}${componentCls}-middle`]: genVerticalStyle("middle", token),
84
+ [`${componentCls}${componentCls}-small`]: genVerticalStyle("small", token)
43
85
  };
44
86
  };
45
87
  var style_default = (prefixCls, typographyPrefixCls) => {
@@ -56,5 +98,6 @@ var style_default = (prefixCls, typographyPrefixCls) => {
56
98
  };
57
99
  // Annotate the CommonJS export names for ESM import in node:
58
100
  0 && (module.exports = {
59
- genDescriptionsStyle
101
+ genDescriptionsStyle,
102
+ genVerticalStyle
60
103
  });
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { DropdownButtonProps } from 'antd/es/dropdown';
3
+ type CompoundedComponent = React.FC<DropdownButtonProps> & {
4
+ /** @internal */
5
+ __ANT_BUTTON: boolean;
6
+ };
7
+ declare const DropdownButton: CompoundedComponent;
8
+ export default DropdownButton;
@@ -0,0 +1,42 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/dropdown/dropdown-button.tsx
30
+ var dropdown_button_exports = {};
31
+ __export(dropdown_button_exports, {
32
+ default: () => dropdown_button_default
33
+ });
34
+ module.exports = __toCommonJS(dropdown_button_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_icons = require("@oceanbase/icons");
38
+ var DropdownButton = ({ icon = /* @__PURE__ */ import_react.default.createElement(import_icons.DownOutlined, null), ...restProps }) => {
39
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Dropdown.Button, { icon, ...restProps });
40
+ };
41
+ DropdownButton.__ANT_BUTTON = true;
42
+ var dropdown_button_default = DropdownButton;
@@ -1 +1,11 @@
1
+ import React from 'react';
2
+ import { Dropdown as AntDropdown } from 'antd';
3
+ import type { DropDownProps } from 'antd/es/dropdown';
4
+ import DropdownButton from './dropdown-button';
1
5
  export * from 'antd/es/dropdown';
6
+ type CompoundedComponent = React.FC<DropDownProps> & {
7
+ Button: typeof DropdownButton;
8
+ _InternalPanelDoNotUseOrYouWillBeFired: typeof AntDropdown._InternalPanelDoNotUseOrYouWillBeFired;
9
+ };
10
+ declare const Dropdown: CompoundedComponent;
11
+ export default Dropdown;