@voplus/morpho-document 1.0.0-dev214 → 1.0.0-dev215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +7 -0
- package/es/components/AddDocDropdown/index.js +12 -1
- package/es/components/AddDocDropdown/index.js.map +1 -1
- package/es/components/AddDocDropdown/state.js +7 -1
- 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 +29 -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 +5 -8
- package/es/components/DocumentList/state.js +21 -38
- 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 +31 -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/NewDocumentForm/index.d.ts +1 -1
- package/es/components/NewDocumentForm/index.js +3 -1
- package/es/components/NewDocumentForm/index.js.map +1 -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/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/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 +77 -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 +17 -0
- package/es/modules/unit/components/SubUnitList/state.js +41 -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 +4 -3
- 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 +35 -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 +27 -0
- package/es/modules/unit/components/UnitTabs/index.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 +1 -5
- 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/ContactStore.d.ts +82 -0
- package/es/modules/unit/data/ContactStore.js +140 -0
- package/es/modules/unit/data/ContactStore.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/hooks.d.ts +24 -0
- package/es/modules/unit/data/hooks.js +65 -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/IContact.d.ts +45 -0
- package/es/modules/unit/data/interfaces/IContact.js +1 -0
- package/es/modules/unit/data/interfaces/IContact.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/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
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FileContext";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/FileStore/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/StoreContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAU,EAAE,MAAe,EAAE,EAAE,CAC1D,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react-addons-transition-group" />
|
|
3
|
+
/// <reference types="react-addons-css-transition-group" />
|
|
4
|
+
export declare class UnitContextState {
|
|
5
|
+
onUnitSelected?: (params?: any) => void;
|
|
6
|
+
/** Construct a new UnitContextState
|
|
7
|
+
* @param options - Optional initial Unit options values.
|
|
8
|
+
*/
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
onUnitSelected?: (params?: any) => void;
|
|
11
|
+
});
|
|
12
|
+
/** Retrieve a clean OptionsObject */
|
|
13
|
+
get options(): {
|
|
14
|
+
UnitSelected: ((params?: any) => void) | undefined;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** React context for ContextState. */
|
|
18
|
+
export declare const UnitContext: import("react").Context<UnitContextState>;
|
|
19
|
+
/** React hook to retrieve the nearest ContextState. */
|
|
20
|
+
export declare function useUnitContext(): UnitContextState;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { computed, observable, toJS } from "mobx";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
export class UnitContextState {
|
|
5
|
+
/** Construct a new UnitContextState
|
|
6
|
+
* @param options - Optional initial Unit options values.
|
|
7
|
+
*/
|
|
8
|
+
constructor(options) {
|
|
9
|
+
if (options) {
|
|
10
|
+
this.onUnitSelected = options.onUnitSelected;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Retrieve a clean OptionsObject */
|
|
14
|
+
get options() {
|
|
15
|
+
return {
|
|
16
|
+
UnitSelected: toJS(this.onUnitSelected)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
observable
|
|
22
|
+
], UnitContextState.prototype, "onUnitSelected", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
computed
|
|
25
|
+
], UnitContextState.prototype, "options", null);
|
|
26
|
+
/** React context for ContextState. */
|
|
27
|
+
export const UnitContext = createContext(null);
|
|
28
|
+
/** React hook to retrieve the nearest ContextState. */
|
|
29
|
+
export function useUnitContext() {
|
|
30
|
+
return useContext(UnitContext);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/UnitContext/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,OAAO,gBAAgB;IAG5B;;OAEG;IACH,YAAmB,OAAqD;QACvE,IAAI,OAAO,EAAE;YACZ,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;SAC7C;IACF,CAAC;IAED,qCAAqC;IAErC,IAAW,OAAO;QACjB,OAAO;YACN,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;SACvC,CAAC;IACH,CAAC;CACD;AAlBY;IAAX,UAAU;wDAAgD;AAa3D;IADC,QAAQ;+CAKR;AAGF,sCAAsC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAmB,IAAW,CAAC,CAAC;AAExE,uDAAuD;AACvD,MAAM,UAAU,cAAc;IAC7B,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IContact, LoadContactListOptions, LoadContactOptions } from ".";
|
|
2
|
+
import { IActivityLog } from "@voplus/morpho-collaboration/es/data/interfaces/IActivityLog";
|
|
3
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
4
|
+
/** React hook to retrieve a contact
|
|
5
|
+
* @param {string} id - id of the task
|
|
6
|
+
* @param {LoadContactOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export declare const useContact: (id: string, options?: LoadContactOptions | undefined) => IContact;
|
|
9
|
+
/** React hook to retrieve a contact or return a default empty contact if id is empty.
|
|
10
|
+
* @param {string} id - id of the task
|
|
11
|
+
* @param {LoadContactOptions} options - options
|
|
12
|
+
*/
|
|
13
|
+
export declare const useContactOrDefault: (id?: string | undefined, options?: LoadContactOptions | undefined) => IContact;
|
|
14
|
+
/** React hook to retrieve a list of tasks
|
|
15
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
16
|
+
* @param options - Optional task list loading options.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useContactListEffect: (list: ListDataContextState<IContact> | null, effect: (list: IContact[]) => void, options?: LoadContactListOptions | undefined) => void;
|
|
19
|
+
/** React hook to retrieve a list of activities of a contact.
|
|
20
|
+
* @param id - the id of the contact.
|
|
21
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
22
|
+
* @param options - Optional task list loading options.
|
|
23
|
+
*/
|
|
24
|
+
export declare const useContactActivityListEffect: (id: string, effect: (list: IActivityLog[]) => void, options?: LoadContactListOptions | undefined) => void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useContactStore } from ".";
|
|
2
|
+
import { useCountedMapListEffect, useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
3
|
+
import { useDeepDepEffect } from "@voplus/morpho-data";
|
|
4
|
+
/** React hook to retrieve a contact
|
|
5
|
+
* @param {string} id - id of the task
|
|
6
|
+
* @param {LoadContactOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export const useContact = (id, options) => {
|
|
9
|
+
options = options ? options : {};
|
|
10
|
+
const store = useContactStore();
|
|
11
|
+
return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
|
|
12
|
+
};
|
|
13
|
+
/** React hook to retrieve a contact or return a default empty contact if id is empty.
|
|
14
|
+
* @param {string} id - id of the task
|
|
15
|
+
* @param {LoadContactOptions} options - options
|
|
16
|
+
*/
|
|
17
|
+
export const useContactOrDefault = (id, options) => {
|
|
18
|
+
options = options ? options : {};
|
|
19
|
+
const store = useContactStore();
|
|
20
|
+
const item = useLoadCountedMapItem(id ? id : "empty_id", store.items, id ? () => store.load(id, options) : () => Promise.resolve({}), options);
|
|
21
|
+
// delete the id if original id passed in is empty.
|
|
22
|
+
if (!id) {
|
|
23
|
+
delete item["id"];
|
|
24
|
+
}
|
|
25
|
+
return item;
|
|
26
|
+
};
|
|
27
|
+
/** React hook to retrieve a list of tasks
|
|
28
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
29
|
+
* @param options - Optional task list loading options.
|
|
30
|
+
*/
|
|
31
|
+
export const useContactListEffect = (list, effect, options) => {
|
|
32
|
+
const deps = options ? options : {};
|
|
33
|
+
const contacts = useContactStore();
|
|
34
|
+
// Call useContactListEffect and ensure won't load twice for same loading options.
|
|
35
|
+
// return useCountedMapListEffect(list, effect, contacts.items, () => contacts.loadList(options), [deps]);
|
|
36
|
+
return useCountedMapListEffect(effect ? innerEffect : effect, contacts.items, () => contacts.loadList(options), [deps], {
|
|
37
|
+
preload: () => {
|
|
38
|
+
if (list)
|
|
39
|
+
list.loading = true;
|
|
40
|
+
},
|
|
41
|
+
postload: () => {
|
|
42
|
+
if (list)
|
|
43
|
+
list.loading = false;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
function innerEffect(result) {
|
|
47
|
+
if (list && result.length < list.filters.paging.PageSize)
|
|
48
|
+
list.hasMore = false;
|
|
49
|
+
effect(result);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/** React hook to retrieve a list of activities of a contact.
|
|
53
|
+
* @param id - the id of the contact.
|
|
54
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
55
|
+
* @param options - Optional task list loading options.
|
|
56
|
+
*/
|
|
57
|
+
export const useContactActivityListEffect = (id, effect, options) => {
|
|
58
|
+
const deps = options ? options : {};
|
|
59
|
+
const store = useContactStore();
|
|
60
|
+
// Call useDeepDepEffect directly because returned links do not need to be stored in counted map.
|
|
61
|
+
useDeepDepEffect(() => {
|
|
62
|
+
store.loadContactActivityList(id, options).then(effect);
|
|
63
|
+
}, [deps]);
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/modules/unit/data/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,eAAe,EAAE,MAAM,GAAG,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,OAA4B,EAAE,EAAE;IACtE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAAyB,CAAC;IACzD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,OAAO,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAW,EAAE,OAA4B,EAAE,EAAE;IAChF,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAAyB,CAAC;IACzD,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,MAAM,IAAI,GAAG,qBAAqB,CACjC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EACpB,KAAK,CAAC,KAAK,EACX,EAAE,CAAC,CAAC,CAAC,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AM,CAAC,MAAM,4BAA4B,GAAG,CAC3C,EAAU,EACV,MAAsC,EACtC,OAAgC,EAC/B,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA6B,CAAC;IAChE,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,iGAAiG;IACjG,gBAAgB,CAAC,GAAG,EAAE;QACrB,KAAK,CAAC,uBAAuB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/unit/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IAddress {
|
|
2
|
+
/** Address line 1 */
|
|
3
|
+
line1: string;
|
|
4
|
+
/** Address line 2 */
|
|
5
|
+
line2?: string;
|
|
6
|
+
/** City of the address*/
|
|
7
|
+
city?: string;
|
|
8
|
+
/** Province/State of the address */
|
|
9
|
+
state?: string;
|
|
10
|
+
/** Postal code of the address */
|
|
11
|
+
postalCode?: string;
|
|
12
|
+
/** Country of the address */
|
|
13
|
+
country: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=IAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAddress.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/interfaces/IAddress.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IAddress } from "./IAddress";
|
|
2
|
+
import { ILoadable } from "@voplus/morpho-data";
|
|
3
|
+
export interface ILegalIdentities {
|
|
4
|
+
/** Number of the identity document. */
|
|
5
|
+
number: string;
|
|
6
|
+
/** Name appear on the legal identity.*/
|
|
7
|
+
name: string;
|
|
8
|
+
/** Type of the legal identity */
|
|
9
|
+
type: "IdentityCard" | "Passport" | "BusinessRegistrationNo";
|
|
10
|
+
/** Country issued the identity */
|
|
11
|
+
country: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IContact extends ILoadable {
|
|
14
|
+
/** Id of the contact */
|
|
15
|
+
id: string;
|
|
16
|
+
/** containerId of the contact */
|
|
17
|
+
containerId: string;
|
|
18
|
+
/** Name of the contact */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Whether the contact is a group or not. */
|
|
21
|
+
isGroup?: boolean;
|
|
22
|
+
/** Email of the contact. */
|
|
23
|
+
email?: string;
|
|
24
|
+
/** Phone of the contact. */
|
|
25
|
+
phone?: string;
|
|
26
|
+
/** Nationality of the contact */
|
|
27
|
+
nationality?: string;
|
|
28
|
+
/** Birthday of the contact */
|
|
29
|
+
birthday?: Date;
|
|
30
|
+
/** Gender of the contact */
|
|
31
|
+
gender?: "Male" | "Female";
|
|
32
|
+
/** Address of the contact. */
|
|
33
|
+
address: IAddress;
|
|
34
|
+
/** Site of the contact. */
|
|
35
|
+
site?: string;
|
|
36
|
+
/** Primary legal identity of the contact if has. */
|
|
37
|
+
primaryLegalIdentity: ILegalIdentities;
|
|
38
|
+
/** Type of the contact. */
|
|
39
|
+
type: string;
|
|
40
|
+
/** path of the contact */
|
|
41
|
+
path?: {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=IContact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IContact.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/interfaces/IContact.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=IEntityName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEntityName.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/interfaces/IEntityName.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/interfaces/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { useLayout, useTabItem } from "@voplus/morpho-data";
|
|
3
|
+
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
4
|
+
import BreadCrumbsHeader from "../../components/BreadCrumbsHeader";
|
|
5
|
+
import UnitDetails from "../../components/UnitDetails";
|
|
6
|
+
import UnitHead from "../../components/UnitHead";
|
|
7
|
+
import UnitTabs from "../../components/UnitTabs";
|
|
8
|
+
import styles from "./index.less";
|
|
9
|
+
import { useContact } from "../../data";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
import { useRouteMatch } from "react-router";
|
|
12
|
+
const UnitDefaultView = () => {
|
|
13
|
+
const [asideContext] = useState(AsideContent.createContext());
|
|
14
|
+
const match = useRouteMatch();
|
|
15
|
+
const id = match.params.id;
|
|
16
|
+
const [loaded, setLoaded] = useState(true);
|
|
17
|
+
const task = useContact(id);
|
|
18
|
+
const layout = useLayout();
|
|
19
|
+
const tab = useTabItem();
|
|
20
|
+
tab.title = task.name;
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
asideContext.openAside(AsideElement, { span: 12 });
|
|
23
|
+
}, []);
|
|
24
|
+
const AsideElement = (React.createElement("div", { className: "module-tab-view_aside" },
|
|
25
|
+
React.createElement(UnitTabs, { id: id })));
|
|
26
|
+
return useObserver(() => (React.createElement("div", { className: "module-tab-view" },
|
|
27
|
+
React.createElement("div", { className: styles["breadcrumb-header"] },
|
|
28
|
+
React.createElement(BreadCrumbsHeader, { id: id, onBreadCrumb: toPath })),
|
|
29
|
+
React.createElement(AsideContent, { context: asideContext },
|
|
30
|
+
React.createElement("div", { className: styles["unit-default-view"] }, loaded && (React.createElement("div", { className: "unit-default-details" },
|
|
31
|
+
React.createElement(UnitHead, { id: id, onReload: onReload, onExpand: () => asideContext.asideContent
|
|
32
|
+
? asideContext.closeAside()
|
|
33
|
+
: asideContext.openAside(AsideElement, { span: 12 }) }),
|
|
34
|
+
React.createElement(UnitDetails, { id: id }))))))));
|
|
35
|
+
function toPath(id) {
|
|
36
|
+
layout.history.push(`/units/${id}`);
|
|
37
|
+
}
|
|
38
|
+
/** reload data */
|
|
39
|
+
function onReload() {
|
|
40
|
+
setLoaded(false);
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
setLoaded(true);
|
|
43
|
+
}, 100);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export default UnitDefaultView;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/pages/UnitDefaultView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,E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AE,QAAQ,EAClB,QAAQ,EAAE,GAAG,EAAE,CACd,YAAY,CAAC,YAAY;wBACxB,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE;wBAC3B,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAErD;gBACF,oBAAC,WAAW,IAAC,EAAE,EAAE,EAAE,GAAI,CAClB,CACN,CACI,CACQ,CACV,CACN,CAAC,CAAC;IAEH,SAAS,MAAM,CAAC,EAAU;QACzB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,kBAAkB;IAClB,SAAS,QAAQ;QAChB,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,UAAU,CAAC,GAAG,EAAE;YACf,SAAS,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,EAAE,GAAG,CAAC,CAAC;IACT,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.unit-default-view {
|
|
2
|
+
height: 100%;
|
|
3
|
+
background: #ffffff;
|
|
4
|
+
:global {
|
|
5
|
+
.unit-default-details {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.breadcrumb-header {
|
|
14
|
+
background: #fff;
|
|
15
|
+
padding: 5px 20px;
|
|
16
|
+
border-bottom: 1px solid #d9d9d9;
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import UnitList from "../../components/UnitList";
|
|
3
|
+
import { useTabItem } from "@voplus/morpho-data";
|
|
4
|
+
const UnitListView = () => {
|
|
5
|
+
const tab = useTabItem();
|
|
6
|
+
tab.title = "Unit";
|
|
7
|
+
return React.createElement(UnitList, null);
|
|
8
|
+
};
|
|
9
|
+
export default UnitListView;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/pages/UnitListView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,YAAY,GAAG,GAAG,EAAE;IACzB,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC;IAEnB,OAAO,oBAAC,QAAQ,OAAG,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
4
|
+
import BreadCrumbsHeader from "../../components/BreadCrumbsHeader";
|
|
5
|
+
import ListHeader from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeader";
|
|
6
|
+
import { State } from "./state";
|
|
7
|
+
import UnitPropertiesView from "../../components/UnitPropertiesView";
|
|
8
|
+
import UnitSortableTree from "../../components/UnitSortableTree";
|
|
9
|
+
import UnitTypeFilter from "../../controls/UnitTypeFilter";
|
|
10
|
+
import styles from "./index.less";
|
|
11
|
+
import { useLayout } from "@voplus/morpho-data";
|
|
12
|
+
import { useObserver } from "mobx-react-lite";
|
|
13
|
+
import { useRouteMatch } from "react-router";
|
|
14
|
+
const UnitTreeView = () => {
|
|
15
|
+
const match = useRouteMatch();
|
|
16
|
+
const [asideContext] = useState(AsideContent.createContext());
|
|
17
|
+
const id = match.params.id;
|
|
18
|
+
const layout = useLayout();
|
|
19
|
+
const [state] = useState(new State());
|
|
20
|
+
/** 建立 ListView 和useTaskListEffect所需的ListDataState. 会根据parentId重建所以不需reset. */
|
|
21
|
+
const list = useCreateListDataState({}, []);
|
|
22
|
+
return useObserver(() => (React.createElement("div", { className: styles["tree-view"] },
|
|
23
|
+
React.createElement(ListDataContext.Provider, { value: list },
|
|
24
|
+
React.createElement(ListHeader, { header: React.createElement(BreadCrumbsHeader, { id: id, onBreadCrumb: toPath }), filterViewProps: {
|
|
25
|
+
columns: [React.createElement(UnitTypeFilter, { key: "unitTypeFilter" })],
|
|
26
|
+
/** story 顯示值用, 組件如無必要,不需提供onFilter, ListView2會自動呼叫filter. */
|
|
27
|
+
onFilter: c => {
|
|
28
|
+
var _a;
|
|
29
|
+
c.filter();
|
|
30
|
+
state.filterType = (_a = c === null || c === void 0 ? void 0 : c.options.Filters) === null || _a === void 0 ? void 0 : _a.filter(item => item.c === "Type")[0];
|
|
31
|
+
},
|
|
32
|
+
onReset: c => {
|
|
33
|
+
c.reset();
|
|
34
|
+
state.filterType = undefined;
|
|
35
|
+
}
|
|
36
|
+
}, sortable: false, addAble: false })),
|
|
37
|
+
React.createElement(AsideContent, { context: asideContext },
|
|
38
|
+
React.createElement(UnitSortableTree, { id: id, filterType: state.filterType, onUnitSelected: onUnitSelected })))));
|
|
39
|
+
function toPath(id) {
|
|
40
|
+
layout.history.push(`/unit-tree/${id}`);
|
|
41
|
+
}
|
|
42
|
+
function onUnitSelected(id) {
|
|
43
|
+
asideContext.openAside(React.createElement(UnitPropertiesView, { id: id }), { span: 12 });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export default UnitTreeView;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/pages/UnitTreeView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAA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-header {
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 10px 20px;
|
|
11
|
+
border-bottom: 1px solid #f2f2f2;
|
|
12
|
+
.view-title {
|
|
13
|
+
color: #000;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
}
|
|
17
|
+
.plus-icon {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
padding: 4px;
|
|
20
|
+
margin-left: 10px;
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
line-height: 1px;
|
|
23
|
+
background: #1abc9c;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
.margin-left-10 {
|
|
27
|
+
margin-left: 10px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.types = [];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
__decorate([
|
|
9
|
+
observable
|
|
10
|
+
], State.prototype, "types", void 0);
|
|
11
|
+
__decorate([
|
|
12
|
+
observable
|
|
13
|
+
], State.prototype, "filterType", void 0);
|
|
14
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/pages/UnitTreeView/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,OAAO,KAAK;IAAlB;QACoB,UAAK,GAAa,EAAE,CAAC;IAEzC,CAAC;CAAA;AAFY;IAAX,UAAU;oCAA6B;AAC5B;IAAX,UAAU;yCAA6C"}
|
|
@@ -1,37 +1,44 @@
|
|
|
1
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
1
2
|
import React, { useState } from "react";
|
|
2
3
|
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
3
|
-
import
|
|
4
|
+
import BreadCrumbsHeader from "../../components/BreadCrumbsHeader";
|
|
4
5
|
import DocumentSortableTree from "../../components/DocumentSortableTree";
|
|
6
|
+
import { DocumentTypeFilter } from "../../controls/filters";
|
|
7
|
+
import ListHeader from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeader";
|
|
5
8
|
import PropertiesView from "../../components/PropertiesView";
|
|
6
|
-
import
|
|
9
|
+
import { State } from "./state";
|
|
7
10
|
import styles from "./index.less";
|
|
8
|
-
import { useDocument } from "../../data";
|
|
9
11
|
import { useLayout } from "@voplus/morpho-data";
|
|
10
12
|
import { useObserver } from "mobx-react-lite";
|
|
11
13
|
import { useRouteMatch } from "react-router";
|
|
12
|
-
// import DocumentTypeFilter from "../../controls/DocumentTypeFilter";
|
|
13
14
|
const TreeViewPage = () => {
|
|
14
15
|
const match = useRouteMatch();
|
|
15
16
|
const [asideContext] = useState(AsideContent.createContext());
|
|
16
17
|
const id = match.params.id;
|
|
17
18
|
const layout = useLayout();
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
const [state] = useState(new State());
|
|
20
|
+
/** 建立 ListView 和useTaskListEffect所需的ListDataState. 会根据parentId重建所以不需reset. */
|
|
21
|
+
const list = useCreateListDataState({}, []);
|
|
22
|
+
return useObserver(() => (React.createElement("div", { className: styles["tree-view"] },
|
|
23
|
+
React.createElement(ListDataContext.Provider, { value: list },
|
|
24
|
+
React.createElement(ListHeader, { header: React.createElement(BreadCrumbsHeader, { id: id, onBreadCrumb: toPath }), filterViewProps: {
|
|
25
|
+
columns: [React.createElement(DocumentTypeFilter, { key: "DocumentTypeFilter" })],
|
|
26
|
+
/** story 顯示值用, 組件如無必要,不需提供onFilter, ListView2會自動呼叫filter. */
|
|
27
|
+
onFilter: c => {
|
|
28
|
+
var _a;
|
|
29
|
+
c.filter();
|
|
30
|
+
state.filterType = (_a = c === null || c === void 0 ? void 0 : c.options.Filters) === null || _a === void 0 ? void 0 : _a.filter(item => item.c === "Type")[0];
|
|
31
|
+
},
|
|
32
|
+
onReset: c => {
|
|
33
|
+
c.reset();
|
|
34
|
+
state.filterType = undefined;
|
|
35
|
+
}
|
|
36
|
+
}, sortable: false, addAble: false })),
|
|
33
37
|
React.createElement(AsideContent, { context: asideContext },
|
|
34
|
-
React.createElement(DocumentSortableTree, { id: match.params.id, onDocumentSelected: onDocumentSelected })))));
|
|
38
|
+
React.createElement(DocumentSortableTree, { id: match.params.id, filterType: state.filterType, onDocumentSelected: onDocumentSelected })))));
|
|
39
|
+
function toPath(id) {
|
|
40
|
+
layout.history.push(`/tree-view/${id}`);
|
|
41
|
+
}
|
|
35
42
|
function onDocumentSelected(id) {
|
|
36
43
|
asideContext.openAside(React.createElement(PropertiesView, { id: id }), { span: 12 });
|
|
37
44
|
}
|