@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.
Files changed (296) hide show
  1. package/changelog.md +7 -0
  2. package/es/Modules.js +4 -3
  3. package/es/Modules.js.map +1 -1
  4. package/es/components/ActivityLog/index.js +11 -4
  5. package/es/components/ActivityLog/index.js.map +1 -1
  6. package/es/components/AddDocDropdown/index.js +12 -1
  7. package/es/components/AddDocDropdown/index.js.map +1 -1
  8. package/es/components/AddDocDropdown/state.js +7 -1
  9. package/es/components/AddDocDropdown/state.js.map +1 -1
  10. package/es/components/BreadCrumbsHeader/index.d.ts +9 -0
  11. package/es/components/BreadCrumbsHeader/index.js +30 -0
  12. package/es/components/BreadCrumbsHeader/index.js.map +1 -0
  13. package/es/components/BreadCrumbsHeader/index.less +10 -0
  14. package/es/components/BreadCrumbsHeader/state.d.ts +10 -0
  15. package/es/components/BreadCrumbsHeader/state.js +34 -0
  16. package/es/components/BreadCrumbsHeader/state.js.map +1 -0
  17. package/es/components/DocumentItem/index.js +2 -8
  18. package/es/components/DocumentItem/index.js.map +1 -1
  19. package/es/components/DocumentList/Header.d.ts +13 -0
  20. package/es/components/DocumentList/Header.js +16 -0
  21. package/es/components/DocumentList/Header.js.map +1 -0
  22. package/es/components/DocumentList/index.js +29 -29
  23. package/es/components/DocumentList/index.js.map +1 -1
  24. package/es/components/DocumentList/index.less +39 -15
  25. package/es/components/DocumentList/state.d.ts +5 -8
  26. package/es/components/DocumentList/state.js +21 -38
  27. package/es/components/DocumentList/state.js.map +1 -1
  28. package/es/components/DocumentListView/index.d.ts +3 -2
  29. package/es/components/DocumentListView/index.js +31 -54
  30. package/es/components/DocumentListView/index.js.map +1 -1
  31. package/es/components/DocumentListView/state.d.ts +1 -36
  32. package/es/components/DocumentListView/state.js +1 -100
  33. package/es/components/DocumentListView/state.js.map +1 -1
  34. package/es/components/DocumentSortableTree/index.js +31 -4
  35. package/es/components/DocumentSortableTree/index.js.map +1 -1
  36. package/es/components/DocumentSortableTree/state.d.ts +7 -6
  37. package/es/components/DocumentSortableTree/state.js +23 -32
  38. package/es/components/DocumentSortableTree/state.js.map +1 -1
  39. package/es/components/DocumentTabs/index.js +2 -4
  40. package/es/components/DocumentTabs/index.js.map +1 -1
  41. package/es/components/DocumentTree/index.js +1 -1
  42. package/es/components/DocumentTree/index.js.map +1 -1
  43. package/es/components/FileViewer/ImageViewer.js +4 -3
  44. package/es/components/FileViewer/ImageViewer.js.map +1 -1
  45. package/es/components/FileViewer/PDFViewer.js +4 -2
  46. package/es/components/FileViewer/PDFViewer.js.map +1 -1
  47. package/es/components/FileViewer/Preview.js +12 -10
  48. package/es/components/FileViewer/Preview.js.map +1 -1
  49. package/es/components/FileViewer/index.less +33 -0
  50. package/es/components/NewDocumentForm/index.d.ts +1 -1
  51. package/es/components/NewDocumentForm/index.js +3 -1
  52. package/es/components/NewDocumentForm/index.js.map +1 -1
  53. package/es/components/QuickAccessSearch/index.js +5 -4
  54. package/es/components/QuickAccessSearch/index.js.map +1 -1
  55. package/es/components/QuickViewDialog/QuickSubTab/index.d.ts +10 -4
  56. package/es/components/QuickViewDialog/QuickSubTab/index.js +16 -16
  57. package/es/components/QuickViewDialog/QuickSubTab/index.js.map +1 -1
  58. package/es/components/QuickViewDialog/QuickSubTab/index.less +7 -19
  59. package/es/components/QuickViewDialog/index.js +2 -1
  60. package/es/components/QuickViewDialog/index.js.map +1 -1
  61. package/es/components/QuickViewDialog/index.less +8 -1
  62. package/es/components/helper.d.ts +1 -1
  63. package/es/components/helper.js +4 -0
  64. package/es/components/helper.js.map +1 -1
  65. package/es/components/styles/common.less +4 -1
  66. package/es/controls/filters/CreateDateFilter/index.d.ts +3 -0
  67. package/es/controls/filters/CreateDateFilter/index.js +24 -0
  68. package/es/controls/filters/CreateDateFilter/index.js.map +1 -0
  69. package/es/controls/filters/CreateDateFilter/state.d.ts +12 -0
  70. package/es/controls/filters/CreateDateFilter/state.js +33 -0
  71. package/es/controls/filters/CreateDateFilter/state.js.map +1 -0
  72. package/es/controls/filters/DocumentStatusFilter/index.d.ts +3 -0
  73. package/es/controls/filters/DocumentStatusFilter/index.js +23 -0
  74. package/es/controls/filters/DocumentStatusFilter/index.js.map +1 -0
  75. package/es/controls/filters/DocumentStatusFilter/state.d.ts +18 -0
  76. package/es/controls/filters/DocumentStatusFilter/state.js +43 -0
  77. package/es/controls/filters/DocumentStatusFilter/state.js.map +1 -0
  78. package/es/controls/filters/DocumentTypeFilter/index.d.ts +3 -0
  79. package/es/controls/filters/DocumentTypeFilter/index.js +21 -0
  80. package/es/controls/filters/DocumentTypeFilter/index.js.map +1 -0
  81. package/es/controls/filters/DocumentTypeFilter/state.d.ts +18 -0
  82. package/es/controls/filters/DocumentTypeFilter/state.js +57 -0
  83. package/es/controls/filters/DocumentTypeFilter/state.js.map +1 -0
  84. package/es/controls/filters/FlagFilter/index.d.ts +3 -0
  85. package/es/controls/filters/FlagFilter/index.js +21 -0
  86. package/es/controls/filters/FlagFilter/index.js.map +1 -0
  87. package/es/controls/filters/FlagFilter/state.d.ts +18 -0
  88. package/es/controls/filters/FlagFilter/state.js +54 -0
  89. package/es/controls/filters/FlagFilter/state.js.map +1 -0
  90. package/es/controls/filters/index.d.ts +4 -0
  91. package/es/controls/filters/index.js +5 -0
  92. package/es/controls/filters/index.js.map +1 -0
  93. package/es/data/DocumentStore/DocumentStore.d.ts +10 -0
  94. package/es/data/DocumentStore/DocumentStore.js +8 -0
  95. package/es/data/DocumentStore/DocumentStore.js.map +1 -1
  96. package/es/data/DocumentStore/hooks/useDocumentListEffect.d.ts +2 -1
  97. package/es/data/DocumentStore/hooks/useDocumentListEffect.js +2 -2
  98. package/es/data/DocumentStore/hooks/useDocumentListEffect.js.map +1 -1
  99. package/es/data/DocumentType.d.ts +3 -1
  100. package/es/data/DocumentType.js +3 -1
  101. package/es/data/DocumentType.js.map +1 -1
  102. package/es/data/interfaces/IShortcut.d.ts +8 -0
  103. package/es/data/interfaces/IShortcut.js +1 -0
  104. package/es/data/interfaces/IShortcut.js.map +1 -0
  105. package/es/data/interfaces/index.d.ts +1 -0
  106. package/es/data/{metas.d.ts → metas/FileTypeMeta.d.ts} +2 -2
  107. package/es/data/{metas.js → metas/FileTypeMeta.js} +4 -4
  108. package/es/data/metas/FileTypeMeta.js.map +1 -0
  109. package/es/data/metas/ShortcutMeta.d.ts +14 -0
  110. package/es/data/metas/ShortcutMeta.js +30 -0
  111. package/es/data/metas/ShortcutMeta.js.map +1 -0
  112. package/es/data/metas/index.d.ts +2 -0
  113. package/es/data/metas/index.js +3 -0
  114. package/es/data/metas/index.js.map +1 -0
  115. package/es/modules/unit/components/ActivityLog/index.d.ts +6 -0
  116. package/es/modules/unit/components/ActivityLog/index.js +62 -0
  117. package/es/modules/unit/components/ActivityLog/index.js.map +1 -0
  118. package/es/modules/unit/components/ActivityLog/index.less +64 -0
  119. package/es/modules/unit/components/ActivityLog/state.d.ts +14 -0
  120. package/es/modules/unit/components/ActivityLog/state.js +51 -0
  121. package/es/modules/unit/components/ActivityLog/state.js.map +1 -0
  122. package/es/modules/unit/components/BreadCrumbsHeader/index.d.ts +6 -0
  123. package/es/modules/unit/components/BreadCrumbsHeader/index.js +27 -0
  124. package/es/modules/unit/components/BreadCrumbsHeader/index.js.map +1 -0
  125. package/es/modules/unit/components/BreadCrumbsHeader/index.less +10 -0
  126. package/es/modules/unit/components/BreadCrumbsHeader/state.d.ts +5 -0
  127. package/es/modules/unit/components/BreadCrumbsHeader/state.js +19 -0
  128. package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +1 -0
  129. package/es/modules/unit/components/NewUnitForm/index.d.ts +11 -0
  130. package/es/modules/unit/components/NewUnitForm/index.js +51 -0
  131. package/es/modules/unit/components/NewUnitForm/index.js.map +1 -0
  132. package/es/modules/unit/components/NewUnitForm/index.less +33 -0
  133. package/es/modules/unit/components/NewUnitForm/state.d.ts +22 -0
  134. package/es/modules/unit/components/NewUnitForm/state.js +49 -0
  135. package/es/modules/unit/components/NewUnitForm/state.js.map +1 -0
  136. package/es/modules/unit/components/SortableTreeUnitTheme/index.d.ts +4 -0
  137. package/es/modules/unit/components/SortableTreeUnitTheme/index.js +23 -0
  138. package/es/modules/unit/components/SortableTreeUnitTheme/index.js.map +1 -0
  139. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.d.ts +3 -0
  140. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js +58 -0
  141. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.js.map +1 -0
  142. package/es/modules/unit/components/SortableTreeUnitTheme/node-content-renderer.less +46 -0
  143. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.d.ts +3 -0
  144. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js +73 -0
  145. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.js.map +1 -0
  146. package/es/modules/unit/components/SortableTreeUnitTheme/tree-node-renderer.less +12 -0
  147. package/es/modules/unit/components/SubUnitList/index.d.ts +5 -0
  148. package/es/modules/unit/components/SubUnitList/index.js +77 -0
  149. package/es/modules/unit/components/SubUnitList/index.js.map +1 -0
  150. package/es/modules/unit/components/SubUnitList/index.less +13 -0
  151. package/es/modules/unit/components/SubUnitList/state.d.ts +17 -0
  152. package/es/modules/unit/components/SubUnitList/state.js +41 -0
  153. package/es/modules/unit/components/SubUnitList/state.js.map +1 -0
  154. package/es/modules/unit/components/UnitAvatar/index.d.ts +1 -0
  155. package/es/modules/unit/components/UnitAvatar/index.js +4 -3
  156. package/es/modules/unit/components/UnitAvatar/index.js.map +1 -1
  157. package/es/modules/unit/components/UnitAvatar/index.less +2 -3
  158. package/es/modules/unit/components/UnitDetails/index.js +98 -7
  159. package/es/modules/unit/components/UnitDetails/index.js.map +1 -1
  160. package/es/modules/unit/components/UnitDetails/index.less +41 -5
  161. package/es/modules/unit/components/UnitDetails/state.d.ts +8 -0
  162. package/es/modules/unit/components/UnitDetails/state.js +24 -0
  163. package/es/modules/unit/components/UnitDetails/state.js.map +1 -0
  164. package/es/modules/unit/components/UnitHead/index.d.ts +2 -0
  165. package/es/modules/unit/components/UnitHead/index.js +31 -7
  166. package/es/modules/unit/components/UnitHead/index.js.map +1 -1
  167. package/es/modules/unit/components/UnitHead/index.less +18 -3
  168. package/es/modules/unit/components/UnitHead/state.d.ts +11 -0
  169. package/es/modules/unit/components/UnitHead/state.js +8 -0
  170. package/es/modules/unit/components/UnitHead/state.js.map +1 -0
  171. package/es/modules/unit/components/UnitItem/DefaultUnitItem.d.ts +4 -0
  172. package/es/modules/unit/components/UnitItem/DefaultUnitItem.js +29 -0
  173. package/es/modules/unit/components/UnitItem/DefaultUnitItem.js.map +1 -0
  174. package/es/modules/unit/components/UnitItem/SubUnitItem.d.ts +4 -0
  175. package/es/modules/unit/components/UnitItem/SubUnitItem.js +35 -0
  176. package/es/modules/unit/components/UnitItem/SubUnitItem.js.map +1 -0
  177. package/es/modules/unit/components/UnitItem/index.less +23 -5
  178. package/es/modules/unit/components/UnitItem/state.d.ts +20 -0
  179. package/es/modules/unit/components/UnitItem/state.js +20 -0
  180. package/es/modules/unit/components/UnitItem/state.js.map +1 -0
  181. package/es/modules/unit/components/UnitList/index.d.ts +4 -0
  182. package/es/modules/unit/components/UnitList/index.js +35 -0
  183. package/es/modules/unit/components/UnitList/index.js.map +1 -0
  184. package/es/modules/unit/components/UnitList/state.d.ts +15 -0
  185. package/es/modules/unit/components/UnitList/state.js +31 -0
  186. package/es/modules/unit/components/UnitList/state.js.map +1 -0
  187. package/es/modules/unit/components/UnitPropertiesView/index.d.ts +6 -0
  188. package/es/modules/unit/components/UnitPropertiesView/index.js +22 -0
  189. package/es/modules/unit/components/UnitPropertiesView/index.js.map +1 -0
  190. package/es/modules/unit/components/UnitSortableTree/index.d.ts +10 -0
  191. package/es/modules/unit/components/UnitSortableTree/index.js +54 -0
  192. package/es/modules/unit/components/UnitSortableTree/index.js.map +1 -0
  193. package/es/modules/unit/components/UnitSortableTree/state.d.ts +50 -0
  194. package/es/modules/unit/components/UnitSortableTree/state.js +151 -0
  195. package/es/modules/unit/components/UnitSortableTree/state.js.map +1 -0
  196. package/es/modules/unit/components/UnitTabs/index.d.ts +6 -0
  197. package/es/modules/unit/components/UnitTabs/index.js +27 -0
  198. package/es/modules/unit/components/UnitTabs/index.js.map +1 -0
  199. package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.d.ts +6 -0
  200. package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js +32 -0
  201. package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js.map +1 -0
  202. package/es/modules/unit/{components → controls}/QuickDataIcon/index.d.ts +1 -5
  203. package/es/modules/unit/controls/QuickDataIcon/index.js +36 -0
  204. package/es/modules/unit/controls/QuickDataIcon/index.js.map +1 -0
  205. package/es/modules/unit/controls/QuickDataIcon/index.less +0 -0
  206. package/es/modules/unit/controls/ToolBar/ContactMenu/index.d.ts +13 -0
  207. package/es/modules/unit/controls/ToolBar/ContactMenu/index.js +59 -0
  208. package/es/modules/unit/controls/ToolBar/ContactMenu/index.js.map +1 -0
  209. package/es/modules/unit/controls/ToolBar/ContactMenu/index.less +20 -0
  210. package/es/modules/unit/controls/ToolBar/ContactMenu/state.d.ts +34 -0
  211. package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +71 -0
  212. package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +1 -0
  213. package/es/modules/unit/controls/ToolBar/index.d.ts +12 -0
  214. package/es/modules/unit/controls/ToolBar/index.js +54 -0
  215. package/es/modules/unit/controls/ToolBar/index.js.map +1 -0
  216. package/es/modules/unit/controls/ToolBar/index.less +18 -0
  217. package/es/modules/unit/controls/ToolBar/state.d.ts +40 -0
  218. package/es/modules/unit/controls/ToolBar/state.js +50 -0
  219. package/es/modules/unit/controls/ToolBar/state.js.map +1 -0
  220. package/es/modules/unit/controls/UnitTypeFilter/index.d.ts +3 -0
  221. package/es/modules/unit/controls/UnitTypeFilter/index.js +21 -0
  222. package/es/modules/unit/controls/UnitTypeFilter/index.js.map +1 -0
  223. package/es/modules/unit/controls/UnitTypeFilter/state.d.ts +18 -0
  224. package/es/modules/unit/controls/UnitTypeFilter/state.js +63 -0
  225. package/es/modules/unit/controls/UnitTypeFilter/state.js.map +1 -0
  226. package/es/modules/unit/data/ContactStore.d.ts +82 -0
  227. package/es/modules/unit/data/ContactStore.js +140 -0
  228. package/es/modules/unit/data/ContactStore.js.map +1 -0
  229. package/es/modules/unit/data/FileStore/FileContext.d.ts +6 -0
  230. package/es/modules/unit/data/FileStore/FileContext.js +40 -0
  231. package/es/modules/unit/data/FileStore/FileContext.js.map +1 -0
  232. package/es/modules/unit/data/FileStore/index.d.ts +1 -0
  233. package/es/modules/unit/data/FileStore/index.js +2 -0
  234. package/es/modules/unit/data/FileStore/index.js.map +1 -0
  235. package/es/modules/unit/data/StoreContext/index.d.ts +3 -0
  236. package/es/modules/unit/data/StoreContext/index.js +4 -0
  237. package/es/modules/unit/data/StoreContext/index.js.map +1 -0
  238. package/es/modules/unit/data/UnitContext/index.d.ts +20 -0
  239. package/es/modules/unit/data/UnitContext/index.js +32 -0
  240. package/es/modules/unit/data/UnitContext/index.js.map +1 -0
  241. package/es/modules/unit/data/hooks.d.ts +24 -0
  242. package/es/modules/unit/data/hooks.js +65 -0
  243. package/es/modules/unit/data/hooks.js.map +1 -0
  244. package/es/modules/unit/data/index.d.ts +3 -0
  245. package/es/modules/unit/data/index.js +3 -0
  246. package/es/modules/unit/data/index.js.map +1 -0
  247. package/es/modules/unit/data/interfaces/IAddress.d.ts +14 -0
  248. package/es/modules/unit/data/interfaces/IAddress.js +1 -0
  249. package/es/modules/unit/data/interfaces/IAddress.js.map +1 -0
  250. package/es/modules/unit/data/interfaces/IContact.d.ts +45 -0
  251. package/es/modules/unit/data/interfaces/IContact.js +1 -0
  252. package/es/modules/unit/data/interfaces/IContact.js.map +1 -0
  253. package/es/modules/unit/data/interfaces/IEntityName.d.ts +6 -0
  254. package/es/modules/unit/data/interfaces/IEntityName.js +1 -0
  255. package/es/modules/unit/data/interfaces/IEntityName.js.map +1 -0
  256. package/es/modules/unit/data/interfaces/index.d.ts +3 -0
  257. package/es/modules/unit/data/interfaces/index.js +1 -0
  258. package/es/modules/unit/data/interfaces/index.js.map +1 -0
  259. package/es/modules/unit/pages/UnitDefaultView/index.d.ts +3 -0
  260. package/es/modules/unit/pages/UnitDefaultView/index.js +47 -0
  261. package/es/modules/unit/pages/UnitDefaultView/index.js.map +1 -0
  262. package/es/modules/unit/pages/UnitDefaultView/index.less +17 -0
  263. package/es/modules/unit/pages/UnitListView/index.d.ts +3 -0
  264. package/es/modules/unit/pages/UnitListView/index.js +10 -0
  265. package/es/modules/unit/pages/UnitListView/index.js.map +1 -0
  266. package/es/modules/unit/pages/UnitTreeView/index.d.ts +3 -0
  267. package/es/modules/unit/pages/UnitTreeView/index.js +47 -0
  268. package/es/modules/unit/pages/UnitTreeView/index.js.map +1 -0
  269. package/es/modules/unit/pages/UnitTreeView/index.less +31 -0
  270. package/es/modules/unit/pages/UnitTreeView/state.d.ts +5 -0
  271. package/es/modules/unit/pages/UnitTreeView/state.js +14 -0
  272. package/es/modules/unit/pages/UnitTreeView/state.js.map +1 -0
  273. package/es/pages/TreeViewPage/index.js +27 -20
  274. package/es/pages/TreeViewPage/index.js.map +1 -1
  275. package/es/pages/TreeViewPage/index.less +28 -19
  276. package/es/pages/TreeViewPage/state.d.ts +5 -0
  277. package/es/pages/TreeViewPage/state.js +14 -0
  278. package/es/pages/TreeViewPage/state.js.map +1 -0
  279. package/es/routes.d.ts +18 -0
  280. package/es/routes.js +40 -1
  281. package/es/routes.js.map +1 -1
  282. package/package.json +5 -3
  283. package/es/controls/DocumentTypeFilter/index.js +0 -54
  284. package/es/controls/DocumentTypeFilter/index.js.map +0 -1
  285. package/es/data/metas.js.map +0 -1
  286. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.d.ts +0 -14
  287. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js +0 -28
  288. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js.map +0 -1
  289. package/es/modules/unit/components/QuickDataIcon/index.js +0 -45
  290. package/es/modules/unit/components/QuickDataIcon/index.js.map +0 -1
  291. package/es/modules/unit/components/UnitItem/index.d.ts +0 -6
  292. package/es/modules/unit/components/UnitItem/index.js +0 -19
  293. package/es/modules/unit/components/UnitItem/index.js.map +0 -1
  294. /package/es/modules/unit/components/{QuickDataIcon → UnitList}/index.less +0 -0
  295. /package/es/{controls/DocumentTypeFilter/index.d.ts → modules/unit/components/UnitPropertiesView/index.less} +0 -0
  296. /package/es/modules/unit/{components → controls}/QuickDataIcon/UnitTeamsIcon/index.less +0 -0
