@voplus/morpho-document 1.0.0-dev300 → 1.0.0-dev302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +1 -1
- package/es/Modules.js +1 -1
- package/es/Modules.js.map +1 -1
- package/es/components/ActivityLog/ActivityLog2/index.js.map +1 -1
- package/es/components/ActivityLog/index.js.map +1 -1
- package/es/components/ActivityLog/state.d.ts +1 -1
- package/es/components/ActivityLog/state.js.map +1 -1
- package/es/components/AvatarList/AvatarItem/index.js +2 -2
- package/es/components/AvatarList/AvatarItem/index.js.map +1 -1
- package/es/components/AvatarList/index.js +2 -2
- package/es/components/AvatarList/index.js.map +1 -1
- package/es/components/DocumentHeader/index.js +1 -1
- package/es/components/DocumentHeader/index.js.map +1 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.less +13 -2
- package/es/components/QuickAccessSearch/ObjectItem/index.js +1 -1
- package/es/controls/DescriptionEditor/index.d.ts +6 -1
- package/es/controls/DescriptionEditor/index.js +24 -6
- package/es/controls/DescriptionEditor/index.js.map +1 -1
- package/es/controls/DescriptionEditor/index.less +20 -1
- package/es/controls/DescriptionEditor/state.d.ts +6 -0
- package/es/controls/DescriptionEditor/state.js +10 -0
- package/es/controls/DescriptionEditor/state.js.map +1 -1
- package/es/controls/ToolBar/buttons/Versions.js +7 -4
- package/es/controls/ToolBar/buttons/Versions.js.map +1 -1
- package/es/controls/ToolBar/index.js +1 -1
- package/es/controls/ToolBar/index.js.map +1 -1
- package/es/controls/ToolBar/menus/Access.js +1 -1
- package/es/controls/ToolBar/menus/Access.js.map +1 -1
- package/es/pages/Page/PageDefaultView/index.js +3 -4
- package/es/pages/Page/PageDefaultView/index.js.map +1 -1
- package/es/pages/Page/PageItem/index.js +3 -1
- package/es/pages/Page/PageItem/index.js.map +1 -1
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js +15 -9
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js.map +1 -1
- package/es/pages/Signature/Letter/LetterContentView/index.d.ts +2 -7
- package/es/pages/Signature/Letter/LetterContentView/index.js +35 -26
- package/es/pages/Signature/Letter/LetterContentView/index.js.map +1 -1
- package/es/pages/Signature/Letter/LetterContentView/state.d.ts +19 -0
- package/es/pages/Signature/Letter/LetterContentView/state.js +27 -0
- package/es/pages/Signature/Letter/LetterContentView/state.js.map +1 -0
- package/es/pages/Signature/Letter/LetterItem/index.js +24 -10
- package/es/pages/Signature/Letter/LetterItem/index.js.map +1 -1
- package/es/pages/Signature/Letter/LetterItem/index.less +7 -10
- package/es/pages/Signature/Letter/LetterList/index.js +1 -2
- package/es/pages/Signature/Letter/LetterList/index.js.map +1 -1
- package/es/pages/Signature/Letter/LetterViewer/index.less +0 -3
- package/es/pages/Signature/SignatureDialog/index.d.ts +2 -0
- package/es/pages/Signature/SignatureDialog/index.js +17 -12
- package/es/pages/Signature/SignatureDialog/index.js.map +1 -1
- package/es/pages/Signature/SignatureDialog/index.less +15 -1
- package/es/pages/Signature/SignatureRecipient/index.js +5 -12
- package/es/pages/Signature/SignatureRecipient/index.js.map +1 -1
- package/es/pages/Signature/SignatureRecipient/index.less +8 -2
- package/es/pages/Signature/SignatureTable/index.less +1 -1
- package/es/pages/Signature/SignerSelect/index.js +24 -12
- package/es/pages/Signature/SignerSelect/index.js.map +1 -1
- package/es/pages/Signature/SignerSelect/state.d.ts +2 -2
- package/es/pages/Signature/SignerSelect/state.js.map +1 -1
- package/es/pages/Signature/data/envelope/EnvelopeStore.d.ts +1 -1
- package/es/pages/VSubmit/components/EmailRecipients/index.d.ts +1 -1
- package/es/pages/VSubmit/components/EmailRecipients/index.js +1 -1
- package/es/pages/VSubmit/components/EmailRecipients/index.js.map +1 -1
- package/es/pages/VSubmit/components/EmailRecipients/state.d.ts +1 -1
- package/es/routes.js +3 -3
- package/es/routes.js.map +1 -1
- package/package.json +5 -5
- package/es/components/PeopleAccess/NewAccessSelector.d.ts +0 -19
- package/es/components/PeopleAccess/NewAccessSelector.js +0 -117
- package/es/components/PeopleAccess/NewAccessSelector.js.map +0 -1
- package/es/components/PeopleAccess/PeopleAccess.d.ts +0 -8
- package/es/components/PeopleAccess/PeopleAccess.js +0 -95
- package/es/components/PeopleAccess/PeopleAccess.js.map +0 -1
- package/es/components/PeopleAccess/PeopleAccessState.d.ts +0 -25
- package/es/components/PeopleAccess/PeopleAccessState.js +0 -145
- package/es/components/PeopleAccess/PeopleAccessState.js.map +0 -1
- package/es/components/PeopleAccess/RoleSelector.d.ts +0 -13
- package/es/components/PeopleAccess/RoleSelector.js +0 -50
- package/es/components/PeopleAccess/RoleSelector.js.map +0 -1
- package/es/components/PeopleAccess/constants.d.ts +0 -14
- package/es/components/PeopleAccess/constants.js +0 -15
- package/es/components/PeopleAccess/constants.js.map +0 -1
- package/es/components/PeopleAccess/index.d.ts +0 -1
- package/es/components/PeopleAccess/index.js +0 -2
- package/es/components/PeopleAccess/index.js.map +0 -1
- package/es/components/PeopleAccess/index.less +0 -65
- package/es/controls/PermissionModal/index.d.ts +0 -6
- package/es/controls/PermissionModal/index.js +0 -10
- package/es/controls/PermissionModal/index.js.map +0 -1
- package/es/controls/PermissionModal/index.less +0 -7
- package/es/modules/unit/UnitUIService.d.ts +0 -6
- package/es/modules/unit/UnitUIService.js +0 -13
- package/es/modules/unit/UnitUIService.js.map +0 -1
- package/es/modules/unit/components/ActivityLog/index.d.ts +0 -6
- package/es/modules/unit/components/ActivityLog/index.js +0 -62
- package/es/modules/unit/components/ActivityLog/index.js.map +0 -1
- package/es/modules/unit/components/ActivityLog/index.less +0 -64
- package/es/modules/unit/components/ActivityLog/state.d.ts +0 -14
- package/es/modules/unit/components/ActivityLog/state.js +0 -51
- package/es/modules/unit/components/ActivityLog/state.js.map +0 -1
- package/es/modules/unit/components/AddUnitDropdown/index.d.ts +0 -10
- package/es/modules/unit/components/AddUnitDropdown/index.js +0 -41
- package/es/modules/unit/components/AddUnitDropdown/index.js.map +0 -1
- package/es/modules/unit/components/AddUnitDropdown/index.less +0 -58
- package/es/modules/unit/components/AddUnitDropdown/state.d.ts +0 -28
- package/es/modules/unit/components/AddUnitDropdown/state.js +0 -86
- package/es/modules/unit/components/AddUnitDropdown/state.js.map +0 -1
- package/es/modules/unit/components/BreadCrumbsHeader/index.d.ts +0 -6
- package/es/modules/unit/components/BreadCrumbsHeader/index.js +0 -27
- package/es/modules/unit/components/BreadCrumbsHeader/index.js.map +0 -1
- package/es/modules/unit/components/BreadCrumbsHeader/index.less +0 -10
- package/es/modules/unit/components/BreadCrumbsHeader/state.d.ts +0 -5
- package/es/modules/unit/components/BreadCrumbsHeader/state.js +0 -19
- package/es/modules/unit/components/BreadCrumbsHeader/state.js.map +0 -1
- package/es/modules/unit/components/ChangeUserPassword/index.d.ts +0 -6
- package/es/modules/unit/components/ChangeUserPassword/index.js +0 -37
- package/es/modules/unit/components/ChangeUserPassword/index.js.map +0 -1
- package/es/modules/unit/components/ChangeUserPassword/index.less +0 -13
- package/es/modules/unit/components/ContactUserInfoView/index.d.ts +0 -6
- package/es/modules/unit/components/ContactUserInfoView/index.js +0 -43
- package/es/modules/unit/components/ContactUserInfoView/index.js.map +0 -1
- package/es/modules/unit/components/ContactUserInfoView/index.less +0 -30
- package/es/modules/unit/components/ContactUserInfoView/state.d.ts +0 -5
- package/es/modules/unit/components/ContactUserInfoView/state.js +0 -14
- package/es/modules/unit/components/ContactUserInfoView/state.js.map +0 -1
- package/es/modules/unit/components/Members/index.d.ts +0 -4
- package/es/modules/unit/components/Members/index.js +0 -67
- package/es/modules/unit/components/Members/index.js.map +0 -1
- package/es/modules/unit/components/Members/index.less +0 -19
- package/es/modules/unit/components/Members/state.d.ts +0 -16
- package/es/modules/unit/components/Members/state.js +0 -25
- package/es/modules/unit/components/Members/state.js.map +0 -1
- package/es/modules/unit/components/NewUnitForm/index.d.ts +0 -12
- package/es/modules/unit/components/NewUnitForm/index.js +0 -51
- package/es/modules/unit/components/NewUnitForm/index.js.map +0 -1
- package/es/modules/unit/components/NewUnitForm/index.less +0 -33
- package/es/modules/unit/components/NewUnitForm/state.d.ts +0 -22
- package/es/modules/unit/components/NewUnitForm/state.js +0 -49
- package/es/modules/unit/components/NewUnitForm/state.js.map +0 -1
- package/es/modules/unit/components/SubUnitList/index.d.ts +0 -9
- package/es/modules/unit/components/SubUnitList/index.js +0 -68
- package/es/modules/unit/components/SubUnitList/index.js.map +0 -1
- package/es/modules/unit/components/SubUnitList/index.less +0 -28
- package/es/modules/unit/components/SubUnitList/state.d.ts +0 -33
- package/es/modules/unit/components/SubUnitList/state.js +0 -67
- package/es/modules/unit/components/SubUnitList/state.js.map +0 -1
- package/es/modules/unit/components/UnitAvatar/index.d.ts +0 -16
- package/es/modules/unit/components/UnitAvatar/index.js +0 -30
- package/es/modules/unit/components/UnitAvatar/index.js.map +0 -1
- package/es/modules/unit/components/UnitAvatar/index.less +0 -7
- package/es/modules/unit/components/UnitDetails/index.d.ts +0 -5
- package/es/modules/unit/components/UnitDetails/index.js +0 -123
- package/es/modules/unit/components/UnitDetails/index.js.map +0 -1
- package/es/modules/unit/components/UnitDetails/index.less +0 -63
- package/es/modules/unit/components/UnitDetails/state.d.ts +0 -8
- package/es/modules/unit/components/UnitDetails/state.js +0 -24
- package/es/modules/unit/components/UnitDetails/state.js.map +0 -1
- package/es/modules/unit/components/UnitHead/index.d.ts +0 -7
- package/es/modules/unit/components/UnitHead/index.js +0 -38
- package/es/modules/unit/components/UnitHead/index.js.map +0 -1
- package/es/modules/unit/components/UnitHead/index.less +0 -26
- package/es/modules/unit/components/UnitHead/state.d.ts +0 -11
- package/es/modules/unit/components/UnitHead/state.js +0 -8
- package/es/modules/unit/components/UnitHead/state.js.map +0 -1
- package/es/modules/unit/components/UnitItem/Item.d.ts +0 -18
- package/es/modules/unit/components/UnitItem/Item.js +0 -34
- package/es/modules/unit/components/UnitItem/Item.js.map +0 -1
- package/es/modules/unit/components/UnitItem/index.d.ts +0 -9
- package/es/modules/unit/components/UnitItem/index.js +0 -46
- package/es/modules/unit/components/UnitItem/index.js.map +0 -1
- package/es/modules/unit/components/UnitItem/index.less +0 -46
- package/es/modules/unit/components/UnitItem/state.d.ts +0 -25
- package/es/modules/unit/components/UnitItem/state.js +0 -20
- package/es/modules/unit/components/UnitItem/state.js.map +0 -1
- package/es/modules/unit/components/UnitList/index.d.ts +0 -4
- package/es/modules/unit/components/UnitList/index.js +0 -37
- package/es/modules/unit/components/UnitList/index.js.map +0 -1
- package/es/modules/unit/components/UnitList/index.less +0 -0
- package/es/modules/unit/components/UnitList/state.d.ts +0 -15
- package/es/modules/unit/components/UnitList/state.js +0 -31
- package/es/modules/unit/components/UnitList/state.js.map +0 -1
- package/es/modules/unit/components/UnitName/index.d.ts +0 -5
- package/es/modules/unit/components/UnitName/index.js +0 -20
- package/es/modules/unit/components/UnitName/index.js.map +0 -1
- package/es/modules/unit/components/UnitPropertiesView/index.d.ts +0 -6
- package/es/modules/unit/components/UnitPropertiesView/index.js +0 -22
- package/es/modules/unit/components/UnitPropertiesView/index.js.map +0 -1
- package/es/modules/unit/components/UnitPropertiesView/index.less +0 -0
- package/es/modules/unit/components/UnitQuickView/QuickSubTab/index.d.ts +0 -15
- package/es/modules/unit/components/UnitQuickView/QuickSubTab/index.js +0 -50
- package/es/modules/unit/components/UnitQuickView/QuickSubTab/index.js.map +0 -1
- package/es/modules/unit/components/UnitQuickView/QuickSubTab/index.less +0 -22
- package/es/modules/unit/components/UnitQuickView/index.d.ts +0 -9
- package/es/modules/unit/components/UnitQuickView/index.js +0 -30
- package/es/modules/unit/components/UnitQuickView/index.js.map +0 -1
- package/es/modules/unit/components/UnitQuickView/index.less +0 -63
- package/es/modules/unit/components/UnitQuickView/state.d.ts +0 -8
- package/es/modules/unit/components/UnitQuickView/state.js +0 -26
- package/es/modules/unit/components/UnitQuickView/state.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/index.d.ts +0 -10
- package/es/modules/unit/components/UnitSortableTree/index.js +0 -70
- package/es/modules/unit/components/UnitSortableTree/index.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/state.d.ts +0 -55
- package/es/modules/unit/components/UnitSortableTree/state.js +0 -166
- package/es/modules/unit/components/UnitSortableTree/state.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.d.ts +0 -3
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.js +0 -22
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/index.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.d.ts +0 -3
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.js +0 -82
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/node-content-renderer.less +0 -316
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.d.ts +0 -3
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.js +0 -21
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/FileExplorerTheme/tree-node-renderer.less +0 -4
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/index.d.ts +0 -4
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/index.js +0 -23
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/index.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/node-content-renderer.d.ts +0 -3
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/node-content-renderer.js +0 -58
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/node-content-renderer.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/node-content-renderer.less +0 -45
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/tree-node-renderer.d.ts +0 -3
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/tree-node-renderer.js +0 -73
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/tree-node-renderer.js.map +0 -1
- package/es/modules/unit/components/UnitSortableTree/themes/SortableTreeUnitTheme/tree-node-renderer.less +0 -12
- package/es/modules/unit/components/UnitTabs/index.d.ts +0 -6
- package/es/modules/unit/components/UnitTabs/index.js +0 -35
- package/es/modules/unit/components/UnitTabs/index.js.map +0 -1
- package/es/modules/unit/components/UnitsSelectDialog/index.d.ts +0 -9
- package/es/modules/unit/components/UnitsSelectDialog/index.js +0 -35
- package/es/modules/unit/components/UnitsSelectDialog/index.js.map +0 -1
- package/es/modules/unit/components/UnitsSelectDialog/index.less +0 -36
- package/es/modules/unit/components/UnitsSelectDialog/state.d.ts +0 -22
- package/es/modules/unit/components/UnitsSelectDialog/state.js +0 -73
- package/es/modules/unit/components/UnitsSelectDialog/state.js.map +0 -1
- package/es/modules/unit/controls/ContactSelect/index.d.ts +0 -9
- package/es/modules/unit/controls/ContactSelect/index.js +0 -78
- package/es/modules/unit/controls/ContactSelect/index.js.map +0 -1
- package/es/modules/unit/controls/ContactSelect/state.d.ts +0 -23
- package/es/modules/unit/controls/ContactSelect/state.js +0 -43
- package/es/modules/unit/controls/ContactSelect/state.js.map +0 -1
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.d.ts +0 -6
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js +0 -32
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.js.map +0 -1
- package/es/modules/unit/controls/QuickDataIcon/UnitTeamsIcon/index.less +0 -21
- package/es/modules/unit/controls/QuickDataIcon/index.d.ts +0 -21
- package/es/modules/unit/controls/QuickDataIcon/index.js +0 -36
- package/es/modules/unit/controls/QuickDataIcon/index.js.map +0 -1
- package/es/modules/unit/controls/QuickDataIcon/index.less +0 -12
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.d.ts +0 -13
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js +0 -66
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.js.map +0 -1
- package/es/modules/unit/controls/ToolBar/ContactMenu/index.less +0 -20
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.d.ts +0 -36
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js +0 -78
- package/es/modules/unit/controls/ToolBar/ContactMenu/state.js.map +0 -1
- package/es/modules/unit/controls/ToolBar/index.d.ts +0 -12
- package/es/modules/unit/controls/ToolBar/index.js +0 -56
- package/es/modules/unit/controls/ToolBar/index.js.map +0 -1
- package/es/modules/unit/controls/ToolBar/index.less +0 -18
- package/es/modules/unit/controls/ToolBar/state.d.ts +0 -42
- package/es/modules/unit/controls/ToolBar/state.js +0 -62
- package/es/modules/unit/controls/ToolBar/state.js.map +0 -1
- package/es/modules/unit/controls/UnitTypeFilter/index.d.ts +0 -3
- package/es/modules/unit/controls/UnitTypeFilter/index.js +0 -21
- package/es/modules/unit/controls/UnitTypeFilter/index.js.map +0 -1
- package/es/modules/unit/controls/UnitTypeFilter/state.d.ts +0 -18
- package/es/modules/unit/controls/UnitTypeFilter/state.js +0 -63
- package/es/modules/unit/controls/UnitTypeFilter/state.js.map +0 -1
- package/es/modules/unit/data/StoreContext/index.d.ts +0 -3
- package/es/modules/unit/data/StoreContext/index.js +0 -4
- package/es/modules/unit/data/StoreContext/index.js.map +0 -1
- package/es/modules/unit/data/UnitContext/index.d.ts +0 -18
- package/es/modules/unit/data/UnitContext/index.js +0 -32
- package/es/modules/unit/data/UnitContext/index.js.map +0 -1
- package/es/modules/unit/data/UnitStore.d.ts +0 -124
- package/es/modules/unit/data/UnitStore.js +0 -226
- package/es/modules/unit/data/UnitStore.js.map +0 -1
- package/es/modules/unit/data/UnitType.d.ts +0 -1
- package/es/modules/unit/data/UnitType.js +0 -18
- package/es/modules/unit/data/UnitType.js.map +0 -1
- package/es/modules/unit/data/UserStore.d.ts +0 -33
- package/es/modules/unit/data/UserStore.js +0 -53
- package/es/modules/unit/data/UserStore.js.map +0 -1
- package/es/modules/unit/data/hooks/index.d.ts +0 -7
- package/es/modules/unit/data/hooks/index.js +0 -8
- package/es/modules/unit/data/hooks/index.js.map +0 -1
- package/es/modules/unit/data/hooks/member-events/index.d.ts +0 -3
- package/es/modules/unit/data/hooks/member-events/index.js +0 -4
- package/es/modules/unit/data/hooks/member-events/index.js.map +0 -1
- package/es/modules/unit/data/hooks/member-events/useAutoUpdateMemberListData.d.ts +0 -4
- package/es/modules/unit/data/hooks/member-events/useAutoUpdateMemberListData.js +0 -13
- package/es/modules/unit/data/hooks/member-events/useAutoUpdateMemberListData.js.map +0 -1
- package/es/modules/unit/data/hooks/member-events/useOnDeleteMember.d.ts +0 -4
- package/es/modules/unit/data/hooks/member-events/useOnDeleteMember.js +0 -17
- package/es/modules/unit/data/hooks/member-events/useOnDeleteMember.js.map +0 -1
- package/es/modules/unit/data/hooks/member-events/useOnNewMember.d.ts +0 -4
- package/es/modules/unit/data/hooks/member-events/useOnNewMember.js +0 -17
- package/es/modules/unit/data/hooks/member-events/useOnNewMember.js.map +0 -1
- package/es/modules/unit/data/hooks/unit-events/index.d.ts +0 -3
- package/es/modules/unit/data/hooks/unit-events/index.js +0 -4
- package/es/modules/unit/data/hooks/unit-events/index.js.map +0 -1
- package/es/modules/unit/data/hooks/unit-events/useAutoUpdateUnitListData.d.ts +0 -4
- package/es/modules/unit/data/hooks/unit-events/useAutoUpdateUnitListData.js +0 -13
- package/es/modules/unit/data/hooks/unit-events/useAutoUpdateUnitListData.js.map +0 -1
- package/es/modules/unit/data/hooks/unit-events/useOnDeleteUnit.d.ts +0 -4
- package/es/modules/unit/data/hooks/unit-events/useOnDeleteUnit.js +0 -17
- package/es/modules/unit/data/hooks/unit-events/useOnDeleteUnit.js.map +0 -1
- package/es/modules/unit/data/hooks/unit-events/useOnNewUnit.d.ts +0 -4
- package/es/modules/unit/data/hooks/unit-events/useOnNewUnit.js +0 -17
- package/es/modules/unit/data/hooks/unit-events/useOnNewUnit.js.map +0 -1
- package/es/modules/unit/data/hooks/useTeamListEffect.d.ts +0 -8
- package/es/modules/unit/data/hooks/useTeamListEffect.js +0 -27
- package/es/modules/unit/data/hooks/useTeamListEffect.js.map +0 -1
- package/es/modules/unit/data/hooks/useUnit.d.ts +0 -6
- package/es/modules/unit/data/hooks/useUnit.js +0 -12
- package/es/modules/unit/data/hooks/useUnit.js.map +0 -1
- package/es/modules/unit/data/hooks/useUnitActivityListEffect.d.ts +0 -8
- package/es/modules/unit/data/hooks/useUnitActivityListEffect.js +0 -16
- package/es/modules/unit/data/hooks/useUnitActivityListEffect.js.map +0 -1
- package/es/modules/unit/data/hooks/useUnitListEffect.d.ts +0 -8
- package/es/modules/unit/data/hooks/useUnitListEffect.js +0 -28
- package/es/modules/unit/data/hooks/useUnitListEffect.js.map +0 -1
- package/es/modules/unit/data/hooks/useUserInfo.d.ts +0 -6
- package/es/modules/unit/data/hooks/useUserInfo.js +0 -12
- package/es/modules/unit/data/hooks/useUserInfo.js.map +0 -1
- package/es/modules/unit/data/index.d.ts +0 -4
- package/es/modules/unit/data/index.js +0 -5
- package/es/modules/unit/data/index.js.map +0 -1
- package/es/modules/unit/data/interfaces/IAddress.d.ts +0 -14
- package/es/modules/unit/data/interfaces/IAddress.js +0 -1
- package/es/modules/unit/data/interfaces/IAddress.js.map +0 -1
- package/es/modules/unit/data/interfaces/IEntityName.d.ts +0 -6
- package/es/modules/unit/data/interfaces/IEntityName.js +0 -1
- package/es/modules/unit/data/interfaces/IEntityName.js.map +0 -1
- package/es/modules/unit/data/interfaces/IUnit.d.ts +0 -51
- package/es/modules/unit/data/interfaces/IUnit.js +0 -1
- package/es/modules/unit/data/interfaces/IUnit.js.map +0 -1
- package/es/modules/unit/data/interfaces/IUserInfo.d.ts +0 -12
- package/es/modules/unit/data/interfaces/IUserInfo.js +0 -1
- package/es/modules/unit/data/interfaces/IUserInfo.js.map +0 -1
- package/es/modules/unit/data/interfaces/index.d.ts +0 -4
- package/es/modules/unit/data/interfaces/index.js +0 -5
- package/es/modules/unit/data/interfaces/index.js.map +0 -1
- package/es/modules/unit/pages/UnitDefaultView/index.d.ts +0 -3
- package/es/modules/unit/pages/UnitDefaultView/index.js +0 -47
- package/es/modules/unit/pages/UnitDefaultView/index.js.map +0 -1
- package/es/modules/unit/pages/UnitDefaultView/index.less +0 -17
- package/es/modules/unit/pages/UnitListView/index.d.ts +0 -3
- package/es/modules/unit/pages/UnitListView/index.js +0 -10
- package/es/modules/unit/pages/UnitListView/index.js.map +0 -1
- package/es/modules/unit/pages/UnitTreeView/index.d.ts +0 -3
- package/es/modules/unit/pages/UnitTreeView/index.js +0 -47
- package/es/modules/unit/pages/UnitTreeView/index.js.map +0 -1
- package/es/modules/unit/pages/UnitTreeView/index.less +0 -31
- package/es/modules/unit/pages/UnitTreeView/state.d.ts +0 -5
- package/es/modules/unit/pages/UnitTreeView/state.js +0 -14
- package/es/modules/unit/pages/UnitTreeView/state.js.map +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,124 +0,0 @@
|
|
|
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, IUnit } from "./interfaces";
|
|
5
|
-
import { IActivityLog } from "@voplus/morpho-collaboration/es/data/interfaces/IActivityLog";
|
|
6
|
-
/** Custom load contact list options type */
|
|
7
|
-
export declare type LoadUnitListOptions = {
|
|
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 LoadUnitOptions = {
|
|
17
|
-
/** Comma separated include options e.g. path */
|
|
18
|
-
includes?: string;
|
|
19
|
-
} & LoadOptions<IUnit>;
|
|
20
|
-
export declare type EditUnitOptions = {
|
|
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 DeleteUnitOptions = {
|
|
40
|
-
DeleteChilds?: boolean;
|
|
41
|
-
};
|
|
42
|
-
export declare class UnitStore extends Store {
|
|
43
|
-
private readonly _api;
|
|
44
|
-
readonly name: string;
|
|
45
|
-
/** Contac created event dispatcher */
|
|
46
|
-
private readonly _created;
|
|
47
|
-
private readonly _deleted;
|
|
48
|
-
private readonly _memberCreated;
|
|
49
|
-
private readonly _memberDeleted;
|
|
50
|
-
constructor(_api: ApiEndPoint);
|
|
51
|
-
/** Id of documents to be moved. */
|
|
52
|
-
moveIds: string[];
|
|
53
|
-
/** Event fires when a new unit has been created. */
|
|
54
|
-
get UnitCreatedEvent(): import("strongly-typed-events").IEvent<UnitStore, IUnit>;
|
|
55
|
-
/** Event fires when a delete contact has been deleted. */
|
|
56
|
-
get UnitDeletedEvent(): import("strongly-typed-events").IEvent<UnitStore, IUnit>;
|
|
57
|
-
/** Event fires when a new member has been created. */
|
|
58
|
-
get MemberCreatedEvent(): import("strongly-typed-events").IEvent<UnitStore, IUnit>;
|
|
59
|
-
/** Event fires when a delete member has been deleted. */
|
|
60
|
-
get MemberDeletedEvent(): import("strongly-typed-events").IEvent<UnitStore, IUnit>;
|
|
61
|
-
readonly items: CountedMap<string, IUnit>;
|
|
62
|
-
/** Create a default contact object with optional default values. */
|
|
63
|
-
static createDefaultContact(defaultValues?: Partial<IUnit>): IUnit;
|
|
64
|
-
/** Create a new contact base on type. */
|
|
65
|
-
create(options: {
|
|
66
|
-
name: string;
|
|
67
|
-
type?: string;
|
|
68
|
-
email?: string;
|
|
69
|
-
}): Promise<IUnit>;
|
|
70
|
-
/** Create a sub unit under parent. */
|
|
71
|
-
createSubUnit(options: {
|
|
72
|
-
name: string;
|
|
73
|
-
parentId: string;
|
|
74
|
-
type: string;
|
|
75
|
-
}): Promise<IUnit>;
|
|
76
|
-
/** 新增用戶至Group.
|
|
77
|
-
* pid是小組id type必须是Team
|
|
78
|
-
* id 是現有用戶id (必须是用户)
|
|
79
|
-
*/
|
|
80
|
-
addUserFromGroup(options: {
|
|
81
|
-
pid: string;
|
|
82
|
-
id: string;
|
|
83
|
-
}): Promise<IUnit>;
|
|
84
|
-
/** Load a task from server.
|
|
85
|
-
* @param {string} id - id of the task.
|
|
86
|
-
* @param {LoadTaskOptions} options - Optional load options.
|
|
87
|
-
*/
|
|
88
|
-
load(id: string, options: LoadUnitOptions): Promise<IUnit>;
|
|
89
|
-
/** Refresh a loaded unit. */
|
|
90
|
-
refresh(id: string, options: LoadUnitOptions): Promise<void>;
|
|
91
|
-
private _listCache;
|
|
92
|
-
/** Load a list of contacts from server.
|
|
93
|
-
* @param {LoadTaskListOptions}
|
|
94
|
-
*/
|
|
95
|
-
loadList(options?: LoadUnitListOptions): Promise<any>;
|
|
96
|
-
private loadUnitsFromServer;
|
|
97
|
-
/** Load a list of team of a contact from server.
|
|
98
|
-
* @param id - id of the contact.
|
|
99
|
-
* @param {LoadUnitListOptions}
|
|
100
|
-
*/
|
|
101
|
-
loadTeamList(id: string, options?: LoadUnitListOptions): Promise<IUnit[]>;
|
|
102
|
-
/** Load a list of activities of a contact from server.
|
|
103
|
-
* @param id - id of the contact.
|
|
104
|
-
* @param {LoadUnitListOptions}
|
|
105
|
-
*/
|
|
106
|
-
loadActivityList(id: string, options?: LoadUnitListOptions): Promise<IActivityLog[]>;
|
|
107
|
-
/** Edit an existing item on server. */
|
|
108
|
-
edit(id: string, options: EditUnitOptions): Promise<void>;
|
|
109
|
-
delete(id: string): Promise<IUnit>;
|
|
110
|
-
/** 把用戶從Group移除
|
|
111
|
-
* pid是小組id
|
|
112
|
-
* id 是現有用戶id (必须是用户)
|
|
113
|
-
*/
|
|
114
|
-
deleteUser(options: {
|
|
115
|
-
pid: string;
|
|
116
|
-
id: string;
|
|
117
|
-
}): Promise<IUnit>;
|
|
118
|
-
moveAfter(id: string, afterId?: string): Promise<void>;
|
|
119
|
-
cut(ids: string[]): void;
|
|
120
|
-
paste(target: string): void;
|
|
121
|
-
move(ids: string[], targetId?: string): Promise<any>;
|
|
122
|
-
}
|
|
123
|
-
/** React hook to retrieve ContactStore */
|
|
124
|
-
export declare const useUnitStore: () => UnitStore;
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { RequestBuilder } from "@voplus/api";
|
|
3
|
-
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
4
|
-
import { action, observable, toJS } 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 = "UnitStore";
|
|
10
|
-
export class UnitStore extends Store {
|
|
11
|
-
constructor(_api) {
|
|
12
|
-
super();
|
|
13
|
-
this._api = _api;
|
|
14
|
-
this.name = StoreName;
|
|
15
|
-
/** Contac created event dispatcher */
|
|
16
|
-
this._created = new EventDispatcher();
|
|
17
|
-
this._deleted = new EventDispatcher();
|
|
18
|
-
this._memberCreated = new EventDispatcher();
|
|
19
|
-
this._memberDeleted = new EventDispatcher();
|
|
20
|
-
/** Id of documents to be moved. */
|
|
21
|
-
this.moveIds = [];
|
|
22
|
-
this.items = new CountedMap((key) => UnitStore.createDefaultContact({ id: key }), observable.map([], { deep: true }));
|
|
23
|
-
this._listCache = new Map();
|
|
24
|
-
invariant(_api, `API cannot be ${_api}.`);
|
|
25
|
-
}
|
|
26
|
-
/** Event fires when a new unit has been created. */
|
|
27
|
-
get UnitCreatedEvent() {
|
|
28
|
-
return this._created.asEvent();
|
|
29
|
-
}
|
|
30
|
-
/** Event fires when a delete contact has been deleted. */
|
|
31
|
-
get UnitDeletedEvent() {
|
|
32
|
-
return this._deleted.asEvent();
|
|
33
|
-
}
|
|
34
|
-
/** Event fires when a new member has been created. */
|
|
35
|
-
get MemberCreatedEvent() {
|
|
36
|
-
return this._memberCreated.asEvent();
|
|
37
|
-
}
|
|
38
|
-
/** Event fires when a delete member has been deleted. */
|
|
39
|
-
get MemberDeletedEvent() {
|
|
40
|
-
return this._memberDeleted.asEvent();
|
|
41
|
-
}
|
|
42
|
-
/** Create a default contact object with optional default values. */
|
|
43
|
-
static createDefaultContact(defaultValues) {
|
|
44
|
-
const v = { loaded: false, address: {}, primaryLegalIdentity: {} };
|
|
45
|
-
if (defaultValues)
|
|
46
|
-
Object.assign(v, defaultValues);
|
|
47
|
-
return v;
|
|
48
|
-
}
|
|
49
|
-
/** Create a new contact base on type. */
|
|
50
|
-
async create(options) {
|
|
51
|
-
invariant(options.name, "Name cannot be empty.");
|
|
52
|
-
const r = await this._api.post(`api/units/create`, new RequestBuilder().form(options));
|
|
53
|
-
const t = (await r.json());
|
|
54
|
-
this._created.dispatch(this, t);
|
|
55
|
-
console.log("create", t);
|
|
56
|
-
return t;
|
|
57
|
-
}
|
|
58
|
-
/** Create a sub unit under parent. */
|
|
59
|
-
async createSubUnit(options) {
|
|
60
|
-
invariant(options.name, "Name cannot be empty.");
|
|
61
|
-
const r = await this._api.post(`api/groups/create`, new RequestBuilder().form(options));
|
|
62
|
-
const t = (await r.json());
|
|
63
|
-
this._created.dispatch(this, t);
|
|
64
|
-
console.log("createFromType", t);
|
|
65
|
-
return t;
|
|
66
|
-
}
|
|
67
|
-
/** 新增用戶至Group.
|
|
68
|
-
* pid是小組id type必须是Team
|
|
69
|
-
* id 是現有用戶id (必须是用户)
|
|
70
|
-
*/
|
|
71
|
-
async addUserFromGroup(options) {
|
|
72
|
-
// invariant(options.name, "Name cannot be empty.");
|
|
73
|
-
const r = await this._api.post(`/api/groups/${options.pid}/add/${options.id}`);
|
|
74
|
-
const t = (await r.json());
|
|
75
|
-
t.parentNodeId = options.pid;
|
|
76
|
-
this._memberCreated.dispatch(this, t);
|
|
77
|
-
console.log("addUserFromGroup", t);
|
|
78
|
-
return t;
|
|
79
|
-
}
|
|
80
|
-
/** Load a task from server.
|
|
81
|
-
* @param {string} id - id of the task.
|
|
82
|
-
* @param {LoadTaskOptions} options - Optional load options.
|
|
83
|
-
*/
|
|
84
|
-
async load(id, options) {
|
|
85
|
-
let query = "";
|
|
86
|
-
if (options.includes)
|
|
87
|
-
query = query.concat(`includes=${options.includes}`);
|
|
88
|
-
if (query)
|
|
89
|
-
query = "?".concat(query);
|
|
90
|
-
const r = await this._api.get(`/units/${id}${query}`);
|
|
91
|
-
return (await r.json());
|
|
92
|
-
}
|
|
93
|
-
/** Refresh a loaded unit. */
|
|
94
|
-
async refresh(id, options) {
|
|
95
|
-
if (!this.items.has(id))
|
|
96
|
-
return;
|
|
97
|
-
const c = await this.load(id, options);
|
|
98
|
-
this.items.overwrite(id, c);
|
|
99
|
-
}
|
|
100
|
-
/** Load a list of contacts from server.
|
|
101
|
-
* @param {LoadTaskListOptions}
|
|
102
|
-
*/
|
|
103
|
-
async loadList(options) {
|
|
104
|
-
options = options !== null && options !== void 0 ? options : { Filters: [] };
|
|
105
|
-
// skip local cache with paging.
|
|
106
|
-
if (options === null || options === void 0 ? void 0 : options.Page)
|
|
107
|
-
return await this.loadUnitsFromServer(options);
|
|
108
|
-
// const reload = options.reload;
|
|
109
|
-
delete options["reload"];
|
|
110
|
-
// Calculate hash code for load options.
|
|
111
|
-
const hc = hash(options);
|
|
112
|
-
// load from server if not cached
|
|
113
|
-
if (!this._listCache.has(hc)) {
|
|
114
|
-
const result = await this.loadUnitsFromServer(options);
|
|
115
|
-
// Save cache and clear time out.
|
|
116
|
-
this._listCache.set(hc, result);
|
|
117
|
-
setTimeout(() => {
|
|
118
|
-
this._listCache.delete(hc);
|
|
119
|
-
}, 5 * 60 * 1000);
|
|
120
|
-
}
|
|
121
|
-
return this._listCache.get(hc);
|
|
122
|
-
}
|
|
123
|
-
async loadUnitsFromServer(options) {
|
|
124
|
-
const urlPostFix = options.parent ? `/${options.parent}/units` : "";
|
|
125
|
-
const r = await this._api.post(`/units${urlPostFix}`, new RequestBuilder().json(options));
|
|
126
|
-
const result = await r.json();
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
/** Load a list of team of a contact from server.
|
|
130
|
-
* @param id - id of the contact.
|
|
131
|
-
* @param {LoadUnitListOptions}
|
|
132
|
-
*/
|
|
133
|
-
async loadTeamList(id, options) {
|
|
134
|
-
invariant(id, "id cannot be empty");
|
|
135
|
-
const r = await this._api.post(`/api/groups/${id}/members`, new RequestBuilder().json(options ? options : {}));
|
|
136
|
-
return (await r.json());
|
|
137
|
-
}
|
|
138
|
-
/** Load a list of activities of a contact from server.
|
|
139
|
-
* @param id - id of the contact.
|
|
140
|
-
* @param {LoadUnitListOptions}
|
|
141
|
-
*/
|
|
142
|
-
async loadActivityList(id, options) {
|
|
143
|
-
invariant(id, "id cannot be empty");
|
|
144
|
-
let query = "";
|
|
145
|
-
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
146
|
-
query = query.concat(`includes=${options.Includes}`);
|
|
147
|
-
}
|
|
148
|
-
if (query)
|
|
149
|
-
query = "?".concat(query);
|
|
150
|
-
const r = await this._api.post(`/units/${id}/activities${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
151
|
-
return (await r.json());
|
|
152
|
-
}
|
|
153
|
-
/** Edit an existing item on server. */
|
|
154
|
-
async edit(id, options) {
|
|
155
|
-
const r = await this._api.post(`api/units/${id}/info`, new RequestBuilder().json(options));
|
|
156
|
-
const t = await r.json();
|
|
157
|
-
this.items.overwrite(t.id, t);
|
|
158
|
-
}
|
|
159
|
-
async delete(id) {
|
|
160
|
-
await this._api.delete(`api/groups/${id}`);
|
|
161
|
-
const item = this.items.peek(id);
|
|
162
|
-
this._deleted.dispatch(this, item);
|
|
163
|
-
return item;
|
|
164
|
-
}
|
|
165
|
-
/** 把用戶從Group移除
|
|
166
|
-
* pid是小組id
|
|
167
|
-
* id 是現有用戶id (必须是用户)
|
|
168
|
-
*/
|
|
169
|
-
async deleteUser(options) {
|
|
170
|
-
await this._api.delete(`api/groups/${options.pid}/remove/${options.id}`);
|
|
171
|
-
const item = this.items.peek(options.id);
|
|
172
|
-
item.parentNodeId = options.pid;
|
|
173
|
-
this._memberDeleted.dispatch(this, item);
|
|
174
|
-
return item;
|
|
175
|
-
}
|
|
176
|
-
async moveAfter(id, afterId) {
|
|
177
|
-
await this._api.post(`api/units/${id}/move?afterId=${afterId}`);
|
|
178
|
-
}
|
|
179
|
-
cut(ids) {
|
|
180
|
-
invariant(ids, "Ids cannot be empty.");
|
|
181
|
-
this.moveIds = ids;
|
|
182
|
-
}
|
|
183
|
-
paste(target) {
|
|
184
|
-
this.move(toJS(this.moveIds), target);
|
|
185
|
-
this.moveIds = [];
|
|
186
|
-
}
|
|
187
|
-
async move(ids, targetId) {
|
|
188
|
-
const result = await this._api.post(`api/units/move`, new RequestBuilder().json({ Ids: ids, TargetId: targetId }));
|
|
189
|
-
const moved = await result.json();
|
|
190
|
-
for (const item of moved) {
|
|
191
|
-
this._created.dispatch(this, item);
|
|
192
|
-
}
|
|
193
|
-
this._deleted.dispatch(this, moved);
|
|
194
|
-
return moved;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
__decorate([
|
|
198
|
-
observable
|
|
199
|
-
], UnitStore.prototype, "moveIds", void 0);
|
|
200
|
-
__decorate([
|
|
201
|
-
observable
|
|
202
|
-
], UnitStore.prototype, "items", void 0);
|
|
203
|
-
__decorate([
|
|
204
|
-
action
|
|
205
|
-
], UnitStore.prototype, "delete", null);
|
|
206
|
-
__decorate([
|
|
207
|
-
action
|
|
208
|
-
], UnitStore.prototype, "moveAfter", null);
|
|
209
|
-
__decorate([
|
|
210
|
-
action
|
|
211
|
-
], UnitStore.prototype, "cut", null);
|
|
212
|
-
__decorate([
|
|
213
|
-
action
|
|
214
|
-
], UnitStore.prototype, "paste", null);
|
|
215
|
-
__decorate([
|
|
216
|
-
action
|
|
217
|
-
], UnitStore.prototype, "move", null);
|
|
218
|
-
/** React hook to retrieve ContactStore */
|
|
219
|
-
export const useUnitStore = () => {
|
|
220
|
-
const context = useApplicationContext();
|
|
221
|
-
if (!context.getStore(StoreName)) {
|
|
222
|
-
context.addStore(new UnitStore(context.api.currentEndPoint));
|
|
223
|
-
}
|
|
224
|
-
return context.getStore(StoreName);
|
|
225
|
-
};
|
|
226
|
-
//# sourceMappingURL=UnitStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnitStore.js","sourceRoot":"","sources":["../../../../src/modules/unit/data/UnitStore.ts"],"names":[],"mappings":";AAAA,OAAO,E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AM;uCAON;AAmBD;IALC,MAAM;0CAON;AAID;IAFC,MAAM;oCAKN;AAID;IAFC,MAAM;sCAKN;AAOD;IALC,MAAM;qCAgBN;AAGF,0CAA0C;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KAC7D;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe,CAAC;AAClD,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type unitType = "Organization" | "Team" | "Account" | "User";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// export const DocumentType = {
|
|
2
|
-
// Default: "Document",
|
|
3
|
-
// Container: "Container",
|
|
4
|
-
// Folder: "Document",
|
|
5
|
-
// Task: "Task",
|
|
6
|
-
// Project: "Project",
|
|
7
|
-
// File: "File",
|
|
8
|
-
// Text: "Text",
|
|
9
|
-
// Meeting: "Meeting",
|
|
10
|
-
// Agenda: "Agenda",
|
|
11
|
-
// Board: "Board",
|
|
12
|
-
// Graph: "Graph",
|
|
13
|
-
// Quotation: "Quotation",
|
|
14
|
-
// Dashboard: "Dashboard",
|
|
15
|
-
// Invoice: "Invoice",
|
|
16
|
-
// Journal: "Journal"
|
|
17
|
-
// };
|
|
18
|
-
//# sourceMappingURL=UnitType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UnitType.js","sourceRoot":"","sources":["../../../../src/modules/unit/data/UnitType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,wBAAwB;AACxB,2BAA2B;AAC3B,uBAAuB;AACvB,iBAAiB;AACjB,uBAAuB;AACvB,iBAAiB;AACjB,iBAAiB;AACjB,uBAAuB;AACvB,qBAAqB;AACrB,mBAAmB;AACnB,mBAAmB;AACnB,2BAA2B;AAC3B,2BAA2B;AAC3B,uBAAuB;AACvB,sBAAsB;AACtB,KAAK"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
-
import { CountedMap, LoadOptions, Store } from "@voplus/morpho-data";
|
|
3
|
-
import { IUserInfo } from "./interfaces";
|
|
4
|
-
/** Custom load contact options type */
|
|
5
|
-
export declare type LoadUserOptions = {
|
|
6
|
-
/** Comma separated include options e.g. path */
|
|
7
|
-
includes?: string;
|
|
8
|
-
} & LoadOptions<IUserInfo>;
|
|
9
|
-
export declare type EditUserOptions = {
|
|
10
|
-
Activate?: boolean;
|
|
11
|
-
Password?: {
|
|
12
|
-
Current?: string;
|
|
13
|
-
New: string;
|
|
14
|
-
Confirm: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare class UserStore extends Store {
|
|
18
|
-
private readonly _api;
|
|
19
|
-
readonly name: string;
|
|
20
|
-
constructor(_api: ApiEndPoint);
|
|
21
|
-
readonly items: CountedMap<string, IUserInfo>;
|
|
22
|
-
/** Create a default contact object with optional default values. */
|
|
23
|
-
static createDefaultContact(defaultValues?: Partial<IUserInfo>): IUserInfo;
|
|
24
|
-
/** Load a task from server.
|
|
25
|
-
* @param {string} id - id of the task.
|
|
26
|
-
* @param {LoadTaskOptions} options - Optional load options.
|
|
27
|
-
*/
|
|
28
|
-
load(id: string, options: LoadUserOptions): Promise<IUserInfo>;
|
|
29
|
-
/** Edit an existing item on server. */
|
|
30
|
-
edit(id: string, options: EditUserOptions): Promise<void>;
|
|
31
|
-
}
|
|
32
|
-
/** React hook to retrieve ContactStore */
|
|
33
|
-
export declare const useUserStore: () => UserStore;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { RequestBuilder } from "@voplus/api";
|
|
3
|
-
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
4
|
-
import { observable } from "mobx";
|
|
5
|
-
import invariant from "invariant";
|
|
6
|
-
const StoreName = "UserStore";
|
|
7
|
-
export class UserStore extends Store {
|
|
8
|
-
constructor(_api) {
|
|
9
|
-
super();
|
|
10
|
-
this._api = _api;
|
|
11
|
-
this.name = StoreName;
|
|
12
|
-
this.items = new CountedMap((key) => UserStore.createDefaultContact({ id: key }), observable.map([], { deep: true }));
|
|
13
|
-
invariant(_api, `API cannot be ${_api}.`);
|
|
14
|
-
}
|
|
15
|
-
/** Create a default contact object with optional default values. */
|
|
16
|
-
static createDefaultContact(defaultValues) {
|
|
17
|
-
const v = { loaded: false };
|
|
18
|
-
if (defaultValues)
|
|
19
|
-
Object.assign(v, defaultValues);
|
|
20
|
-
return v;
|
|
21
|
-
}
|
|
22
|
-
/** Load a task from server.
|
|
23
|
-
* @param {string} id - id of the task.
|
|
24
|
-
* @param {LoadTaskOptions} options - Optional load options.
|
|
25
|
-
*/
|
|
26
|
-
async load(id, options) {
|
|
27
|
-
let query = "";
|
|
28
|
-
if (options.includes)
|
|
29
|
-
query = query.concat(`includes=${options.includes}`);
|
|
30
|
-
if (query)
|
|
31
|
-
query = "?".concat(query);
|
|
32
|
-
const r = await this._api.get(`/user/${id}${query}`);
|
|
33
|
-
return (await r.json());
|
|
34
|
-
}
|
|
35
|
-
/** Edit an existing item on server. */
|
|
36
|
-
async edit(id, options) {
|
|
37
|
-
const r = await this._api.post(`api/user/${id}/info`, new RequestBuilder().json(options));
|
|
38
|
-
const t = await r.json();
|
|
39
|
-
this.items.overwrite(t.id, t);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
__decorate([
|
|
43
|
-
observable
|
|
44
|
-
], UserStore.prototype, "items", void 0);
|
|
45
|
-
/** React hook to retrieve ContactStore */
|
|
46
|
-
export const useUserStore = () => {
|
|
47
|
-
const context = useApplicationContext();
|
|
48
|
-
if (!context.getStore(StoreName)) {
|
|
49
|
-
context.addStore(new UserStore(context.api.currentEndPoint));
|
|
50
|
-
}
|
|
51
|
-
return context.getStore(StoreName);
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=UserStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserStore.js","sourceRoot":"","sources":["../../../../src/modules/unit/data/UserStore.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAe,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAU,UAAU,EAAQ,MAAM,MAAM,CAAC;AAGhD,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,MAAM,SAAS,GAAG,WAAW,CAAC;AAiB9B,MAAM,OAAO,SAAU,SAAQ,KAAK;IAGnC,YAAoC,IAAiB;QACpD,KAAK,EAAE,CAAC;QAD2B,SAAI,GAAJ,IAAI,CAAa;QAFrC,SAAI,GAAW,SAAS,CAAC;QASzB,UAAK,GAAkC,IAAI,UAAU,CACpE,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAC5D,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAClC,CAAC;QARD,SAAS,CAAC,IAAI,EAAE,iBAAiB,IAAI,GAAG,CAAC,CAAC;IAC3C,CAAC;IASD,oEAAoE;IAC7D,MAAM,CAAC,oBAAoB,CAAC,aAAkC;QACpE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAe,CAAC;QACzC,IAAI,aAAa;YAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QACnD,OAAO,CAAC,CAAC;IACV,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,OAAwB;QACrD,I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ListEffect";
|
|
3
|
-
export * from "./useTeamListEffect";
|
|
4
|
-
export * from "./useUnitActivityListEffect";
|
|
5
|
-
export * from "./unit-events";
|
|
6
|
-
export * from "./member-events";
|
|
7
|
-
export * from "./useUserInfo";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/unit/data/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/unit/data/hooks/member-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IUnit } from "../../interfaces";
|
|
2
|
-
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
3
|
-
/** React hook to call action when a new Member has been created. */
|
|
4
|
-
export declare const useAutoUpdateMemberListData: (list: ListDataContextState<IUnit>, shouldUpdate: (d: IUnit, event: string) => boolean) => void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useOnDeleteMember, useOnNewMember } from "./";
|
|
2
|
-
/** React hook to call action when a new Member has been created. */
|
|
3
|
-
export const useAutoUpdateMemberListData = (list, shouldUpdate) => {
|
|
4
|
-
useOnNewMember((s, d) => {
|
|
5
|
-
if (shouldUpdate(d, "new"))
|
|
6
|
-
list.union([d]);
|
|
7
|
-
});
|
|
8
|
-
useOnDeleteMember((s, d) => {
|
|
9
|
-
if (shouldUpdate(d, "delete"))
|
|
10
|
-
list.remove(d.id);
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=useAutoUpdateMemberListData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoUpdateMemberListData.js","sourceRoot":"","sources":["../../../../../../src/modules/unit/data/hooks/member-events/useAutoUpdateMemberListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAKvD,oEAAoE;AACpE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAC1C,IAAiC,EACjC,YAAkD,EACjD,EAAE;IACH,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACvB,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useUnitStore } from "../../UnitStore";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
/** React hook to call action when a delete Member has been created. */
|
|
4
|
-
export const useOnDeleteMember = (action) => {
|
|
5
|
-
const store = useUnitStore();
|
|
6
|
-
const onDeleteMember = (store, doc) => {
|
|
7
|
-
console.log(`onDeleteMember - ${doc.id} ${doc.name}`);
|
|
8
|
-
action(store, doc);
|
|
9
|
-
};
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
store.MemberDeletedEvent.subscribe(onDeleteMember);
|
|
12
|
-
return () => {
|
|
13
|
-
store.MemberDeletedEvent.unsubscribe(onDeleteMember);
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useOnDeleteMember.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOnDeleteMember.js","sourceRoot":"","sources":["../../../../../../src/modules/unit/data/hooks/member-events/useOnDeleteMember.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAA8C,EAAE,EAAE;IACnF,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,MAAM,cAAc,GAAG,CAAC,KAAgB,EAAE,GAAU,EAAE,EAAE;QACvD,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useUnitStore } from "../../UnitStore";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
/** React hook to call action when a new member has been created. */
|
|
4
|
-
export const useOnNewMember = (action) => {
|
|
5
|
-
const store = useUnitStore();
|
|
6
|
-
const onNewMember = (store, doc) => {
|
|
7
|
-
console.log(`onNewMember - ${doc.id} ${doc.name}`);
|
|
8
|
-
action(store, doc);
|
|
9
|
-
};
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
store.MemberCreatedEvent.subscribe(onNewMember);
|
|
12
|
-
return () => {
|
|
13
|
-
store.MemberCreatedEvent.unsubscribe(onNewMember);
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useOnNewMember.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOnNewMember.js","sourceRoot":"","sources":["../../../../../../src/modules/unit/data/hooks/member-events/useOnNewMember.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAA8C,EAAE,EAAE;IAChF,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,CAAC,KAAgB,EAAE,GAAU,EAAE,EAAE;QACpD,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|