@voplus/morpho-document 1.0.0-dev214 → 1.0.0-dev216
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/ActivityLog/index.less +64 -64
- package/es/components/AddDocDropdown/index.js +23 -5
- package/es/components/AddDocDropdown/index.js.map +1 -1
- package/es/components/AddDocDropdown/index.less +3 -2
- package/es/components/AddDocDropdown/state.d.ts +1 -0
- package/es/components/AddDocDropdown/state.js +9 -3
- package/es/components/AddDocDropdown/state.js.map +1 -1
- package/es/components/BreadCrumbsHeader/index.d.ts +9 -0
- package/es/components/BreadCrumbsHeader/index.js +30 -0
- package/es/components/BreadCrumbsHeader/index.js.map +1 -0
- package/es/components/BreadCrumbsHeader/index.less +10 -0
- package/es/components/BreadCrumbsHeader/state.d.ts +10 -0
- package/es/components/BreadCrumbsHeader/state.js +34 -0
- package/es/components/BreadCrumbsHeader/state.js.map +1 -0
- package/es/components/DocumentItem/index.js +2 -8
- package/es/components/DocumentItem/index.js.map +1 -1
- package/es/components/DocumentList/Header.d.ts +13 -0
- package/es/components/DocumentList/Header.js +16 -0
- package/es/components/DocumentList/Header.js.map +1 -0
- package/es/components/DocumentList/index.js +35 -29
- package/es/components/DocumentList/index.js.map +1 -1
- package/es/components/DocumentList/index.less +39 -15
- package/es/components/DocumentList/state.d.ts +9 -27
- package/es/components/DocumentList/state.js +20 -115
- package/es/components/DocumentList/state.js.map +1 -1
- package/es/components/DocumentListView/index.d.ts +3 -2
- package/es/components/DocumentListView/index.js +31 -54
- package/es/components/DocumentListView/index.js.map +1 -1
- package/es/components/DocumentListView/state.d.ts +1 -36
- package/es/components/DocumentListView/state.js +1 -100
- package/es/components/DocumentListView/state.js.map +1 -1
- package/es/components/DocumentSortableTree/index.js +32 -4
- package/es/components/DocumentSortableTree/index.js.map +1 -1
- package/es/components/DocumentSortableTree/state.d.ts +7 -6
- package/es/components/DocumentSortableTree/state.js +23 -32
- package/es/components/DocumentSortableTree/state.js.map +1 -1
- package/es/components/DocumentTabs/index.js +2 -4
- package/es/components/DocumentTabs/index.js.map +1 -1
- package/es/components/DocumentTree/index.js +1 -1
- package/es/components/DocumentTree/index.js.map +1 -1
- package/es/components/FileViewer/ImageViewer.js +4 -3
- package/es/components/FileViewer/ImageViewer.js.map +1 -1
- package/es/components/FileViewer/PDFViewer.js +4 -2
- package/es/components/FileViewer/PDFViewer.js.map +1 -1
- package/es/components/FileViewer/Preview.js +12 -10
- package/es/components/FileViewer/Preview.js.map +1 -1
- package/es/components/FileViewer/index.less +33 -0
- package/es/components/Links/index.less +111 -111
- package/es/components/NewDocumentForm/index.d.ts +1 -1
- package/es/components/NewDocumentForm/index.js +10 -3
- package/es/components/NewDocumentForm/index.js.map +1 -1
- package/es/components/NewDocumentForm/index.less +9 -1
- package/es/components/QuickAccessSearch/index.js +5 -4
- package/es/components/QuickAccessSearch/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.d.ts +10 -4
- package/es/components/QuickViewDialog/QuickSubTab/index.js +16 -16
- package/es/components/QuickViewDialog/QuickSubTab/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.less +7 -19
- package/es/components/QuickViewDialog/index.js +2 -1
- package/es/components/QuickViewDialog/index.js.map +1 -1
- package/es/components/QuickViewDialog/index.less +8 -1
- package/es/components/helper.d.ts +1 -1
- package/es/components/helper.js +4 -0
- package/es/components/helper.js.map +1 -1
- package/es/components/styles/common.less +4 -1
- package/es/controls/filters/DocumentTypeFilter/index.d.ts +3 -0
- package/es/controls/filters/DocumentTypeFilter/index.js +21 -0
- package/es/controls/filters/DocumentTypeFilter/index.js.map +1 -0
- package/es/controls/filters/DocumentTypeFilter/state.d.ts +18 -0
- package/es/controls/filters/DocumentTypeFilter/state.js +57 -0
- package/es/controls/filters/DocumentTypeFilter/state.js.map +1 -0
- package/es/controls/filters/index.d.ts +1 -0
- package/es/controls/filters/index.js +1 -0
- package/es/controls/filters/index.js.map +1 -1
- package/es/data/DocumentStore/hooks/useDocumentListEffect.d.ts +2 -1
- package/es/data/DocumentStore/hooks/useDocumentListEffect.js +2 -2
- package/es/data/DocumentStore/hooks/useDocumentListEffect.js.map +1 -1
- package/es/data/DocumentType.d.ts +3 -1
- package/es/data/DocumentType.js +3 -1
- package/es/data/DocumentType.js.map +1 -1
- package/es/data/metas/ShortcutMeta.js +1 -1
- package/es/data/metas/ShortcutMeta.js.map +1 -1
- package/es/modules/unit/components/ActivityLog/index.d.ts +6 -0
- package/es/modules/unit/components/ActivityLog/index.js +62 -0
- package/es/modules/unit/components/ActivityLog/index.js.map +1 -0
- package/es/modules/unit/components/ActivityLog/index.less +64 -0
- package/es/modules/unit/components/ActivityLog/state.d.ts +14 -0
- package/es/modules/unit/components/ActivityLog/state.js +51 -0
- package/es/modules/unit/components/ActivityLog/state.js.map +1 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.d.ts +6 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.js +27 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.js.map +1 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.less +10 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.d.ts +5 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.js +19 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +1 -0
- package/es/modules/unit/components/Members/index.d.ts +4 -0
- package/es/modules/unit/components/Members/index.js +91 -0
- package/es/modules/unit/components/Members/index.js.map +1 -0
- package/es/modules/unit/components/Members/index.less +19 -0
- package/es/modules/unit/components/Members/state.d.ts +18 -0
- package/es/modules/unit/components/Members/state.js +29 -0
- package/es/modules/unit/components/Members/state.js.map +1 -0
- package/es/modules/unit/components/NewUnitForm/index.d.ts +11 -0
- package/es/modules/unit/components/NewUnitForm/index.js +51 -0
- package/es/modules/unit/components/NewUnitForm/index.js.map +1 -0
- package/es/modules/unit/components/NewUnitForm/index.less +33 -0
- package/es/modules/unit/components/NewUnitForm/state.d.ts +22 -0
- package/es/modules/unit/components/NewUnitForm/state.js +49 -0
- package/es/modules/unit/components/NewUnitForm/state.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.d.ts +4 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js +23 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.d.ts +3 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js +58 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.less +46 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.d.ts +3 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js +73 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.less +12 -0
- package/es/modules/unit/components/SubUnitList/index.d.ts +5 -0
- package/es/modules/unit/components/SubUnitList/index.js +70 -0
- package/es/modules/unit/components/SubUnitList/index.js.map +1 -0
- package/es/modules/unit/components/SubUnitList/index.less +13 -0
- package/es/modules/unit/components/SubUnitList/state.d.ts +14 -0
- package/es/modules/unit/components/SubUnitList/state.js +21 -0
- package/es/modules/unit/components/SubUnitList/state.js.map +1 -0
- package/es/modules/unit/components/UnitAvatar/index.d.ts +1 -0
- package/es/modules/unit/components/UnitAvatar/index.js +5 -4
- package/es/modules/unit/components/UnitAvatar/index.js.map +1 -1
- package/es/modules/unit/components/UnitAvatar/index.less +2 -3
- package/es/modules/unit/components/UnitDetails/index.js +98 -7
- package/es/modules/unit/components/UnitDetails/index.js.map +1 -1
- package/es/modules/unit/components/UnitDetails/index.less +41 -5
- package/es/modules/unit/components/UnitDetails/state.d.ts +8 -0
- package/es/modules/unit/components/UnitDetails/state.js +24 -0
- package/es/modules/unit/components/UnitDetails/state.js.map +1 -0
- package/es/modules/unit/components/UnitHead/index.d.ts +2 -0
- package/es/modules/unit/components/UnitHead/index.js +31 -7
- package/es/modules/unit/components/UnitHead/index.js.map +1 -1
- package/es/modules/unit/components/UnitHead/index.less +18 -3
- package/es/modules/unit/components/UnitHead/state.d.ts +11 -0
- package/es/modules/unit/components/UnitHead/state.js +8 -0
- package/es/modules/unit/components/UnitHead/state.js.map +1 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.d.ts +4 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js +29 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js.map +1 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.d.ts +4 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.js +35 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.js.map +1 -0
- package/es/modules/unit/components/UnitItem/index.less +23 -5
- package/es/modules/unit/components/UnitItem/state.d.ts +20 -0
- package/es/modules/unit/components/UnitItem/state.js +20 -0
- package/es/modules/unit/components/UnitItem/state.js.map +1 -0
- package/es/modules/unit/components/UnitList/index.d.ts +4 -0
- package/es/modules/unit/components/UnitList/index.js +37 -0
- package/es/modules/unit/components/UnitList/index.js.map +1 -0
- package/es/modules/unit/components/UnitList/state.d.ts +15 -0
- package/es/modules/unit/components/UnitList/state.js +31 -0
- package/es/modules/unit/components/UnitList/state.js.map +1 -0
- package/es/modules/unit/components/UnitPropertiesView/index.d.ts +6 -0
- package/es/modules/unit/components/UnitPropertiesView/index.js +22 -0
- package/es/modules/unit/components/UnitPropertiesView/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/index.d.ts +10 -0
- package/es/modules/unit/components/UnitSortableTree/index.js +54 -0
- package/es/modules/unit/components/UnitSortableTree/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/state.d.ts +50 -0
- package/es/modules/unit/components/UnitSortableTree/state.js +151 -0
- package/es/modules/unit/components/UnitSortableTree/state.js.map +1 -0
- package/es/modules/unit/components/UnitTabs/index.d.ts +6 -0
- package/es/modules/unit/components/UnitTabs/index.js +29 -0
- package/es/modules/unit/components/UnitTabs/index.js.map +1 -0
- package/es/modules/unit/controls/ContactSelect/index.d.ts +9 -0
- package/es/modules/unit/controls/ContactSelect/index.js +78 -0
- package/es/modules/unit/controls/ContactSelect/index.js.map +1 -0
- package/es/modules/unit/controls/ContactSelect/state.d.ts +23 -0
- package/es/modules/unit/controls/ContactSelect/state.js +43 -0
- package/es/modules/unit/controls/ContactSelect/state.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.d.ts +6 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js +32 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js.map +1 -0
- package/es/modules/unit/{components → controls}/QuickDataIcon/index.d.ts +2 -6
- package/es/modules/unit/controls/QuickDataIcon/index.js +36 -0
- package/es/modules/unit/controls/QuickDataIcon/index.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/index.less +0 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.d.ts +13 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js +59 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.less +20 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.d.ts +34 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +71 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/index.d.ts +12 -0
- package/es/modules/unit/controls/ToolBar/index.js +54 -0
- package/es/modules/unit/controls/ToolBar/index.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/index.less +18 -0
- package/es/modules/unit/controls/ToolBar/state.d.ts +40 -0
- package/es/modules/unit/controls/ToolBar/state.js +50 -0
- package/es/modules/unit/controls/ToolBar/state.js.map +1 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.d.ts +3 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.js +21 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.js.map +1 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.d.ts +18 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.js +63 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.js.map +1 -0
- package/es/modules/unit/data/FileStore/FileContext.d.ts +6 -0
- package/es/modules/unit/data/FileStore/FileContext.js +40 -0
- package/es/modules/unit/data/FileStore/FileContext.js.map +1 -0
- package/es/modules/unit/data/FileStore/index.d.ts +1 -0
- package/es/modules/unit/data/FileStore/index.js +2 -0
- package/es/modules/unit/data/FileStore/index.js.map +1 -0
- package/es/modules/unit/data/StoreContext/index.d.ts +3 -0
- package/es/modules/unit/data/StoreContext/index.js +4 -0
- package/es/modules/unit/data/StoreContext/index.js.map +1 -0
- package/es/modules/unit/data/UnitContext/index.d.ts +20 -0
- package/es/modules/unit/data/UnitContext/index.js +32 -0
- package/es/modules/unit/data/UnitContext/index.js.map +1 -0
- package/es/modules/unit/data/UnitStore.d.ts +103 -0
- package/es/modules/unit/data/UnitStore.js +180 -0
- package/es/modules/unit/data/UnitStore.js.map +1 -0
- package/es/modules/unit/data/hooks.d.ts +25 -0
- package/es/modules/unit/data/hooks.js +91 -0
- package/es/modules/unit/data/hooks.js.map +1 -0
- package/es/modules/unit/data/index.d.ts +3 -0
- package/es/modules/unit/data/index.js +3 -0
- package/es/modules/unit/data/index.js.map +1 -0
- package/es/modules/unit/data/interfaces/IAddress.d.ts +14 -0
- package/es/modules/unit/data/interfaces/IAddress.js +1 -0
- package/es/modules/unit/data/interfaces/IAddress.js.map +1 -0
- package/es/modules/unit/data/interfaces/IEntityName.d.ts +6 -0
- package/es/modules/unit/data/interfaces/IEntityName.js +1 -0
- package/es/modules/unit/data/interfaces/IEntityName.js.map +1 -0
- package/es/modules/unit/data/interfaces/IUnit.d.ts +47 -0
- package/es/modules/unit/data/interfaces/IUnit.js +1 -0
- package/es/modules/unit/data/interfaces/IUnit.js.map +1 -0
- package/es/modules/unit/data/interfaces/index.d.ts +3 -0
- package/es/modules/unit/data/interfaces/index.js +1 -0
- package/es/modules/unit/data/interfaces/index.js.map +1 -0
- package/es/modules/unit/pages/UnitDefaultView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitDefaultView/index.js +47 -0
- package/es/modules/unit/pages/UnitDefaultView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitDefaultView/index.less +17 -0
- package/es/modules/unit/pages/UnitListView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitListView/index.js +10 -0
- package/es/modules/unit/pages/UnitListView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitTreeView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitTreeView/index.js +47 -0
- package/es/modules/unit/pages/UnitTreeView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitTreeView/index.less +31 -0
- package/es/modules/unit/pages/UnitTreeView/state.d.ts +5 -0
- package/es/modules/unit/pages/UnitTreeView/state.js +14 -0
- package/es/modules/unit/pages/UnitTreeView/state.js.map +1 -0
- package/es/pages/TreeViewPage/index.js +27 -20
- package/es/pages/TreeViewPage/index.js.map +1 -1
- package/es/pages/TreeViewPage/index.less +28 -19
- package/es/pages/TreeViewPage/state.d.ts +5 -0
- package/es/pages/TreeViewPage/state.js +14 -0
- package/es/pages/TreeViewPage/state.js.map +1 -0
- package/es/routes.d.ts +18 -0
- package/es/routes.js +40 -1
- package/es/routes.js.map +1 -1
- package/package.json +3 -1
- package/es/controls/DocumentTypeFilter/index.js +0 -54
- package/es/controls/DocumentTypeFilter/index.js.map +0 -1
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.d.ts +0 -14
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js +0 -28
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js.map +0 -1
- package/es/modules/unit/components/QuickDataIcon/index.js +0 -45
- package/es/modules/unit/components/QuickDataIcon/index.js.map +0 -1
- package/es/modules/unit/components/UnitItem/index.d.ts +0 -6
- package/es/modules/unit/components/UnitItem/index.js +0 -19
- package/es/modules/unit/components/UnitItem/index.js.map +0 -1
- /package/es/modules/unit/components/{QuickDataIcon → UnitList}/index.less +0 -0
- /package/es/{controls/DocumentTypeFilter/index.d.ts → modules/unit/components/UnitPropertiesView/index.less} +0 -0
- /package/es/modules/unit/{components → controls}/QuickDataIcon/UnitTeamsIcon/index.less +0 -0
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./index.less";
|
|
3
|
-
import {
|
|
4
|
-
export interface IData extends
|
|
5
|
-
/** Number of task */
|
|
6
|
-
taskNumbers?: number;
|
|
7
|
-
/** Number of incomplete of task */
|
|
8
|
-
incompleteTaskNumbers?: number;
|
|
3
|
+
import { IUnit } from "../../data";
|
|
4
|
+
export interface IData extends IUnit {
|
|
9
5
|
documents?: number;
|
|
10
6
|
comments?: number;
|
|
11
7
|
users?: number;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { useUnit } from "../../data";
|
|
3
|
+
import { faCommentDots, faListAlt, faListOl, faPaperclip, faUsers } from "@fortawesome/pro-light-svg-icons";
|
|
4
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Tooltip } from "@voplus/antd";
|
|
7
|
+
import UnitTeamsIcon from "./UnitTeamsIcon";
|
|
8
|
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
9
|
+
library.add(faCommentDots, faListAlt, faListOl, faPaperclip, faUsers);
|
|
10
|
+
const QuickDataIcon = (props) => {
|
|
11
|
+
const { id, tip } = props;
|
|
12
|
+
const document = useUnit(id);
|
|
13
|
+
const { documents, comments } = document;
|
|
14
|
+
const list = [
|
|
15
|
+
{
|
|
16
|
+
name: "Document",
|
|
17
|
+
icon: ["fal", "paperclip"],
|
|
18
|
+
num: documents || 0
|
|
19
|
+
},
|
|
20
|
+
{ name: "Comment", icon: ["fal", "comment-dots"], num: comments || 0 }
|
|
21
|
+
];
|
|
22
|
+
return (React.createElement(React.Fragment, null,
|
|
23
|
+
list.map(item => tip ? (React.createElement(Tooltip, { key: item.name, title: item.name },
|
|
24
|
+
React.createElement("span", { className: "quick-data-icon", onClick: () => (item.name === "Document" ? props.onClick() : null) },
|
|
25
|
+
React.createElement(FAIcon, { icon: item.icon }),
|
|
26
|
+
item.num))) : (React.createElement("span", { className: "quick-data-icon" },
|
|
27
|
+
React.createElement(FAIcon, { icon: item.icon }),
|
|
28
|
+
item.num))),
|
|
29
|
+
React.createElement(UnitTeamsIcon, { id: id })));
|
|
30
|
+
};
|
|
31
|
+
QuickDataIcon.defaultProps = {
|
|
32
|
+
tip: true,
|
|
33
|
+
includes: ""
|
|
34
|
+
};
|
|
35
|
+
export default QuickDataIcon;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/QuickDataIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAS,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACN,aAAa,EACb,SAAS,EACT,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE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AE,GAAI,CACT,CACjB,CAAC;AACH,CAAC,CAAC;AACF,aAAa,CAAC,YAAY,GAAG;IAC5B,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,EAAE;CACZ,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ContactMenuProps } from "./state";
|
|
3
|
+
/**unit 下拉更多功能Menu*/
|
|
4
|
+
declare const ContactMenu: {
|
|
5
|
+
(props: ContactMenuProps): JSX.Element;
|
|
6
|
+
defaultProps: {
|
|
7
|
+
edit: boolean;
|
|
8
|
+
del: boolean;
|
|
9
|
+
move: boolean;
|
|
10
|
+
paste: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default ContactMenu;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Button, Dropdown, Menu } from "@voplus/antd";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { faClone, faCut, faEllipsisV, faExternalLink, faFolderTree, faLock, faPaste, faPrint, faTrashAlt, faUnlock } from "@fortawesome/pro-light-svg-icons";
|
|
5
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
6
|
+
import { FileStore } from "../../../data/FileStore";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import styles from "./index.less";
|
|
9
|
+
import { useLayout } from "@voplus/morpho-data";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
import { useUnitStore } from "../../../data";
|
|
12
|
+
/**unit 下拉更多功能Menu*/
|
|
13
|
+
const ContactMenu = (props) => {
|
|
14
|
+
const store = useUnitStore();
|
|
15
|
+
const [filestore] = useState(new FileStore());
|
|
16
|
+
const [state] = useState(new State(store, filestore));
|
|
17
|
+
state.layout = useLayout();
|
|
18
|
+
state.props = props;
|
|
19
|
+
const { edit, del, move, paste, open, shape, size, icon, lock, unlock, printPath } = props;
|
|
20
|
+
const menu = useObserver(() => (React.createElement(Menu, { className: styles["more-operate-dropdown"], onClick: (val) => state.moreOperate(val) },
|
|
21
|
+
edit && (React.createElement(Menu.Item, { key: "Edit" },
|
|
22
|
+
React.createElement(FAIcon, { icon: faClone, color: "#666", size: "sm" }),
|
|
23
|
+
React.createElement("span", { className: "type-name" }, "Edit"))),
|
|
24
|
+
move && (React.createElement(Menu.Item, { key: "Move" },
|
|
25
|
+
React.createElement(FAIcon, { icon: faCut, color: "#666", size: "sm" }),
|
|
26
|
+
React.createElement("span", { className: "type-name" }, "Move"))),
|
|
27
|
+
paste && (React.createElement(Menu.Item, { key: "Paste" },
|
|
28
|
+
React.createElement(FAIcon, { icon: faPaste, color: "#666", size: "sm" }),
|
|
29
|
+
React.createElement("span", { className: "type-name" }, "Paste"))),
|
|
30
|
+
lock && (React.createElement(Menu.Item, { key: "Lock" },
|
|
31
|
+
React.createElement(FAIcon, { icon: faLock, color: "#666", size: "sm" }),
|
|
32
|
+
React.createElement("span", { className: "type-name" }, "Lock"))),
|
|
33
|
+
unlock && (React.createElement(Menu.Item, { key: "Unlock" },
|
|
34
|
+
React.createElement(FAIcon, { icon: faUnlock, color: "#666", size: "sm" }),
|
|
35
|
+
React.createElement("span", { className: "type-name" }, "Unlock"))),
|
|
36
|
+
open && (React.createElement(Menu.Item, { key: "Open" },
|
|
37
|
+
React.createElement(FAIcon, { icon: faExternalLink, color: "#666", size: "sm" }),
|
|
38
|
+
React.createElement("span", { className: "type-name" }, "Open"))),
|
|
39
|
+
printPath && (React.createElement(Menu.Item, { key: "Print" },
|
|
40
|
+
React.createElement(FAIcon, { icon: faPrint, color: "#666", size: "sm" }),
|
|
41
|
+
React.createElement("span", { className: "type-name" }, "Print"))),
|
|
42
|
+
React.createElement(Menu.Item, { key: "OpenTreeView" },
|
|
43
|
+
React.createElement(FAIcon, { icon: faFolderTree, color: "#666", size: "sm" }),
|
|
44
|
+
React.createElement("span", { className: "type-name" }, "Open Tree View (Test)")),
|
|
45
|
+
del && (React.createElement(Menu.Item, { key: "Delete", className: "del-btn" },
|
|
46
|
+
React.createElement(FAIcon, { icon: faTrashAlt, color: "#f5222d", size: "sm" }),
|
|
47
|
+
React.createElement("span", { className: "type-name" }, "Delete"))))));
|
|
48
|
+
return useObserver(() => (React.createElement(Dropdown, { overlay: menu, placement: "bottomRight" }, shape ? (React.createElement(Button, { shape: "circle", size: size, onClick: e => e.stopPropagation() },
|
|
49
|
+
React.createElement(FAIcon, { size: "lg", icon: icon ? icon : faEllipsisV }))) : (React.createElement("span", { onClick: e => e.stopPropagation(), className: classnames(styles["more-operate"], props.className) },
|
|
50
|
+
React.createElement(FAIcon, { size: "lg", icon: icon ? icon : faEllipsisV }))))));
|
|
51
|
+
};
|
|
52
|
+
ContactMenu.defaultProps = {
|
|
53
|
+
edit: true,
|
|
54
|
+
del: true,
|
|
55
|
+
move: true,
|
|
56
|
+
paste: true
|
|
57
|
+
};
|
|
58
|
+
export default ContactMenu;
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/unit/controls/ToolBar/ContactMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAoB,KAAK,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACN,OAAO,EACP,KAAK,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAM,EACN,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,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,CACP,CACS,CACX,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG;IAC1B,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;CACX,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.more-operate-dropdown {
|
|
2
|
+
:global {
|
|
3
|
+
.type-name {
|
|
4
|
+
margin-left: 10px;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
}
|
|
7
|
+
.del-btn{
|
|
8
|
+
color: #f5222d;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
.more-operate {
|
|
13
|
+
// font-size: 24px;
|
|
14
|
+
padding: 0 5px;
|
|
15
|
+
vertical-align: middle;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
.more-operate-dropdown-icon{
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FileStore } from "../../../data/FileStore/FileContext";
|
|
2
|
+
import { UnitStore } from "../../../data";
|
|
3
|
+
export declare type ContactMenuProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
printPath?: string;
|
|
7
|
+
edit?: boolean;
|
|
8
|
+
del?: boolean;
|
|
9
|
+
move?: boolean;
|
|
10
|
+
paste?: boolean;
|
|
11
|
+
open?: boolean;
|
|
12
|
+
url?: string;
|
|
13
|
+
lock?: boolean;
|
|
14
|
+
unlock?: boolean;
|
|
15
|
+
shape?: boolean;
|
|
16
|
+
icon?: any;
|
|
17
|
+
size?: "middle" | "small" | "large";
|
|
18
|
+
deleteTitel?: string;
|
|
19
|
+
onEdit?: (params?: any) => void;
|
|
20
|
+
onDelete?: (params?: any) => void;
|
|
21
|
+
onMove?: () => void;
|
|
22
|
+
onPaste?: () => void;
|
|
23
|
+
onLock?: () => void;
|
|
24
|
+
onUnlock?: () => void;
|
|
25
|
+
};
|
|
26
|
+
export declare class State {
|
|
27
|
+
private _store;
|
|
28
|
+
private _filestore;
|
|
29
|
+
constructor(_store: UnitStore, _filestore: FileStore);
|
|
30
|
+
props: ContactMenuProps;
|
|
31
|
+
layout: any;
|
|
32
|
+
/** Menu item click */
|
|
33
|
+
moreOperate({ key, domEvent }: any): Promise<any>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Modal, message } from "@voplus/antd";
|
|
3
|
+
import { action, observable } from "mobx";
|
|
4
|
+
import Routes from "../../../../../routes";
|
|
5
|
+
export class State {
|
|
6
|
+
constructor(_store, _filestore) {
|
|
7
|
+
this._store = _store;
|
|
8
|
+
this._filestore = _filestore;
|
|
9
|
+
}
|
|
10
|
+
/** Menu item click */
|
|
11
|
+
async moreOperate({ key, domEvent }) {
|
|
12
|
+
domEvent.stopPropagation();
|
|
13
|
+
if (key === "Edit")
|
|
14
|
+
this.props.onEdit();
|
|
15
|
+
if (key === "Delete") {
|
|
16
|
+
Modal.confirm({
|
|
17
|
+
title: this.props.deleteTitel ? this.props.deleteTitel : "Do you want to delete this item?",
|
|
18
|
+
onOk: () => {
|
|
19
|
+
if (this.props.onDelete) {
|
|
20
|
+
return this.props.onDelete();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this._store.delete(this.props.id);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (key === "Move") {
|
|
29
|
+
this.props.onMove ? this.props.onMove() : this._filestore.onMove([this.props.id]);
|
|
30
|
+
}
|
|
31
|
+
if (key === "Paste") {
|
|
32
|
+
if (this.props.onPaste) {
|
|
33
|
+
this.props.onPaste();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (this._filestore.moveIds.some((id) => id === this.props.id)) {
|
|
37
|
+
return message.warn("Cannot move to itself");
|
|
38
|
+
}
|
|
39
|
+
this._filestore.onPaste(() => {
|
|
40
|
+
this._store.move(this._filestore.moveIds, this.props.id);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (key === "OpenTreeView" && this.props.id)
|
|
45
|
+
this.layout.history.push(Routes.UnitTree.getUrl(this.props.id));
|
|
46
|
+
if (key === "Open")
|
|
47
|
+
this.layout.history.push(this.props.url);
|
|
48
|
+
// if (key === "Lock") {
|
|
49
|
+
// this.props.onLock
|
|
50
|
+
// ? this.props.onLock()
|
|
51
|
+
// : this._store.edit(this.props.id!, { Status: "Readonly" });
|
|
52
|
+
// }
|
|
53
|
+
// if (key === "Unlock") {
|
|
54
|
+
// this.props.onUnlock
|
|
55
|
+
// ? this.props.onUnlock()
|
|
56
|
+
// : this._store.edit(this.props.id!, { Status: "Normal" });
|
|
57
|
+
// }
|
|
58
|
+
if (key === "Print")
|
|
59
|
+
window.open(window.location.protocol + "//" + window.location.host + `${this.props.printPath}`, "_blank");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
__decorate([
|
|
63
|
+
observable
|
|
64
|
+
], State.prototype, "props", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
observable
|
|
67
|
+
], State.prototype, "layout", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
action
|
|
70
|
+
], State.prototype, "moreOperate", null);
|
|
71
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../../src/modules/unit/controls/ToolBar/ContactMenu/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,MAAM,MAAM,uBAAuB,CAAC;AA2B3C,MAAM,OAAO,KAAK;IACjB,YAA2B,MAA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
|
4
|
+
(props: ToolBarProps): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
edit: boolean;
|
|
7
|
+
more: boolean;
|
|
8
|
+
shape: boolean;
|
|
9
|
+
size: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default ToolBar;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Button, Modal, Tooltip } from "@voplus/antd";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { State } from "./state";
|
|
4
|
+
import { faExpandAlt, faExternalLink, faPencilAlt, faPrint, faRedo, faTrashAlt } from "@fortawesome/pro-light-svg-icons";
|
|
5
|
+
import ContactMenu from "./ContactMenu";
|
|
6
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
7
|
+
import styles from "./index.less";
|
|
8
|
+
import { useLayout } from "@voplus/morpho-data";
|
|
9
|
+
import { useObserver } from "mobx-react-lite";
|
|
10
|
+
import { useUnit } from "../../data";
|
|
11
|
+
const ToolBar = (props) => {
|
|
12
|
+
const [state] = useState(new State());
|
|
13
|
+
const layout = useLayout();
|
|
14
|
+
const { id, path, url, expand, size, more, hoverEdit, hoverDel, reload, onEdit, onReLoad, onExpand } = props;
|
|
15
|
+
state.props = props;
|
|
16
|
+
state.contact = useUnit(props.id);
|
|
17
|
+
// state.parentDoc = useContact(state.contact.parentId!);
|
|
18
|
+
return useObserver(() => (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement("div", { className: styles["tool-bar"] },
|
|
20
|
+
reload && (React.createElement(Tooltip, { title: "Reload" },
|
|
21
|
+
React.createElement(Button, { size: size, shape: "circle", onClick: onReLoad },
|
|
22
|
+
React.createElement(FAIcon, { icon: faRedo })))),
|
|
23
|
+
expand && (React.createElement(Tooltip, { title: "Expand" },
|
|
24
|
+
React.createElement(Button, { size: size, shape: "circle", onClick: () => onExpand() },
|
|
25
|
+
React.createElement(FAIcon, { icon: faExpandAlt })))),
|
|
26
|
+
url && (React.createElement(Tooltip, { title: "Open a new page" },
|
|
27
|
+
React.createElement(Button, { size: size, shape: "circle", onClick: () => layout.history.push(url) },
|
|
28
|
+
React.createElement(FAIcon, { icon: faExternalLink })))),
|
|
29
|
+
hoverEdit && (React.createElement(Tooltip, { title: "Edit" },
|
|
30
|
+
React.createElement(Button, { size: size, shape: "circle", onClick: () => onEdit() },
|
|
31
|
+
React.createElement(FAIcon, { icon: faPencilAlt })))),
|
|
32
|
+
hoverDel && (React.createElement(Button, { type: "danger", size: size, shape: "circle", onClick: onDelete, className: "del-btn" },
|
|
33
|
+
React.createElement(FAIcon, { icon: faTrashAlt }))),
|
|
34
|
+
path && (React.createElement(Tooltip, { title: "Print" },
|
|
35
|
+
React.createElement(Button, { size: size, shape: "circle", onClick: () => window.open(window.location.origin + `/${path}`, "_blank") },
|
|
36
|
+
React.createElement(FAIcon, { icon: faPrint })))),
|
|
37
|
+
more && React.createElement(ContactMenu, Object.assign({}, props, { del: state.del, move: state.move, paste: state.paste }))))));
|
|
38
|
+
function onDelete() {
|
|
39
|
+
Modal.confirm({
|
|
40
|
+
title: "Do you want to delete this item?",
|
|
41
|
+
onOk() {
|
|
42
|
+
return props.onDelete();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
ToolBar.defaultProps = {
|
|
48
|
+
edit: false,
|
|
49
|
+
more: true,
|
|
50
|
+
shape: true,
|
|
51
|
+
size: "small"
|
|
52
|
+
};
|
|
53
|
+
export default ToolBar;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/ToolBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAA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AG,IAAI,IAAI,EAAE,EAAE,QAAQ,CAAC;oBAEzE,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,GAAI,CACjB,CACA,CACV;YACA,IAAI,IAAI,oBAAC,WAAW,oBAAK,KAAK,IAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,CACpF,CACU,CACjB,CAAC,CAAC;IAEH,SAAS,QAAQ;QAChB,KAAK,CAAC,OAAO,CAAC;YACb,KAAK,EAAE,kCAAkC;YACzC,IAAI;gBACH,OAAO,KAAK,CAAC,QAAS,EAAE,CAAC;YAC1B,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AACF,OAAO,CAAC,YAAY,GAAG;IACtB,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,OAAO;CACb,CAAC;AACF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.tool-bar {
|
|
2
|
+
:global {
|
|
3
|
+
.ant-btn {
|
|
4
|
+
margin-left: 5px;
|
|
5
|
+
}
|
|
6
|
+
.archive-btn {
|
|
7
|
+
background: #fff;
|
|
8
|
+
border-color: #faad14;
|
|
9
|
+
color: #faad14;
|
|
10
|
+
}
|
|
11
|
+
.archive-btn:active,
|
|
12
|
+
.archive-btn.active,
|
|
13
|
+
.archive-btn:hover {
|
|
14
|
+
background-color: #faad14;
|
|
15
|
+
color: #fff;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IUnit } from "../../data";
|
|
2
|
+
export declare type ToolBarProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
includes?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
hoverEdit?: boolean;
|
|
8
|
+
hoverDel?: boolean;
|
|
9
|
+
hoverOpen?: boolean;
|
|
10
|
+
edit?: boolean;
|
|
11
|
+
more?: boolean;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
expand?: boolean;
|
|
14
|
+
url?: string;
|
|
15
|
+
shape?: boolean;
|
|
16
|
+
reload?: boolean;
|
|
17
|
+
size?: "middle" | "small" | "large";
|
|
18
|
+
deleteTitel?: string;
|
|
19
|
+
onEdit?: (params?: any) => void;
|
|
20
|
+
onDelete?: (params?: any) => void;
|
|
21
|
+
onMove?: () => void;
|
|
22
|
+
onPaste?: () => void;
|
|
23
|
+
onOpen?: () => void;
|
|
24
|
+
onLock?: () => void;
|
|
25
|
+
onUnlock?: () => void;
|
|
26
|
+
onReLoad?: () => void;
|
|
27
|
+
onExpand?: () => void;
|
|
28
|
+
};
|
|
29
|
+
export declare class State {
|
|
30
|
+
props: ToolBarProps;
|
|
31
|
+
contact: IUnit;
|
|
32
|
+
parentDoc: IUnit;
|
|
33
|
+
permissionVisible: boolean;
|
|
34
|
+
versionsModalVisible: boolean;
|
|
35
|
+
publishlock: boolean;
|
|
36
|
+
publishVisible: boolean;
|
|
37
|
+
get del(): boolean;
|
|
38
|
+
get move(): boolean;
|
|
39
|
+
get paste(): boolean;
|
|
40
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { computed, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.permissionVisible = false;
|
|
6
|
+
this.versionsModalVisible = false;
|
|
7
|
+
this.publishlock = false;
|
|
8
|
+
this.publishVisible = false;
|
|
9
|
+
}
|
|
10
|
+
get del() {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
get move() {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
get paste() {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
observable
|
|
22
|
+
], State.prototype, "props", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
observable
|
|
25
|
+
], State.prototype, "contact", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
observable
|
|
28
|
+
], State.prototype, "parentDoc", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
observable
|
|
31
|
+
], State.prototype, "permissionVisible", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
observable
|
|
34
|
+
], State.prototype, "versionsModalVisible", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
observable
|
|
37
|
+
], State.prototype, "publishlock", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
observable
|
|
40
|
+
], State.prototype, "publishVisible", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
computed
|
|
43
|
+
], State.prototype, "del", null);
|
|
44
|
+
__decorate([
|
|
45
|
+
computed
|
|
46
|
+
], State.prototype, "move", null);
|
|
47
|
+
__decorate([
|
|
48
|
+
computed
|
|
49
|
+
], State.prototype, "paste", null);
|
|
50
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/ToolBar/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAyCpD,MAAM,OAAO,KAAK;IAAlB;QAIoB,sBAAiB,GAAG,KAAK,CAAC;QAC1B,yBAAoB,GAAG,KAAK,CAAC;QAC7B,gBAAW,GAAG,KAAK,CAAC;QACpB,mBAAc,GAAG,KAAK,CAAC;IAgB3C,CAAC;IAbA,IAAW,GAAG;QACb,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,IAAW,IAAI;QACd,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,IAAW,KAAK;QACf,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAtBY;IAAX,UAAU;oCAA4B;AAC3B;IAAX,UAAU;sCAAuB;AACtB;IAAX,UAAU;wCAAyB;AACxB;IAAX,UAAU;gDAAkC;AACjC;IAAX,UAAU;mDAAqC;AACpC;IAAX,UAAU;0CAA4B;AAC3B;IAAX,UAAU;6CAA+B;AAG1C;IADC,QAAQ;gCAGR;AAGD;IADC,QAAQ;iCAGR;AAGD;IADC,QAAQ;kCAGR"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
|
|
5
|
+
import { useObserver } from "mobx-react-lite";
|
|
6
|
+
const UnitTypeFilter = () => {
|
|
7
|
+
/** 引入父組件的 FilterOptionsContextState */
|
|
8
|
+
const context = useFilterOptionsContext();
|
|
9
|
+
/** 尝试从 context 取得 Type, 如果没有的话context会使用第二个factory参数创建一个State. */
|
|
10
|
+
const state = context.getFilterState("Type", () => new State());
|
|
11
|
+
return useObserver(() => (React.createElement("div", null,
|
|
12
|
+
React.createElement("div", { className: "menu-item-title" }, "Types"),
|
|
13
|
+
state.menus.map(item => (React.createElement("div", { key: item.value, className: classnames("filter-menu-item", {
|
|
14
|
+
bold: state.types.has(item.value)
|
|
15
|
+
}), onClick: () => state.changeType(item.value) },
|
|
16
|
+
React.createElement("div", { className: "filter-name" },
|
|
17
|
+
item.icon,
|
|
18
|
+
item.name)))))));
|
|
19
|
+
};
|
|
20
|
+
export default UnitTypeFilter;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/UnitTypeFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,cAAc,GAAG,GAAG,EAAE;IAC3B,uCAAuC;IACvC,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAE1C,kEAAkE;IAClE,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAEhE,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB;QACC,6BAAK,SAAS,EAAC,iBAAiB,YAAY;QAC3C,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACxB,6BACC,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;gBACzC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;aACjC,CAAC,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAE3C,6BAAK,SAAS,EAAC,aAAa;gBAC1B,IAAI,CAAC,IAAI;gBACT,IAAI,CAAC,IAAI,CACL,CACD,CACN,CAAC,CACG,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FilterOption } from "@voplus/morpho-data";
|
|
3
|
+
import { IFilterState } from "@voplus/morpho-ui/es/data";
|
|
4
|
+
/** TypeFilter的 State, 实现 IFilterState 接口 */
|
|
5
|
+
export declare class State implements IFilterState {
|
|
6
|
+
/** Types of unit of filter */
|
|
7
|
+
types: Map<string, boolean>;
|
|
8
|
+
/** Alter unit type */
|
|
9
|
+
changeType(value: string): void;
|
|
10
|
+
get menus(): {
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
icon: JSX.Element;
|
|
14
|
+
}[];
|
|
15
|
+
/** 视乎State内容,返回正确的FilterOption[]. 在Filter时,Context 会使用此属性replace Context内FilterOption的资料。 */
|
|
16
|
+
get filters(): FilterOption[];
|
|
17
|
+
reset(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, observable } from "mobx";
|
|
3
|
+
import { faSitemap, faUser, faUserCircle, faUsers } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import React from "react";
|
|
6
|
+
/** TypeFilter的 State, 实现 IFilterState 接口 */
|
|
7
|
+
export class State {
|
|
8
|
+
constructor() {
|
|
9
|
+
/** Types of unit of filter */
|
|
10
|
+
this.types = new Map();
|
|
11
|
+
}
|
|
12
|
+
/** Alter unit type */
|
|
13
|
+
changeType(value) {
|
|
14
|
+
this.types.has(value) ? this.types.delete(value) : this.types.set(value, true);
|
|
15
|
+
}
|
|
16
|
+
get menus() {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
name: "Account",
|
|
20
|
+
value: "Account",
|
|
21
|
+
icon: React.createElement(FAIcon, { icon: faUserCircle, color: "#fd7e14", className: "icon" })
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "Organization",
|
|
25
|
+
value: "Organization",
|
|
26
|
+
icon: React.createElement(FAIcon, { icon: faSitemap, color: "#ff4d4f", className: "icon" })
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "User",
|
|
30
|
+
value: "User",
|
|
31
|
+
icon: React.createElement(FAIcon, { icon: faUser, color: "#ff4d4f", className: "icon" })
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "Team",
|
|
35
|
+
value: "Team",
|
|
36
|
+
icon: React.createElement(FAIcon, { icon: faUsers, color: "#ff4d4f", className: "icon" })
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/** 视乎State内容,返回正确的FilterOption[]. 在Filter时,Context 会使用此属性replace Context内FilterOption的资料。 */
|
|
41
|
+
get filters() {
|
|
42
|
+
if (this.types.size === 0)
|
|
43
|
+
return [];
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
c: "Type",
|
|
47
|
+
o: "contains",
|
|
48
|
+
v1: JSON.stringify(Array.from(this.types.keys())),
|
|
49
|
+
l: "And"
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
reset() {
|
|
54
|
+
this.types.clear();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
__decorate([
|
|
58
|
+
observable
|
|
59
|
+
], State.prototype, "types", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
action
|
|
62
|
+
], State.prototype, "changeType", null);
|
|
63
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/UnitTypeFilter/state.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE7F,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,4CAA4C;AAC5C,MAAM,OAAO,KAAK;IAAlB;QACC,8BAA8B;QACX,UAAK,GAAyB,IAAI,GAAG,EAAE,CAAC;IAiD5D,CAAC;IA/CA,sBAAsB;IAEf,UAAU,CAAC,KAAa;QAC9B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KA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,CAAC;IACpB,CAAC;CACD;AAjDY;IAAX,UAAU;oCAAgD;AAI3D;IADC,MAAM;uCAGN"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, computed } from "mobx";
|
|
3
|
+
import { message } from "@voplus/antd";
|
|
4
|
+
export class FileStore {
|
|
5
|
+
get moveIds() {
|
|
6
|
+
const moveIds = sessionStorage.getItem("moveIds");
|
|
7
|
+
return moveIds ? JSON.parse(moveIds) : [];
|
|
8
|
+
}
|
|
9
|
+
onMove(ids) {
|
|
10
|
+
const moveIds = ids;
|
|
11
|
+
if (!moveIds.length)
|
|
12
|
+
return message.warning("nothing to cut");
|
|
13
|
+
window.sessionStorage.setItem("moveIds", JSON.stringify(moveIds));
|
|
14
|
+
return message.success("Replicating Success");
|
|
15
|
+
}
|
|
16
|
+
onPaste(loader) {
|
|
17
|
+
if (this.moveIds.length) {
|
|
18
|
+
loader();
|
|
19
|
+
this.clear();
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
message.warning("nothing to cut");
|
|
23
|
+
}
|
|
24
|
+
clear() {
|
|
25
|
+
window.sessionStorage.clear();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
__decorate([
|
|
29
|
+
computed
|
|
30
|
+
], FileStore.prototype, "moveIds", null);
|
|
31
|
+
__decorate([
|
|
32
|
+
action
|
|
33
|
+
], FileStore.prototype, "onMove", null);
|
|
34
|
+
__decorate([
|
|
35
|
+
action
|
|
36
|
+
], FileStore.prototype, "onPaste", null);
|
|
37
|
+
__decorate([
|
|
38
|
+
action
|
|
39
|
+
], FileStore.prototype, "clear", null);
|
|
40
|
+
//# sourceMappingURL=FileContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileContext.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/FileStore/FileContext.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,SAAS;IAErB,IAAI,OAAO;QACV,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAClD,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,GAAa;QAC1B,MAAM,OAAO,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC9D,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAClE,OAAO,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC/C,CAAC;IAEM,OAAO,CAAC,MAAkB;QAChC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACxB,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,EAAE,CAAC;SACb;;YAAM,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,CAAC;IAEM,KAAK;QACX,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACD;AAtBA;IADC,QAAQ;wCAIR;AAED;IADC,MAAM;uCAMN;AAED;IADC,MAAM;wCAMN;AAED;IADC,MAAM;sCAGN"}
|