@voplus/morpho-document 1.4.119 → 1.4.121
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/es/components/DocumentProperties/index.d.ts +8 -5
- package/es/components/DocumentProperties/index.js +27 -52
- package/es/components/DocumentProperties/index.js.map +1 -1
- package/es/controls/PropertiesSection/index.d.ts +6 -0
- package/es/controls/PropertiesSection/index.js +17 -0
- package/es/controls/PropertiesSection/index.js.map +1 -0
- package/es/controls/PropertiesSection/index.less +21 -0
- package/es/pages/DocumentPage/index.js +6 -3
- package/es/pages/DocumentPage/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
declare const DocumentProperties: {
|
|
3
3
|
(props: {
|
|
4
4
|
id: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
className?: string;
|
|
6
|
+
/** 是否需要Form标签包裹 */
|
|
7
|
+
fromLabelRequired?: boolean;
|
|
7
8
|
/** label 标签布局 */
|
|
8
9
|
labelCol?: number;
|
|
9
10
|
/** 需要为输入控件设置布局样式时,使用该属性 */
|
|
@@ -11,13 +12,15 @@ declare const DocumentProperties: {
|
|
|
11
12
|
/** 自定义 Title */
|
|
12
13
|
title?: string;
|
|
13
14
|
/** 可隐藏某个 properties */
|
|
14
|
-
|
|
15
|
+
customProperties?: {
|
|
15
16
|
name: "Tags" | "Create Date" | "Create By" | "Folder";
|
|
16
|
-
|
|
17
|
+
visible?: boolean;
|
|
17
18
|
}[];
|
|
18
19
|
}): JSX.Element;
|
|
19
20
|
defaultProps: {
|
|
20
|
-
|
|
21
|
+
customProperties: {
|
|
22
|
+
name: string;
|
|
23
|
+
}[];
|
|
21
24
|
};
|
|
22
25
|
};
|
|
23
26
|
export default DocumentProperties;
|
|
@@ -7,19 +7,16 @@ import TagView from "../TagView";
|
|
|
7
7
|
import FolderEdit from "../../controls/FolderEdit";
|
|
8
8
|
import ChildDocumentSelect from "../../controls/ChildDocumentSelect";
|
|
9
9
|
import DocumentReference from "../../controls/DocumentReference";
|
|
10
|
+
import PropertiesSection from "../../controls/PropertiesSection";
|
|
10
11
|
import classnames from "classnames";
|
|
11
12
|
import moment from "moment";
|
|
12
13
|
import styles from "./index.less";
|
|
13
14
|
const DocumentProperties = (props) => {
|
|
14
|
-
const { id,
|
|
15
|
+
const { id, fromLabelRequired, labelCol, wrapperCol, title, customProperties } = props;
|
|
15
16
|
const doc = useDocument(id, { reload: true, includes: "tags,createdby,folder" });
|
|
16
17
|
const store = useDocumentStore();
|
|
17
18
|
const [showEditIcon, setShowEditIcon] = useState(true);
|
|
18
19
|
const [folderEditable, setFolderEditable] = useState(false);
|
|
19
|
-
const [visibleTags, setVisibleTags] = useState(true);
|
|
20
|
-
const [visibleCreateDate, setVisibleCreateDate] = useState(true);
|
|
21
|
-
const [visibleCreateBy, setVisibleCreateBy] = useState(true);
|
|
22
|
-
const [visibleFolder, setVisibleFolder] = useState(true);
|
|
23
20
|
const clickEvent = (e) => {
|
|
24
21
|
if (!e.target.className.toString().includes("ant-select")) {
|
|
25
22
|
setFolderEditable(false);
|
|
@@ -34,62 +31,40 @@ const DocumentProperties = (props) => {
|
|
|
34
31
|
window.removeEventListener("click", clickEvent, true);
|
|
35
32
|
};
|
|
36
33
|
}, [folderEditable]);
|
|
37
|
-
|
|
38
|
-
return observe(() => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
const filterPro = customProperties === null || customProperties === void 0 ? void 0 : customProperties.filter((i) => (i === null || i === void 0 ? void 0 : i.visible) !== false);
|
|
35
|
+
return observe(() => fromLabelRequired ? (React.createElement("div", { className: classnames(styles["document-roperties"], props.className) },
|
|
36
|
+
React.createElement(PropertiesSection, { title: title, properties: React.createElement(Form, { labelAlign: "left", labelCol: { span: labelCol || 10 }, scrollToFirstError: true }, filterPro === null || filterPro === void 0 ? void 0 : filterPro.map((i) => (React.createElement(React.Fragment, { key: i.name }, renderProp(i))))) }))) : (React.createElement("div", { className: classnames(styles["document-roperties"], props.className) },
|
|
37
|
+
React.createElement(PropertiesSection, { title: title, properties: filterPro === null || filterPro === void 0 ? void 0 : filterPro.map((i) => (React.createElement(React.Fragment, { key: i.name }, renderProp(i)))) }))));
|
|
38
|
+
function renderProp(item) {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
switch (item.name) {
|
|
41
|
+
case "Tags":
|
|
42
|
+
return (React.createElement(Form.Item, { label: "Tags", wrapperCol: { span: wrapperCol || 12 } },
|
|
43
|
+
React.createElement(TagView, { id: id, tags: doc.tags, editable: !doc.readonly })));
|
|
44
|
+
case "Create By":
|
|
45
|
+
return (React.createElement(Form.Item, { label: "Create By" },
|
|
46
|
+
React.createElement(MetionList, { contacts: doc.createdBy ? [doc.createdBy] : [], canEdit: false, placeholder: "no Data" })));
|
|
47
|
+
case "Create Date":
|
|
48
|
+
return (React.createElement(Form.Item, { label: "Create Date" }, doc.createDate ? (moment(doc.createDate).format("DD MMM yyyy")) : (React.createElement("span", { className: "no-data" }, "no data"))));
|
|
49
|
+
case "Folder":
|
|
50
|
+
return (React.createElement(Form.Item, { label: "Folder", wrapperCol: { span: wrapperCol || 12 } },
|
|
50
51
|
React.createElement(FolderEdit, { showEditIcon: showEditIcon, onEditIconClick: () => {
|
|
51
52
|
setFolderEditable(true);
|
|
52
53
|
setShowEditIcon(false);
|
|
53
54
|
} }, folderEditable && ((_a = doc.folder) === null || _a === void 0 ? void 0 : _a.parentNodeId) ? (React.createElement(ChildDocumentSelect, { id: doc.folder.parentNodeId, multiple: false, selected: (_b = doc.folder) === null || _b === void 0 ? void 0 : _b.id, onChange: (doc) => {
|
|
54
55
|
setShowEditIcon(true);
|
|
55
56
|
store.edit(id, { data: { FolderId: doc.id }, error: "message" });
|
|
56
|
-
} })) : ((_c = doc.folder) === null || _c === void 0 ? void 0 : _c.id) ? (React.createElement(DocumentReference, { id: doc.folder.id })) : (React.createElement("span", { className: "no-data" }, "Add Folder")))))
|
|
57
|
-
|
|
58
|
-
React.createElement(TagView, { id: id, tags: doc.tags, editable: !doc.readonly }))),
|
|
59
|
-
visibleCreateDate && (React.createElement(Form.Item, { label: "Create Date" }, doc.createDate ? (moment(doc.createDate).format("DD MMM yyyy")) : (React.createElement("span", { className: "no-data" }, "no data")))),
|
|
60
|
-
visibleCreateBy && (React.createElement(Form.Item, { label: "Create By" },
|
|
61
|
-
React.createElement(MetionList, { contacts: doc.createdBy ? [doc.createdBy] : [], canEdit: false, placeholder: "no Data" }))),
|
|
62
|
-
visibleFolder && (React.createElement(Form.Item, { label: "Folder", wrapperCol: { span: wrapperCol || 12 } },
|
|
63
|
-
React.createElement(FolderEdit, { showEditIcon: showEditIcon, onEditIconClick: () => {
|
|
64
|
-
setFolderEditable(true);
|
|
65
|
-
setShowEditIcon(false);
|
|
66
|
-
} }, folderEditable && ((_d = doc.folder) === null || _d === void 0 ? void 0 : _d.parentNodeId) ? (React.createElement(ChildDocumentSelect, { id: doc.folder.parentNodeId, multiple: false, selected: (_e = doc.folder) === null || _e === void 0 ? void 0 : _e.id, onChange: (doc) => {
|
|
67
|
-
setShowEditIcon(true);
|
|
68
|
-
store.edit(id, { data: { FolderId: doc.id }, error: "message" });
|
|
69
|
-
} })) : ((_f = doc.folder) === null || _f === void 0 ? void 0 : _f.id) ? (React.createElement(DocumentReference, { id: doc.folder.id })) : (React.createElement("span", { className: "no-data" }, "Add Folder")))))));
|
|
70
|
-
});
|
|
71
|
-
function hideProperties(config) {
|
|
72
|
-
config &&
|
|
73
|
-
config.map((i) => {
|
|
74
|
-
switch (i.name) {
|
|
75
|
-
case "Tags":
|
|
76
|
-
i.hide === true && setVisibleTags(false);
|
|
77
|
-
break;
|
|
78
|
-
case "Create Date":
|
|
79
|
-
i.hide === true && setVisibleCreateDate(false);
|
|
80
|
-
break;
|
|
81
|
-
case "Create By":
|
|
82
|
-
i.hide === true && setVisibleCreateBy(false);
|
|
83
|
-
break;
|
|
84
|
-
case "Folder":
|
|
85
|
-
i.hide === true && setVisibleFolder(false);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
57
|
+
} })) : ((_c = doc.folder) === null || _c === void 0 ? void 0 : _c.id) ? (React.createElement(DocumentReference, { id: doc.folder.id })) : (React.createElement("span", { className: "no-data" }, "Add Folder")))));
|
|
58
|
+
}
|
|
89
59
|
}
|
|
90
60
|
};
|
|
91
61
|
DocumentProperties.defaultProps = {
|
|
92
|
-
|
|
62
|
+
customProperties: [
|
|
63
|
+
{ name: "Tags" },
|
|
64
|
+
{ name: "Create Date" },
|
|
65
|
+
{ name: "Create By" },
|
|
66
|
+
{ name: "Folder" },
|
|
67
|
+
],
|
|
93
68
|
};
|
|
94
69
|
export default DocumentProperties;
|
|
95
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentProperties/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAa,MAAM,8BAA8B,CAAC;AACxF,OAAO,UAAU,MAAM,2CAA2C,CAAC;AACnE,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,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AAgB,EAAE;QACjB,EAAE,IAAI,EAAE,MAAM,EAAE;QAChB,EAAE,IAAI,EAAE,aAAa,EAAE;QACvB,EAAE,IAAI,EAAE,WAAW,EAAE;QACrB,EAAE,IAAI,EAAE,QAAQ,EAAE;KAClB;CACD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { observe } from "@voplus/morpho-ui";
|
|
3
|
+
import { DownOutlined, UpOutlined } from "@ant-design/icons";
|
|
4
|
+
import classnames from "classnames";
|
|
5
|
+
import styles from "./index.less";
|
|
6
|
+
const PropertiesSection = (props) => {
|
|
7
|
+
const [iconDirectionUp, setIconDirectionUp] = useState(true);
|
|
8
|
+
return observe(() => (React.createElement("div", { className: styles["properties-section"] },
|
|
9
|
+
props.title && (React.createElement("div", { className: "properties-section-header" },
|
|
10
|
+
React.createElement("div", { className: "properties-section-title" }, props.title),
|
|
11
|
+
React.createElement("div", { onClick: () => setIconDirectionUp(!iconDirectionUp) }, iconDirectionUp ? React.createElement(UpOutlined, null) : React.createElement(DownOutlined, null)))),
|
|
12
|
+
React.createElement("div", { className: classnames("prperties-content", {
|
|
13
|
+
show: !iconDirectionUp,
|
|
14
|
+
}) }, props.properties))));
|
|
15
|
+
};
|
|
16
|
+
export default PropertiesSection;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/PropertiesSection/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,iBAAiB,GAAG,CAAC,KAAsD,EAAE,EAAE;IACpF,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7D,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,6BAAK,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC;QAC1C,KAAK,CAAC,KAAK,IAAI,CACf,6BAAK,SAAS,EAAC,2BAA2B;YACzC,6BAAK,SAAS,EAAC,0BAA0B,IAAE,KAAK,CAAC,KAAK,CAAO;YAC7D,6BAAK,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,CAAC,eAAe,CAAC,IACtD,eAAe,CAAC,CAAC,CAAC,oBAAC,UAAU,OAAG,CAAC,CAAC,CAAC,oBAAC,YAAY,OAAG,CAC/C,CACD,CACN;QACD,6BACC,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE;gBAC1C,IAAI,EAAE,CAAC,eAAe;aACtB,CAAC,IAED,KAAK,CAAC,UAAU,CACZ,CACD,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.properties-section {
|
|
2
|
+
:global {
|
|
3
|
+
.properties-section-header {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
padding-right: 7px;
|
|
8
|
+
|
|
9
|
+
.properties-section-title {
|
|
10
|
+
font-size: 1.22222222em;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.prperties-content {
|
|
16
|
+
&.show {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import ViewFrame from "../../components/ViewFrame";
|
|
3
|
-
import { observe } from "@voplus/morpho-ui";
|
|
4
|
-
import { useLayout } from "@voplus/morpho-data";
|
|
5
|
-
import { useMetaStore } from "@voplus/morpho-document-core";
|
|
3
|
+
import { observe, useAutorunEffect } from "@voplus/morpho-ui";
|
|
4
|
+
import { useLayout, useTabItem } from "@voplus/morpho-data";
|
|
5
|
+
import { useMetaStore, useDocument } from "@voplus/morpho-document-core";
|
|
6
6
|
import { useRouteMatch } from "react-router";
|
|
7
7
|
const DocumentPage = (props) => {
|
|
8
8
|
var _a, _b;
|
|
9
9
|
const meta = useMetaStore();
|
|
10
10
|
const match = useRouteMatch();
|
|
11
11
|
const layout = useLayout();
|
|
12
|
+
const tab = useTabItem();
|
|
12
13
|
const query = new URLSearchParams(layout.history.location.search);
|
|
13
14
|
const id = (_b = (_a = query.get("active")) !== null && _a !== void 0 ? _a : props.root) !== null && _b !== void 0 ? _b : match === null || match === void 0 ? void 0 : match.params.id;
|
|
14
15
|
const view = query.get("view");
|
|
16
|
+
const doc = useDocument(id);
|
|
17
|
+
useAutorunEffect(() => (tab.title = doc.name || "Drive"));
|
|
15
18
|
return observe(() => (React.createElement(ViewFrame, { id: id, view: view, onNavigate: onNavigate, className: props.className, exclude: props.exclude, disabled: props.disabled, defaultViewType: props.defaultViewType })));
|
|
16
19
|
function onNavigate(id, view) {
|
|
17
20
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pages/DocumentPage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pages/DocumentPage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM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