@@ -0,0 +1,40 @@
1
+ import { IContact } from "../../data";
2
+ export declare type ToolBarProps = {
3
+ id: string;
4
+ includes?: string;
5
+ className?: string;
6
+ path?: string;
7
+ hoverEdit?: boolean;
8
+ hoverDel?: boolean;
9
+ hoverOpen?: boolean;
10
+ edit?: boolean;
11
+ more?: boolean;
12
+ open?: boolean;
13
+ expand?: boolean;
14
+ url?: string;
15
+ shape?: boolean;
16
+ reload?: boolean;
17
+ size?: "middle" | "small" | "large";
18
+ deleteTitel?: string;
19
+ onEdit?: (params?: any) => void;
20
+ onDelete?: (params?: any) => void;
21
+ onMove?: () => void;
22
+ onPaste?: () => void;
23
+ onOpen?: () => void;
24
+ onLock?: () => void;
25
+ onUnlock?: () => void;
26
+ onReLoad?: () => void;
27
+ onExpand?: () => void;
28
+ };
29
+ export declare class State {
30
+ props: ToolBarProps;
31
+ contact: IContact;
32
+ parentDoc: IContact;
33
+ permissionVisible: boolean;
34
+ versionsModalVisible: boolean;
35
+ publishlock: boolean;
36
+ publishVisible: boolean;
37
+ get del(): boolean;
38
+ get move(): boolean;
39
+ get paste(): boolean;
40
+ }
@@ -0,0 +1,50 @@
1
+ import { __decorate } from "tslib";
2
+ import { computed, observable } from "mobx";
3
+ export class State {
4
+ constructor() {
5
+ this.permissionVisible = false;
6
+ this.versionsModalVisible = false;
7
+ this.publishlock = false;
8
+ this.publishVisible = false;
9
+ }
10
+ get del() {
11
+ return true;
12
+ }
13
+ get move() {
14
+ return true;
15
+ }
16
+ get paste() {
17
+ return true;
18
+ }
19
+ }
20
+ __decorate([
21
+ observable
22
+ ], State.prototype, "props", void 0);
23
+ __decorate([
24
+ observable
25
+ ], State.prototype, "contact", void 0);
26
+ __decorate([
27
+ observable
28
+ ], State.prototype, "parentDoc", void 0);
29
+ __decorate([
30
+ observable
31
+ ], State.prototype, "permissionVisible", void 0);
32
+ __decorate([
33
+ observable
34
+ ], State.prototype, "versionsModalVisible", void 0);
35
+ __decorate([
36
+ observable
37
+ ], State.prototype, "publishlock", void 0);
38
+ __decorate([
39
+ observable
40
+ ], State.prototype, "publishVisible", void 0);
41
+ __decorate([
42
+ computed
43
+ ], State.prototype, "del", null);
44
+ __decorate([
45
+ computed
46
+ ], State.prototype, "move", null);
47
+ __decorate([
48
+ computed
49
+ ], State.prototype, "paste", null);
50
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/ToolBar/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAyCpD,MAAM,OAAO,KAAK;IAAlB;QAIoB,sBAAiB,GAAG,KAAK,CAAC;QAC1B,yBAAoB,GAAG,KAAK,CAAC;QAC7B,gBAAW,GAAG,KAAK,CAAC;QACpB,mBAAc,GAAG,KAAK,CAAC;IAgB3C,CAAC;IAbA,IAAW,GAAG;QACb,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,IAAW,IAAI;QACd,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,IAAW,KAAK;QACf,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAtBY;IAAX,UAAU;oCAA4B;AAC3B;IAAX,UAAU;sCAA0B;AACzB;IAAX,UAAU;wCAA4B;AAC3B;IAAX,UAAU;gDAAkC;AACjC;IAAX,UAAU;mDAAqC;AACpC;IAAX,UAAU;0CAA4B;AAC3B;IAAX,UAAU;6CAA+B;AAG1C;IADC,QAAQ;gCAGR;AAGD;IADC,QAAQ;iCAGR;AAGD;IADC,QAAQ;kCAGR"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const UnitTypeFilter: () => JSX.Element;
3
+ export default UnitTypeFilter;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { State } from "./state";
3
+ import classnames from "classnames";
4
+ import { useFilterOptionsContext } from "@voplus/morpho-ui/es/data";
5
+ import { useObserver } from "mobx-react-lite";
6
+ const UnitTypeFilter = () => {
7
+ /** 引入父組件的 FilterOptionsContextState */
8
+ const context = useFilterOptionsContext();
9
+ /** 尝试从 context 取得 Type, 如果没有的话context会使用第二个factory参数创建一个State. */
10
+ const state = context.getFilterState("Type", () => new State());
11
+ return useObserver(() => (React.createElement("div", null,
12
+ React.createElement("div", { className: "menu-item-title" }, "Types"),
13
+ state.menus.map(item => (React.createElement("div", { key: item.value, className: classnames("filter-menu-item", {
14
+ bold: state.types.has(item.value)
15
+ }), onClick: () => state.changeType(item.value) },
16
+ React.createElement("div", { className: "filter-name" },
17
+ item.icon,
18
+ item.name)))))));
19
+ };
20
+ export default UnitTypeFilter;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/controls/UnitTypeFilter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,cAAc,GAAG,GAAG,EAAE;IAC3B,uCAAuC;IACvC,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAE1C,kEAAkE;IAClE,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAEhE,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB;QACC,6BAAK,SAAS,EAAC,iBAAiB,YAAY;QAC3C,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACxB,6BACC,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;gBACzC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;aACjC,CAAC,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAE3C,6BAAK,SAAS,EAAC,aAAa;gBAC1B,IAAI,CAAC,IAAI;gBACT,IAAI,CAAC,IAAI,CACL,CACD,CACN,CAAC,CACG,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { FilterOption } from "@voplus/morpho-data";
3
+ import { IFilterState } from "@voplus/morpho-ui/es/data";
4
+ /** TypeFilter的 State, 实现 IFilterState 接口 */
5
+ export declare class State implements IFilterState {
6
+ /** Types of unit of filter */
7
+ types: Map<string, boolean>;
8
+ /** Alter unit type */
9
+ changeType(value: string): void;
10
+ get menus(): {
11
+ name: string;
12
+ value: string;
13
+ icon: JSX.Element;
14
+ }[];
15
+ /** 视乎State内容,返回正确的FilterOption[]. 在Filter时,Context 会使用此属性replace Context内FilterOption的资料。 */
16
+ get filters(): FilterOption[];
17
+ reset(): void;
18
+ }
@@ -0,0 +1,63 @@
1
+ import { __decorate } from "tslib";
2
+ import { action, observable } from "mobx";
3
+ import { faSitemap, faUser, faUserCircle, faUsers } from "@fortawesome/free-solid-svg-icons";
4
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
5
+ import React from "react";
6
+ /** TypeFilter的 State, 实现 IFilterState 接口 */
7
+ export class State {
8
+ constructor() {
9
+ /** Types of unit of filter */
10
+ this.types = new Map();
11
+ }
12
+ /** Alter unit type */
13
+ changeType(value) {
14
+ this.types.has(value) ? this.types.delete(value) : this.types.set(value, true);
15
+ }
16
+ get menus() {
17
+ return [
18
+ {
19
+ name: "Account",
20
+ value: "Account",
21
+ icon: React.createElement(FAIcon, { icon: faUserCircle, color: "#fd7e14", className: "icon" })
22
+ },
23
+ {
24
+ name: "Organization",
25
+ value: "Organization",
26
+ icon: React.createElement(FAIcon, { icon: faSitemap, color: "#ff4d4f", className: "icon" })
27
+ },
28
+ {
29
+ name: "User",
30
+ value: "User",
31
+ icon: React.createElement(FAIcon, { icon: faUser, color: "#ff4d4f", className: "icon" })
32
+ },
33
+ {
34
+ name: "Team",
35
+ value: "Team",
36
+ icon: React.createElement(FAIcon, { icon: faUsers, color: "#ff4d4f", className: "icon" })
37
+ }
38
+ ];
39
+ }
40
+ /** 视乎State内容,返回正确的FilterOption[]. 在Filter时,Context 会使用此属性replace Context内FilterOption的资料。 */
41
+ get filters() {
42
+ if (this.types.size === 0)
43
+ return [];
44
+ return [
45
+ {
46
+ c: "Type",
47
+ o: "contains",
48
+ v1: JSON.stringify(Array.from(this.types.keys())),
49
+ l: "And"
50
+ }
51
+ ];
52
+ }
53
+ reset() {
54
+ this.types.clear();
55
+ }
56
+ }
57
+ __decorate([
58
+ observable
59
+ ], State.prototype, "types", void 0);
60
+ __decorate([
61
+ action
62
+ ], State.prototype, "changeType", null);
63
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"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,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,GAAG;aAChE;SACD,CAAC;IACH,CAAC;IAED,6FAA6F;IAC7F,IAAW,OAAO;QACjB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACrC,OAAO;YACN;gBACC,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,UAAU;gBACb,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;gBACjD,CAAC,EAAE,KAAK;aACQ;SACjB,CAAC;IACH,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACD;AAjDY;IAAX,UAAU;oCAAgD;AAI3D;IADC,MAAM;uCAGN"}
@@ -0,0 +1,82 @@
1
+ import { ApiEndPoint } from "@voplus/api";
2
+ import { CountedMap, LoadOptions, Store } from "@voplus/morpho-data";
3
+ import { FilterOption, PageParameters } from "@voplus/morpho-data/es/types";
4
+ import { IAddress, IContact } from "./interfaces";
5
+ import { IActivityLog } from "@voplus/morpho-collaboration/es/data/interfaces/IActivityLog";
6
+ /** Custom load contact list options type */
7
+ export declare type LoadContactListOptions = {
8
+ Includes?: string;
9
+ reload?: boolean;
10
+ /** Parent id of of the units to be loaded */
11
+ parent?: string;
12
+ Filters?: FilterOption[];
13
+ Page?: PageParameters;
14
+ };
15
+ /** Custom load contact options type */
16
+ export declare type LoadContactOptions = {
17
+ /** Comma separated include options e.g. path */
18
+ includes?: string;
19
+ } & LoadOptions<IContact>;
20
+ export declare type EditContactOptions = {
21
+ /** New name of the contact. */
22
+ Name?: string;
23
+ /** New Size of the contact. */
24
+ Size?: string;
25
+ /** New Gender of the contact. */
26
+ Gender?: "Male" | "Female";
27
+ /** New Email of the contact. */
28
+ Email?: string;
29
+ /** New Address of the contact. */
30
+ Address?: IAddress;
31
+ /** New Phone of the contact. */
32
+ Phone?: string;
33
+ /** New Nationality of the contact. */
34
+ Nationality?: string;
35
+ /** New Birthday of the contact. */
36
+ Birthday?: string;
37
+ };
38
+ /** Custom load contact list options type. */
39
+ export declare type DeleteContactOptions = {
40
+ DeleteChilds?: boolean;
41
+ };
42
+ export declare class ContactStore extends Store {
43
+ private readonly _api;
44
+ readonly name: string;
45
+ /** Document created event dispatcher */
46
+ private readonly _documentCreated;
47
+ private readonly _documentDeleted;
48
+ readonly items: CountedMap<string, IContact>;
49
+ /** Create a default contact object with optional default values. */
50
+ static createDefaultContact(defaultValues?: Partial<IContact>): IContact;
51
+ constructor(_api: ApiEndPoint);
52
+ /** Create a new document base on type. */
53
+ createFromType(options: {
54
+ name: string;
55
+ parentId: string;
56
+ type: string;
57
+ }): Promise<IContact>;
58
+ /** Load a task from server.
59
+ * @param {string} id - id of the task.
60
+ * @param {LoadTaskOptions} options - Optional load options.
61
+ */
62
+ load(id: string, options: LoadContactOptions): Promise<IContact>;
63
+ /** Refresh a loaded unit. */
64
+ refresh(id: string, options: LoadContactOptions): Promise<void>;
65
+ private _listCache;
66
+ /** Load a list of contacts from server.
67
+ * @param {LoadTaskListOptions}
68
+ */
69
+ loadList(options?: LoadContactListOptions): Promise<any>;
70
+ /** Load a list of activities of a contact from server.
71
+ * @param id - id of the contact.
72
+ * @param {LoadContactListOptions}
73
+ */
74
+ loadContactActivityList(id: string, options?: LoadContactListOptions): Promise<IActivityLog[]>;
75
+ /** Edit an existing item on server. */
76
+ edit(id: string, options: EditContactOptions): Promise<void>;
77
+ delete(id: string): Promise<IContact>;
78
+ moveAfter(id: string, afterId?: string): Promise<void>;
79
+ move(ids: string[], targetId?: string): Promise<any>;
80
+ }
81
+ /** React hook to retrieve ContactStore */
82
+ export declare const useContactStore: () => ContactStore;
@@ -0,0 +1,140 @@
1
+ import { __decorate } from "tslib";
2
+ import { RequestBuilder } from "@voplus/api";
3
+ import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
4
+ import { action, observable } from "mobx";
5
+ import { EventDispatcher } from "strongly-typed-events";
6
+ import hash from "object-hash";
7
+ import invariant from "invariant";
8
+ import { setTimeout } from "timers";
9
+ const StoreName = "ContactStore";
10
+ export class ContactStore extends Store {
11
+ constructor(_api) {
12
+ super();
13
+ this._api = _api;
14
+ this.name = StoreName;
15
+ /** Document created event dispatcher */
16
+ this._documentCreated = new EventDispatcher();
17
+ this._documentDeleted = new EventDispatcher();
18
+ this.items = new CountedMap((key) => ContactStore.createDefaultContact({ id: key }), observable.map([], { deep: true }));
19
+ this._listCache = new Map();
20
+ invariant(_api, `API cannot be ${_api}.`);
21
+ }
22
+ /** Create a default contact object with optional default values. */
23
+ static createDefaultContact(defaultValues) {
24
+ const v = { loaded: false, address: {}, primaryLegalIdentity: {} };
25
+ if (defaultValues)
26
+ Object.assign(v, defaultValues);
27
+ return v;
28
+ }
29
+ /** Create a new document base on type. */
30
+ async createFromType(options) {
31
+ invariant(options.name, "Name cannot be empty.");
32
+ const r = await this._api.post(`api/groups/create`, new RequestBuilder().form(options));
33
+ const t = (await r.json());
34
+ this._documentCreated.dispatch(this, t);
35
+ console.log("createFromType", t);
36
+ return t;
37
+ }
38
+ /** Load a task from server.
39
+ * @param {string} id - id of the task.
40
+ * @param {LoadTaskOptions} options - Optional load options.
41
+ */
42
+ async load(id, options) {
43
+ let query = "";
44
+ if (options.includes)
45
+ query = query.concat(`includes=${options.includes}`);
46
+ if (query)
47
+ query = "?".concat(query);
48
+ const r = await this._api.get(`/units/${id}${query}`);
49
+ return (await r.json());
50
+ }
51
+ /** Refresh a loaded unit. */
52
+ async refresh(id, options) {
53
+ if (!this.items.has(id))
54
+ return;
55
+ const c = await this.load(id, options);
56
+ this.items.overwrite(id, c);
57
+ }
58
+ /** Load a list of contacts from server.
59
+ * @param {LoadTaskListOptions}
60
+ */
61
+ async loadList(options) {
62
+ options = options !== null && options !== void 0 ? options : { Filters: [] };
63
+ // const reload = options.reload;
64
+ delete options["reload"];
65
+ // Calculate hash code for load options.
66
+ const hc = hash(options);
67
+ // load from server if not cached
68
+ if (!this._listCache.has(hc)) {
69
+ const urlPostFix = options.parent ? `/${options.parent}/units` : "";
70
+ const r = await this._api.post(`/units${urlPostFix}`, new RequestBuilder().json(options));
71
+ const result = await r.json();
72
+ // Save cache and clear time out.
73
+ this._listCache.set(hc, result);
74
+ setTimeout(() => {
75
+ this._listCache.delete(hc);
76
+ }, 5 * 60 * 1000);
77
+ }
78
+ return this._listCache.get(hc);
79
+ }
80
+ /** Load a list of activities of a contact from server.
81
+ * @param id - id of the contact.
82
+ * @param {LoadContactListOptions}
83
+ */
84
+ async loadContactActivityList(id, options) {
85
+ invariant(id, "id cannot be empty");
86
+ let query = "";
87
+ if (options === null || options === void 0 ? void 0 : options.Includes) {
88
+ query = query.concat(`includes=${options.Includes}`);
89
+ }
90
+ if (query)
91
+ query = "?".concat(query);
92
+ const r = await this._api.post(`/units/${id}/activities${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
93
+ return (await r.json());
94
+ }
95
+ /** Edit an existing item on server. */
96
+ async edit(id, options) {
97
+ const r = await this._api.post(`api/units/${id}/info`, new RequestBuilder().json(options));
98
+ const t = await r.json();
99
+ this.items.overwrite(t.id, t);
100
+ }
101
+ async delete(id) {
102
+ await this._api.delete(`api/groups/${id}`);
103
+ const item = this.items.peek(id);
104
+ this._documentDeleted.dispatch(this, item);
105
+ return item;
106
+ }
107
+ async moveAfter(id, afterId) {
108
+ await this._api.post(`api/units/${id}/move?afterId=${afterId}`);
109
+ }
110
+ async move(ids, targetId) {
111
+ const result = await this._api.post(`api/units/move`, new RequestBuilder().json({ Ids: ids, TargetId: targetId }));
112
+ const moved = await result.json();
113
+ for (const item of moved) {
114
+ this._documentCreated.dispatch(this, item);
115
+ }
116
+ this._documentDeleted.dispatch(this, moved);
117
+ return moved;
118
+ }
119
+ }
120
+ __decorate([
121
+ observable
122
+ ], ContactStore.prototype, "items", void 0);
123
+ __decorate([
124
+ action
125
+ ], ContactStore.prototype, "delete", null);
126
+ __decorate([
127
+ action
128
+ ], ContactStore.prototype, "moveAfter", null);
129
+ __decorate([
130
+ action
131
+ ], ContactStore.prototype, "move", null);
132
+ /** React hook to retrieve ContactStore */
133
+ export const useContactStore = () => {
134
+ const context = useApplicationContext();
135
+ if (!context.getStore(StoreName)) {
136
+ context.addStore(new ContactStore(context.api.currentEndPoint));
137
+ }
138
+ return context.getStore(StoreName);
139
+ };
140
+ //# sourceMappingURL=ContactStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactStore.js","sourceRoot":"","sources":["../../../../src/modules/unit/data/ContactStore.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAe,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG5F,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,SAAS,GAAG,cAAc,CAAC;AAqDjC,MAAM,OAAO,YAAa,SAAQ,KAAK;IAmBtC,YAAoC,IAAiB;QACpD,KAAK,EAAE,CAAC;QAD2B,SAAI,GAAJ,IAAI,CAAa;QAlBrC,SAAI,GAAW,SAAS,CAAC;QACzC,wCAAwC;QACvB,qBAAgB,GAAG,IAAI,eAAe,EAA0B,CAAC;QACjE,qBAAgB,GAAG,IAAI,eAAe,EAA0B,CAAC;QAGlE,UAAK,GAAiC,IAAI,UAAU,CACnE,CAAC,GAAW,EA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C;CACD;AA/IA;IAFC,UAAU;2CAKT;AA2GF;IADC,MAAM;0CAMN;AAOD;IALC,MAAM;6CAON;AAOD;IALC,MAAM;wCAgBN;AAGF,0CAA0C;AAC1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KAChE;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB,CAAC;AACrD,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare class FileStore {
2
+ get moveIds(): any;
3
+ onMove(ids: string[]): import("@voplus/antd/es/message").MessageType;
4
+ onPaste(loader: () => void): void;
5
+ clear(): void;
6
+ }
@@ -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;