@doreamonjs/page-detail 1.10.26 → 1.10.29

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 CHANGED
@@ -3,6 +3,28 @@
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.10.29](https://github.com/doreamonjs/doreamon/compare/v1.10.28...v1.10.29) (2023-11-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * page-detail title allow function ([597e479](https://github.com/doreamonjs/doreamon/commit/597e479123455e66e686f2ee4f7de09850198deb))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.10.28](https://github.com/doreamonjs/doreamon/compare/v1.10.27...v1.10.28) (2023-11-29)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * components.Card.Information type link ([f92584e](https://github.com/doreamonjs/doreamon/commit/f92584e78afcbcec87357628a5be18618a73dea5))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [1.10.26](https://github.com/doreamonjs/doreamon/compare/v1.10.25...v1.10.26) (2023-11-29)
7
29
 
8
30
  **Note:** Version bump only for package @doreamonjs/page-detail
package/lib/index.d.ts CHANGED
@@ -34,6 +34,7 @@ interface Datasets {
34
34
  }
35
35
  export interface DetailBasis {
36
36
  items: InfoItem[][];
37
+ title?: string | ((values: any, context: any) => string);
37
38
  column?: number;
38
39
  }
39
40
  export interface InfoItem {
@@ -44,8 +45,8 @@ export interface InfoItem {
44
45
  rollout?: string;
45
46
  }
46
47
  export interface DetailModules {
47
- tabs: TabItem[];
48
- defaultTab?: string;
48
+ items: TabItem[];
49
+ default?: string;
49
50
  }
50
51
  export interface TabItem {
51
52
  key: string;
package/lib/index.js CHANGED
@@ -11,12 +11,21 @@ const antd_1 = require("antd");
11
11
  require("./index.less");
12
12
  const componentName = 'doreamonjs-design-page-detail';
13
13
  const DetailPage = (props) => {
14
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
14
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
15
15
  const values = (_b = (_a = props === null || props === void 0 ? void 0 : props.datasets) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : {};
16
- const title = (_d = (_c = values === null || values === void 0 ? void 0 : values.title) !== null && _c !== void 0 ? _c : values === null || values === void 0 ? void 0 : values.name) !== null && _d !== void 0 ? _d : '-';
17
- const details = (_e = props.attributes.detail.basis) === null || _e === void 0 ? void 0 : _e.items;
18
- const defaultTab = (_f = props.attributes.detail.modules) === null || _f === void 0 ? void 0 : _f.defaultTab;
19
- const tabs = (_h = (_g = props.attributes.detail.modules) === null || _g === void 0 ? void 0 : _g.tabs) === null || _h === void 0 ? void 0 : _h.map((tab, index) => {
16
+ let title = (_d = (_c = values === null || values === void 0 ? void 0 : values.title) !== null && _c !== void 0 ? _c : values === null || values === void 0 ? void 0 : values.name) !== null && _d !== void 0 ? _d : '-';
17
+ if (!!((_f = (_e = props.attributes.detail) === null || _e === void 0 ? void 0 : _e.basis) === null || _f === void 0 ? void 0 : _f.title)) {
18
+ const title_ = props.attributes.detail.basis.title;
19
+ if (typeof title_ === 'function') {
20
+ title = title_(values, props);
21
+ }
22
+ else {
23
+ title = title_;
24
+ }
25
+ }
26
+ const details = (_g = props.attributes.detail.basis) === null || _g === void 0 ? void 0 : _g.items;
27
+ const defaultTab = (_h = props.attributes.detail.modules) === null || _h === void 0 ? void 0 : _h.default;
28
+ const tabs = (_k = (_j = props.attributes.detail.modules) === null || _j === void 0 ? void 0 : _j.items) === null || _k === void 0 ? void 0 : _k.map((tab, index) => {
20
29
  return {
21
30
  ...tab,
22
31
  render: !tab.render ? undefined : () => {
@@ -24,8 +33,7 @@ const DetailPage = (props) => {
24
33
  },
25
34
  };
26
35
  });
27
- console.log('tabs:', tabs, props.attributes.detail);
28
- if (+((_j = doreamon_1.default.dom.router.getQuery()) === null || _j === void 0 ? void 0 : _j.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
36
+ if (+((_l = doreamon_1.default.dom.router.getQuery()) === null || _l === void 0 ? void 0 : _l.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
29
37
  return (react_1.default.createElement("div", { style: {
30
38
  width: '100%',
31
39
  height: '500px',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doreamonjs/page-detail",
3
- "version": "1.10.26",
3
+ "version": "1.10.29",
4
4
  "description": "detail page",
5
5
  "keywords": [
6
6
  "doreamonjs",
@@ -71,7 +71,7 @@
71
71
  "@znode/fs": "^1.0.2"
72
72
  },
73
73
  "dependencies": {
74
- "@doreamonjs/components": "^1.10.26",
74
+ "@doreamonjs/components": "^1.10.29",
75
75
  "@zodash/doreamon": "^1.1.5",
76
76
  "antd": "4.18.9",
77
77
  "react-monaco-editor": "^0.50.1",
@@ -80,5 +80,5 @@
80
80
  "xterm-addon-attach": "^0.6.0",
81
81
  "xterm-addon-fit": "^0.5.0"
82
82
  },
83
- "gitHead": "fcc1816234645cd4025d6f0eec98383e3f57537a"
83
+ "gitHead": "4d3bc4a9d5356f0600161f05509e01d565e5f4c1"
84
84
  }