@lambo-design/detail-table 1.0.0-beta.21 → 1.0.0-beta.22

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/detail-table",
3
- "version": "1.0.0-beta.21",
3
+ "version": "1.0.0-beta.22",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -10,8 +10,8 @@
10
10
  "registry": "https://registry.npmjs.org/"
11
11
  },
12
12
  "devDependencies": {
13
- "@lambo-design/core": "^4.7.1-beta.60",
14
- "@lambo-design/shared": "^1.0.0-beta.43"
13
+ "@lambo-design/shared": "^1.0.0-beta.43",
14
+ "@lambo-design/core": "^4.7.1-beta.60"
15
15
  },
16
16
  "scripts": {}
17
17
  }
@@ -15,7 +15,8 @@ const ColProps = {
15
15
  validator: function(value) {
16
16
  return ["horizontal", "vertical"].indexOf(value) !== -1;
17
17
  }
18
- }
18
+ },
19
+ totalCols: Number
19
20
  };
20
21
 
21
22
  const Col = {
@@ -30,11 +31,11 @@ const Col = {
30
31
 
31
32
  // Calculate the total width and column width
32
33
  const totalWidth = 100; // You can adjust this value according to your needs
33
- const columnWidth = totalWidth / 6;
34
+ const columnWidth = totalWidth / ColProps.totalCols;
34
35
 
35
36
  // Set label and content widths
36
- const labelWidth = columnWidth;
37
- const contentWidth = columnWidth * 2;
37
+ const labelWidth = columnWidth * 3 / 10;
38
+ const contentWidth = columnWidth * 7 / 10;
38
39
 
39
40
  const labelProps = {
40
41
  attrs: {},
@@ -14,13 +14,15 @@ export default {
14
14
  functional: true,
15
15
  render: function(createElement, context) {
16
16
  const { children, index, prefixCls, bordered, layout, colon } = context.props;
17
+ const totalCols = toArray(children).length;
17
18
  const renderCol = (colItem, type, idx) => {
18
19
  const colProps = {
19
20
  child: colItem,
20
21
  bordered: bordered,
21
22
  colon: colon,
22
23
  type: type,
23
- layout: layout
24
+ layout: layout,
25
+ totalCols: totalCols
24
26
  }
25
27
  return createElement(Col, {props:colProps,key: `${type}-${colItem.key || idx}`});
26
28
  };