@doreamonjs/page-detail 1.12.1 → 1.12.2
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/CHANGELOG.md +8 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +12 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.12.2](https://github.com/doreamonjs/doreamon/compare/v1.12.1...v1.12.2) (2024-05-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @doreamonjs/page-detail
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.12.1](https://github.com/doreamonjs/doreamon/compare/v1.12.0...v1.12.1) (2024-05-08)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @doreamonjs/page-detail
|
package/lib/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface DetailModules {
|
|
|
53
53
|
}
|
|
54
54
|
export interface TabItem {
|
|
55
55
|
key: string;
|
|
56
|
-
title: string;
|
|
56
|
+
title: string | ((values: any, context: any) => string);
|
|
57
57
|
icon?: string;
|
|
58
58
|
disabled?: boolean;
|
|
59
59
|
render(values: any, index: number, context: any): JSX.Element;
|
package/lib/index.js
CHANGED
|
@@ -63,11 +63,20 @@ const DetailPage = (props) => {
|
|
|
63
63
|
}
|
|
64
64
|
return isVisible !== false;
|
|
65
65
|
}).map((tab, index) => {
|
|
66
|
+
let title = tab.title;
|
|
67
|
+
let render = tab.render;
|
|
68
|
+
if (typeof title === 'function') {
|
|
69
|
+
title = title(values, props);
|
|
70
|
+
}
|
|
71
|
+
if (!!tab.render && typeof tab.render === 'function') {
|
|
72
|
+
render = () => {
|
|
73
|
+
return tab.render(values, index, props);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
66
76
|
return {
|
|
67
77
|
...tab,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
78
|
+
title,
|
|
79
|
+
render,
|
|
71
80
|
};
|
|
72
81
|
});
|
|
73
82
|
if (+((_u = doreamon_1.default.dom.router.getQuery()) === null || _u === void 0 ? void 0 : _u.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doreamonjs/page-detail",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"description": "detail page",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"doreamonjs",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"xterm-addon-attach": "^0.6.0",
|
|
81
81
|
"xterm-addon-fit": "^0.5.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "32c3f81364d665029776015febc54b05b4825ac4"
|
|
84
84
|
}
|