@douyinfe/semi-ui 2.55.0-beta.0 → 2.55.1

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.
@@ -7,7 +7,7 @@ var __rest = this && this.__rest || function (s, e) {
7
7
  }
8
8
  return t;
9
9
  };
10
- import React from 'react';
10
+ import React, { isValidElement } from 'react';
11
11
  import cls from 'classnames';
12
12
  import PropTypes from 'prop-types';
13
13
  import { strings, cssClasses } from '@douyinfe/semi-foundation/lib/es/descriptions/constants';
@@ -50,7 +50,22 @@ class Descriptions extends BaseComponent {
50
50
  this.foundation = new DescriptionsFoundation(this.adapter);
51
51
  }
52
52
  get adapter() {
53
- return Object.assign({}, super.adapter);
53
+ return Object.assign(Object.assign({}, super.adapter), {
54
+ getColumns: () => {
55
+ var _a, _b;
56
+ if ((_a = this.props.data) === null || _a === void 0 ? void 0 : _a.length) {
57
+ return this.props.data;
58
+ }
59
+ if (this.props.children) {
60
+ return (_b = React.Children.toArray(this.props.children)) === null || _b === void 0 ? void 0 : _b.map(item => {
61
+ return /*#__PURE__*/isValidElement(item) ? Object.assign({
62
+ value: item.props.children
63
+ }, item.props) : [];
64
+ });
65
+ }
66
+ return [];
67
+ }
68
+ });
54
69
  }
55
70
  render() {
56
71
  const _a = this.props,
@@ -48,7 +48,7 @@ export default class Item extends PureComponent {
48
48
  className: keyCls
49
49
  }, itemKey)), /*#__PURE__*/React.createElement("td", {
50
50
  className: `${prefixCls}-item ${prefixCls}-item-td`,
51
- colSpan: span || 1
51
+ colSpan: span ? span * 2 - 1 : 1
52
52
  }, /*#__PURE__*/React.createElement("span", {
53
53
  className: valCls
54
54
  }, typeof children === 'function' ? children() : children)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.55.0-beta.0",
3
+ "version": "2.55.1",
4
4
  "description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -20,12 +20,12 @@
20
20
  "@dnd-kit/core": "^6.0.8",
21
21
  "@dnd-kit/sortable": "^7.0.2",
22
22
  "@dnd-kit/utilities": "^3.2.1",
23
- "@douyinfe/semi-animation": "2.55.0-beta.0",
24
- "@douyinfe/semi-animation-react": "2.55.0-beta.0",
25
- "@douyinfe/semi-foundation": "2.55.0-beta.0",
26
- "@douyinfe/semi-icons": "2.55.0-beta.0",
27
- "@douyinfe/semi-illustrations": "2.55.0-beta.0",
28
- "@douyinfe/semi-theme-default": "2.55.0-beta.0",
23
+ "@douyinfe/semi-animation": "2.55.1",
24
+ "@douyinfe/semi-animation-react": "2.55.1",
25
+ "@douyinfe/semi-foundation": "2.55.1",
26
+ "@douyinfe/semi-icons": "2.55.1",
27
+ "@douyinfe/semi-illustrations": "2.55.1",
28
+ "@douyinfe/semi-theme-default": "2.55.1",
29
29
  "async-validator": "^3.5.0",
30
30
  "classnames": "^2.2.6",
31
31
  "copy-text-to-clipboard": "^2.1.1",
@@ -75,7 +75,7 @@
75
75
  ],
76
76
  "author": "",
77
77
  "license": "MIT",
78
- "gitHead": "1b20ba60f41785e247a71987235b5f3bbd577ff0",
78
+ "gitHead": "d74bd5368afc88bc49abc4ba432be9dd74fa707b",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",