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

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/.versionrc ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "tagPrefix": "@lambo-design/detail-table@",
3
+ "releaseCommitMessageFormat": "chore(release): @lambo-design/detail-table@{{currentTag}}",
4
+ "path": ".",
5
+ "header": "# Changelog",
6
+ "types": [
7
+ {"type": "chore", "section":"'🎫 Chores | 其他更新", "hidden": false},
8
+ {"type": "revert", "section":"⏪ Reverts | 回退", "hidden": false},
9
+ {"type": "feat", "section": "✨ Features | 新功能", "hidden": false},
10
+ {"type": "fix", "section": "🐛 Bug Fixes | Bug 修复", "hidden": false},
11
+ {"type": "improvement", "section": "Feature Improvements", "hidden": false},
12
+ {"type": "docs", "section":"📝 Documentation | 文档", "hidden": false},
13
+ {"type": "style", "section":"💄 Styles | 风格", "hidden": false},
14
+ {"type": "refactor", "section":"💄 Styles | 风格", "hidden": false},
15
+ {"type": "perf", "section":"⚡ Performance Improvements | 性能优化", "hidden": false},
16
+ {"type": "test", "section":"✅ Tests | 测试", "hidden": false},
17
+ {"type": "build", "section":"👷‍ Build System | 构建", "hidden": false},
18
+ {"type": "ci", "section":"🔧 Continuous Integration | CI 配置", "hidden":false}
19
+ ],
20
+ "commitUrlFormat": "http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/{{hash}}",
21
+ "compareUrlFormat": "http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/{{previousTag}}...{{currentTag}}",
22
+ "issueUrlFormat": "http://git.inspur.com/ecbh/lambo-design/lambo-design/-/issues/{{id}}"
23
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+ ## 1.0.0-beta.24 (2024-05-09)
3
+
4
+
5
+ ### ✨ Features | 新功能
6
+
7
+ * **@lambo-design/detail-table:** 明细表格问题处理 ([9a798f5](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/9a798f5f36579a1dbd1e55b1031f8400a4f463f3))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/detail-table",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.24",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -10,8 +10,15 @@
10
10
  "registry": "https://registry.npmjs.org/"
11
11
  },
12
12
  "devDependencies": {
13
- "@lambo-design/shared": "^1.0.0-beta.43",
14
- "@lambo-design/core": "^4.7.1-beta.60"
13
+ "@lambo-design/core": "^4.7.1-beta.136",
14
+ "@lambo-design/shared": "^1.0.0-beta.170"
15
15
  },
16
- "scripts": {}
16
+ "scripts": {
17
+ "release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
18
+ "release-major": "standard-version --release-as major",
19
+ "release-minor": "standard-version --release-as minor",
20
+ "release-patch": "standard-version --release-as patch",
21
+ "release-beta": "standard-version --prerelease beta",
22
+ "re-publish": "pnpm publish --access public --no-git-checks"
23
+ }
17
24
  }
