@voplus/morpho-document 1.4.40 → 1.4.42
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/DocumentHeader/index.js +22 -2
- package/es/components/DocumentHeader/index.js.map +1 -1
- package/es/components/DocumentItem/DefaultDocumentItem.d.ts +4 -0
- package/es/components/DocumentItem/DefaultDocumentItem.js +33 -0
- package/es/components/DocumentItem/DefaultDocumentItem.js.map +1 -0
- package/es/components/DocumentItem/SelectDocumentItem.d.ts +4 -0
- package/es/components/DocumentItem/SelectDocumentItem.js +19 -0
- package/es/components/DocumentItem/SelectDocumentItem.js.map +1 -0
- package/es/components/DocumentItem/SimpleDocumentItem.d.ts +4 -0
- package/es/components/DocumentItem/SimpleDocumentItem.js +24 -0
- package/es/components/DocumentItem/SimpleDocumentItem.js.map +1 -0
- package/es/components/DocumentItem/SubDocumentItem.d.ts +9 -0
- package/es/components/DocumentItem/SubDocumentItem.js +50 -0
- package/es/components/DocumentItem/SubDocumentItem.js.map +1 -0
- package/es/components/DocumentItem/TreeDocumentItem.d.ts +4 -0
- package/es/components/DocumentItem/TreeDocumentItem.js +22 -0
- package/es/components/DocumentItem/TreeDocumentItem.js.map +1 -0
- package/es/components/DocumentItem/index.d.ts +5 -6
- package/es/components/DocumentItem/index.js +13 -94
- package/es/components/DocumentItem/index.js.map +1 -1
- package/es/components/DocumentItem/index.less +63 -122
- package/es/components/DocumentItem/state.d.ts +5 -5
- package/es/components/DocumentList/index.js +9 -2
- package/es/components/DocumentList/index.js.map +1 -1
- package/es/components/DocumentListView/index.js +2 -2
- package/es/components/DocumentListView/index.js.map +1 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.js +2 -2
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.js.map +1 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.less +10 -2
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/node-content-renderer.js +2 -2
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/node-content-renderer.js.map +1 -1
- package/es/components/FileViewer/Preview.js +2 -2
- package/es/components/FileViewer/Preview.js.map +1 -1
- package/es/components/FileViewer/index.less +3 -0
- package/es/components/Links/index.less +111 -111
- package/es/components/QuickAccessSearch/ObjectItem/index.js +2 -2
- package/es/components/QuickAccessSearch/ObjectItem/index.js.map +1 -1
- package/es/controls/data-icons/DocumentDataIcon/index.js +12 -3
- package/es/controls/data-icons/DocumentDataIcon/index.js.map +1 -1
- package/es/controls/data-icons/DocumentDataIcon/index.less +0 -11
- package/es/controls/data-icons/DocumentPathDataIcon/Content.js +2 -2
- package/es/controls/data-icons/DocumentPathDataIcon/Content.js.map +1 -1
- package/es/controls/data-icons/DocumentPathDataIcon/index.less +0 -10
- package/es/modules/graph/components/GraphQuickViewDialog/index.js +2 -2
- package/es/modules/graph/components/GraphQuickViewDialog/index.js.map +1 -1
- package/es/style/print.less +1 -1
- package/package.json +1 -1
- package/es/components/DocumentName/index.d.ts +0 -23
- package/es/components/DocumentName/index.js +0 -82
- package/es/components/DocumentName/index.js.map +0 -1
- package/es/components/DocumentName/index.less +0 -60
|
@@ -17,6 +17,7 @@ import classnames from "classnames";
|
|
|
17
17
|
import { faLock } from "@fortawesome/pro-light-svg-icons";
|
|
18
18
|
import { runInAction } from "mobx";
|
|
19
19
|
import { useDocumentListContext } from "../../data/contexts/DocumentListContext";
|
|
20
|
+
import { useLayout } from "@voplus/morpho-data";
|
|
20
21
|
import { useMetaStore } from "../../data";
|
|
21
22
|
import { useViewContext } from "../../data/contexts/ViewContext";
|
|
22
23
|
const DocumentHeader = (props) => {
|
|
@@ -30,6 +31,7 @@ const DocumentHeader = (props) => {
|
|
|
30
31
|
includes: "tags,versions",
|
|
31
32
|
});
|
|
32
33
|
const meta = useMetaStore();
|
|
34
|
+
const layout = useLayout();
|
|
33
35
|
const [state] = useState(new State(documentStore));
|
|
34
36
|
state.props = props;
|
|
35
37
|
useEffect(() => {
|
|
@@ -85,9 +87,27 @@ const DocumentHeader = (props) => {
|
|
|
85
87
|
return (_a = context === null || context === void 0 ? void 0 : context.onDocumentSelected) === null || _a === void 0 ? void 0 : _a.call(context, id);
|
|
86
88
|
}
|
|
87
89
|
if (quickVisible) {
|
|
88
|
-
|
|
90
|
+
/* 手机模式 */
|
|
91
|
+
if (layout.ui.mobile) {
|
|
92
|
+
const element = asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent;
|
|
93
|
+
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement("div", { style: {
|
|
94
|
+
width: "100%",
|
|
95
|
+
height: "100%",
|
|
96
|
+
background: "#fff",
|
|
97
|
+
position: "absolute",
|
|
98
|
+
top: "0",
|
|
99
|
+
} },
|
|
100
|
+
React.createElement(DocumentQuickViewDialog, { id: id, visible: true, onCancel: () => {
|
|
101
|
+
if (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent)
|
|
102
|
+
asideContext.closeAside();
|
|
103
|
+
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(element, { span: 12 });
|
|
104
|
+
} })), { span: 12 });
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
state.quickViewVisible = !state.quickViewVisible;
|
|
108
|
+
(_b = props.onShowQuickView) === null || _b === void 0 ? void 0 : _b.call(props, state.quickViewVisible);
|
|
109
|
+
}
|
|
89
110
|
}
|
|
90
|
-
(_b = props.onShowQuickView) === null || _b === void 0 ? void 0 : _b.call(props, state.quickViewVisible);
|
|
91
111
|
});
|
|
92
112
|
}
|
|
93
113
|
/** Handler for click event on document name.**/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCA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rB;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AACF,cAAc,CAAC,YAAY,GAAG;IAC7B,eAAe,EAAE,SAAS;IAC1B,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,OAAO;IAC1B,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,IAAI;CACxB,CAAC;AACF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DocumentListContext, DocumentListContextState, useDocumentListContext, } from "../../data/contexts/DocumentListContext";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import DocumentHeader from "../DocumentHeader";
|
|
4
|
+
import classnames from "classnames";
|
|
5
|
+
import { observe } from "@voplus/morpho-ui";
|
|
6
|
+
import styles from "./index.less";
|
|
7
|
+
import { useDocument } from "@voplus/morpho-document-core";
|
|
8
|
+
const DefaultDocumentItem = (props) => {
|
|
9
|
+
/**DocumentListView props(type onDriveClick)*/
|
|
10
|
+
const store = useDocumentListContext();
|
|
11
|
+
const { id, includes, connectDragSource } = props;
|
|
12
|
+
/** DocumentItem store.type="drive-sub"时双击(onDriveClick()),DocumentListView(Drive)会进入子文件
|
|
13
|
+
* 设置listoptions.type=props.type,避免DocumentItem>DocumentList>DocumentItem执行onDriveClick(),出现错误
|
|
14
|
+
*/
|
|
15
|
+
const [listoptions] = useState(new DocumentListContextState());
|
|
16
|
+
const doc = useDocument(props.id, {
|
|
17
|
+
reload: (i) => !!props.reload,
|
|
18
|
+
includes: includes,
|
|
19
|
+
});
|
|
20
|
+
return observe(() => {
|
|
21
|
+
var _a;
|
|
22
|
+
return (React.createElement(DocumentListContext.Provider, { value: listoptions },
|
|
23
|
+
React.createElement("div", { className: classnames(styles["sub-document-item"], props.className), onDoubleClick: onDriveClick },
|
|
24
|
+
React.createElement(DocumentHeader, { id: id, quickDataBarAlign: "left", flagVisible: false, tagsVisible: !!((_a = doc.tags) === null || _a === void 0 ? void 0 : _a.length), subtitleVisible: true, toolsVisible: false, ...props.headerProps }))));
|
|
25
|
+
});
|
|
26
|
+
/**Drive 用戶雙擊文件*/
|
|
27
|
+
function onDriveClick() {
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = store.onDriveClick) === null || _a === void 0 ? void 0 : _a.call(store, id);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export default DefaultDocumentItem;
|
|
33
|
+
//# sourceMappingURL=DefaultDocumentItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultDocumentItem.js","sourceRoot":"","sources":["../../../src/components/DocumentItem/DefaultDocumentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,GACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,mBAAmB,GAAG,CAAC,KAAwB,EAAE,EAAE;IACrD,8CAA8C;IAC9C,MAAM,KAAK,GAAG,sBAAsB,EAAE,CAAC;IACvC,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAClD;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC;IAE/D,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE;QAC9B,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM;QAC7B,QAAQ,EAAE,QAAQ;KACrB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACjB,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,WAAW;YAC5C,6BAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,YAAY;gBACjG,oBAAC,cAAc,IACX,EAAE,EAAE,EAAE,EACN,iBAAiB,EAAC,MAAM,EACxB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,CAAC,CAAC,CAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,MAAM,CAAA,EAC/B,eAAe,EAAE,IAAI,EACrB,YAAY,EAAE,KAAK,KACf,KAAK,CAAC,WAAW,GACvB,CACA,CACqB,CAClC,CAAA;KAAA,CAAC,CAAC;IAGH,iBAAiB;IACjB,SAAS,YAAY;;QACjB,MAAA,KAAK,CAAC,YAAY,+CAAlB,KAAK,EAAgB,EAAE,CAAC,CAAC;IAC7B,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import DocumentHeader from "../DocumentHeader";
|
|
2
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import classnames from "classnames";
|
|
5
|
+
import { faCheck } from "@fortawesome/pro-light-svg-icons";
|
|
6
|
+
import { observe } from "@voplus/morpho-ui";
|
|
7
|
+
import styles from "./index.less";
|
|
8
|
+
import { useDocument } from "@voplus/morpho-document-core";
|
|
9
|
+
const SelectDocumentItem = (props) => {
|
|
10
|
+
const { id, checked } = props;
|
|
11
|
+
const doc = useDocument(props.id, { reload: false });
|
|
12
|
+
return observe(() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (React.createElement("div", { className: classnames(styles["sub-document-item"], props.className), onDoubleClick: () => { var _a; return (_a = props.onSelectDocument) === null || _a === void 0 ? void 0 : _a.call(props, doc); } },
|
|
15
|
+
React.createElement(DocumentHeader, { id: id, quickDataBarAlign: "left", flagVisible: false, tagsVisible: !!((_a = doc.tags) === null || _a === void 0 ? void 0 : _a.length), subtitleVisible: true, quickVisible: false, tools: React.createElement(React.Fragment, null, checked ? React.createElement(FAIcon, { icon: faCheck, className: classnames("icon-check") }) : null), ...props.headerProps })));
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export default SelectDocumentItem;
|
|
19
|
+
//# sourceMappingURL=SelectDocumentItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectDocumentItem.js","sourceRoot":"","sources":["../../../src/components/DocumentItem/SelectDocumentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,kBAAkB,GAAG,CAAC,KAAwB,EAAE,EAAE;IACpD,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAErD,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACjB,6BAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,gBAAgB,+CAAtB,KAAK,EAAoB,GAAG,CAAC,CAAA,EAAA;YACxH,oBAAC,cAAc,IACX,EAAE,EAAE,EAAE,EACN,iBAAiB,EAAC,MAAM,EACxB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,CAAC,CAAC,CAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,MAAM,CAAA,EAC/B,eAAe,EAAE,IAAI,EACrB,YAAY,EAAE,KAAK,EACnB,KAAK,EACD,0CAAG,OAAO,CAAC,CAAC,CAAC,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,YAAY,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,CAAI,KAEtF,KAAK,CAAC,WAAW,GACvB,CACA,CACT,CAAA;KAAA,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { State } from "./state";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { useDocument, useDocumentStore } from "@voplus/morpho-document-core";
|
|
4
|
+
import DocumentHeader from "../DocumentHeader";
|
|
5
|
+
import { Open } from "../../controls/ToolBar/buttons";
|
|
6
|
+
import ToolBar from "../../controls/ToolBar/ToolBar2";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import { observe } from "@voplus/morpho-ui";
|
|
9
|
+
import styles from "./index.less";
|
|
10
|
+
import { useMetaStore } from "../../data";
|
|
11
|
+
const SimpleDocumentItem = (props) => {
|
|
12
|
+
const { id } = props;
|
|
13
|
+
const meta = useMetaStore();
|
|
14
|
+
const docStore = useDocumentStore();
|
|
15
|
+
const [state] = useState(new State(docStore));
|
|
16
|
+
const doc = useDocument(props.id, { reload: false });
|
|
17
|
+
state.update(doc);
|
|
18
|
+
return observe(() => (React.createElement("div", { className: classnames(styles["sub-document-item"], "simple-document-item", props.className) },
|
|
19
|
+
React.createElement(DocumentHeader, { id: id, quickDataBarAlign: "left", flagVisible: false, tagsVisible: false, subtitleVisible: true, clickNameEffect: "default", quickDataBarVisible: false, descriptionVisible: false, onMouse: (over) => state.isHover = over, tools: React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
20
|
+
React.createElement(ToolBar, { id: state.item.id, showMenu: false },
|
|
21
|
+
React.createElement(Open, { size: "small", url: meta.getRoute(state.item) }))), ...props.headerProps }))));
|
|
22
|
+
};
|
|
23
|
+
export default SimpleDocumentItem;
|
|
24
|
+
//# sourceMappingURL=SimpleDocumentItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleDocumentItem.js","sourceRoot":"","sources":["../../../src/components/DocumentItem/SimpleDocumentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,OAAO,MAAM,iCAAiC,CAAC;AACtD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,kBAAkB,GAAG,CAAC,KAAwB,EAAE,EAAE;IACpD,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;I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@@
|
|
|
1
|
+
import { Archive, Download, Open, Restore, Versions } from "../../controls/ToolBar/buttons";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import { DocumentListContext, DocumentListContextState, useDocumentListContext, } from "../../data/contexts/DocumentListContext";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import { useDocument, useDocumentStore } from "@voplus/morpho-document-core";
|
|
6
|
+
import { Checkbox } from "@voplus/antd";
|
|
7
|
+
import DocumentHeader from "../DocumentHeader";
|
|
8
|
+
import ToolBar from "../../controls/ToolBar/ToolBar2";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import { observe } from "@voplus/morpho-ui";
|
|
11
|
+
import styles from "./index.less";
|
|
12
|
+
import { useMetaStore } from "../../data";
|
|
13
|
+
const SubDocumentItem = (props) => {
|
|
14
|
+
/**DocumentListView props(type onDriveClick)*/
|
|
15
|
+
const store = useDocumentListContext();
|
|
16
|
+
const { id, multiple, includes, toolbar, connectDragSource } = props;
|
|
17
|
+
const docStore = useDocumentStore();
|
|
18
|
+
const [state] = useState(new State(docStore));
|
|
19
|
+
/** DocumentItem store.type="drive-sub"时双击(onDriveClick()),DocumentListView(Drive)会进入子文件
|
|
20
|
+
* 设置listoptions.type=props.type,避免DocumentItem>DocumentList>DocumentItem执行onDriveClick(),出现错误
|
|
21
|
+
*/
|
|
22
|
+
const [listoptions] = useState(new DocumentListContextState());
|
|
23
|
+
// listoptions.type = props.type;
|
|
24
|
+
const meta = useMetaStore();
|
|
25
|
+
state.props = props;
|
|
26
|
+
const item = useDocument(props.id, {
|
|
27
|
+
reload: (i) => !!props.reload,
|
|
28
|
+
includes: includes,
|
|
29
|
+
});
|
|
30
|
+
state.update(item);
|
|
31
|
+
return observe(() => (React.createElement(DocumentListContext.Provider, { value: listoptions },
|
|
32
|
+
React.createElement("div", { className: classnames(styles["sub-document-item"], props.className), onDoubleClick: onDriveClick },
|
|
33
|
+
React.createElement(DocumentHeader, { id: props.id, quickDataBarAlign: "left", flagVisible: false, clickNameEffect: "default", onMouse: (over) => state.isHover = over && !multiple, onShowQuickView: props.onChangeDisabled, pre: multiple ? (React.createElement(Checkbox, { value: props.id, disabled: state.readonly })) : (null), tools: React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
34
|
+
React.createElement(ToolBar, { id: state.item.id, moreProps: { buttonProps: { size: "middle" } } },
|
|
35
|
+
React.createElement(Open, { size: "middle", url: meta.getRoute(state.item) }),
|
|
36
|
+
toolbar,
|
|
37
|
+
state.item.status === "Archived" ? (React.createElement(Restore, { size: "middle" })) : (React.createElement(Archive, { size: "middle" })),
|
|
38
|
+
React.createElement(Versions, { size: "middle" }),
|
|
39
|
+
state.item.type === "File" && React.createElement(Download, { size: "middle" }))), ...props.headerProps })))));
|
|
40
|
+
/**Drive 用戶雙擊文件*/
|
|
41
|
+
function onDriveClick() {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = store.onDriveClick) === null || _a === void 0 ? void 0 : _a.call(store, state.item.id);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
SubDocumentItem.defaultProps = {
|
|
47
|
+
includes: "tag"
|
|
48
|
+
};
|
|
49
|
+
export default SubDocumentItem;
|
|
50
|
+
//# sourceMappingURL=SubDocumentItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubDocumentItem.js","sourceRoot":"","sources":["../../../src/components/DocumentItem/SubDocumentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EACN,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,GACtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,g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M,IAAI,oBAAC,QAAQ,IAAC,IAAI,EAAC,QAAQ,GAAG,CAChD,CACL,KAEH,KAAK,CAAC,WAAW,GACpB,CACG,CACwB,CAC/B,CAAC,CAAC;IAEH,iBAAiB;IACjB,SAAS,YAAY;;QACpB,MAAA,KAAK,CAAC,YAAY,+CAAlB,KAAK,EAAgB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG;IAC9B,QAAQ,EAAE,KAAK;CACf,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import DocumentHeader from "../DocumentHeader";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
import { observe } from "@voplus/morpho-ui";
|
|
5
|
+
import styles from "./index.less";
|
|
6
|
+
import { useDocument } from "@voplus/morpho-document-core";
|
|
7
|
+
import { useDocumentListContext, } from "../../data/contexts/DocumentListContext";
|
|
8
|
+
const TreeDocumentItem = (props) => {
|
|
9
|
+
const store = useDocumentListContext();
|
|
10
|
+
const { id } = props;
|
|
11
|
+
const doc = useDocument(props.id, { reload: false });
|
|
12
|
+
return observe(() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (React.createElement("div", { className: classnames(styles["sub-document-item"], props.className), onClick: () => {
|
|
15
|
+
var _a;
|
|
16
|
+
(_a = store === null || store === void 0 ? void 0 : store.onDocumentSelected) === null || _a === void 0 ? void 0 : _a.call(store, id);
|
|
17
|
+
} },
|
|
18
|
+
React.createElement(DocumentHeader, { id: id, quickDataBarAlign: "left", flagVisible: false, tagsVisible: !!((_a = doc.tags) === null || _a === void 0 ? void 0 : _a.length), subtitleVisible: true, toolsVisible: false, quickVisible: false, ...props.headerProps })));
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export default TreeDocumentItem;
|
|
22
|
+
//# sourceMappingURL=TreeDocumentItem.js.map
|
|
@@ -0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,CAAA;KAAA,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DocumentItemProps } from "./state";
|
|
3
|
-
declare const DocumentItem: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
3
|
+
declare const DocumentItem: (props: {
|
|
4
|
+
/** "detail" 详情| "sub" sub列表| "select" 文件选择对话盒|"drive" Drive列表|"driveSub" Drive列表| "tree" DocumentSortableTree | "simple" */
|
|
5
|
+
type: string;
|
|
6
|
+
item: DocumentItemProps;
|
|
7
|
+
}) => JSX.Element;
|
|
9
8
|
export default DocumentItem;
|
|
@@ -1,99 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import DocumentDataIconBar from "../../controls/DocumentDataIconBar";
|
|
8
|
-
import DocumentName from "../DocumentName";
|
|
9
|
-
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
10
|
-
import ToolBar from "../../controls/ToolBar/ToolBar2";
|
|
11
|
-
import classnames from "classnames";
|
|
12
|
-
import { faCheck } from "@fortawesome/pro-light-svg-icons";
|
|
1
|
+
import DefaultDocumentItem from "./DefaultDocumentItem";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import SelectDocumentItem from "./SelectDocumentItem";
|
|
4
|
+
import SimpleDocumentItem from "./SimpleDocumentItem";
|
|
5
|
+
import SubDocumentItem from "./SubDocumentItem";
|
|
6
|
+
import TreeDocumentItem from "./TreeDocumentItem";
|
|
13
7
|
import { observe } from "@voplus/morpho-ui";
|
|
14
|
-
import { runInAction } from "mobx";
|
|
15
|
-
import styles from "./index.less";
|
|
16
|
-
import { useMetaStore } from "../../data";
|
|
17
8
|
const DocumentItem = (props) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*/
|
|
26
|
-
const [listoptions] = useState(new DocumentListContextState());
|
|
27
|
-
listoptions.type = props.type;
|
|
28
|
-
const meta = useMetaStore();
|
|
29
|
-
state.props = props;
|
|
30
|
-
const item = useDocument(props.id, {
|
|
31
|
-
reload: (i) => !!props.reload,
|
|
32
|
-
includes: includes,
|
|
33
|
-
});
|
|
34
|
-
state.update(item);
|
|
35
|
-
const iconList = (React.createElement("div", { className: "document-other" },
|
|
36
|
-
React.createElement(DocumentDataIconBar, { id: id })));
|
|
37
|
-
return observe(() => (React.createElement(React.Fragment, null, state.item.loaded ? (React.createElement(DocumentListContext.Provider, { value: listoptions },
|
|
38
|
-
React.createElement("div", { className: classnames(styles["document-type-list"], props.className) },
|
|
39
|
-
!type ||
|
|
40
|
-
(type === "drive" && (React.createElement("div", { className: "document-item", onDoubleClick: onDriveClick },
|
|
41
|
-
React.createElement("div", { className: "file-info" },
|
|
42
|
-
React.createElement(DocumentName, { id: props.id, includes: includes, showIcon: true, status: false, quickView: false }),
|
|
43
|
-
React.createElement("div", { className: "document-content-control" }, iconList))))),
|
|
44
|
-
type === "detail" && (React.createElement("div", { className: classnames("document-detail-item") },
|
|
45
|
-
React.createElement(DocumentName, { id: props.id, showIcon: true, status: false, includes: includes, inlineEdit: !state.readonly }),
|
|
46
|
-
iconList)),
|
|
47
|
-
type === "sub" && (React.createElement("div", { className: classnames("document-item", {
|
|
48
|
-
"sub-document-item_hover": state.isHover,
|
|
49
|
-
}), onMouseLeave: () => runInAction(() => (state.isHover = false)) },
|
|
50
|
-
React.createElement("div", { className: "document-sub-item", onDoubleClick: onDriveClick, onMouseOver: () => runInAction(() => (state.isHover = !multiple)) },
|
|
51
|
-
multiple && (React.createElement(Checkbox, { value: props.id, disabled: state.readonly, className: "select-checkbox" })),
|
|
52
|
-
React.createElement("div", { className: "file-info" },
|
|
53
|
-
React.createElement(DocumentName, { id: props.id, showIcon: true, includes: includes, onChangeDisabled: props.onChangeDisabled }),
|
|
54
|
-
state.item.note && React.createElement("div", { className: "publish-note" }, state.item.note),
|
|
55
|
-
iconList)),
|
|
56
|
-
React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
57
|
-
React.createElement(ToolBar, { id: state.item.id, moreProps: { buttonProps: { size: "middle" } } },
|
|
58
|
-
React.createElement(Open, { size: "middle", url: meta.getRoute(state.item) }),
|
|
59
|
-
toolbar,
|
|
60
|
-
state.item.status === "Archived" ? (React.createElement(Restore, { size: "middle" })) : (React.createElement(Archive, { size: "middle" })),
|
|
61
|
-
React.createElement(Versions, { size: "middle" }),
|
|
62
|
-
state.item.type === "File" && React.createElement(Download, { size: "middle" }))))),
|
|
63
|
-
type === "select" && (React.createElement("div", { className: "document-item", onDoubleClick: () => { var _a; return (_a = props.onSelectDocument) === null || _a === void 0 ? void 0 : _a.call(props, state.item); } },
|
|
64
|
-
React.createElement("div", { className: "file-info" },
|
|
65
|
-
React.createElement(DocumentName, { id: props.id, includes: includes, showIcon: true, status: false, showTags: false }),
|
|
66
|
-
iconList),
|
|
67
|
-
checked && React.createElement(FAIcon, { icon: faCheck, className: classnames("icon-check") }))),
|
|
68
|
-
type === "tree" && (React.createElement("div", { className: "document-item", onClick: () => {
|
|
69
|
-
var _a;
|
|
70
|
-
(_a = store === null || store === void 0 ? void 0 : store.onDocumentSelected) === null || _a === void 0 ? void 0 : _a.call(store, state.item.id);
|
|
71
|
-
} },
|
|
72
|
-
React.createElement("div", { className: "file-info" },
|
|
73
|
-
React.createElement(DocumentName, { id: props.id, includes: includes, showIcon: true, status: false, quickView: false }),
|
|
74
|
-
iconList))),
|
|
75
|
-
type === "file-tree" && (React.createElement("div", { onClick: () => {
|
|
76
|
-
var _a;
|
|
77
|
-
(_a = store === null || store === void 0 ? void 0 : store.onDocumentSelected) === null || _a === void 0 ? void 0 : _a.call(store, state.item.id);
|
|
78
|
-
} },
|
|
79
|
-
React.createElement(DocumentName, { id: props.id, className: "file-tree-item", showIcon: true, showTags: false, status: false, quickView: false }))),
|
|
80
|
-
type === "simple" && (React.createElement("div", { className: classnames("document-item", {
|
|
81
|
-
"sub-document-item_hover": state.isHover,
|
|
82
|
-
}), onMouseLeave: () => runInAction(() => (state.isHover = false)) },
|
|
83
|
-
React.createElement("div", { className: "document-sub-item", onMouseOver: () => runInAction(() => (state.isHover = !multiple)) },
|
|
84
|
-
React.createElement(DocumentName, { id: props.id, showIcon: true, includes: includes, showTags: false, onChangeDisabled: props.onChangeDisabled })),
|
|
85
|
-
React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
86
|
-
React.createElement(ToolBar, { id: state.item.id, showMenu: false },
|
|
87
|
-
React.createElement(Open, { size: "small", url: meta.getRoute(state.item) })))))))) : null)));
|
|
88
|
-
/**Drive 用戶雙擊文件*/
|
|
89
|
-
function onDriveClick() {
|
|
90
|
-
var _a;
|
|
91
|
-
if (type === "drive" || (store === null || store === void 0 ? void 0 : store.type) === "drive-sub")
|
|
92
|
-
(_a = store.onDriveClick) === null || _a === void 0 ? void 0 : _a.call(store, state.item.id);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
DocumentItem.defaultProps = {
|
|
96
|
-
includes: "tag"
|
|
9
|
+
const { type } = props;
|
|
10
|
+
return observe(() => (React.createElement(React.Fragment, null,
|
|
11
|
+
type === "drive" && React.createElement(DefaultDocumentItem, { ...props.item }),
|
|
12
|
+
type === "sub" && React.createElement(SubDocumentItem, { ...props.item }),
|
|
13
|
+
type === "select" && React.createElement(SelectDocumentItem, { ...props.item }),
|
|
14
|
+
type === "tree" && React.createElement(TreeDocumentItem, { ...props.item }),
|
|
15
|
+
type === "simple" && React.createElement(SimpleDocumentItem, { ...props.item }))));
|
|
97
16
|
};
|
|
98
17
|
export default DocumentItem;
|
|
99
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,YAAY,GAAG,CAAC,KAIrB,EAAE,EAAE;IACD,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEvB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACjB;QACK,IAAI,KAAK,OAAO,IAAI,oBAAC,mBAAmB,OAAK,KAAK,CAAC,IAAI,GAAI;QAC3D,IAAI,KAAK,KAAK,IAAI,oBAAC,eAAe,OAAK,KAAK,CAAC,IAAI,GAAI;QACrD,IAAI,KAAK,QAAQ,IAAI,oBAAC,kBAAkB,OAAK,KAAK,CAAC,IAAI,GAAI;QAC3D,IAAI,KAAK,MAAM,IAAI,oBAAC,gBAAgB,OAAK,KAAK,CAAC,IAAI,GAAI;QACvD,IAAI,KAAK,QAAQ,IAAI,oBAAC,kBAAkB,OAAK,KAAK,CAAC,IAAI,GAAI,CAC7D,CACN,CAAC,CAAC;AACP,CAAC,CAAC;AAGF,eAAe,YAAY,CAAC"}
|