@voplus/morpho-document 1.0.0-dev212 → 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/Modules.js +4 -3
- package/es/Modules.js.map +1 -1
- package/es/components/ActivityLog/index.js +11 -4
- package/es/components/ActivityLog/index.js.map +1 -1
- 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/CreateDateFilter/index.d.ts +3 -0
- package/es/controls/filters/CreateDateFilter/index.js +24 -0
- package/es/controls/filters/CreateDateFilter/index.js.map +1 -0
- package/es/controls/filters/CreateDateFilter/state.d.ts +12 -0
- package/es/controls/filters/CreateDateFilter/state.js +33 -0
- package/es/controls/filters/CreateDateFilter/state.js.map +1 -0
- package/es/controls/filters/DocumentStatusFilter/index.d.ts +3 -0
- package/es/controls/filters/DocumentStatusFilter/index.js +23 -0
- package/es/controls/filters/DocumentStatusFilter/index.js.map +1 -0
- package/es/controls/filters/DocumentStatusFilter/state.d.ts +18 -0
- package/es/controls/filters/DocumentStatusFilter/state.js +43 -0
- package/es/controls/filters/DocumentStatusFilter/state.js.map +1 -0
- 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/FlagFilter/index.d.ts +3 -0
- package/es/controls/filters/FlagFilter/index.js +21 -0
- package/es/controls/filters/FlagFilter/index.js.map +1 -0
- package/es/controls/filters/FlagFilter/state.d.ts +18 -0
- package/es/controls/filters/FlagFilter/state.js +54 -0
- package/es/controls/filters/FlagFilter/state.js.map +1 -0
- package/es/controls/filters/index.d.ts +4 -0
- package/es/controls/filters/index.js +5 -0
- package/es/controls/filters/index.js.map +1 -0
- package/es/data/DocumentStore/DocumentStore.d.ts +10 -0
- package/es/data/DocumentStore/DocumentStore.js +8 -0
- package/es/data/DocumentStore/DocumentStore.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/interfaces/IShortcut.d.ts +8 -0
- package/es/data/interfaces/IShortcut.js +1 -0
- package/es/data/interfaces/IShortcut.js.map +1 -0
- package/es/data/interfaces/index.d.ts +1 -0
- package/es/data/{metas.d.ts → metas/FileTypeMeta.d.ts} +2 -2
- package/es/data/{metas.js → metas/FileTypeMeta.js} +4 -4
- package/es/data/metas/FileTypeMeta.js.map +1 -0
- package/es/data/metas/ShortcutMeta.d.ts +14 -0
- package/es/data/metas/ShortcutMeta.js +30 -0
- package/es/data/metas/ShortcutMeta.js.map +1 -0
- package/es/data/metas/index.d.ts +2 -0
- package/es/data/metas/index.js +3 -0
- package/es/data/metas/index.js.map +1 -0
- 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 +5 -3
- package/es/controls/DocumentTypeFilter/index.js +0 -54
- package/es/controls/DocumentTypeFilter/index.js.map +0 -1
- package/es/data/metas.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,24 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.birthdayEdit = false;
|
|
6
|
+
this.addressEdit = false;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
__decorate([
|
|
10
|
+
observable
|
|
11
|
+
], State.prototype, "id", void 0);
|
|
12
|
+
__decorate([
|
|
13
|
+
observable
|
|
14
|
+
], State.prototype, "contact", void 0);
|
|
15
|
+
__decorate([
|
|
16
|
+
observable
|
|
17
|
+
], State.prototype, "birthday", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
observable
|
|
20
|
+
], State.prototype, "birthdayEdit", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
observable
|
|
23
|
+
], State.prototype, "addressEdit", void 0);
|
|
24
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitDetails/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAoB,UAAU,EAAE,MAAM,MAAM,CAAC;AAIpD,MAAM,OAAO,KAAK;IAAlB;QAIoB,iBAAY,GAAG,KAAK,CAAC;QACrB,gBAAW,GAAG,KAAK,CAAC;IACxC,CAAC;CAAA;AALY;IAAX,UAAU;iCAAmB;AAClB;IAAX,UAAU;sCAA0B;AACzB;IAAX,UAAU;uCAAsB;AACrB;IAAX,UAAU;2CAA6B;AAC5B;IAAX,UAAU;0CAA4B"}
|
|
@@ -1,14 +1,38 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useContact, useContactStore } from "../../data";
|
|
3
|
+
import { InlineEdit } from "@voplus/morpho-ui";
|
|
4
|
+
import { Skeleton } from "@voplus/antd";
|
|
5
|
+
import { State } from "./state";
|
|
6
|
+
import ToolBar from "../../controls/ToolBar";
|
|
2
7
|
import UnitAvatar from "../UnitAvatar";
|
|
8
|
+
import classnames from "classnames";
|
|
3
9
|
import styles from "./index.less";
|
|
4
|
-
import {
|
|
10
|
+
import { useAsideContentContext } from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
|
5
11
|
import { useObserver } from "mobx-react-lite";
|
|
6
12
|
const UnitHead = (props) => {
|
|
7
|
-
const { id } = props;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
const { id, onExpand, onReload } = props;
|
|
14
|
+
const [state] = useState(new State());
|
|
15
|
+
const store = useContactStore();
|
|
16
|
+
const asideContext = useAsideContentContext();
|
|
17
|
+
state.contact = useContact(id, { reload: true });
|
|
18
|
+
return useObserver(() => (React.createElement("div", { className: styles["unit-head"] }, state.contact.loading ? (React.createElement(Skeleton, { active: true })) : (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement("div", { className: "tool-bar-content" },
|
|
20
|
+
React.createElement(ToolBar, { id: id, reload: true, url: onExpand ? "" : `/units/${id}`, expand: !!onExpand, onDelete: onItemDelete, onReLoad: onReload, onExpand: onExpand })),
|
|
21
|
+
React.createElement(UnitAvatar, { id: id, size: 70 }),
|
|
22
|
+
React.createElement("div", { className: "unit-name" },
|
|
23
|
+
React.createElement(InlineEdit, { defaultValue: state.contact.name, content: v => React.createElement("div", { className: classnames("inline-edit") }, v.store.value), onSave: value => save(value, state.contact.name, { Name: value }) })),
|
|
24
|
+
React.createElement("div", null, state.contact.type))))));
|
|
25
|
+
/** edit save */
|
|
26
|
+
function save(v, name, params) {
|
|
27
|
+
if (v.trim() === name)
|
|
28
|
+
return;
|
|
29
|
+
store.edit(state.contact.id, params);
|
|
30
|
+
}
|
|
31
|
+
/**delete contact*/
|
|
32
|
+
async function onItemDelete() {
|
|
33
|
+
await store.delete(id);
|
|
34
|
+
asideContext.closeAside();
|
|
35
|
+
}
|
|
12
36
|
};
|
|
13
37
|
export default UnitHead;
|
|
14
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitHead/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/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unit-head {
|
|
2
2
|
text-align: center;
|
|
3
|
+
padding: 10px 0;
|
|
4
|
+
margin: 0 20px;
|
|
3
5
|
:global {
|
|
6
|
+
.tool-bar-content{
|
|
7
|
+
text-align: right;
|
|
8
|
+
}
|
|
9
|
+
// .unit-name {
|
|
10
|
+
// color: #000;
|
|
11
|
+
// font-size: 16px;
|
|
12
|
+
// font-weight: 500;
|
|
13
|
+
// margin-top: 12px;
|
|
14
|
+
// }
|
|
4
15
|
.unit-name {
|
|
5
16
|
color: #000;
|
|
6
|
-
font-size:
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
margin-top: 12px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
&.inline-edit{
|
|
22
|
+
cursor: text;
|
|
23
|
+
}
|
|
9
24
|
}
|
|
10
25
|
}
|
|
11
26
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitHead/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAoB,UAAU,EAAQ,MAAM,MAAM,CAAC;AAY1D,MAAM,OAAO,KAAK;CAEjB;AADY;IAAX,UAAU;sCAA0B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import { UnitContext, UnitContextState, useUnitContext } from "../../data/UnitContext";
|
|
4
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import QuickDataIcon from "../../controls/QuickDataIcon";
|
|
6
|
+
import UnitAvatar from "../UnitAvatar";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import { faBars } from "@fortawesome/pro-light-svg-icons";
|
|
9
|
+
import styles from "./index.less";
|
|
10
|
+
import { useContact } from "../../data";
|
|
11
|
+
import { useObserver } from "mobx-react-lite";
|
|
12
|
+
const DefaultUnitItem = (props) => {
|
|
13
|
+
const { id, index, className, connectDragSource } = props;
|
|
14
|
+
const [state] = useState(new State());
|
|
15
|
+
const contact = useContact(id);
|
|
16
|
+
const store = useUnitContext();
|
|
17
|
+
const [options] = useState(new UnitContextState());
|
|
18
|
+
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
19
|
+
React.createElement("div", { className: classnames(styles["unit-item"], className), onClick: () => { var _a; return (_a = store === null || store === void 0 ? void 0 : store.onUnitSelected) === null || _a === void 0 ? void 0 : _a.call(store, contact.id); } },
|
|
20
|
+
React.createElement("div", { className: "unit-avatar" },
|
|
21
|
+
React.createElement(UnitAvatar, { id: id, size: "large", index: index })),
|
|
22
|
+
React.createElement("div", null,
|
|
23
|
+
React.createElement("div", { className: "unit-name" }, contact.name),
|
|
24
|
+
React.createElement("div", null,
|
|
25
|
+
connectDragSource ? (connectDragSource(React.createElement("span", { className: classnames("task-move", { show: state.editable }) }, React.createElement(FAIcon, { icon: faBars })))) : (React.createElement("span", { className: "task-move" })),
|
|
26
|
+
React.createElement(QuickDataIcon, { id: id })))))));
|
|
27
|
+
};
|
|
28
|
+
export default DefaultUnitItem;
|
|
29
|
+
//# sourceMappingURL=DefaultUnitItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultUnitItem.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/DefaultUnitItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO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I,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,IAChE,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI,CACnB,CACP,CACD,CAAC,CAAC,CAAC,CACH,8BAAM,SAAS,EAAC,WAAW,GAAG,CAC9B;oBACD,oBAAC,aAAa,IAAC,EAAE,EAAE,EAAE,GAAI,CACpB,CACD,CACD,CACgB,CACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Checkbox } from "@voplus/antd";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { State } from "./state";
|
|
4
|
+
import { UnitContext, UnitContextState, useUnitContext } from "../../data/UnitContext";
|
|
5
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
6
|
+
import QuickDataIcon from "../../controls/QuickDataIcon";
|
|
7
|
+
import ToolBar from "../../controls/ToolBar";
|
|
8
|
+
import UnitAvatar from "../UnitAvatar";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import { faBars } from "@fortawesome/pro-light-svg-icons";
|
|
11
|
+
import styles from "./index.less";
|
|
12
|
+
import { useContact } from "../../data";
|
|
13
|
+
import { useObserver } from "mobx-react-lite";
|
|
14
|
+
const SubUnitItem = (props) => {
|
|
15
|
+
const { id, index, type, multiple, className, connectDragSource } = props;
|
|
16
|
+
const [state] = useState(new State());
|
|
17
|
+
const contact = useContact(id);
|
|
18
|
+
const store = useUnitContext();
|
|
19
|
+
const [options] = useState(new UnitContextState());
|
|
20
|
+
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
21
|
+
React.createElement("div", { className: classnames(styles["unit-item"], className), onClick: () => { var _a; return (_a = store === null || store === void 0 ? void 0 : store.onUnitSelected) === null || _a === void 0 ? void 0 : _a.call(store, contact.id); }, onMouseLeave: () => (state.isHover = false) },
|
|
22
|
+
React.createElement("div", { className: classnames("unit-item_box", { "unit-item_hover": state.isHover }), onMouseOver: () => (state.isHover = !multiple && !state.editable) },
|
|
23
|
+
multiple && React.createElement(Checkbox, { value: props.id, className: "multiple-checkbox" }),
|
|
24
|
+
React.createElement("div", { className: "unit-avatar" },
|
|
25
|
+
React.createElement(UnitAvatar, { id: id, size: "large", index: index })),
|
|
26
|
+
React.createElement("div", null,
|
|
27
|
+
React.createElement("div", { className: "unit-name" }, contact.name),
|
|
28
|
+
React.createElement("div", null,
|
|
29
|
+
!multiple && connectDragSource ? (connectDragSource(React.createElement("span", { className: classnames("task-move", { show: state.editable }) }, React.createElement(FAIcon, { icon: faBars })))) : (React.createElement("span", { className: "task-move" })),
|
|
30
|
+
React.createElement(QuickDataIcon, { id: id })))),
|
|
31
|
+
type === "sub" && (React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
|
32
|
+
React.createElement(ToolBar, { id: props.id, size: "middle", url: `/units/${props.id}` })))))));
|
|
33
|
+
};
|
|
34
|
+
export default SubUnitItem;
|
|
35
|
+
//# sourceMappingURL=SubUnitItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubUnitItem.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/SubUnitItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,QAAQ,EAAS,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,UAAU,MAAM,YAAY,C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9
|
+
border-bottom: 1px solid #d9d9d9;
|
|
6
10
|
:global {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
.unit-item_box {
|
|
12
|
+
flex:1;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
.multiple-checkbox {
|
|
17
|
+
margin-right: 10px;
|
|
9
18
|
}
|
|
10
19
|
.unit-name {
|
|
11
20
|
color: #000;
|
|
12
21
|
font-size: 15px;
|
|
13
22
|
font-weight: 500;
|
|
14
23
|
}
|
|
15
|
-
.avatar
|
|
24
|
+
.unit-avatar {
|
|
16
25
|
margin-right: 10px;
|
|
17
26
|
}
|
|
27
|
+
.hover-operate-icon {
|
|
28
|
+
display: none;
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 0;
|
|
31
|
+
z-index: 100;
|
|
32
|
+
&.show {
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
18
36
|
}
|
|
19
37
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConnectDragSource } from "react-dnd";
|
|
2
|
+
import { IContact } from "../../data";
|
|
3
|
+
export declare type UnitItemProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
index?: number;
|
|
6
|
+
type?: string;
|
|
7
|
+
reload?: boolean;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
connectDragSource?: ConnectDragSource;
|
|
10
|
+
onExpand?: () => void;
|
|
11
|
+
onReload?: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class State {
|
|
15
|
+
contact: IContact;
|
|
16
|
+
/** Edit model of unit */
|
|
17
|
+
editable: boolean;
|
|
18
|
+
/** MouseOver of sub unit */
|
|
19
|
+
isHover: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
/** Edit model of unit */
|
|
6
|
+
this.editable = false;
|
|
7
|
+
/** MouseOver of sub unit */
|
|
8
|
+
this.isHover = false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
__decorate([
|
|
12
|
+
observable
|
|
13
|
+
], State.prototype, "contact", void 0);
|
|
14
|
+
__decorate([
|
|
15
|
+
observable
|
|
16
|
+
], State.prototype, "editable", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
observable
|
|
19
|
+
], State.prototype, "isHover", void 0);
|
|
20
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitItem/state.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAclC,MAAM,OAAO,KAAK;IAAlB;QAEC,0BAA0B;QACP,aAAQ,GAAG,KAAK,CAAC;QACpC,6BAA6B;QACV,YAAO,GAAG,KAAK,CAAC;IACpC,CAAC;CAAA;AALY;IAAX,UAAU;sCAA0B;AAEzB;IAAX,UAAU;uCAAyB;AAExB;IAAX,UAAU;sCAAwB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DocumentStatusFilter, FlagFilter } from "../../../../controls/filters";
|
|
2
|
+
import { useContactListEffect } from "../../data";
|
|
3
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
4
|
+
import React, { useState } from "react";
|
|
5
|
+
import { State } from "./state";
|
|
6
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
7
|
+
import NewUnitForm from "../NewUnitForm";
|
|
8
|
+
import UnitItem from "../UnitItem/DefaultUnitItem";
|
|
9
|
+
import UnitPropertiesView from "../UnitPropertiesView";
|
|
10
|
+
import { useObserver } from "mobx-react-lite";
|
|
11
|
+
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
12
|
+
const UnitList = (props) => {
|
|
13
|
+
const { readonly, parentId } = props;
|
|
14
|
+
const [state] = useState(new State());
|
|
15
|
+
state.props = props;
|
|
16
|
+
/** 建立 ListView 和useContactListEffect所需的ListDataState. 会根据parentId重建所以不需reset. */
|
|
17
|
+
const list = useCreateListDataState({
|
|
18
|
+
filterDefaults: {
|
|
19
|
+
filters: []
|
|
20
|
+
}
|
|
21
|
+
}, [parentId]);
|
|
22
|
+
/** 如果 list.filters.options变更了就重渲染,使下一行的useContactListEffect 可以接收新参数*/
|
|
23
|
+
useRenderOnChange(() => list.filters.options);
|
|
24
|
+
/** 把ListDataState传给useContactListEffect,使之可以自動更新loading, hasmore. */
|
|
25
|
+
useContactListEffect(list, result => list.union(result), list.filters.options);
|
|
26
|
+
return useObserver(() => (React.createElement(ListDataContext.Provider, { value: list },
|
|
27
|
+
React.createElement(ListView, { renderId: parentId, headerProps: {
|
|
28
|
+
filterViewProps: {
|
|
29
|
+
columns: [React.createElement(DocumentStatusFilter, { key: "Status" }), React.createElement(FlagFilter, { key: "Flag" })]
|
|
30
|
+
},
|
|
31
|
+
sortable: false
|
|
32
|
+
}, formViewTitle: "Add Unit", formView: React.createElement(NewUnitForm, { parentId: "" }), propertiesView: (id) => React.createElement(UnitPropertiesView, { id: id }), renderItem: ({ item, index, connectDragSource }) => (React.createElement(UnitItem, { id: item.id, index: index, reload: !!readonly })) }))));
|
|
33
|
+
};
|
|
34
|
+
export default UnitList;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAY,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE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,EAAE,oBAAC,UAAU,IAAC,GAAG,EAAC,MAAM,GAAG,CAAC;iBAC3E;gBACD,QAAQ,EAAE,KAAK;aACf,EACD,aAAa,EAAC,UAAU,EACxB,QAAQ,EAAE,oBAAC,WAAW,IAAC,QAAQ,EAAC,EAAE,GAAG,EACrC,cAAc,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,oBAAC,kBAAkB,IAAC,EAAE,EAAE,EAAE,GAAI,EAC9D,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAO,EAAE,EAAE,CAAC,CACxD,oBAAC,QAAQ,IACR,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,CAAC,CAAC,QAAQ,GAEjB,CACF,GACA,CACwB,CAC3B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IContact } from "../../data";
|
|
2
|
+
export declare type UnitListProps = {
|
|
3
|
+
parentId?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
scrollParentRef?: any;
|
|
6
|
+
header?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare class State {
|
|
10
|
+
props: UnitListProps;
|
|
11
|
+
list: IContact[];
|
|
12
|
+
onMove(ids: string[]): void;
|
|
13
|
+
moveAfter(id: string, afterId: string, list: any[]): Promise<void>;
|
|
14
|
+
onDelete(ids: string[]): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { action, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.list = [];
|
|
6
|
+
}
|
|
7
|
+
onMove(ids) {
|
|
8
|
+
// store.onMove(ids);
|
|
9
|
+
}
|
|
10
|
+
// order by sub task
|
|
11
|
+
async moveAfter(id, afterId, list) {
|
|
12
|
+
// await taskStore.moveAfter(id, afterId);
|
|
13
|
+
// this.list = list;
|
|
14
|
+
}
|
|
15
|
+
async onDelete(ids) {
|
|
16
|
+
// await taskStore.delete(ids, { DeleteChilds: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
observable
|
|
21
|
+
], State.prototype, "list", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
action
|
|
24
|
+
], State.prototype, "onMove", null);
|
|
25
|
+
__decorate([
|
|
26
|
+
action
|
|
27
|
+
], State.prototype, "moveAfter", null);
|
|
28
|
+
__decorate([
|
|
29
|
+
action
|
|
30
|
+
], State.prototype, "onDelete", null);
|
|
31
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitList/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAY,UAAU,EAAQ,MAAM,MAAM,CAAC;AAc1D,MAAM,OAAO,KAAK;IAAlB;QAEoB,SAAI,GAAe,EAAE,CAAC;IAkB1C,CAAC;IAfO,MAAM,CAAC,GAAa;QAC1B,qBAAqB;IACtB,CAAC;IAED,oBAAoB;IAEb,KAAK,CAAC,SAAS,CAAC,EAAU,EAAE,OAAe,EAAE,IAAW;QAC9D,0CAA0C;QAC1C,oBAAoB;IACrB,CAAC;IAGM,KAAK,CAAC,QAAQ,CAAC,GAAa;QAClC,uDAAuD;IACxD,CAAC;CACD;AAlBY;IAAX,UAAU;mCAA8B;AAGzC;IADC,MAAM;mCAGN;AAID;IADC,MAAM;sCAIN;AAGD;IADC,MAAM;qCAGN"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import UnitDetails from "../UnitDetails";
|
|
3
|
+
import UnitHead from "../UnitHead";
|
|
4
|
+
import UnitTabs from "../UnitTabs";
|
|
5
|
+
import { useObserver } from "mobx-react-lite";
|
|
6
|
+
/** Unit PropertiesView */
|
|
7
|
+
const UnitPropertiesView = (props) => {
|
|
8
|
+
const id = props.id;
|
|
9
|
+
const [loaded, setLoaded] = useState(true);
|
|
10
|
+
return useObserver(() => (React.createElement("div", { className: "module-detail-view" }, loaded && (React.createElement(React.Fragment, null,
|
|
11
|
+
React.createElement(UnitHead, { id: id, onReload: onReload }),
|
|
12
|
+
React.createElement(UnitTabs, { id: id, details: React.createElement(UnitDetails, { id: id }) }))))));
|
|
13
|
+
/** reload data */
|
|
14
|
+
function onReload() {
|
|
15
|
+
setLoaded(false);
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
setLoaded(true);
|
|
18
|
+
}, 100);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default UnitPropertiesView;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,0BAA0B;AAC1B,MAAM,kBAAkB,GAAG,CAAC,KAAqB,EAAE,EAAE;IACpD,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3C,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,6BAAK,SAAS,EAAC,oBAAoB,IACjC,MAAM,IAAI,CACV,oBAAC,KAAK,CAAC,QAAQ;QACd,oBAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAI;QACxC,oBAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,oBAAC,WAAW,IAAC,EAAE,EAAE,EAAE,GAAI,GAAI,CACtC,CACjB,CACI,CACN,CAAC,CAAC;IAEH,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;AACF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UnitSortableTreeProps } from "./state";
|
|
3
|
+
declare const UnitSortableTree: {
|
|
4
|
+
(props: UnitSortableTreeProps): JSX.Element;
|
|
5
|
+
defaultProps: {
|
|
6
|
+
canDrag: boolean;
|
|
7
|
+
theme: import("react-sortable-tree").ThemeProps;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default UnitSortableTree;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { State } from "./state";
|
|
3
|
+
import { UnitContext, UnitContextState } from "../../data/UnitContext";
|
|
4
|
+
import { useContact, useContactListEffect, useContactStore } from "../../data";
|
|
5
|
+
import { Scrollbars } from "react-custom-scrollbars";
|
|
6
|
+
import SortableTree from "react-sortable-tree";
|
|
7
|
+
import SortableTreeUnitTheme from "../SortableTreeUnitTheme";
|
|
8
|
+
import { useObserver } from "mobx-react-lite";
|
|
9
|
+
const UnitSortableTree = (props) => {
|
|
10
|
+
const { theme, canDrag } = props;
|
|
11
|
+
const store = useContactStore();
|
|
12
|
+
const [state] = useState(new State(store));
|
|
13
|
+
/**把store 传给子级 UnitItem*/
|
|
14
|
+
const [options] = useState(new UnitContextState());
|
|
15
|
+
options.onUnitSelected = props.onUnitSelected;
|
|
16
|
+
/** 根文件 */
|
|
17
|
+
const root = useContact(props.id);
|
|
18
|
+
useObserver(() => {
|
|
19
|
+
if (root.loaded && !state.treeData.length) {
|
|
20
|
+
// if (root.documents! > 0) {
|
|
21
|
+
root.children = state.treeChildren;
|
|
22
|
+
// }
|
|
23
|
+
root.loaded = false;
|
|
24
|
+
state.treeData = [{ ...root }];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
var _a;
|
|
29
|
+
state.filterType = props.filterType;
|
|
30
|
+
if ((_a = state.treeData[0]) === null || _a === void 0 ? void 0 : _a.loaded) {
|
|
31
|
+
state.id = state.treeData[0].id;
|
|
32
|
+
state.treeData[0].children = [];
|
|
33
|
+
state.treeData = [...state.treeData];
|
|
34
|
+
state.treeNodeChildren = state.treeData[0];
|
|
35
|
+
state.treeNodeChildren.loaded = true;
|
|
36
|
+
state.treeNodeChildren.loading = true;
|
|
37
|
+
state.effect = state.updateNodes;
|
|
38
|
+
}
|
|
39
|
+
}, [props.filterType]);
|
|
40
|
+
useContactListEffect(null, state.effect, {
|
|
41
|
+
Filters: state.filters
|
|
42
|
+
});
|
|
43
|
+
/** isVirtualized={false} 可以解决滚动时,重新渲染UnitItem组件
|
|
44
|
+
* 设置为false可禁用虚拟化。默认为true。注意:拖动时自动滚动以及滚动到searchFocusOffset都将被禁用。*/
|
|
45
|
+
return useObserver(() => (React.createElement(UnitContext.Provider, { value: options },
|
|
46
|
+
React.createElement(Scrollbars, { autoHide: true },
|
|
47
|
+
React.createElement(SortableTree, { isVirtualized: false, treeData: state.treeData, onChange: (val) => state.updateTreeData(val), getNodeKey: ({ node }) => node.id, onVisibilityToggle: (val) => state.onVisibilityToggle(val), onMoveNode: (val) => state.onMoveNode(val), canDrop: ({ nextPath }) => ((nextPath === null || nextPath === void 0 ? void 0 : nextPath.length) > 1 ? true : false), canNodeHaveChildren: (node) => state.toHaveChildren(node), canDrag: canDrag, theme: theme })))));
|
|
48
|
+
};
|
|
49
|
+
UnitSortableTree.defaultProps = {
|
|
50
|
+
canDrag: true,
|
|
51
|
+
theme: SortableTreeUnitTheme
|
|
52
|
+
};
|
|
53
|
+
export default UnitSortableTree;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/components/UnitSortableTree/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IACzD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAE3C,yBAAyB;IACzB,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,cAAe,CAAC;IAE/C,UAAU;IACV,MAAM,IAAI,GAAQ,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAA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QAAQ,IAAC,KAAK,EAAE,OAAO;QACnC,oBAAC,UAAU,IAAC,QAAQ;YACnB,oBAAC,YAAY,IACZ,aAAa,EAAE,KAAK,EACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EACjD,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EACjC,kBAAkB,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAC/D,UAAU,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAC/C,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,IAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAChE,mBAAmB,EAAE,CAAC,IAAS,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAC9D,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,CACU,CACS,CACvB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG;IAC/B,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,qBAAqB;CAC5B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ContactStore, IContact } from "../../data";
|
|
2
|
+
import { FilterOption } from "@voplus/morpho-data";
|
|
3
|
+
export declare type UnitSortableTreeProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
/** Unit Tree theme */
|
|
6
|
+
theme?: any;
|
|
7
|
+
/** 是否可以拖放 */
|
|
8
|
+
canDrag?: boolean;
|
|
9
|
+
filterType?: FilterOption;
|
|
10
|
+
/** Unit selected */
|
|
11
|
+
onUnitSelected?: (params?: any) => void;
|
|
12
|
+
};
|
|
13
|
+
export interface ITreeNodeData extends IContact {
|
|
14
|
+
/** node expanded 与否 */
|
|
15
|
+
expanded?: boolean;
|
|
16
|
+
children?: ITreeNodeData[];
|
|
17
|
+
}
|
|
18
|
+
export declare class State {
|
|
19
|
+
private _store;
|
|
20
|
+
constructor(_store: ContactStore);
|
|
21
|
+
id: string;
|
|
22
|
+
/** 如果effect 是null就不执行 useUnitListEffect*/
|
|
23
|
+
effect: (list: IContact[]) => void | null;
|
|
24
|
+
treeNodeChildren: any;
|
|
25
|
+
/** dummy placeholder data */
|
|
26
|
+
treeChildren: ITreeNodeData[];
|
|
27
|
+
/** 沒load之前, 看看現在這個文件有沒有子文件, 有的話要放個 dummy placeholder data 在children里, */
|
|
28
|
+
treeData: ITreeNodeData[];
|
|
29
|
+
/** filter type for unit */
|
|
30
|
+
filterType: FilterOption | undefined;
|
|
31
|
+
/** 根据path查找文件 */
|
|
32
|
+
findFiles(path: string[]): any;
|
|
33
|
+
/** 更新 TreeData */
|
|
34
|
+
updateTreeData(val: any): void;
|
|
35
|
+
/** update useUnitListEffect */
|
|
36
|
+
updateNodes: (list: IContact[]) => void;
|
|
37
|
+
/**在子节点折叠或者展开后调用*/
|
|
38
|
+
onVisibilityToggle(val: any): void;
|
|
39
|
+
/** 在节点移动操作之后调用 */
|
|
40
|
+
onMoveNode(val: any): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 确定节点是否可以具有子级的功能,对于在canDrop有条件时防止悬停预览很有用。默认设置为返回的函数true。函数应为类型(node): bool
|
|
43
|
+
*/
|
|
44
|
+
toHaveChildren(node: any): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* unit filters
|
|
47
|
+
* @return unit filters
|
|
48
|
+
*/
|
|
49
|
+
get filters(): any[];
|
|
50
|
+
}
|