@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.
Files changed (257) hide show
  1. package/changelog.md +7 -0
  2. package/es/components/AddDocDropdown/index.js +12 -1
  3. package/es/components/AddDocDropdown/index.js.map +1 -1
  4. package/es/components/AddDocDropdown/state.js +7 -1
  5. package/es/components/AddDocDropdown/state.js.map +1 -1
  6. package/es/components/BreadCrumbsHeader/index.d.ts +9 -0
  7. package/es/components/BreadCrumbsHeader/index.js +30 -0
  8. package/es/components/BreadCrumbsHeader/index.js.map +1 -0
  9. package/es/components/BreadCrumbsHeader/index.less +10 -0
  10. package/es/components/BreadCrumbsHeader/state.d.ts +10 -0
  11. package/es/components/BreadCrumbsHeader/state.js +34 -0
  12. package/es/components/BreadCrumbsHeader/state.js.map +1 -0
  13. package/es/components/DocumentItem/index.js +2 -8
  14. package/es/components/DocumentItem/index.js.map +1 -1
  15. package/es/components/DocumentList/Header.d.ts +13 -0
  16. package/es/components/DocumentList/Header.js +16 -0
  17. package/es/components/DocumentList/Header.js.map +1 -0
  18. package/es/components/DocumentList/index.js +29 -29
  19. package/es/components/DocumentList/index.js.map +1 -1
  20. package/es/components/DocumentList/index.less +39 -15
  21. package/es/components/DocumentList/state.d.ts +5 -8
  22. package/es/components/DocumentList/state.js +21 -38
  23. package/es/components/DocumentList/state.js.map +1 -1
  24. package/es/components/DocumentListView/index.d.ts +3 -2
  25. package/es/components/DocumentListView/index.js +31 -54
  26. package/es/components/DocumentListView/index.js.map +1 -1
  27. package/es/components/DocumentListView/state.d.ts +1 -36
  28. package/es/components/DocumentListView/state.js +1 -100
  29. package/es/components/DocumentListView/state.js.map +1 -1
  30. package/es/components/DocumentSortableTree/index.js +31 -4
  31. package/es/components/DocumentSortableTree/index.js.map +1 -1
  32. package/es/components/DocumentSortableTree/state.d.ts +7 -6
  33. package/es/components/DocumentSortableTree/state.js +23 -32
  34. package/es/components/DocumentSortableTree/state.js.map +1 -1
  35. package/es/components/DocumentTabs/index.js +2 -4
  36. package/es/components/DocumentTabs/index.js.map +1 -1
  37. package/es/components/DocumentTree/index.js +1 -1
  38. package/es/components/DocumentTree/index.js.map +1 -1
  39. package/es/components/FileViewer/ImageViewer.js +4 -3
  40. package/es/components/FileViewer/ImageViewer.js.map +1 -1
  41. package/es/components/FileViewer/PDFViewer.js +4 -2
  42. package/es/components/FileViewer/PDFViewer.js.map +1 -1
  43. package/es/components/FileViewer/Preview.js +12 -10
  44. package/es/components/FileViewer/Preview.js.map +1 -1
  45. package/es/components/FileViewer/index.less +33 -0
  46. package/es/components/NewDocumentForm/index.d.ts +1 -1
  47. package/es/components/NewDocumentForm/index.js +3 -1
  48. package/es/components/NewDocumentForm/index.js.map +1 -1
  49. package/es/components/QuickAccessSearch/index.js +5 -4
  50. package/es/components/QuickAccessSearch/index.js.map +1 -1
  51. package/es/components/QuickViewDialog/QuickSubTab/index.d.ts +10 -4
  52. package/es/components/QuickViewDialog/QuickSubTab/index.js +16 -16
  53. package/es/components/QuickViewDialog/QuickSubTab/index.js.map +1 -1
  54. package/es/components/QuickViewDialog/QuickSubTab/index.less +7 -19
  55. package/es/components/QuickViewDialog/index.js +2 -1
  56. package/es/components/QuickViewDialog/index.js.map +1 -1
  57. package/es/components/QuickViewDialog/index.less +8 -1
  58. package/es/components/helper.d.ts +1 -1
  59. package/es/components/helper.js +4 -0
  60. package/es/components/helper.js.map +1 -1
  61. package/es/components/styles/common.less +4 -1
  62. package/es/controls/filters/DocumentTypeFilter/index.d.ts +3 -0
  63. package/es/controls/filters/DocumentTypeFilter/index.js +21 -0
  64. package/es/controls/filters/DocumentTypeFilter/index.js.map +1 -0
  65. package/es/controls/filters/DocumentTypeFilter/state.d.ts +18 -0
  66. package/es/controls/filters/DocumentTypeFilter/state.js +57 -0
  67. package/es/controls/filters/DocumentTypeFilter/state.js.map +1 -0
  68. package/es/controls/filters/index.d.ts +1 -0
  69. package/es/controls/filters/index.js +1 -0
  70. package/es/controls/filters/index.js.map +1 -1
  71. package/es/data/DocumentStore/hooks/useDocumentListEffect.d.ts +2 -1
  72. package/es/data/DocumentStore/hooks/useDocumentListEffect.js +2 -2
  73. package/es/data/DocumentStore/hooks/useDocumentListEffect.js.map +1 -1
  74. package/es/data/DocumentType.d.ts +3 -1
  75. package/es/data/DocumentType.js +3 -1
  76. package/es/data/DocumentType.js.map +1 -1
  77. package/es/modules/unit/components/ActivityLog/index.d.ts +6 -0
  78. package/es/modules/unit/components/ActivityLog/index.js +62 -0
  79. package/es/modules/unit/components/ActivityLog/index.js.map +1 -0
  80. package/es/modules/unit/components/ActivityLog/index.less +64 -0
  81. package/es/modules/unit/components/ActivityLog/state.d.ts +14 -0
  82. package/es/modules/unit/components/ActivityLog/state.js +51 -0
  83. package/es/modules/unit/components/ActivityLog/state.js.map +1 -0
  84. package/es/modules/unit/components/BreadCrumbsHeader/index.d.ts +6 -0
  85. package/es/modules/unit/components/BreadCrumbsHeader/index.js +27 -0
  86. package/es/modules/unit/components/BreadCrumbsHeader/index.js.map +1 -0
  87. package/es/modules/unit/components/BreadCrumbsHeader/index.less +10 -0
  88. package/es/modules/unit/components/BreadCrumbsHeader/state.d.ts +5 -0
  89. package/es/modules/unit/components/BreadCrumbsHeader/state.js +19 -0
  90. package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +1 -0
  91. package/es/modules/unit/components/NewUnitForm/index.d.ts +11 -0
  92. package/es/modules/unit/components/NewUnitForm/index.js +51 -0
  93. package/es/modules/unit/components/NewUnitForm/index.js.map +1 -0
  94. package/es/modules/unit/components/NewUnitForm/index.less +33 -0
  95. package/es/modules/unit/components/NewUnitForm/state.d.ts +22 -0
  96. package/es/modules/unit/components/NewUnitForm/state.js +49 -0
  97. package/es/modules/unit/components/NewUnitForm/state.js.map +1 -0
  98. package/es/modules/unit/components/SortableTreeUnitTheme/index.d.ts +4 -0
  99. package/es/modules/unit/components/SortableTreeUnitTheme/index.js +23 -0
  100. package/es/modules/unit/components/SortableTreeUnitTheme/index.js.map +1 -0
  101. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.d.ts +3 -0
  102. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js +58 -0
  103. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js.map +1 -0
  104. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.less +46 -0
  105. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.d.ts +3 -0
  106. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js +73 -0
  107. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js.map +1 -0
  108. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.less +12 -0
  109. package/es/modules/unit/components/SubUnitList/index.d.ts +5 -0
  110. package/es/modules/unit/components/SubUnitList/index.js +77 -0
  111. package/es/modules/unit/components/SubUnitList/index.js.map +1 -0
  112. package/es/modules/unit/components/SubUnitList/index.less +13 -0
  113. package/es/modules/unit/components/SubUnitList/state.d.ts +17 -0
  114. package/es/modules/unit/components/SubUnitList/state.js +41 -0
  115. package/es/modules/unit/components/SubUnitList/state.js.map +1 -0
  116. package/es/modules/unit/components/UnitAvatar/index.d.ts +1 -0
  117. package/es/modules/unit/components/UnitAvatar/index.js +4 -3
  118. package/es/modules/unit/components/UnitAvatar/index.js.map +1 -1
  119. package/es/modules/unit/components/UnitAvatar/index.less +2 -3
  120. package/es/modules/unit/components/UnitDetails/index.js +98 -7
  121. package/es/modules/unit/components/UnitDetails/index.js.map +1 -1
  122. package/es/modules/unit/components/UnitDetails/index.less +41 -5
  123. package/es/modules/unit/components/UnitDetails/state.d.ts +8 -0
  124. package/es/modules/unit/components/UnitDetails/state.js +24 -0
  125. package/es/modules/unit/components/UnitDetails/state.js.map +1 -0
  126. package/es/modules/unit/components/UnitHead/index.d.ts +2 -0
  127. package/es/modules/unit/components/UnitHead/index.js +31 -7
  128. package/es/modules/unit/components/UnitHead/index.js.map +1 -1
  129. package/es/modules/unit/components/UnitHead/index.less +18 -3
  130. package/es/modules/unit/components/UnitHead/state.d.ts +11 -0
  131. package/es/modules/unit/components/UnitHead/state.js +8 -0
  132. package/es/modules/unit/components/UnitHead/state.js.map +1 -0
  133. package/es/modules/unit/components/UnitItem/DefaultUnitItem.d.ts +4 -0
  134. package/es/modules/unit/components/UnitItem/DefaultUnitItem.js +29 -0
  135. package/es/modules/unit/components/UnitItem/DefaultUnitItem.js.map +1 -0
  136. package/es/modules/unit/components/UnitItem/SubUnitItem.d.ts +4 -0
  137. package/es/modules/unit/components/UnitItem/SubUnitItem.js +35 -0
  138. package/es/modules/unit/components/UnitItem/SubUnitItem.js.map +1 -0
  139. package/es/modules/unit/components/UnitItem/index.less +23 -5
  140. package/es/modules/unit/components/UnitItem/state.d.ts +20 -0
  141. package/es/modules/unit/components/UnitItem/state.js +20 -0
  142. package/es/modules/unit/components/UnitItem/state.js.map +1 -0
  143. package/es/modules/unit/components/UnitList/index.d.ts +4 -0
  144. package/es/modules/unit/components/UnitList/index.js +35 -0
  145. package/es/modules/unit/components/UnitList/index.js.map +1 -0
  146. package/es/modules/unit/components/UnitList/state.d.ts +15 -0
  147. package/es/modules/unit/components/UnitList/state.js +31 -0
  148. package/es/modules/unit/components/UnitList/state.js.map +1 -0
  149. package/es/modules/unit/components/UnitPropertiesView/index.d.ts +6 -0
  150. package/es/modules/unit/components/UnitPropertiesView/index.js +22 -0
  151. package/es/modules/unit/components/UnitPropertiesView/index.js.map +1 -0
  152. package/es/modules/unit/components/UnitSortableTree/index.d.ts +10 -0
  153. package/es/modules/unit/components/UnitSortableTree/index.js +54 -0
  154. package/es/modules/unit/components/UnitSortableTree/index.js.map +1 -0
  155. package/es/modules/unit/components/UnitSortableTree/state.d.ts +50 -0
  156. package/es/modules/unit/components/UnitSortableTree/state.js +151 -0
  157. package/es/modules/unit/components/UnitSortableTree/state.js.map +1 -0
  158. package/es/modules/unit/components/UnitTabs/index.d.ts +6 -0
  159. package/es/modules/unit/components/UnitTabs/index.js +27 -0
  160. package/es/modules/unit/components/UnitTabs/index.js.map +1 -0
  161. package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.d.ts +6 -0
  162. package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js +32 -0
  163. package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js.map +1 -0
  164. package/es/modules/unit/{components → controls}/QuickDataIcon/index.d.ts +1 -5
  165. package/es/modules/unit/controls/QuickDataIcon/index.js +36 -0
  166. package/es/modules/unit/controls/QuickDataIcon/index.js.map +1 -0
  167. package/es/modules/unit/controls/QuickDataIcon/index.less +0 -0
  168. package/es/modules/unit/controls/ToolBar/ContactMenu/index.d.ts +13 -0
  169. package/es/modules/unit/controls/ToolBar/ContactMenu/index.js +59 -0
  170. package/es/modules/unit/controls/ToolBar/ContactMenu/index.js.map +1 -0
  171. package/es/modules/unit/controls/ToolBar/ContactMenu/index.less +20 -0
  172. package/es/modules/unit/controls/ToolBar/ContactMenu/state.d.ts +34 -0
  173. package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +71 -0
  174. package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +1 -0
  175. package/es/modules/unit/controls/ToolBar/index.d.ts +12 -0
  176. package/es/modules/unit/controls/ToolBar/index.js +54 -0
  177. package/es/modules/unit/controls/ToolBar/index.js.map +1 -0
  178. package/es/modules/unit/controls/ToolBar/index.less +18 -0
  179. package/es/modules/unit/controls/ToolBar/state.d.ts +40 -0
  180. package/es/modules/unit/controls/ToolBar/state.js +50 -0
  181. package/es/modules/unit/controls/ToolBar/state.js.map +1 -0
  182. package/es/modules/unit/controls/UnitTypeFilter/index.d.ts +3 -0
  183. package/es/modules/unit/controls/UnitTypeFilter/index.js +21 -0
  184. package/es/modules/unit/controls/UnitTypeFilter/index.js.map +1 -0
  185. package/es/modules/unit/controls/UnitTypeFilter/state.d.ts +18 -0
  186. package/es/modules/unit/controls/UnitTypeFilter/state.js +63 -0
  187. package/es/modules/unit/controls/UnitTypeFilter/state.js.map +1 -0
  188. package/es/modules/unit/data/ContactStore.d.ts +82 -0
  189. package/es/modules/unit/data/ContactStore.js +140 -0
  190. package/es/modules/unit/data/ContactStore.js.map +1 -0
  191. package/es/modules/unit/data/FileStore/FileContext.d.ts +6 -0
  192. package/es/modules/unit/data/FileStore/FileContext.js +40 -0
  193. package/es/modules/unit/data/FileStore/FileContext.js.map +1 -0
  194. package/es/modules/unit/data/FileStore/index.d.ts +1 -0
  195. package/es/modules/unit/data/FileStore/index.js +2 -0
  196. package/es/modules/unit/data/FileStore/index.js.map +1 -0
  197. package/es/modules/unit/data/StoreContext/index.d.ts +3 -0
  198. package/es/modules/unit/data/StoreContext/index.js +4 -0
  199. package/es/modules/unit/data/StoreContext/index.js.map +1 -0
  200. package/es/modules/unit/data/UnitContext/index.d.ts +20 -0
  201. package/es/modules/unit/data/UnitContext/index.js +32 -0
  202. package/es/modules/unit/data/UnitContext/index.js.map +1 -0
  203. package/es/modules/unit/data/hooks.d.ts +24 -0
  204. package/es/modules/unit/data/hooks.js +65 -0
  205. package/es/modules/unit/data/hooks.js.map +1 -0
  206. package/es/modules/unit/data/index.d.ts +3 -0
  207. package/es/modules/unit/data/index.js +3 -0
  208. package/es/modules/unit/data/index.js.map +1 -0
  209. package/es/modules/unit/data/interfaces/IAddress.d.ts +14 -0
  210. package/es/modules/unit/data/interfaces/IAddress.js +1 -0
  211. package/es/modules/unit/data/interfaces/IAddress.js.map +1 -0
  212. package/es/modules/unit/data/interfaces/IContact.d.ts +45 -0
  213. package/es/modules/unit/data/interfaces/IContact.js +1 -0
  214. package/es/modules/unit/data/interfaces/IContact.js.map +1 -0
  215. package/es/modules/unit/data/interfaces/IEntityName.d.ts +6 -0
  216. package/es/modules/unit/data/interfaces/IEntityName.js +1 -0
  217. package/es/modules/unit/data/interfaces/IEntityName.js.map +1 -0
  218. package/es/modules/unit/data/interfaces/index.d.ts +3 -0
  219. package/es/modules/unit/data/interfaces/index.js +1 -0
  220. package/es/modules/unit/data/interfaces/index.js.map +1 -0
  221. package/es/modules/unit/pages/UnitDefaultView/index.d.ts +3 -0
  222. package/es/modules/unit/pages/UnitDefaultView/index.js +47 -0
  223. package/es/modules/unit/pages/UnitDefaultView/index.js.map +1 -0
  224. package/es/modules/unit/pages/UnitDefaultView/index.less +17 -0
  225. package/es/modules/unit/pages/UnitListView/index.d.ts +3 -0
  226. package/es/modules/unit/pages/UnitListView/index.js +10 -0
  227. package/es/modules/unit/pages/UnitListView/index.js.map +1 -0
  228. package/es/modules/unit/pages/UnitTreeView/index.d.ts +3 -0
  229. package/es/modules/unit/pages/UnitTreeView/index.js +47 -0
  230. package/es/modules/unit/pages/UnitTreeView/index.js.map +1 -0
  231. package/es/modules/unit/pages/UnitTreeView/index.less +31 -0
  232. package/es/modules/unit/pages/UnitTreeView/state.d.ts +5 -0
  233. package/es/modules/unit/pages/UnitTreeView/state.js +14 -0
  234. package/es/modules/unit/pages/UnitTreeView/state.js.map +1 -0
  235. package/es/pages/TreeViewPage/index.js +27 -20
  236. package/es/pages/TreeViewPage/index.js.map +1 -1
  237. package/es/pages/TreeViewPage/index.less +28 -19
  238. package/es/pages/TreeViewPage/state.d.ts +5 -0
  239. package/es/pages/TreeViewPage/state.js +14 -0
  240. package/es/pages/TreeViewPage/state.js.map +1 -0
  241. package/es/routes.d.ts +18 -0
  242. package/es/routes.js +40 -1
  243. package/es/routes.js.map +1 -1
  244. package/package.json +3 -1
  245. package/es/controls/DocumentTypeFilter/index.js +0 -54
  246. package/es/controls/DocumentTypeFilter/index.js.map +0 -1
  247. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.d.ts +0 -14
  248. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js +0 -28
  249. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js.map +0 -1
  250. package/es/modules/unit/components/QuickDataIcon/index.js +0 -45
  251. package/es/modules/unit/components/QuickDataIcon/index.js.map +0 -1
  252. package/es/modules/unit/components/UnitItem/index.d.ts +0 -6
  253. package/es/modules/unit/components/UnitItem/index.js +0 -19
  254. package/es/modules/unit/components/UnitItem/index.js.map +0 -1
  255. /package/es/modules/unit/components/{QuickDataIcon → UnitList}/index.less +0 -0
  256. /package/es/{controls/DocumentTypeFilter/index.d.ts → modules/unit/components/UnitPropertiesView/index.less} +0 -0
  257. /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,2 @@
