@doreamonjs/page-detail 1.10.98 → 1.10.99
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.js +35 -12
- package/lib/index.less +40 -0
- package/package.json +3 -3
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.99](https://github.com/doreamonjs/doreamon/compare/v1.10.98...v1.10.99) (2024-03-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @doreamonjs/page-detail
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.10.98](https://github.com/doreamonjs/doreamon/compare/v1.10.97...v1.10.98) (2024-03-15)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @doreamonjs/page-detail
|
package/lib/index.js
CHANGED
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
5
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
25
|
exports.DetailPage = void 0;
|
|
7
|
-
const react_1 =
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
8
27
|
const doreamon_1 = __importDefault(require("@zodash/doreamon"));
|
|
9
28
|
const components_1 = require("@doreamonjs/components");
|
|
10
29
|
const antd_1 = require("antd");
|
|
30
|
+
const icons_1 = require("@ant-design/icons");
|
|
11
31
|
require("./index.less");
|
|
12
32
|
const componentName = 'doreamonjs-design-page-detail';
|
|
13
33
|
const DetailPage = (props) => {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
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
|
+
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)) {
|
|
19
40
|
const title_ = props.attributes.detail.basis.title;
|
|
20
41
|
if (typeof title_ === 'function') {
|
|
21
42
|
title = title_(values, props);
|
|
@@ -24,7 +45,7 @@ const DetailPage = (props) => {
|
|
|
24
45
|
title = title_;
|
|
25
46
|
}
|
|
26
47
|
}
|
|
27
|
-
if (!!((
|
|
48
|
+
if (!!((_p = (_o = props.attributes.detail) === null || _o === void 0 ? void 0 : _o.basis) === null || _p === void 0 ? void 0 : _p.subTitle)) {
|
|
28
49
|
const subTitle_ = props.attributes.detail.basis.subTitle;
|
|
29
50
|
if (typeof subTitle_ === 'function') {
|
|
30
51
|
subTitle = subTitle_(values, props);
|
|
@@ -33,9 +54,9 @@ const DetailPage = (props) => {
|
|
|
33
54
|
subTitle = subTitle_;
|
|
34
55
|
}
|
|
35
56
|
}
|
|
36
|
-
const details = (
|
|
37
|
-
const defaultTab = (
|
|
38
|
-
const tabs = (
|
|
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) => {
|
|
39
60
|
let isVisible = tab.visible;
|
|
40
61
|
if (typeof tab.visible === 'function') {
|
|
41
62
|
isVisible = tab.visible(values, tab, index, props);
|
|
@@ -49,7 +70,7 @@ const DetailPage = (props) => {
|
|
|
49
70
|
},
|
|
50
71
|
};
|
|
51
72
|
});
|
|
52
|
-
if (+((
|
|
73
|
+
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)) {
|
|
53
74
|
return (react_1.default.createElement("div", { style: {
|
|
54
75
|
width: '100%',
|
|
55
76
|
height: '500px',
|
|
@@ -59,7 +80,9 @@ const DetailPage = (props) => {
|
|
|
59
80
|
react_1.default.createElement(antd_1.Skeleton, { paragraph: { rows: 10 } })));
|
|
60
81
|
}
|
|
61
82
|
return (react_1.default.createElement("div", { className: doreamon_1.default.classnames('page', componentName, props.className) },
|
|
62
|
-
react_1.default.createElement(components_1.Card.Information, { title:
|
|
83
|
+
react_1.default.createElement(components_1.Card.Information, { title: !isMobile ? title : (react_1.default.createElement("div", null,
|
|
84
|
+
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); } }),
|
|
85
|
+
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) => {
|
|
63
86
|
props.onActionTrigger(action, {
|
|
64
87
|
values,
|
|
65
88
|
});
|
package/lib/index.less
CHANGED
|
@@ -15,3 +15,43 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
@media (max-width: 767px) {
|
|
20
|
+
.@{pageDetailPrefixCls}.page {
|
|
21
|
+
position: fixed;
|
|
22
|
+
top: 0px;
|
|
23
|
+
left: 0px;
|
|
24
|
+
width: 100vw;
|
|
25
|
+
height: 100vh;
|
|
26
|
+
padding: 0;
|
|
27
|
+
z-index: 1000;
|
|
28
|
+
|
|
29
|
+
.ant-page-header-heading-left {
|
|
30
|
+
flex: 1;
|
|
31
|
+
|
|
32
|
+
.ant-page-header-heading-title span {
|
|
33
|
+
display: inline-block;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
text-align: right;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ant-descriptions-item {
|
|
42
|
+
display: block;
|
|
43
|
+
|
|
44
|
+
.ant-descriptions-item-label {
|
|
45
|
+
width: 100px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ant-descriptions-item-content {
|
|
49
|
+
text-align: left;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doreamonjs/page-detail",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.99",
|
|
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.
|
|
74
|
+
"@doreamonjs/components": "^1.10.99",
|
|
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": "
|
|
83
|
+
"gitHead": "a15cdaecf1401d59b36f1aa9cf3c58cc48ddf6f8"
|
|
84
84
|
}
|