@voplus/morpho-document 1.0.0-dev214 → 1.0.0-dev216
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ActivityLog/index.less +64 -64
- package/es/components/AddDocDropdown/index.js +23 -5
- package/es/components/AddDocDropdown/index.js.map +1 -1
- package/es/components/AddDocDropdown/index.less +3 -2
- package/es/components/AddDocDropdown/state.d.ts +1 -0
- package/es/components/AddDocDropdown/state.js +9 -3
- package/es/components/AddDocDropdown/state.js.map +1 -1
- package/es/components/BreadCrumbsHeader/index.d.ts +9 -0
- package/es/components/BreadCrumbsHeader/index.js +30 -0
- package/es/components/BreadCrumbsHeader/index.js.map +1 -0
- package/es/components/BreadCrumbsHeader/index.less +10 -0
- package/es/components/BreadCrumbsHeader/state.d.ts +10 -0
- package/es/components/BreadCrumbsHeader/state.js +34 -0
- package/es/components/BreadCrumbsHeader/state.js.map +1 -0
- package/es/components/DocumentItem/index.js +2 -8
- package/es/components/DocumentItem/index.js.map +1 -1
- package/es/components/DocumentList/Header.d.ts +13 -0
- package/es/components/DocumentList/Header.js +16 -0
- package/es/components/DocumentList/Header.js.map +1 -0
- package/es/components/DocumentList/index.js +35 -29
- package/es/components/DocumentList/index.js.map +1 -1
- package/es/components/DocumentList/index.less +39 -15
- package/es/components/DocumentList/state.d.ts +9 -27
- package/es/components/DocumentList/state.js +20 -115
- package/es/components/DocumentList/state.js.map +1 -1
- package/es/components/DocumentListView/index.d.ts +3 -2
- package/es/components/DocumentListView/index.js +31 -54
- package/es/components/DocumentListView/index.js.map +1 -1
- package/es/components/DocumentListView/state.d.ts +1 -36
- package/es/components/DocumentListView/state.js +1 -100
- package/es/components/DocumentListView/state.js.map +1 -1
- package/es/components/DocumentSortableTree/index.js +32 -4
- package/es/components/DocumentSortableTree/index.js.map +1 -1
- package/es/components/DocumentSortableTree/state.d.ts +7 -6
- package/es/components/DocumentSortableTree/state.js +23 -32
- package/es/components/DocumentSortableTree/state.js.map +1 -1
- package/es/components/DocumentTabs/index.js +2 -4
- package/es/components/DocumentTabs/index.js.map +1 -1
- package/es/components/DocumentTree/index.js +1 -1
- package/es/components/DocumentTree/index.js.map +1 -1
- package/es/components/FileViewer/ImageViewer.js +4 -3
- package/es/components/FileViewer/ImageViewer.js.map +1 -1
- package/es/components/FileViewer/PDFViewer.js +4 -2
- package/es/components/FileViewer/PDFViewer.js.map +1 -1
- package/es/components/FileViewer/Preview.js +12 -10
- package/es/components/FileViewer/Preview.js.map +1 -1
- package/es/components/FileViewer/index.less +33 -0
- package/es/components/Links/index.less +111 -111
- package/es/components/NewDocumentForm/index.d.ts +1 -1
- package/es/components/NewDocumentForm/index.js +10 -3
- package/es/components/NewDocumentForm/index.js.map +1 -1
- package/es/components/NewDocumentForm/index.less +9 -1
- package/es/components/QuickAccessSearch/index.js +5 -4
- package/es/components/QuickAccessSearch/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.d.ts +10 -4
- package/es/components/QuickViewDialog/QuickSubTab/index.js +16 -16
- package/es/components/QuickViewDialog/QuickSubTab/index.js.map +1 -1
- package/es/components/QuickViewDialog/QuickSubTab/index.less +7 -19
- package/es/components/QuickViewDialog/index.js +2 -1
- package/es/components/QuickViewDialog/index.js.map +1 -1
- package/es/components/QuickViewDialog/index.less +8 -1
- package/es/components/helper.d.ts +1 -1
- package/es/components/helper.js +4 -0
- package/es/components/helper.js.map +1 -1
- package/es/components/styles/common.less +4 -1
- package/es/controls/filters/DocumentTypeFilter/index.d.ts +3 -0
- package/es/controls/filters/DocumentTypeFilter/index.js +21 -0
- package/es/controls/filters/DocumentTypeFilter/index.js.map +1 -0
- package/es/controls/filters/DocumentTypeFilter/state.d.ts +18 -0
- package/es/controls/filters/DocumentTypeFilter/state.js +57 -0
- package/es/controls/filters/DocumentTypeFilter/state.js.map +1 -0
- package/es/controls/filters/index.d.ts +1 -0
- package/es/controls/filters/index.js +1 -0
- package/es/controls/filters/index.js.map +1 -1
- package/es/data/DocumentStore/hooks/useDocumentListEffect.d.ts +2 -1
- package/es/data/DocumentStore/hooks/useDocumentListEffect.js +2 -2
- package/es/data/DocumentStore/hooks/useDocumentListEffect.js.map +1 -1
- package/es/data/DocumentType.d.ts +3 -1
- package/es/data/DocumentType.js +3 -1
- package/es/data/DocumentType.js.map +1 -1
- package/es/data/metas/ShortcutMeta.js +1 -1
- package/es/data/metas/ShortcutMeta.js.map +1 -1
- package/es/modules/unit/components/ActivityLog/index.d.ts +6 -0
- package/es/modules/unit/components/ActivityLog/index.js +62 -0
- package/es/modules/unit/components/ActivityLog/index.js.map +1 -0
- package/es/modules/unit/components/ActivityLog/index.less +64 -0
- package/es/modules/unit/components/ActivityLog/state.d.ts +14 -0
- package/es/modules/unit/components/ActivityLog/state.js +51 -0
- package/es/modules/unit/components/ActivityLog/state.js.map +1 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.d.ts +6 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.js +27 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.js.map +1 -0
- package/es/modules/unit/components/BreadCrumbsHeader/index.less +10 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.d.ts +5 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.js +19 -0
- package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +1 -0
- package/es/modules/unit/components/Members/index.d.ts +4 -0
- package/es/modules/unit/components/Members/index.js +91 -0
- package/es/modules/unit/components/Members/index.js.map +1 -0
- package/es/modules/unit/components/Members/index.less +19 -0
- package/es/modules/unit/components/Members/state.d.ts +18 -0
- package/es/modules/unit/components/Members/state.js +29 -0
- package/es/modules/unit/components/Members/state.js.map +1 -0
- package/es/modules/unit/components/NewUnitForm/index.d.ts +11 -0
- package/es/modules/unit/components/NewUnitForm/index.js +51 -0
- package/es/modules/unit/components/NewUnitForm/index.js.map +1 -0
- package/es/modules/unit/components/NewUnitForm/index.less +33 -0
- package/es/modules/unit/components/NewUnitForm/state.d.ts +22 -0
- package/es/modules/unit/components/NewUnitForm/state.js +49 -0
- package/es/modules/unit/components/NewUnitForm/state.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.d.ts +4 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js +23 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/index.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.d.ts +3 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js +58 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.less +46 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.d.ts +3 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js +73 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js.map +1 -0
- package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.less +12 -0
- package/es/modules/unit/components/SubUnitList/index.d.ts +5 -0
- package/es/modules/unit/components/SubUnitList/index.js +70 -0
- package/es/modules/unit/components/SubUnitList/index.js.map +1 -0
- package/es/modules/unit/components/SubUnitList/index.less +13 -0
- package/es/modules/unit/components/SubUnitList/state.d.ts +14 -0
- package/es/modules/unit/components/SubUnitList/state.js +21 -0
- package/es/modules/unit/components/SubUnitList/state.js.map +1 -0
- package/es/modules/unit/components/UnitAvatar/index.d.ts +1 -0
- package/es/modules/unit/components/UnitAvatar/index.js +5 -4
- package/es/modules/unit/components/UnitAvatar/index.js.map +1 -1
- package/es/modules/unit/components/UnitAvatar/index.less +2 -3
- package/es/modules/unit/components/UnitDetails/index.js +98 -7
- package/es/modules/unit/components/UnitDetails/index.js.map +1 -1
- package/es/modules/unit/components/UnitDetails/index.less +41 -5
- package/es/modules/unit/components/UnitDetails/state.d.ts +8 -0
- package/es/modules/unit/components/UnitDetails/state.js +24 -0
- package/es/modules/unit/components/UnitDetails/state.js.map +1 -0
- package/es/modules/unit/components/UnitHead/index.d.ts +2 -0
- package/es/modules/unit/components/UnitHead/index.js +31 -7
- package/es/modules/unit/components/UnitHead/index.js.map +1 -1
- package/es/modules/unit/components/UnitHead/index.less +18 -3
- package/es/modules/unit/components/UnitHead/state.d.ts +11 -0
- package/es/modules/unit/components/UnitHead/state.js +8 -0
- package/es/modules/unit/components/UnitHead/state.js.map +1 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.d.ts +4 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js +29 -0
- package/es/modules/unit/components/UnitItem/DefaultUnitItem.js.map +1 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.d.ts +4 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.js +35 -0
- package/es/modules/unit/components/UnitItem/SubUnitItem.js.map +1 -0
- package/es/modules/unit/components/UnitItem/index.less +23 -5
- package/es/modules/unit/components/UnitItem/state.d.ts +20 -0
- package/es/modules/unit/components/UnitItem/state.js +20 -0
- package/es/modules/unit/components/UnitItem/state.js.map +1 -0
- package/es/modules/unit/components/UnitList/index.d.ts +4 -0
- package/es/modules/unit/components/UnitList/index.js +37 -0
- package/es/modules/unit/components/UnitList/index.js.map +1 -0
- package/es/modules/unit/components/UnitList/state.d.ts +15 -0
- package/es/modules/unit/components/UnitList/state.js +31 -0
- package/es/modules/unit/components/UnitList/state.js.map +1 -0
- package/es/modules/unit/components/UnitPropertiesView/index.d.ts +6 -0
- package/es/modules/unit/components/UnitPropertiesView/index.js +22 -0
- package/es/modules/unit/components/UnitPropertiesView/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/index.d.ts +10 -0
- package/es/modules/unit/components/UnitSortableTree/index.js +54 -0
- package/es/modules/unit/components/UnitSortableTree/index.js.map +1 -0
- package/es/modules/unit/components/UnitSortableTree/state.d.ts +50 -0
- package/es/modules/unit/components/UnitSortableTree/state.js +151 -0
- package/es/modules/unit/components/UnitSortableTree/state.js.map +1 -0
- package/es/modules/unit/components/UnitTabs/index.d.ts +6 -0
- package/es/modules/unit/components/UnitTabs/index.js +29 -0
- package/es/modules/unit/components/UnitTabs/index.js.map +1 -0
- package/es/modules/unit/controls/ContactSelect/index.d.ts +9 -0
- package/es/modules/unit/controls/ContactSelect/index.js +78 -0
- package/es/modules/unit/controls/ContactSelect/index.js.map +1 -0
- package/es/modules/unit/controls/ContactSelect/state.d.ts +23 -0
- package/es/modules/unit/controls/ContactSelect/state.js +43 -0
- package/es/modules/unit/controls/ContactSelect/state.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.d.ts +6 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js +32 -0
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js.map +1 -0
- package/es/modules/unit/{components → controls}/QuickDataIcon/index.d.ts +2 -6
- package/es/modules/unit/controls/QuickDataIcon/index.js +36 -0
- package/es/modules/unit/controls/QuickDataIcon/index.js.map +1 -0
- package/es/modules/unit/controls/QuickDataIcon/index.less +0 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.d.ts +13 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js +59 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.less +20 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.d.ts +34 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +71 -0
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/index.d.ts +12 -0
- package/es/modules/unit/controls/ToolBar/index.js +54 -0
- package/es/modules/unit/controls/ToolBar/index.js.map +1 -0
- package/es/modules/unit/controls/ToolBar/index.less +18 -0
- package/es/modules/unit/controls/ToolBar/state.d.ts +40 -0
- package/es/modules/unit/controls/ToolBar/state.js +50 -0
- package/es/modules/unit/controls/ToolBar/state.js.map +1 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.d.ts +3 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.js +21 -0
- package/es/modules/unit/controls/UnitTypeFilter/index.js.map +1 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.d.ts +18 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.js +63 -0
- package/es/modules/unit/controls/UnitTypeFilter/state.js.map +1 -0
- package/es/modules/unit/data/FileStore/FileContext.d.ts +6 -0
- package/es/modules/unit/data/FileStore/FileContext.js +40 -0
- package/es/modules/unit/data/FileStore/FileContext.js.map +1 -0
- package/es/modules/unit/data/FileStore/index.d.ts +1 -0
- package/es/modules/unit/data/FileStore/index.js +2 -0
- package/es/modules/unit/data/FileStore/index.js.map +1 -0
- package/es/modules/unit/data/StoreContext/index.d.ts +3 -0
- package/es/modules/unit/data/StoreContext/index.js +4 -0
- package/es/modules/unit/data/StoreContext/index.js.map +1 -0
- package/es/modules/unit/data/UnitContext/index.d.ts +20 -0
- package/es/modules/unit/data/UnitContext/index.js +32 -0
- package/es/modules/unit/data/UnitContext/index.js.map +1 -0
- package/es/modules/unit/data/UnitStore.d.ts +103 -0
- package/es/modules/unit/data/UnitStore.js +180 -0
- package/es/modules/unit/data/UnitStore.js.map +1 -0
- package/es/modules/unit/data/hooks.d.ts +25 -0
- package/es/modules/unit/data/hooks.js +91 -0
- package/es/modules/unit/data/hooks.js.map +1 -0
- package/es/modules/unit/data/index.d.ts +3 -0
- package/es/modules/unit/data/index.js +3 -0
- package/es/modules/unit/data/index.js.map +1 -0
- package/es/modules/unit/data/interfaces/IAddress.d.ts +14 -0
- package/es/modules/unit/data/interfaces/IAddress.js +1 -0
- package/es/modules/unit/data/interfaces/IAddress.js.map +1 -0
- package/es/modules/unit/data/interfaces/IEntityName.d.ts +6 -0
- package/es/modules/unit/data/interfaces/IEntityName.js +1 -0
- package/es/modules/unit/data/interfaces/IEntityName.js.map +1 -0
- package/es/modules/unit/data/interfaces/IUnit.d.ts +47 -0
- package/es/modules/unit/data/interfaces/IUnit.js +1 -0
- package/es/modules/unit/data/interfaces/IUnit.js.map +1 -0
- package/es/modules/unit/data/interfaces/index.d.ts +3 -0
- package/es/modules/unit/data/interfaces/index.js +1 -0
- package/es/modules/unit/data/interfaces/index.js.map +1 -0
- package/es/modules/unit/pages/UnitDefaultView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitDefaultView/index.js +47 -0
- package/es/modules/unit/pages/UnitDefaultView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitDefaultView/index.less +17 -0
- package/es/modules/unit/pages/UnitListView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitListView/index.js +10 -0
- package/es/modules/unit/pages/UnitListView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitTreeView/index.d.ts +3 -0
- package/es/modules/unit/pages/UnitTreeView/index.js +47 -0
- package/es/modules/unit/pages/UnitTreeView/index.js.map +1 -0
- package/es/modules/unit/pages/UnitTreeView/index.less +31 -0
- package/es/modules/unit/pages/UnitTreeView/state.d.ts +5 -0
- package/es/modules/unit/pages/UnitTreeView/state.js +14 -0
- package/es/modules/unit/pages/UnitTreeView/state.js.map +1 -0
- package/es/pages/TreeViewPage/index.js +27 -20
- package/es/pages/TreeViewPage/index.js.map +1 -1
- package/es/pages/TreeViewPage/index.less +28 -19
- package/es/pages/TreeViewPage/state.d.ts +5 -0
- package/es/pages/TreeViewPage/state.js +14 -0
- package/es/pages/TreeViewPage/state.js.map +1 -0
- package/es/routes.d.ts +18 -0
- package/es/routes.js +40 -1
- package/es/routes.js.map +1 -1
- package/package.json +3 -1
- package/es/controls/DocumentTypeFilter/index.js +0 -54
- package/es/controls/DocumentTypeFilter/index.js.map +0 -1
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.d.ts +0 -14
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js +0 -28
- package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js.map +0 -1
- package/es/modules/unit/components/QuickDataIcon/index.js +0 -45
- package/es/modules/unit/components/QuickDataIcon/index.js.map +0 -1
- package/es/modules/unit/components/UnitItem/index.d.ts +0 -6
- package/es/modules/unit/components/UnitItem/index.js +0 -19
- package/es/modules/unit/components/UnitItem/index.js.map +0 -1
- /package/es/modules/unit/components/{QuickDataIcon → UnitList}/index.less +0 -0
- /package/es/{controls/DocumentTypeFilter/index.d.ts → modules/unit/components/UnitPropertiesView/index.less} +0 -0
- /package/es/modules/unit/{components → controls}/QuickDataIcon/UnitTeamsIcon/index.less +0 -0
|
@@ -3,29 +3,53 @@
|
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
height: 100%;
|
|
5
5
|
:global {
|
|
6
|
-
.
|
|
7
|
-
position: relative;
|
|
6
|
+
.list-view-header {
|
|
8
7
|
display: flex;
|
|
9
8
|
justify-content: space-between;
|
|
10
9
|
align-items: center;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
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;
|
|
19
20
|
margin-left: 10px;
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
line-height: 1px;
|
|
23
|
+
background: #1abc9c;
|
|
20
24
|
cursor: pointer;
|
|
21
25
|
}
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
.header-empty {
|
|
26
|
-
display: none;
|
|
26
|
+
.margin-left-10 {
|
|
27
|
+
margin-left: 10px;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
30
|
+
// .doc-list_header {
|
|
31
|
+
// position: relative;
|
|
32
|
+
// display: flex;
|
|
33
|
+
// justify-content: space-between;
|
|
34
|
+
// align-items: center;
|
|
35
|
+
// // padding: 2px 0 10px 0;
|
|
36
|
+
// padding: 10px 0;
|
|
37
|
+
// margin: 0 20px;
|
|
38
|
+
// color: #000;
|
|
39
|
+
// font-size: 15px;
|
|
40
|
+
// line-height: 15px;
|
|
41
|
+
// border-bottom: 1px solid #d9d9d9;
|
|
42
|
+
// .operate-icon span {
|
|
43
|
+
// margin-left: 10px;
|
|
44
|
+
// cursor: pointer;
|
|
45
|
+
// }
|
|
46
|
+
// .ant-checkbox-wrapper {
|
|
47
|
+
// width: auto;
|
|
48
|
+
// }
|
|
49
|
+
// .header-empty {
|
|
50
|
+
// display: none;
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
29
53
|
.doc-list-content {
|
|
30
54
|
height: 100%;
|
|
31
55
|
> span {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DocumentStore, IDocument } from "../../data";
|
|
2
|
+
import { DocumentStore, IDocument, docType } from "../../data";
|
|
3
|
+
import { FilterOption } from "@voplus/morpho-data";
|
|
3
4
|
import { SortParameters } from "@voplus/morpho-data/es/types";
|
|
4
5
|
export declare type DocumentListProps = {
|
|
5
6
|
id: string;
|
|
@@ -37,30 +38,21 @@ export declare class State {
|
|
|
37
38
|
pageSize: number;
|
|
38
39
|
/** documentlist filter name */
|
|
39
40
|
filterName: string;
|
|
40
|
-
|
|
41
|
-
/** documentlist filter status */
|
|
42
|
-
status: string[];
|
|
43
|
-
/** 头部 FilterListDropdown组件 filter status list*/
|
|
44
|
-
statusList: any[];
|
|
41
|
+
filterList?: FilterOption[];
|
|
45
42
|
/** e.g. exclude={["Task", "Agenda"]} 結果:不會顯示 Task和Agenda文件 */
|
|
46
43
|
exclude: string[];
|
|
47
|
-
addText: boolean;
|
|
48
|
-
addFolder: boolean;
|
|
49
|
-
addTask: boolean;
|
|
50
|
-
addMeeting: boolean;
|
|
51
|
-
addBoard: boolean;
|
|
52
|
-
addGraph: boolean;
|
|
53
|
-
addQuotation: boolean;
|
|
54
|
-
addDashboard: boolean;
|
|
55
44
|
/** timeout input documentname */
|
|
56
45
|
timeout: any;
|
|
46
|
+
shortcut: boolean;
|
|
47
|
+
/** NewDocumentForm */
|
|
48
|
+
addAble: boolean;
|
|
49
|
+
/** add document type */
|
|
50
|
+
type: docType;
|
|
57
51
|
reset(): void;
|
|
58
52
|
/** documentList add Drop down more menus hidden*/
|
|
59
53
|
cancel(): void;
|
|
60
54
|
/**load next page*/
|
|
61
55
|
loadMore(): void;
|
|
62
|
-
/**document filters status*/
|
|
63
|
-
onStatus(value: any): void;
|
|
64
56
|
/** SearchHeader 查找文件name */
|
|
65
57
|
onChangeName(values: string): void;
|
|
66
58
|
/** is check */
|
|
@@ -74,17 +66,7 @@ export declare class State {
|
|
|
74
66
|
/** Upload 通过覆盖默认的上传行为,可以自定义自己的上传实现 */
|
|
75
67
|
customRequest(option: any): Promise<void>;
|
|
76
68
|
/** AddDocDropdown(新增type下拉Menu) item click */
|
|
77
|
-
onItemClick(val:
|
|
78
|
-
/**
|
|
79
|
-
* show new document view
|
|
80
|
-
* @return {Boolean} true:show false:hidden
|
|
81
|
-
*/
|
|
82
|
-
get isAddDocForm(): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* document type
|
|
85
|
-
* @return {String} document type
|
|
86
|
-
*/
|
|
87
|
-
get docType(): "document" | "text" | "task" | "meeting" | "board" | "graph" | "quotation" | "dashboard";
|
|
69
|
+
onItemClick(val: docType): void;
|
|
88
70
|
/**
|
|
89
71
|
* document filters
|
|
90
72
|
* @return document filters
|
|
@@ -17,26 +17,14 @@ export class State {
|
|
|
17
17
|
this.pageSize = 20;
|
|
18
18
|
/** documentlist filter name */
|
|
19
19
|
this.filterName = "";
|
|
20
|
-
|
|
21
|
-
this.statusList = [
|
|
22
|
-
{ name: "Draft", value: "Draft", counts: "n", color: "#e6ad51" },
|
|
23
|
-
{ name: "Normal", value: "Normal", counts: "n", color: "#ff5c86" },
|
|
24
|
-
{ name: "Readonly", value: "Readonly", counts: "n", color: "#4bd8e0" },
|
|
25
|
-
{ name: "Archived", value: "Archived", counts: "n", color: "#52c41a" },
|
|
26
|
-
{ name: "Deleted", value: "Deleted", counts: "n", color: "#823f3f" }
|
|
27
|
-
];
|
|
20
|
+
this.filterList = [];
|
|
28
21
|
/** e.g. exclude={["Task", "Agenda"]} 結果:不會顯示 Task和Agenda文件 */
|
|
29
22
|
this.exclude = [];
|
|
30
|
-
this.addText = false;
|
|
31
|
-
this.addFolder = false;
|
|
32
|
-
this.addTask = false;
|
|
33
|
-
this.addMeeting = false;
|
|
34
|
-
this.addBoard = false;
|
|
35
|
-
this.addGraph = false;
|
|
36
|
-
this.addQuotation = false;
|
|
37
|
-
this.addDashboard = false;
|
|
38
23
|
/** timeout input documentname */
|
|
39
24
|
this.timeout = null;
|
|
25
|
+
this.shortcut = false;
|
|
26
|
+
/** NewDocumentForm */
|
|
27
|
+
this.addAble = false;
|
|
40
28
|
}
|
|
41
29
|
reset() {
|
|
42
30
|
this.lists = [];
|
|
@@ -48,27 +36,14 @@ export class State {
|
|
|
48
36
|
}
|
|
49
37
|
/** documentList add Drop down more menus hidden*/
|
|
50
38
|
cancel() {
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.addTask = false;
|
|
54
|
-
this.addMeeting = false;
|
|
55
|
-
this.addBoard = false;
|
|
56
|
-
this.addGraph = false;
|
|
57
|
-
this.addQuotation = false;
|
|
58
|
-
this.addDashboard = false;
|
|
39
|
+
this.shortcut = false;
|
|
40
|
+
this.addAble = false;
|
|
59
41
|
}
|
|
60
42
|
/**load next page*/
|
|
61
43
|
loadMore() {
|
|
62
44
|
this.loading = true;
|
|
63
45
|
this.page = this.page + 1;
|
|
64
46
|
}
|
|
65
|
-
/**document filters status*/
|
|
66
|
-
onStatus(value) {
|
|
67
|
-
const { status, flags } = value;
|
|
68
|
-
this.status = status;
|
|
69
|
-
this.flags = flags;
|
|
70
|
-
this.reset();
|
|
71
|
-
}
|
|
72
47
|
/** SearchHeader 查找文件name */
|
|
73
48
|
onChangeName(values) {
|
|
74
49
|
if (this.timeout) {
|
|
@@ -115,61 +90,20 @@ export class State {
|
|
|
115
90
|
}
|
|
116
91
|
/** AddDocDropdown(新增type下拉Menu) item click */
|
|
117
92
|
onItemClick(val) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
get isAddDocForm() {
|
|
126
|
-
return (this.addFolder ||
|
|
127
|
-
this.addText ||
|
|
128
|
-
this.addMeeting ||
|
|
129
|
-
this.addTask ||
|
|
130
|
-
this.addBoard ||
|
|
131
|
-
this.addGraph ||
|
|
132
|
-
this.addQuotation ||
|
|
133
|
-
this.addDashboard);
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* document type
|
|
137
|
-
* @return {String} document type
|
|
138
|
-
*/
|
|
139
|
-
get docType() {
|
|
140
|
-
if (this.addText)
|
|
141
|
-
return "text";
|
|
142
|
-
if (this.addTask)
|
|
143
|
-
return "task";
|
|
144
|
-
if (this.addMeeting)
|
|
145
|
-
return "meeting";
|
|
146
|
-
if (this.addBoard)
|
|
147
|
-
return "board";
|
|
148
|
-
if (this.addGraph)
|
|
149
|
-
return "graph";
|
|
150
|
-
if (this.addQuotation)
|
|
151
|
-
return "quotation";
|
|
152
|
-
if (this.addDashboard)
|
|
153
|
-
return "dashboard";
|
|
154
|
-
return "document";
|
|
93
|
+
if (val.toLowerCase() === "shortcut") {
|
|
94
|
+
this.shortcut = true;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
this.type = val;
|
|
98
|
+
this.addAble = true;
|
|
99
|
+
}
|
|
155
100
|
}
|
|
156
101
|
/**
|
|
157
102
|
* document filters
|
|
158
103
|
* @return document filters
|
|
159
104
|
*/
|
|
160
105
|
get filters() {
|
|
161
|
-
|
|
162
|
-
if (this.status && this.status.length) {
|
|
163
|
-
filters.push({
|
|
164
|
-
c: "Status",
|
|
165
|
-
o: "contains",
|
|
166
|
-
l: "And",
|
|
167
|
-
v1: toJS(JSON.stringify(this.status))
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
if (this.flags && this.flags.length) {
|
|
171
|
-
filters.push({ c: "Flag", o: "contains", l: "or", v1: toJS(JSON.stringify(this.flags)) });
|
|
172
|
-
}
|
|
106
|
+
let filters = [];
|
|
173
107
|
if (this.id) {
|
|
174
108
|
filters.push({ c: "ParentNodeId", o: "=", l: "And", v1: this.id });
|
|
175
109
|
}
|
|
@@ -182,6 +116,7 @@ export class State {
|
|
|
182
116
|
if (this.props.filtersSystem) {
|
|
183
117
|
filters.push({ c: "System", o: "=", l: "And", v1: "True" });
|
|
184
118
|
}
|
|
119
|
+
filters = [...filters, ...this.filterList];
|
|
185
120
|
return filters;
|
|
186
121
|
}
|
|
187
122
|
/**
|
|
@@ -224,43 +159,22 @@ __decorate([
|
|
|
224
159
|
], State.prototype, "filterName", void 0);
|
|
225
160
|
__decorate([
|
|
226
161
|
observable
|
|
227
|
-
], State.prototype, "
|
|
228
|
-
__decorate([
|
|
229
|
-
observable
|
|
230
|
-
], State.prototype, "status", void 0);
|
|
231
|
-
__decorate([
|
|
232
|
-
observable
|
|
233
|
-
], State.prototype, "statusList", void 0);
|
|
162
|
+
], State.prototype, "filterList", void 0);
|
|
234
163
|
__decorate([
|
|
235
164
|
observable
|
|
236
165
|
], State.prototype, "exclude", void 0);
|
|
237
166
|
__decorate([
|
|
238
167
|
observable
|
|
239
|
-
], State.prototype, "
|
|
240
|
-
__decorate([
|
|
241
|
-
observable
|
|
242
|
-
], State.prototype, "addFolder", void 0);
|
|
243
|
-
__decorate([
|
|
244
|
-
observable
|
|
245
|
-
], State.prototype, "addTask", void 0);
|
|
246
|
-
__decorate([
|
|
247
|
-
observable
|
|
248
|
-
], State.prototype, "addMeeting", void 0);
|
|
249
|
-
__decorate([
|
|
250
|
-
observable
|
|
251
|
-
], State.prototype, "addBoard", void 0);
|
|
252
|
-
__decorate([
|
|
253
|
-
observable
|
|
254
|
-
], State.prototype, "addGraph", void 0);
|
|
168
|
+
], State.prototype, "timeout", void 0);
|
|
255
169
|
__decorate([
|
|
256
170
|
observable
|
|
257
|
-
], State.prototype, "
|
|
171
|
+
], State.prototype, "shortcut", void 0);
|
|
258
172
|
__decorate([
|
|
259
173
|
observable
|
|
260
|
-
], State.prototype, "
|
|
174
|
+
], State.prototype, "addAble", void 0);
|
|
261
175
|
__decorate([
|
|
262
176
|
observable
|
|
263
|
-
], State.prototype, "
|
|
177
|
+
], State.prototype, "type", void 0);
|
|
264
178
|
__decorate([
|
|
265
179
|
action
|
|
266
180
|
], State.prototype, "reset", null);
|
|
@@ -270,9 +184,6 @@ __decorate([
|
|
|
270
184
|
__decorate([
|
|
271
185
|
action
|
|
272
186
|
], State.prototype, "loadMore", null);
|
|
273
|
-
__decorate([
|
|
274
|
-
action
|
|
275
|
-
], State.prototype, "onStatus", null);
|
|
276
187
|
__decorate([
|
|
277
188
|
action
|
|
278
189
|
], State.prototype, "onChangeName", null);
|
|
@@ -294,12 +205,6 @@ __decorate([
|
|
|
294
205
|
__decorate([
|
|
295
206
|
action
|
|
296
207
|
], State.prototype, "onItemClick", null);
|
|
297
|
-
__decorate([
|
|
298
|
-
computed
|
|
299
|
-
], State.prototype, "isAddDocForm", null);
|
|
300
|
-
__decorate([
|
|
301
|
-
computed
|
|
302
|
-
], State.prototype, "docType", null);
|
|
303
208
|
__decorate([
|
|
304
209
|
computed
|
|
305
210
|
], State.prototype, "filters", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/components/DocumentList/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,MA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AU;sCAAwB;AAEvB;IAAX,UAAU;mCAAsB;AAGjC;IADC,MAAM;kCASN;AAID;IADC,MAAM;mCAIN;AAID;IADC,MAAM;qCAIN;AAID;IADC,MAAM;yCAUN;AAID;IADC,MAAM;oCAIN;AAID;IADC,MAAM;uCAIN;AAID;IADC,MAAM;2CAKN;AAID;IADC,MAAM;qCAUN;AAID;IADC,MAAM;0CAIN;AAID;IADC,MAAM;wCAQN;AAOD;IADC,QAAQ;oCAiBR;AAOD;IADC,QAAQ;iCAMR"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { DocumentListContext, DocumentListContextState } from "../../data/contexts/DocumentListContext";
|
|
2
|
-
import {
|
|
3
|
-
import { useDocumentListEffect, useDocumentStore
|
|
4
|
-
import {
|
|
5
|
-
import React, {
|
|
2
|
+
import { DocumentStatusFilter, FlagFilter } from "../../controls/filters";
|
|
3
|
+
import { useAutoUpdateListData, useDocumentListEffect, useDocumentStore } from "../../data";
|
|
4
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import BreadCrumbsHeader from "../BreadCrumbsHeader";
|
|
7
|
+
import { DefaultFolders } from "../../data/DefaultFolders";
|
|
6
8
|
import DocumentItem from "../DocumentItem";
|
|
7
|
-
import
|
|
8
|
-
import FlagFilter from "@voplus/morpho-ui/es/controls/FilterView/FlagFilter";
|
|
9
|
-
import { ListView } from "@voplus/morpho-ui";
|
|
9
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
|
10
10
|
import NewDocumentForm from "../NewDocumentForm";
|
|
11
11
|
import PropertiesView from "../PropertiesView";
|
|
12
|
+
import { State } from "./state";
|
|
12
13
|
import { useObserver } from "mobx-react-lite";
|
|
14
|
+
import { useRenderOnChange } from "@voplus/morpho-ui";
|
|
13
15
|
const DocumentList = (props) => {
|
|
14
16
|
const documentstore = useDocumentStore();
|
|
15
17
|
const [state] = useState(new State(documentstore));
|
|
@@ -17,61 +19,36 @@ const DocumentList = (props) => {
|
|
|
17
19
|
state.id = state.id ? state.id : props.id;
|
|
18
20
|
/**把store 传给子级 DocumentItem*/
|
|
19
21
|
const [listoptions] = useState(new DocumentListContextState());
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
listoptions.onDriveClick = onDriveClick;
|
|
26
|
-
useDocumentListEffect(list => {
|
|
27
|
-
state.lists = list;
|
|
28
|
-
state.loading = false;
|
|
29
|
-
}, {
|
|
30
|
-
Includes: "tags",
|
|
31
|
-
Filters: state.filters,
|
|
32
|
-
Page: { Page: state.page, PageSize: 20 }
|
|
33
|
-
});
|
|
34
|
-
useOnNewDocument((s, doc) => {
|
|
35
|
-
if (doc.parentNodeId === state.id) {
|
|
36
|
-
state.lists.push(doc);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
useOnDeleteDocument((s, doc) => {
|
|
40
|
-
if (doc instanceof Array && doc.length && doc[0].parentNodeId === props.id) {
|
|
41
|
-
return;
|
|
22
|
+
/** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
|
|
23
|
+
const list = useCreateListDataState({
|
|
24
|
+
filterDefaults: {
|
|
25
|
+
includes: "tags,path",
|
|
26
|
+
filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: state.id }]
|
|
42
27
|
}
|
|
43
|
-
state.lists =
|
|
44
|
-
doc instanceof Array
|
|
45
|
-
? state.lists.filter(item => !doc.some(({ id }) => item.id === id))
|
|
46
|
-
: state.lists.filter(item => item.id !== doc.id);
|
|
47
|
-
});
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
state.status = [];
|
|
50
|
-
state.flags = [];
|
|
51
|
-
filterState.status = [];
|
|
52
|
-
filterState.flags = [];
|
|
53
|
-
state.reset();
|
|
54
28
|
}, [state.id]);
|
|
29
|
+
listoptions.type = "drive-sub";
|
|
30
|
+
listoptions.onDriveClick = onBreadCrumb;
|
|
31
|
+
/** 如果 list.filters.options变更了就重渲染,使下一行的useDocumentListEffect 可以接收新参数*/
|
|
32
|
+
useRenderOnChange(() => list.filters.options);
|
|
33
|
+
/** 把ListDataState传给useDocumentListEffect,使之可以自動更新loading, hasmore. */
|
|
34
|
+
useDocumentListEffect(list, result => list.union(result), list.filters.options);
|
|
35
|
+
/** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
|
|
36
|
+
useAutoUpdateListData(list, d => d.parentId === state.id);
|
|
55
37
|
return useObserver(() => (React.createElement(DocumentListContext.Provider, { value: listoptions },
|
|
56
|
-
React.createElement(
|
|
57
|
-
React.createElement(ListView, { renderId: state.id,
|
|
38
|
+
React.createElement(ListDataContext.Provider, { value: list },
|
|
39
|
+
React.createElement(ListView, { renderId: state.id, headerProps: {
|
|
40
|
+
header: (React.createElement(BreadCrumbsHeader, { id: state.id, drivePath: { id: DefaultFolders.DriveId, name: "Drive" }, onBreadCrumb: onBreadCrumb })),
|
|
41
|
+
filterViewProps: {
|
|
42
|
+
columns: [React.createElement(DocumentStatusFilter, { key: "Status" }), React.createElement(FlagFilter, { key: "Flag" })]
|
|
43
|
+
},
|
|
44
|
+
sortable: false
|
|
45
|
+
}, formViewTitle: "Add Document", formView: React.createElement(NewDocumentForm, { showView: true, parentId: state.id }), propertiesView: (id) => React.createElement(PropertiesView, { id: id }), renderItem: ({ item, index }) => React.createElement(DocumentItem, { id: item.id, type: "drive" }) })))));
|
|
58
46
|
/** 双击documentlist DocumentItem 返回的数据
|
|
59
47
|
* 拿到 DocumentItem id等数据 展示新的documentlist
|
|
60
48
|
* 如果type="bread",则是点击了头部的breadCrumbs,拿到新的id 展示新的documentlist
|
|
61
49
|
*/
|
|
62
|
-
function
|
|
63
|
-
const { id, name, type, parentId, parentName } = value;
|
|
50
|
+
function onBreadCrumb(id) {
|
|
64
51
|
state.id = id;
|
|
65
|
-
if (type === "bread") {
|
|
66
|
-
const breadIndex = state.breadCrumbs.findIndex(item => item.id === id) + 1;
|
|
67
|
-
state.breadCrumbs.splice(breadIndex, state.breadCrumbs.length - breadIndex);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
if (parentId)
|
|
71
|
-
state.breadCrumbs.push({ name: parentName, id: parentId, path: "drive" });
|
|
72
|
-
if (name)
|
|
73
|
-
state.breadCrumbs.push({ name: name, id: id, path: "drive" });
|
|
74
|
-
}
|
|
75
52
|
}
|
|
76
53
|
};
|
|
77
54
|
export default DocumentList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentListView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,wBAAwB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentListView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,wBAAwB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAEN,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,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entStore
|
|
2
|
-
export interface IBreadCrumb {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
path?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare type DocumentListProps = {
|
|
8
|
-
id: string;
|
|
9
|
-
};
|
|
1
|
+
import { DocumentStore } from "../../data";
|
|
10
2
|
export declare class State {
|
|
11
3
|
private _store;
|
|
12
|
-
props: DocumentListProps;
|
|
13
4
|
constructor(_store: DocumentStore);
|
|
14
5
|
id: string;
|
|
15
|
-
lists: IDocument[];
|
|
16
|
-
page: number;
|
|
17
|
-
flags: string[];
|
|
18
|
-
/** document filters status */
|
|
19
|
-
status: string[];
|
|
20
|
-
/** documentlist head breadCrumbs */
|
|
21
|
-
breadCrumbs: IBreadCrumb[];
|
|
22
|
-
/** document filters */
|
|
23
|
-
statusList: any[];
|
|
24
|
-
/** data loading */
|
|
25
|
-
loading: boolean;
|
|
26
|
-
/** reload */
|
|
27
|
-
reload: boolean;
|
|
28
|
-
/** document readonly type */
|
|
29
|
-
readonly: boolean;
|
|
30
|
-
/** reset */
|
|
31
|
-
reset(): void;
|
|
32
|
-
/** load next page */
|
|
33
|
-
loadMore(): void;
|
|
34
|
-
/** filter status */
|
|
35
|
-
filter(value: any): void;
|
|
36
|
-
/**
|
|
37
|
-
* document filters
|
|
38
|
-
* @return document filters
|
|
39
|
-
*/
|
|
40
|
-
get filters(): any[];
|
|
41
6
|
}
|