1
+ export * from "./FileContext";
2
+ //# sourceMappingURL=index.js.map
@@ -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,3 @@
1
+ import moment from "moment";
2
+ export declare const localFormat: (time?: any, format?: string | undefined) => string;
3
+ export declare const toLocal: (time: any) => moment.Moment;
@@ -0,0 +1,4 @@
1
+ import moment from "moment";
2
+ export const localFormat = (time, format) => moment(moment.utc(time).toDate()).format(format);
3
+ export const toLocal = (time) => moment(moment.utc(time).valueOf());
4
+ //# sourceMappingURL=index.js.map
@@ -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,C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ks";
@@ -0,0 +1,3 @@
1
+ export * from "./ContactStore";
2
+ export * from "./hooks";
3
+ //# sourceMappingURL=index.js.map
@@ -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,6 @@
1
+ export interface IEntityId {
2
+ id: string;
3
+ }
4
+ export interface IEntityName extends IEntityId {
5
+ name: string;
6
+ }
@@ -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,3 @@
1
+ export * from "./IContact";
2
+ export * from "./IEntityName";
3
+ export * from "./IAddress";
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ declare const UnitDefaultView: () => JSX.Element;
3
+ export default UnitDefaultView;
@@ -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;A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AAE,MAAM,GAAI,CAC9C;QACN,oBAAC,YAAY,IAAC,OAAO,EAAE,YAAY;YAClC,6BAAK,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,IACzC,MAAM,IAAI,CACV,6BAAK,SAAS,EAAC,sBAAsB;gBACpC,oBAAC,QAAQ,IACR,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,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,3 @@
1
+ /// <reference types="react" />
2
+ declare const UnitListView: () => JSX.Element;
3
+ export default UnitListView;
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ declare const UnitTreeView: () => JSX.Element;
3
+ export default UnitTreeView;
@@ -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,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,UAAU,MAAM,oEAAoE,CAAC;AAC5F,O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BACX,KAAK,CAAC,UAAU,SAAG,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAC,OAAO,0CAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC;oBAC7E,CAAC;oBACD,OAAO,EAAE,CAAC,CAAC,EAAE;wBACZ,CAAC,CAAC,KAAK,EAAE,CAAC;wBACV,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;oBAC9B,CAAC;iBACD,EACD,QAAQ,EAAE,KAAK,EACf,OAAO,EAAE,KAAK,GACb,CACwB;QAC3B,oBAAC,YAAY,IAAC,OAAO,EAAE,YAAY;YAClC,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,GAAI,CAC5E,CACV,CACN,CAAC,CAAC;IAEH,SAAS,MAAM,CAAC,EAAU;QACzB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,SAAS,cAAc,CAAC,EAAU;QACjC,YAAY,CAAC,SAAS,CAAC,oBAAC,kBAAkB,IAAC,EAAE,EAAE,EAAE,GAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,31 @@
1
+ .tree-view {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ :global {
6
+ .list-view-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,5 @@
1
+ import { FilterOption } from "@voplus/morpho-data";
2
+ export declare class State {
3
+ types: string[];
4
+ filterType: FilterOption | undefined;
5
+ }
@@ -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 { Breadcrumb } from "@voplus/antd";
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 classnames from "classnames";
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 doc = useDocument(id, { reload: true, includes: "path" });
19
- const subStrName = (name) => {
20
- return doc.path && doc.path.length > 4 && name.length > 30
21
- ? name.substr(0, 20) + "..."
22
- : name;
23
- };
24
- const toPath = (id) => {
25
- layout.history.push(`/tree-view/${id}`);
26
- };
27
- return useObserver(() => (React.createElement(React.Fragment, null,
28
- !!(doc.path && doc.path.length) && (React.createElement("div", { className: styles["breadcrumb-container"] },
29
- React.createElement(Breadcrumb, { separator: ">" }, [...doc.path, { id: id, name: doc.name }].map((item) => (React.createElement(Breadcrumb.Item, { key: item.id, onClick: () => toPath(item.id) },
30
- React.createElement("span", { title: item.name, className: classnames("breadcrumb-name", {
31
- "breadcrumb-active": item.id === id
32
- }) }, subStrName(item.name)))))))),
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
  }