@@ -28,15 +28,8 @@ const Col = {
28
28
  const { key } = ctx.data;
29
29
  const label = getComponentFromProp(child, "label");
30
30
  const slots = getSlots(child);
31
-
32
- // Calculate the total width and column width
33
- const totalWidth = 100; // You can adjust this value according to your needs
34
- const columnWidth = totalWidth / ColProps.totalCols;
35
-
36
- // Set label and content widths
37
- const labelWidth = columnWidth * 3 / 10;
38
- const contentWidth = columnWidth * 7 / 10;
39
-
31
+ const labelColSpan = Math.floor(100 / ColProps.totalCols * 0.33); // 计算 label 的长度
32
+ const contextColSpan = Math.floor(100 / ColProps.totalCols * 0.66); // 计算 context 的长度
40
33
  const labelProps = {
41
34
  attrs: {},
42
35
  class: [
@@ -48,55 +41,69 @@ const Col = {
48
41
  ],
49
42
  key: `${key}-label`,
50
43
  style: {
51
- width: `${labelWidth}%` // Set label width
44
+ width: `${labelColSpan}%` // 添加 label 的宽度
52
45
  }
53
46
  };
47
+ if (layout === "vertical") {
48
+ labelProps.attrs.colSpan = span * 2 - 1;
49
+ }
54
50
 
55
51
  if (bordered) {
56
52
  if (type === "label") {
57
53
  return createElement("th", labelProps, label);
58
54
  }
59
-
60
55
  return createElement(
61
56
  "td",
62
57
  {
63
58
  class: `${prefixCls}-item-content`,
64
59
  key: `${key}-content`,
65
- attrs: {
66
- colspan: span * 2 - 1
67
- },
60
+ attrs:{colSpan: span * 2 - 1},
68
61
  style: {
69
- width: `${contentWidth}%` // Set content width
62
+ width: `${contextColSpan}%` // 添加 content 的宽度
70
63
  }
71
64
  },
72
65
  slots.default
73
66
  );
74
67
  }
75
-
76
68
  if (layout === "vertical") {
77
- // ... (existing code)
78
- }
79
-
80
- return createElement(
81
- "td",
82
- {
83
- attrs: {
84
- colspan: span
85
- },
86
- class: `${prefixCls}-item`,
87
- style: {
88
- width: `${columnWidth}%` // Set column width
89
- }
90
- },
91
- [
92
- createElement("span", labelProps, label),
69
+ if (type === "content") {
70
+ return createElement(
71
+ "td",
72
+ { colSpan: span, class: `${prefixCls}-item` },
73
+ createElement(
74
+ "span",
75
+ { class: `${prefixCls}-item-content`, key: `${key}-content`, style: { width: `${contextColSpan}%` } },
76
+ slots.default
77
+ )
78
+ );
79
+ }
80
+ return createElement(
81
+ "td",
82
+ { colSpan: span, class: `${prefixCls}-item` },
93
83
  createElement(
94
84
  "span",
95
- { class: `${prefixCls}-item-content`, key: `${key}-content` },
96
- slots.default
85
+ {
86
+ class: [
87
+ `${prefixCls}-item-label`,
88
+ { [`${prefixCls}-item-colon`]: colon }
89
+ ],
90
+ key: `${key}-label`,
91
+ style: {
92
+ width: `${labelColSpan}%` // 添加 label 的宽度
93
+ }
94
+ },
95
+ label
97
96
  )
98
- ]
99
- );
97
+ );
98
+ }
99
+ return createElement("td", { colSpan: span, class: `${prefixCls}-item` }, [
100
+ createElement("span", labelProps, label),
101
+ createElement(
102
+ "span",
103
+ { class: `${prefixCls}-item-content`, key: `${key}-content`, style: { width: `${contextColSpan}%` } },
104
+ slots.default
105
+ )
106
+ ]);
100
107
  }
101
108
  };
102
109
 
@@ -22,7 +22,7 @@ export default {
22
22
  colon: colon,
23
23
  type: type,
24
24
  layout: layout,
25
- totalCols: totalCols
25
+ totalCols: totalCols,
26
26
  }
27
27
  return createElement(Col, {props:colProps,key: `${type}-${colItem.key || idx}`});
28
28
  };
@@ -21,7 +21,8 @@
21
21
  :bordered="bordered"
22
22
  :layout="layout"
23
23
  :colon="colon"
24
- ></Row>
24
+ >
25
+ </Row>
25
26
  </tbody>
26
27
  </table>
27
28
  </div>
@@ -109,6 +110,7 @@ export default {
109
110
  .filter((node) => node);
110
111
  const column = this.getColumn();
111
112
  this.childrenArray = this.generateChildrenRows(cloneChildren, column);
113
+ console.log('array:',this.childrenArray)
112
114
  },
113
115
  getColumn() {
114
116
  const { column } = this.$props;
@@ -40,6 +40,7 @@
40
40
  font-weight: 500;
41
41
  font-size: 14px;
42
42
  line-height: 1.5;
43
+ width: 11%;
43
44
 
44
45
  &::after {
45
46
  position: relative;
@@ -67,6 +68,7 @@
67
68
  color: var(--text-color,@_text-color);;
68
69
  font-size: 14px;
69
70
  line-height: 1.5;
71
+ width: 22%;
70
72
  }
71
73
 
72
74
  &-item {