@doreamonjs/page-detail 1.12.3 → 1.12.5

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,22 @@
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.5](https://github.com/doreamonjs/doreamon/compare/v1.12.4...v1.12.5) (2024-05-10)
7
+
8
+ **Note:** Version bump only for package @doreamonjs/page-detail
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.12.4](https://github.com/doreamonjs/doreamon/compare/v1.12.3...v1.12.4) (2024-05-09)
15
+
16
+ **Note:** Version bump only for package @doreamonjs/page-detail
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.12.3](https://github.com/doreamonjs/doreamon/compare/v1.12.2...v1.12.3) (2024-05-09)
7
23
 
8
24
  **Note:** Version bump only for package @doreamonjs/page-detail
package/lib/index.d.ts CHANGED
@@ -39,6 +39,7 @@ export interface DetailBasis {
39
39
  title?: string | ((values: any, context: any) => string);
40
40
  subTitle?: string | ((values: any, context: any) => string);
41
41
  column?: number;
42
+ renderBottom?(values: any, context: any): JSX.Element;
42
43
  }
43
44
  export interface InfoItem {
44
45
  key: string;
package/lib/index.js CHANGED
@@ -31,12 +31,13 @@ const icons_1 = require("@ant-design/icons");
31
31
  require("./index.less");
32
32
  const componentName = 'doreamonjs-design-page-detail';
33
33
  const DetailPage = (props) => {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
34
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
35
35
  const [isMobile] = react_1.useState((_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, "(max-width: 767px)")) === null || _b === void 0 ? void 0 : _b.matches);
36
36
  const values = (_d = (_c = props === null || props === void 0 ? void 0 : props.datasets) === null || _c === void 0 ? void 0 : _c.values) !== null && _d !== void 0 ? _d : {};
37
- let title = (_h = (_f = (_e = values === null || values === void 0 ? void 0 : values.title) !== null && _e !== void 0 ? _e : values === null || values === void 0 ? void 0 : values.name) !== null && _f !== void 0 ? _f : (_g = props.attributes) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '-';
38
- let subTitle = (_j = values === null || values === void 0 ? void 0 : values.subTitle) !== null && _j !== void 0 ? _j : (_k = props.attributes) === null || _k === void 0 ? void 0 : _k.subTitle;
39
- if (!!((_m = (_l = props.attributes.detail) === null || _l === void 0 ? void 0 : _l.basis) === null || _m === void 0 ? void 0 : _m.title)) {
37
+ const renderBasisBottom = (_f = (_e = props.attributes.detail) === null || _e === void 0 ? void 0 : _e.basis) === null || _f === void 0 ? void 0 : _f.renderBottom;
38
+ let title = (_k = (_h = (_g = values === null || values === void 0 ? void 0 : values.title) !== null && _g !== void 0 ? _g : values === null || values === void 0 ? void 0 : values.name) !== null && _h !== void 0 ? _h : (_j = props.attributes) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '-';
39
+ let subTitle = (_l = values === null || values === void 0 ? void 0 : values.subTitle) !== null && _l !== void 0 ? _l : (_m = props.attributes) === null || _m === void 0 ? void 0 : _m.subTitle;
40
+ if (!!((_p = (_o = props.attributes.detail) === null || _o === void 0 ? void 0 : _o.basis) === null || _p === void 0 ? void 0 : _p.title)) {
40
41
  const title_ = props.attributes.detail.basis.title;
41
42
  if (typeof title_ === 'function') {
42
43
  title = title_(values, props);
@@ -45,7 +46,7 @@ const DetailPage = (props) => {
45
46
  title = title_;
46
47
  }
47
48
  }
48
- if (!!((_p = (_o = props.attributes.detail) === null || _o === void 0 ? void 0 : _o.basis) === null || _p === void 0 ? void 0 : _p.subTitle)) {
49
+ if (!!((_r = (_q = props.attributes.detail) === null || _q === void 0 ? void 0 : _q.basis) === null || _r === void 0 ? void 0 : _r.subTitle)) {
49
50
  const subTitle_ = props.attributes.detail.basis.subTitle;
50
51
  if (typeof subTitle_ === 'function') {
51
52
  subTitle = subTitle_(values, props);
@@ -54,9 +55,9 @@ const DetailPage = (props) => {
54
55
  subTitle = subTitle_;
55
56
  }
56
57
  }
57
- const details = (_q = props.attributes.detail.basis) === null || _q === void 0 ? void 0 : _q.items;
58
- const defaultTab = (_r = props.attributes.detail.modules) === null || _r === void 0 ? void 0 : _r.default;
59
- const tabs = (_t = (_s = props.attributes.detail.modules) === null || _s === void 0 ? void 0 : _s.items) === null || _t === void 0 ? void 0 : _t.filter((tab, index) => {
58
+ const details = (_s = props.attributes.detail.basis) === null || _s === void 0 ? void 0 : _s.items;
59
+ const defaultTab = (_t = props.attributes.detail.modules) === null || _t === void 0 ? void 0 : _t.default;
60
+ const tabs = (_v = (_u = props.attributes.detail.modules) === null || _u === void 0 ? void 0 : _u.items) === null || _v === void 0 ? void 0 : _v.filter((tab, index) => {
60
61
  let isVisible = tab.visible;
61
62
  if (typeof tab.visible === 'function') {
62
63
  isVisible = tab.visible(values, tab, index, props);
@@ -79,7 +80,7 @@ const DetailPage = (props) => {
79
80
  render,
80
81
  };
81
82
  });
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)) {
83
+ if (+((_w = doreamon_1.default.dom.router.getQuery()) === null || _w === void 0 ? void 0 : _w.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
83
84
  return (react_1.default.createElement("div", { style: {
84
85
  width: '100%',
85
86
  height: '500px',
@@ -91,11 +92,15 @@ const DetailPage = (props) => {
91
92
  return (react_1.default.createElement("div", { className: doreamon_1.default.classnames('page', componentName, props.className) },
92
93
  react_1.default.createElement(components_1.Card.Information, { title: !isMobile ? title : (react_1.default.createElement("div", null,
93
94
  react_1.default.createElement(icons_1.ArrowLeftOutlined, { style: { marginRight: 8 }, onClick: () => { var _a, _b, _c, _d, _e; return (_e = (_d = (_c = (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.__DOREAMONJS_SDK) === null || _b === void 0 ? void 0 : _b.shared) === null || _c === void 0 ? void 0 : _c.router) === null || _d === void 0 ? void 0 : _d.goBack) === null || _e === void 0 ? void 0 : _e.call(_d); } }),
94
- react_1.default.createElement("div", { style: { display: 'inline-block' } }, title))), subTitle: subTitle, actions: props.attributes.actions, allowActionTypes: ['custom'], column: (_x = (_w = (_v = props.attributes.detail) === null || _v === void 0 ? void 0 : _v.basis) === null || _w === void 0 ? void 0 : _w.column) !== null && _x !== void 0 ? _x : 2, items: details, data: values, onActionClick: (action, values) => {
95
+ react_1.default.createElement("div", { style: { display: 'inline-block' } }, title))), subTitle: subTitle, actions: props.attributes.actions, allowActionTypes: ['custom'], column: (_z = (_y = (_x = props.attributes.detail) === null || _x === void 0 ? void 0 : _x.basis) === null || _y === void 0 ? void 0 : _y.column) !== null && _z !== void 0 ? _z : 2, items: details, data: values, onActionClick: (action, values) => {
95
96
  props.onActionTrigger(action, {
96
97
  values,
97
98
  });
98
99
  } }),
100
+ !!renderBasisBottom && (react_1.default.createElement("div", { style: {
101
+ padding: 24,
102
+ paddingTop: 0,
103
+ } }, renderBasisBottom(values, props))),
99
104
  react_1.default.createElement(components_1.Tab, { className: 'tab', items: tabs, defaultValue: defaultTab })));
100
105
  };
101
106
  exports.DetailPage = DetailPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doreamonjs/page-detail",
3
- "version": "1.12.3",
3
+ "version": "1.12.5",
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.12.3",
74
+ "@doreamonjs/components": "^1.12.5",
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": "1bf68ff053ea62b42c5b06d86c686c2b4d97a588"
83
+ "gitHead": "3fd003324f3534f151ba840a2d077d0a51cef5fe"
84
84
  }