@doreamonjs/page-detail 1.10.70 → 1.10.72

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,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.10.72](https://github.com/doreamonjs/doreamon/compare/v1.10.71...v1.10.72) (2024-01-29)
7
+
8
+ **Note:** Version bump only for package @doreamonjs/page-detail
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.10.70](https://github.com/doreamonjs/doreamon/compare/v1.10.69...v1.10.70) (2024-01-25)
7
15
 
8
16
  **Note:** Version bump only for package @doreamonjs/page-detail
package/lib/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export interface DetailPageProps {
22
22
  onRefresh: () => void;
23
23
  }
24
24
  interface Attributes {
25
+ title?: string;
26
+ description?: string;
25
27
  actions: any[];
26
28
  detail: {
27
29
  basis: DetailBasis;
@@ -35,6 +37,7 @@ interface Datasets {
35
37
  export interface DetailBasis {
36
38
  items: InfoItem[][];
37
39
  title?: string | ((values: any, context: any) => string);
40
+ description?: string | ((values: any, context: any) => string);
38
41
  column?: number;
39
42
  }
40
43
  export interface InfoItem {
package/lib/index.js CHANGED
@@ -11,10 +11,11 @@ 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, _k, _l, _m, _o, _p;
14
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
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
- 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)) {
16
+ let title = (_f = (_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 : (_e = props.attributes) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '-';
17
+ let description = (_j = (_g = values === null || values === void 0 ? void 0 : values.description) !== null && _g !== void 0 ? _g : (_h = props.attributes) === null || _h === void 0 ? void 0 : _h.description) !== null && _j !== void 0 ? _j : '-';
18
+ if (!!((_l = (_k = props.attributes.detail) === null || _k === void 0 ? void 0 : _k.basis) === null || _l === void 0 ? void 0 : _l.title)) {
18
19
  const title_ = props.attributes.detail.basis.title;
19
20
  if (typeof title_ === 'function') {
20
21
  title = title_(values, props);
@@ -23,9 +24,18 @@ const DetailPage = (props) => {
23
24
  title = title_;
24
25
  }
25
26
  }
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.filter((tab, index) => {
27
+ if (!!((_o = (_m = props.attributes.detail) === null || _m === void 0 ? void 0 : _m.basis) === null || _o === void 0 ? void 0 : _o.description)) {
28
+ const description_ = props.attributes.detail.basis.description;
29
+ if (typeof description_ === 'function') {
30
+ description = description_(values, props);
31
+ }
32
+ else {
33
+ description = description_;
34
+ }
35
+ }
36
+ const details = (_p = props.attributes.detail.basis) === null || _p === void 0 ? void 0 : _p.items;
37
+ const defaultTab = (_q = props.attributes.detail.modules) === null || _q === void 0 ? void 0 : _q.default;
38
+ const tabs = (_s = (_r = props.attributes.detail.modules) === null || _r === void 0 ? void 0 : _r.items) === null || _s === void 0 ? void 0 : _s.filter((tab, index) => {
29
39
  let isVisible = tab.visible;
30
40
  if (typeof tab.visible === 'function') {
31
41
  isVisible = tab.visible(values, tab, index, props);
@@ -39,7 +49,7 @@ const DetailPage = (props) => {
39
49
  },
40
50
  };
41
51
  });
42
- 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)) {
52
+ if (+((_t = doreamon_1.default.dom.router.getQuery()) === null || _t === void 0 ? void 0 : _t.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
43
53
  return (react_1.default.createElement("div", { style: {
44
54
  width: '100%',
45
55
  height: '500px',
@@ -49,7 +59,7 @@ const DetailPage = (props) => {
49
59
  react_1.default.createElement(antd_1.Skeleton, { paragraph: { rows: 10 } })));
50
60
  }
51
61
  return (react_1.default.createElement("div", { className: doreamon_1.default.classnames('page', componentName, props.className) },
52
- react_1.default.createElement(components_1.Card.Information, { title: title, actions: props.attributes.actions, allowActionTypes: ['custom'], column: (_p = (_o = (_m = props.attributes.detail) === null || _m === void 0 ? void 0 : _m.basis) === null || _o === void 0 ? void 0 : _o.column) !== null && _p !== void 0 ? _p : 2, items: details, data: values, onActionClick: (action, values) => {
62
+ react_1.default.createElement(components_1.Card.Information, { title: title, subTitle: description, actions: props.attributes.actions, allowActionTypes: ['custom'], column: (_w = (_v = (_u = props.attributes.detail) === null || _u === void 0 ? void 0 : _u.basis) === null || _v === void 0 ? void 0 : _v.column) !== null && _w !== void 0 ? _w : 2, items: details, data: values, onActionClick: (action, values) => {
53
63
  props.onActionTrigger(action, {
54
64
  values,
55
65
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doreamonjs/page-detail",
3
- "version": "1.10.70",
3
+ "version": "1.10.72",
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.70",
74
+ "@doreamonjs/components": "^1.10.72",
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": "656f6c9058fddb9e7d7dfbaa3a78cf3ce82f8006"
83
+ "gitHead": "4decdd42a73a9456434a8d59b5b93dff2cbe1b21"
84
84
  }