@voplus/morpho-workspace 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/controls/filters/WorkStatusFilter/index.d.ts +3 -0
- package/es/controls/filters/WorkStatusFilter/index.js +21 -0
- package/es/controls/filters/WorkStatusFilter/index.js.map +1 -0
- package/es/controls/filters/WorkStatusFilter/state.d.ts +17 -0
- package/es/controls/filters/WorkStatusFilter/state.js +49 -0
- package/es/controls/filters/WorkStatusFilter/state.js.map +1 -0
- package/es/data/notification/interfaces.d.ts +2 -1
- package/es/data/work/WorkStore.d.ts +10 -0
- package/es/data/work/WorkStore.js +21 -0
- package/es/data/work/WorkStore.js.map +1 -0
- package/es/data/work/hook.d.ts +9 -0
- package/es/data/work/hook.js +20 -0
- package/es/data/work/hook.js.map +1 -0
- package/es/data/work/index.d.ts +3 -0
- package/es/data/work/index.js +4 -0
- package/es/data/work/index.js.map +1 -0
- package/es/data/work/interfaces.d.ts +37 -0
- package/es/data/work/interfaces.js +2 -0
- package/es/data/work/interfaces.js.map +1 -0
- package/es/data/workerror/WorkErrorStore.d.ts +37 -0
- package/es/data/workerror/WorkErrorStore.js +117 -0
- package/es/data/workerror/WorkErrorStore.js.map +1 -0
- package/es/data/workerror/hook.d.ts +9 -0
- package/es/data/workerror/hook.js +19 -0
- package/es/data/workerror/hook.js.map +1 -0
- package/es/data/workerror/index.d.ts +4 -0
- package/es/data/workerror/index.js +5 -0
- package/es/data/workerror/index.js.map +1 -0
- package/es/data/workerror/interfaces.d.ts +20 -0
- package/es/data/workerror/interfaces.js +2 -0
- package/es/data/workerror/interfaces.js.map +1 -0
- package/es/data/workerror/types.d.ts +50 -0
- package/es/data/workerror/types.js +9 -0
- package/es/data/workerror/types.js.map +1 -0
- package/es/data/workerror/workerror-events/index.d.ts +3 -0
- package/es/data/workerror/workerror-events/index.js +4 -0
- package/es/data/workerror/workerror-events/index.js.map +1 -0
- package/es/data/workerror/workerror-events/useAutoUpdateListData.d.ts +4 -0
- package/es/data/workerror/workerror-events/useAutoUpdateListData.js +13 -0
- package/es/data/workerror/workerror-events/useAutoUpdateListData.js.map +1 -0
- package/es/data/workerror/workerror-events/useOnDeleteWorkspace.d.ts +4 -0
- package/es/data/workerror/workerror-events/useOnDeleteWorkspace.js +17 -0
- package/es/data/workerror/workerror-events/useOnDeleteWorkspace.js.map +1 -0
- package/es/data/workerror/workerror-events/useOnNewWorkspace.d.ts +4 -0
- package/es/data/workerror/workerror-events/useOnNewWorkspace.js +17 -0
- package/es/data/workerror/workerror-events/useOnNewWorkspace.js.map +1 -0
- package/es/data/workspace/WorkSpaceStore.d.ts +39 -0
- package/es/data/workspace/WorkSpaceStore.js +134 -0
- package/es/data/workspace/WorkSpaceStore.js.map +1 -0
- package/es/data/workspace/hooks.d.ts +13 -0
- package/es/data/workspace/hooks.js +23 -0
- package/es/data/workspace/hooks.js.map +1 -0
- package/es/data/workspace/index.d.ts +4 -0
- package/es/data/workspace/index.js +5 -0
- package/es/data/workspace/index.js.map +1 -0
- package/es/data/workspace/interfaces.d.ts +17 -0
- package/es/data/workspace/interfaces.js +2 -0
- package/es/data/workspace/interfaces.js.map +1 -0
- package/es/data/workspace/types.d.ts +28 -0
- package/es/data/workspace/types.js +2 -0
- package/es/data/workspace/types.js.map +1 -0
- package/es/data/workspace/useWorkSpaceCompletedWorkEffect.d.ts +10 -0
- package/es/data/workspace/useWorkSpaceCompletedWorkEffect.js +14 -0
- package/es/data/workspace/useWorkSpaceCompletedWorkEffect.js.map +1 -0
- package/es/data/workspace/workspace-events/index.d.ts +3 -0
- package/es/data/workspace/workspace-events/index.js +4 -0
- package/es/data/workspace/workspace-events/index.js.map +1 -0
- package/es/data/workspace/workspace-events/useAutoUpdateListData.d.ts +4 -0
- package/es/data/workspace/workspace-events/useAutoUpdateListData.js +13 -0
- package/es/data/workspace/workspace-events/useAutoUpdateListData.js.map +1 -0
- package/es/data/workspace/workspace-events/useOnDeleteWorkspace.d.ts +4 -0
- package/es/data/workspace/workspace-events/useOnDeleteWorkspace.js +17 -0
- package/es/data/workspace/workspace-events/useOnDeleteWorkspace.js.map +1 -0
- package/es/data/workspace/workspace-events/useOnNewWorkspace.d.ts +4 -0
- package/es/data/workspace/workspace-events/useOnNewWorkspace.js +17 -0
- package/es/data/workspace/workspace-events/useOnNewWorkspace.js.map +1 -0
- package/es/data/worktype/WorkTypeStore.d.ts +21 -0
- package/es/data/worktype/WorkTypeStore.js +75 -0
- package/es/data/worktype/WorkTypeStore.js.map +1 -0
- package/es/data/worktype/hook.d.ts +9 -0
- package/es/data/worktype/hook.js +20 -0
- package/es/data/worktype/hook.js.map +1 -0
- package/es/data/worktype/index.d.ts +4 -0
- package/es/data/worktype/index.js +5 -0
- package/es/data/worktype/index.js.map +1 -0
- package/es/data/worktype/interfaces.d.ts +57 -0
- package/es/data/worktype/interfaces.js +2 -0
- package/es/data/worktype/interfaces.js.map +1 -0
- package/es/data/worktype/types.d.ts +55 -0
- package/es/data/worktype/types.js +2 -0
- package/es/data/worktype/types.js.map +1 -0
- package/es/data/worktype/useWorkTypeCompletedWorkEffect.d.ts +10 -0
- package/es/data/worktype/useWorkTypeCompletedWorkEffect.js +14 -0
- package/es/data/worktype/useWorkTypeCompletedWorkEffect.js.map +1 -0
- package/es/modules/board/components/Board/index.js +1 -3
- package/es/modules/board/components/Board/index.js.map +1 -1
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.js +2 -2
- package/es/modules/meeting/components/AgendaList/AgendaItem/index.js.map +1 -1
- package/es/modules/meeting/components/MeetingList/index.js +1 -2
- package/es/modules/meeting/components/MeetingList/index.js.map +1 -1
- package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.d.ts +2 -2
- package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.js +3 -3
- package/es/modules/notification/components/DocumentNotificationCard/index.js.map +1 -0
- package/es/modules/notification/components/NotificationList/index.js +2 -2
- package/es/modules/notification/components/NotificationList/index.js.map +1 -1
- package/es/modules/notification/components/NotificationList/index.less +11 -3
- package/es/modules/tasks/reports/TaskSummaryCard/index.js +2 -2
- package/es/modules/tasks/reports/TaskSummaryCard/index.js.map +1 -1
- package/es/modules/work/components/NewWorkErrorDialog/index.d.ts +9 -0
- package/es/modules/work/components/NewWorkErrorDialog/index.js +70 -0
- package/es/modules/work/components/NewWorkErrorDialog/index.js.map +1 -0
- package/es/modules/work/components/NewWorkErrorDialog/index.less +18 -0
- package/es/modules/work/components/NewWorkErrorDialog/state.d.ts +16 -0
- package/es/modules/work/components/NewWorkErrorDialog/state.js +37 -0
- package/es/modules/work/components/NewWorkErrorDialog/state.js.map +1 -0
- package/es/modules/work/components/RejectWorkDialog/index.d.ts +9 -0
- package/es/modules/work/components/RejectWorkDialog/index.js +54 -0
- package/es/modules/work/components/RejectWorkDialog/index.js.map +1 -0
- package/es/modules/work/components/RejectWorkDialog/index.less +18 -0
- package/es/modules/work/components/RejectWorkDialog/state.d.ts +12 -0
- package/es/modules/work/components/RejectWorkDialog/state.js +35 -0
- package/es/modules/work/components/RejectWorkDialog/state.js.map +1 -0
- package/es/modules/work/components/WorkErrorItem/index.d.ts +6 -0
- package/es/modules/work/components/WorkErrorItem/index.js +24 -0
- package/es/modules/work/components/WorkErrorItem/index.js.map +1 -0
- package/es/modules/work/components/WorkErrorItem/index.less +26 -0
- package/es/modules/work/components/WorkErrorList/index.d.ts +8 -0
- package/es/modules/work/components/WorkErrorList/index.js +44 -0
- package/es/modules/work/components/WorkErrorList/index.js.map +1 -0
- package/es/modules/work/components/WorkErrorList/index.less +5 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.d.ts +6 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.js +45 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.js.map +1 -0
- package/es/modules/work/components/WorkErrorPropertiesView/index.less +22 -0
- package/es/modules/work/components/WorkItem/index.d.ts +11 -0
- package/es/modules/work/components/WorkItem/index.js +25 -0
- package/es/modules/work/components/WorkItem/index.js.map +1 -0
- package/es/modules/work/components/WorkItem/index.less +17 -0
- package/es/modules/work/components/WorkList/index.d.ts +16 -0
- package/es/modules/work/components/WorkList/index.js +88 -0
- package/es/modules/work/components/WorkList/index.js.map +1 -0
- package/es/modules/work/components/WorkList/index.less +7 -0
- package/es/modules/work/components/WorkPropertiesView/index.d.ts +7 -0
- package/es/modules/work/components/WorkPropertiesView/index.js +35 -0
- package/es/modules/work/components/WorkPropertiesView/index.js.map +1 -0
- package/es/modules/work/components/WorkPropertiesView/index.less +23 -0
- package/es/{pages/Space/components/Documents → modules/work/components/WorkQATab}/index.d.ts +2 -2
- package/es/modules/work/components/WorkQATab/index.js +33 -0
- package/es/modules/work/components/WorkQATab/index.js.map +1 -0
- package/es/modules/work/components/WorkQATab/index.less +24 -0
- package/es/modules/work/components/WorkTabs/index.d.ts +7 -0
- package/es/modules/work/components/WorkTabs/index.js +45 -0
- package/es/modules/work/components/WorkTabs/index.js.map +1 -0
- package/es/modules/work/components/WorkTabs/index.less +16 -0
- package/es/modules/work/components/WorkTaskList/index.d.ts +5 -0
- package/es/modules/work/components/WorkTaskList/index.js +65 -0
- package/es/modules/work/components/WorkTaskList/index.js.map +1 -0
- package/es/modules/work/components/WorkTaskList/index.less +18 -0
- package/es/modules/work/components/WorkTaskList/state.d.ts +14 -0
- package/es/modules/work/components/WorkTaskList/state.js +23 -0
- package/es/modules/work/components/WorkTaskList/state.js.map +1 -0
- package/es/modules/work/components/WorkTasksTab/index.d.ts +6 -0
- package/es/modules/work/components/WorkTasksTab/index.js +17 -0
- package/es/modules/work/components/WorkTasksTab/index.js.map +1 -0
- package/es/modules/work/components/WorkTasksTab/index.less +7 -0
- package/es/modules/work/components/WorksProperties/index.d.ts +6 -0
- package/es/modules/work/components/WorksProperties/index.js +27 -0
- package/es/modules/work/components/WorksProperties/index.js.map +1 -0
- package/es/modules/work/components/WorksProperties/index.less +8 -0
- package/es/modules/work/pages/WorkDefaultView/index.d.ts +4 -0
- package/es/modules/work/pages/WorkDefaultView/index.js +26 -0
- package/es/modules/work/pages/WorkDefaultView/index.js.map +1 -0
- package/es/modules/work/pages/WorkDefaultView/index.less +17 -0
- package/es/modules/work/pages/WorkListPage/index.d.ts +6 -0
- package/es/modules/work/pages/WorkListPage/index.js +19 -0
- package/es/modules/work/pages/WorkListPage/index.js.map +1 -0
- package/es/modules/workspace/components/MyWorkspaces/index.d.ts +11 -0
- package/es/modules/workspace/components/MyWorkspaces/index.js +34 -0
- package/es/modules/workspace/components/MyWorkspaces/index.js.map +1 -0
- package/es/modules/workspace/components/MyWorkspaces/index.less +18 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.d.ts +10 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.js +59 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.js.map +1 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/index.less +18 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/state.d.ts +12 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/state.js +35 -0
- package/es/modules/workspace/components/NewWorkspaceDialog/state.js.map +1 -0
- package/es/modules/workspace/components/WorkspaceCard/index.d.ts +8 -0
- package/es/modules/workspace/components/WorkspaceCard/index.js +18 -0
- package/es/modules/workspace/components/WorkspaceCard/index.js.map +1 -0
- package/es/modules/workspace/components/WorkspaceCard/index.less +47 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.d.ts +13 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.js +49 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.js.map +1 -0
- package/es/modules/workspace/components/WorkspaceCardList/index.less +13 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.d.ts +6 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js +41 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/index.less +19 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/state.d.ts +15 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/state.js +68 -0
- package/es/modules/workspace/components/WorkspacePropertiesView/state.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.d.ts +6 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.js +68 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/index.less +8 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/state.d.ts +5 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/state.js +26 -0
- package/es/modules/workspace/controls/WorkspaceCompletedWorksChart/state.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.d.ts +8 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.js +36 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.js.map +1 -0
- package/es/modules/workspace/controls/WorkspaceMenu/index.less +33 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.d.ts +4 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.js +51 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.js.map +1 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/index.less +22 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/state.d.ts +15 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/state.js +68 -0
- package/es/modules/workspace/pages/WorkspaceDefaultView/state.js.map +1 -0
- package/es/modules/workspace/pages/WorkspacePage/index.d.ts +4 -0
- package/es/modules/workspace/pages/WorkspacePage/index.js +73 -0
- package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -0
- package/es/modules/workspace/pages/WorkspacePage/index.less +1 -0
- package/es/modules/workspace/pages/WorkspacePage/state.d.ts +23 -0
- package/es/modules/workspace/pages/WorkspacePage/state.js +108 -0
- package/es/modules/workspace/pages/WorkspacePage/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCard/index.d.ts +8 -0
- package/es/modules/worktype/components/WorkTypeCard/index.js +18 -0
- package/es/modules/worktype/components/WorkTypeCard/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCard/index.less +47 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.d.ts +16 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.js +50 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeCardList/index.less +15 -0
- package/es/modules/worktype/components/WorkTypeItem/index.d.ts +8 -0
- package/es/modules/worktype/components/WorkTypeItem/index.js +11 -0
- package/es/modules/worktype/components/WorkTypeItem/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeItem/index.less +19 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.js +55 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeProperties/index.less +5 -0
- package/es/modules/worktype/components/WorkTypeProperties/state.d.ts +11 -0
- package/es/modules/worktype/components/WorkTypeProperties/state.js +57 -0
- package/es/modules/worktype/components/WorkTypeProperties/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.d.ts +5 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.js +28 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesTabs/index.less +0 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.js +38 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/index.less +19 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/state.d.ts +15 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/state.js +68 -0
- package/es/modules/worktype/components/WorkTypePropertiesView/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeQA/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeQA/index.js +60 -0
- package/es/modules/worktype/components/WorkTypeQA/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeQA/index.less +35 -0
- package/es/modules/worktype/components/WorkTypeQA/state.d.ts +21 -0
- package/es/modules/worktype/components/WorkTypeQA/state.js +145 -0
- package/es/modules/worktype/components/WorkTypeQA/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeStats/index.d.ts +5 -0
- package/es/modules/worktype/components/WorkTypeStats/index.js +16 -0
- package/es/modules/worktype/components/WorkTypeStats/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeStats/index.less +29 -0
- package/es/modules/worktype/components/WorkTypeStats/state.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeStats/state.js +27 -0
- package/es/modules/worktype/components/WorkTypeStats/state.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.d.ts +6 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.js +45 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.js.map +1 -0
- package/es/modules/worktype/components/WorkTypeTabs/index.less +16 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.d.ts +6 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.js +70 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.js.map +1 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/index.less +8 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/state.d.ts +5 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/state.js +26 -0
- package/es/modules/worktype/controls/WorktypeCompleteWorksChart/state.js.map +1 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.d.ts +4 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.js +24 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.js.map +1 -0
- package/es/modules/worktype/pages/WorkTypeDefaultView/index.less +21 -0
- package/es/pages/Routes.d.ts +12 -0
- package/es/pages/Routes.js +29 -3
- package/es/pages/Routes.js.map +1 -1
- package/es/pages/Space/components/Notifications/index.js +1 -0
- package/es/pages/Space/components/Notifications/index.js.map +1 -1
- package/es/pages/Space/components/Tasks/index.d.ts +2 -2
- package/es/pages/Space/components/Tasks/index.js +50 -11
- package/es/pages/Space/components/Tasks/index.js.map +1 -1
- package/es/pages/Space/components/Works/index.d.ts +2 -2
- package/es/pages/Space/components/Works/index.js +13 -37
- package/es/pages/Space/components/Works/index.js.map +1 -1
- package/es/pages/Space/components/Workspaces/index.d.ts +3 -0
- package/es/pages/Space/components/Workspaces/index.js +19 -0
- package/es/pages/Space/components/Workspaces/index.js.map +1 -0
- package/es/pages/Space/pages/MySpace/index.js +49 -14
- package/es/pages/Space/pages/MySpace/index.js.map +1 -1
- package/es/pages/Space/pages/MySpace/state.d.ts +27 -6
- package/es/pages/Space/pages/MySpace/state.js +114 -24
- package/es/pages/Space/pages/MySpace/state.js.map +1 -1
- package/es/pages/Work/components/NewWorkDialog/index.js +3 -7
- package/es/pages/Work/components/NewWorkDialog/index.js.map +1 -1
- package/es/pages/Work/pages/WorkDefaultView/index.js +20 -17
- package/es/pages/Work/pages/WorkDefaultView/index.js.map +1 -1
- package/es/pages/WorkType/WorkTypeCheckList/index.d.ts +1 -2
- package/es/pages/WorkType/WorkTypeCheckList/index.js +43 -34
- package/es/pages/WorkType/WorkTypeCheckList/index.js.map +1 -1
- package/es/pages/WorkType/WorkTypeDetail/index.js +6 -10
- package/es/pages/WorkType/WorkTypeDetail/index.js.map +1 -1
- package/es/pages/WorkType/data/WorkTypeStore.js +4 -4
- package/es/pages/WorkType/data/WorkTypeStore.js.map +1 -1
- package/es/pages/WorkType/data/interfaces.d.ts +24 -7
- package/es/pages/WorkType/data/types.d.ts +19 -18
- package/es/routes.js.map +1 -1
- package/package.json +2 -2
- package/es/modules/notification/components/MentionNotificationCard/index.js.map +0 -1
- package/es/pages/Space/components/Documents/index.js +0 -26
- package/es/pages/Space/components/Documents/index.js.map +0 -1
- package/es/pages/Space/components/Documents/index.less +0 -5
- /package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.less +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkErrorStore } from "../WorkErrorStore";
|
|
2
|
+
import { IWorkError } from "../interfaces";
|
|
3
|
+
/** React hook to call action when a new workerror has been created. */
|
|
4
|
+
export declare const useOnNewWorkError: (action: (store: WorkErrorStore, doc: IWorkError) => void) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useWorkErrorStore } from "../WorkErrorStore";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
/** React hook to call action when a new workerror has been created. */
|
|
4
|
+
export const useOnNewWorkError = (action) => {
|
|
5
|
+
const store = useWorkErrorStore();
|
|
6
|
+
const onNewWorkError = (store, doc) => {
|
|
7
|
+
console.log(`onNewWorkError - ${doc.id} ${doc.name}`);
|
|
8
|
+
action(store, doc);
|
|
9
|
+
};
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
store.WorkErrorCreatedEvent.subscribe(onNewWorkError);
|
|
12
|
+
return () => {
|
|
13
|
+
store.WorkErrorCreatedEvent.unsubscribe(onNewWorkError);
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useOnNewWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnNewWorkspace.js","sourceRoot":"","sources":["../../../../src/data/workerror/workerror-events/useOnNewWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAwD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,cAAc,GAAG,CAAC,KAAqB,EAAE,GAAe,EAAE,EAAE;QACjE,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,qBAAqB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACtD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store } from "@voplus/morpho-data";
|
|
3
|
+
import { CreateWorkspaceOptions, EditWorkspaceOptions, IWorkspace, LoadWorkspaceOptions } from "./";
|
|
4
|
+
import { IDocumentAccessSettings, LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
5
|
+
/** Workspace store provides service for workspace operations */
|
|
6
|
+
export declare class WorkspaceStore extends Store {
|
|
7
|
+
readonly endpoint: ApiEndPoint;
|
|
8
|
+
/** Name of the store */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** Workspace created event dispatcher */
|
|
11
|
+
private readonly _workspaceCreated;
|
|
12
|
+
private readonly _workspaceDeleted;
|
|
13
|
+
/** Event fires when a new workspace has been created. */
|
|
14
|
+
get WorkspaceCreatedEvent(): import("strongly-typed-events").IEvent<WorkspaceStore, IWorkspace>;
|
|
15
|
+
/** Event fires when a delete workspace has been deleted. */
|
|
16
|
+
get WorkspaceDeletedEvent(): import("strongly-typed-events").IEvent<WorkspaceStore, IWorkspace>;
|
|
17
|
+
constructor(endpoint: ApiEndPoint);
|
|
18
|
+
/** All currently used workspace. */
|
|
19
|
+
readonly items: CountedMap<string, IWorkspace>;
|
|
20
|
+
/** Load a workspace from server.
|
|
21
|
+
* @param {string} id - id of the workspace.
|
|
22
|
+
* @param {LoadWorkspaceOptions} options - Optional load options.
|
|
23
|
+
*/
|
|
24
|
+
load(id: string, options?: LoadWorkspaceOptions): Promise<IWorkspace>;
|
|
25
|
+
/** Load a list of workspaces from server.
|
|
26
|
+
* @param {LoadDocumentListOptions}
|
|
27
|
+
*/
|
|
28
|
+
loadList(options?: LoadDocumentListOptions): Promise<IWorkspace[]>;
|
|
29
|
+
/** Create a new workspaces. */
|
|
30
|
+
create(options: CreateWorkspaceOptions): Promise<IWorkspace>;
|
|
31
|
+
/** Edit an existing item on server. */
|
|
32
|
+
edit(id: string, options: EditWorkspaceOptions): Promise<any>;
|
|
33
|
+
delete(ids: string[], options: {
|
|
34
|
+
DeleteChilds?: boolean;
|
|
35
|
+
}): Promise<IWorkspace[]>;
|
|
36
|
+
loadAccess(id: string): Promise<IDocumentAccessSettings>;
|
|
37
|
+
}
|
|
38
|
+
/** React hook to retrieve WorkspaceStore */
|
|
39
|
+
export declare const useWorkspaceStore: () => WorkspaceStore;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { RequestBuilder } from "@voplus/api";
|
|
3
|
+
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
4
|
+
import { EventDispatcher } from "strongly-typed-events";
|
|
5
|
+
import { action } from "mobx";
|
|
6
|
+
import invariant from "invariant";
|
|
7
|
+
import { observable } from "mobx";
|
|
8
|
+
const StoreName = "WorkspaceStore";
|
|
9
|
+
/** Workspace store provides service for workspace operations */
|
|
10
|
+
export class WorkspaceStore extends Store {
|
|
11
|
+
constructor(endpoint) {
|
|
12
|
+
super();
|
|
13
|
+
Object.defineProperty(this, "endpoint", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: endpoint
|
|
18
|
+
});
|
|
19
|
+
/** Name of the store */
|
|
20
|
+
Object.defineProperty(this, "name", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: StoreName
|
|
25
|
+
});
|
|
26
|
+
/** Workspace created event dispatcher */
|
|
27
|
+
Object.defineProperty(this, "_workspaceCreated", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: new EventDispatcher()
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(this, "_workspaceDeleted", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: new EventDispatcher()
|
|
38
|
+
});
|
|
39
|
+
/** All currently used workspace. */
|
|
40
|
+
Object.defineProperty(this, "items", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Event fires when a new workspace has been created. */
|
|
48
|
+
get WorkspaceCreatedEvent() {
|
|
49
|
+
return this._workspaceCreated.asEvent();
|
|
50
|
+
}
|
|
51
|
+
/** Event fires when a delete workspace has been deleted. */
|
|
52
|
+
get WorkspaceDeletedEvent() {
|
|
53
|
+
return this._workspaceDeleted.asEvent();
|
|
54
|
+
}
|
|
55
|
+
/** Load a workspace from server.
|
|
56
|
+
* @param {string} id - id of the workspace.
|
|
57
|
+
* @param {LoadWorkspaceOptions} options - Optional load options.
|
|
58
|
+
*/
|
|
59
|
+
async load(id, options) {
|
|
60
|
+
options = options !== null && options !== void 0 ? options : {};
|
|
61
|
+
let query = "";
|
|
62
|
+
if (options.includes)
|
|
63
|
+
query = query.concat(`includes=${options.includes}`);
|
|
64
|
+
if (query)
|
|
65
|
+
query = "?".concat(query);
|
|
66
|
+
const r = await this.endpoint.get(`/api/workspaces/${id}${query}`);
|
|
67
|
+
return await r.json();
|
|
68
|
+
}
|
|
69
|
+
/** Load a list of workspaces from server.
|
|
70
|
+
* @param {LoadDocumentListOptions}
|
|
71
|
+
*/
|
|
72
|
+
async loadList(options) {
|
|
73
|
+
let query = "";
|
|
74
|
+
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
75
|
+
query = query.concat(`includes=${options.Includes}`);
|
|
76
|
+
}
|
|
77
|
+
if (query)
|
|
78
|
+
query = "?".concat(query);
|
|
79
|
+
const r = await this.endpoint.post(`/api/workspaces${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
80
|
+
return (await r.json());
|
|
81
|
+
}
|
|
82
|
+
/** Create a new workspaces. */
|
|
83
|
+
async create(options) {
|
|
84
|
+
invariant(options.data.Name, "Name cannot be empty.");
|
|
85
|
+
return await this.action(async () => {
|
|
86
|
+
const r = await this.endpoint.post(`/api/workspaces/create`, new RequestBuilder().json(options.data));
|
|
87
|
+
const t = (await r.json());
|
|
88
|
+
this._workspaceCreated.dispatch(this, t);
|
|
89
|
+
return t;
|
|
90
|
+
}, options);
|
|
91
|
+
}
|
|
92
|
+
/** Edit an existing item on server. */
|
|
93
|
+
async edit(id, options) {
|
|
94
|
+
return this.action(async () => {
|
|
95
|
+
const r = await this.endpoint.post(`/api/workspaces/${id}`, new RequestBuilder().json(options.data));
|
|
96
|
+
const t = (await r.json());
|
|
97
|
+
this.items.overwrite(t.id, t);
|
|
98
|
+
return t;
|
|
99
|
+
}, options);
|
|
100
|
+
}
|
|
101
|
+
async delete(ids, options) {
|
|
102
|
+
await this.endpoint.delete(`/api/workspaces/delete`, new RequestBuilder().json({ Ids: ids, Options: options }));
|
|
103
|
+
const deleted = [];
|
|
104
|
+
for (const id of ids) {
|
|
105
|
+
const item = this.items.peek(id);
|
|
106
|
+
if (item) {
|
|
107
|
+
deleted.push(item);
|
|
108
|
+
item.status = "Deleted";
|
|
109
|
+
this._workspaceDeleted.dispatch(this, item);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return deleted;
|
|
113
|
+
}
|
|
114
|
+
async loadAccess(id) {
|
|
115
|
+
invariant(id, "id cannot be empty");
|
|
116
|
+
const r = await this.endpoint.get(`/api/nodes/${id}/permissions`);
|
|
117
|
+
return await r.json();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
__decorate([
|
|
121
|
+
action
|
|
122
|
+
], WorkspaceStore.prototype, "delete", null);
|
|
123
|
+
__decorate([
|
|
124
|
+
action
|
|
125
|
+
], WorkspaceStore.prototype, "loadAccess", null);
|
|
126
|
+
/** React hook to retrieve WorkspaceStore */
|
|
127
|
+
export const useWorkspaceStore = () => {
|
|
128
|
+
const context = useApplicationContext();
|
|
129
|
+
if (!context.getService(StoreName)) {
|
|
130
|
+
context.registerService(new WorkspaceStore(context.api.currentEndPoint));
|
|
131
|
+
}
|
|
132
|
+
return context.getService(StoreName);
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=WorkSpaceStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkSpaceStore.js","sourceRoot":"","sources":["../../../src/data/workspace/WorkSpaceStore.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAO/E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC,gEAAgE;AAChE,MAAM,OAAO,cAAe,SAAQ,KAAK;IAiBrC,YAAmC,QAAqB;QACpD,KAAK,EAAE,CAAC;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,CAAC;IAC1B,CAAC;CACJ;AAzBG;IADC,MAAM;4CAkBN;AAGD;IADC,MAAM;gDAKN;AAGL,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAChC,OAAO,CAAC,eAAe,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KAC5E;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CAAoB,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IWorkspace, LoadWorkspaceOptions } from ".";
|
|
2
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
3
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
4
|
+
/** React hook to retrieve a workspace
|
|
5
|
+
* @param {string} id - id of the workspace
|
|
6
|
+
* @param {LoadWorkspaceOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export declare const useWorkspace: (id: string, options?: LoadWorkspaceOptions | undefined) => IWorkspace;
|
|
9
|
+
/** React hook to retrieve a list of workspaces
|
|
10
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
11
|
+
* @param options - Optional workspace list loading options.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useWorkspaceListEffect: (list: ListDataContextState<IWorkspace> | null, effect: (list: IWorkspace[], total: number) => void, options?: LoadDocumentListOptions | undefined) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useWorkspaceStore } from ".";
|
|
2
|
+
import { useListLoaderEffect } from "@voplus/morpho-ui/es/hooks";
|
|
3
|
+
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
4
|
+
/** React hook to retrieve a workspace
|
|
5
|
+
* @param {string} id - id of the workspace
|
|
6
|
+
* @param {LoadWorkspaceOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export const useWorkspace = (id, options) => {
|
|
9
|
+
options = options !== null && options !== void 0 ? options : {};
|
|
10
|
+
const store = useWorkspaceStore();
|
|
11
|
+
return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
|
|
12
|
+
};
|
|
13
|
+
/** React hook to retrieve a list of workspaces
|
|
14
|
+
* @param effect - Effect callback to be ran after successful retrieved the list.
|
|
15
|
+
* @param options - Optional workspace list loading options.
|
|
16
|
+
*/
|
|
17
|
+
export const useWorkspaceListEffect = (list, effect, options) => {
|
|
18
|
+
const deps = options ? options : {};
|
|
19
|
+
const store = useWorkspaceStore();
|
|
20
|
+
// Call useListLoaderEffect and ensure won't load twice for same loading options.
|
|
21
|
+
return useListLoaderEffect(list, store.items, effect, () => store.loadList(options), [deps]);
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/workspace/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAIxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,OAA8B,EAAE,EAAE;IAC1E,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAK,EAA2B,CAAC;IAClD,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAElC,OAAO,qBAAqB,CAC3B,EAAE,EACF,KAAK,CAAC,KAAK,EACX,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAC9B,OAAO,CACO,CAAC;AACjB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACrC,IAA6C,EAC7C,MAAmD,EACnD,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAElC,iFAAiF;IACjF,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/workspace/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ILoadable } from "@voplus/morpho-data";
|
|
2
|
+
export declare type MessageStatus = "New" | "Due" | "Pending" | "Done" | "Cancelled";
|
|
3
|
+
export interface IWorkspace extends ILoadable {
|
|
4
|
+
/** id of the workspace. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** name of the workspace. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** status of the workspace. */
|
|
9
|
+
status?: string;
|
|
10
|
+
/** Create date of the workspace. */
|
|
11
|
+
createDate?: string;
|
|
12
|
+
/** Owner of the workspace. */
|
|
13
|
+
owner?: {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/workspace/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LoadOptions, StoreActionOptions } from "@voplus/morpho-data";
|
|
2
|
+
import { IWorkspace } from ".";
|
|
3
|
+
/** Custom load contact options type */
|
|
4
|
+
export declare type LoadWorkspaceOptions = {
|
|
5
|
+
/** Comma separated include options e.g. path */
|
|
6
|
+
includes?: string;
|
|
7
|
+
} & LoadOptions<IWorkspace>;
|
|
8
|
+
/** Custom create workspace options type. Use TitleCase to fit server need. */
|
|
9
|
+
export declare type CreateWorkspaceDataOptions = {
|
|
10
|
+
ParentId?: string;
|
|
11
|
+
Name: string;
|
|
12
|
+
/** List of id of members */
|
|
13
|
+
MemberIds?: string[];
|
|
14
|
+
};
|
|
15
|
+
export declare type CreateWorkspaceOptions = {
|
|
16
|
+
data: CreateWorkspaceDataOptions;
|
|
17
|
+
} & StoreActionOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Custom edit workspace options type. Use TitleCase to fit server need.
|
|
20
|
+
*/
|
|
21
|
+
export declare type EditWorkspaceDataOptions = {
|
|
22
|
+
Name?: string;
|
|
23
|
+
/** list of member unit ids */
|
|
24
|
+
MemberIds?: string[];
|
|
25
|
+
};
|
|
26
|
+
export declare type EditWorkspaceOptions = {
|
|
27
|
+
data: EditWorkspaceDataOptions;
|
|
28
|
+
} & StoreActionOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/data/workspace/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface IWorkSpaceCompletedWork {
|
|
2
|
+
/** date of the completed-works. */
|
|
3
|
+
date: string;
|
|
4
|
+
/** total of the completed-works */
|
|
5
|
+
total: number;
|
|
6
|
+
}
|
|
7
|
+
/** React hook to retrieve workspace summary report.
|
|
8
|
+
* @param {string} id - id of the dashboard
|
|
9
|
+
*/
|
|
10
|
+
export declare const useWorkSpaceCompletedWork: (id: string, effect: (data: IWorkSpaceCompletedWork[]) => void) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useDeepDepEffect } from "@voplus/morpho-data";
|
|
2
|
+
import { useDocumentStore } from "@voplus/morpho-document-core";
|
|
3
|
+
/** React hook to retrieve workspace summary report.
|
|
4
|
+
* @param {string} id - id of the dashboard
|
|
5
|
+
*/
|
|
6
|
+
export const useWorkSpaceCompletedWork = (id, effect) => {
|
|
7
|
+
const documents = useDocumentStore();
|
|
8
|
+
return useDeepDepEffect(() => {
|
|
9
|
+
documents.endpoint.get(`/api/workspaces/reports/completed-works/${id}`).then((r) => {
|
|
10
|
+
r.json().then((result) => effect(result));
|
|
11
|
+
});
|
|
12
|
+
}, [id]);
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useWorkSpaceCompletedWorkEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkSpaceCompletedWorkEffect.js","sourceRoot":"","sources":["../../../src/data/workspace/useWorkSpaceCompletedWorkEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAUhE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,EAAU,EACV,MAAiD,EAChD,EAAE;IACH,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IAErC,OAAO,gBAAgB,CAAC,GAAG,EAAE;QAC5B,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,2CAA2C,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YAClF,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACV,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/workspace/workspace-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IWorkspace } from "../interfaces";
|
|
2
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
3
|
+
/** React hook to call action when a new workspace has been created. */
|
|
4
|
+
export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IWorkspace, event: string) => boolean) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useOnDeleteWorkspace, useOnNewWorkspace } from ".";
|
|
2
|
+
/** React hook to call action when a new workspace has been created. */
|
|
3
|
+
export const useAutoUpdateListData = (list, shouldUpdate) => {
|
|
4
|
+
useOnNewWorkspace((s, d) => {
|
|
5
|
+
if (shouldUpdate(d, "new"))
|
|
6
|
+
list.union([d]);
|
|
7
|
+
});
|
|
8
|
+
useOnDeleteWorkspace((s, d) => {
|
|
9
|
+
if (shouldUpdate(d, "new"))
|
|
10
|
+
list.remove(d.id);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useAutoUpdateListData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoUpdateListData.js","sourceRoot":"","sources":["../../../../src/data/workspace/workspace-events/useAutoUpdateListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAK5D,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA+B,EAC/B,YAAuD,EACtD,EAAE;IACH,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkspaceStore } from "../WorkSpaceStore";
|
|
2
|
+
import { IWorkspace } from "../interfaces";
|
|
3
|
+
/** React hook to call action when a delete workspace has been created. */
|
|
4
|
+
export declare const useOnDeleteWorkspace: (action: (store: WorkspaceStore, doc: IWorkspace) => void) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useWorkspaceStore } from "../WorkSpaceStore";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
/** React hook to call action when a delete workspace has been created. */
|
|
4
|
+
export const useOnDeleteWorkspace = (action) => {
|
|
5
|
+
const store = useWorkspaceStore();
|
|
6
|
+
const onDeleteWorkspace = (store, doc) => {
|
|
7
|
+
console.log(`onDeleteWorkspace - ${doc.id} ${doc.name}`);
|
|
8
|
+
action(store, doc);
|
|
9
|
+
};
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
store.WorkspaceDeletedEvent.subscribe(onDeleteWorkspace);
|
|
12
|
+
return () => {
|
|
13
|
+
store.WorkspaceDeletedEvent.unsubscribe(onDeleteWorkspace);
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useOnDeleteWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnDeleteWorkspace.js","sourceRoot":"","sources":["../../../../src/data/workspace/workspace-events/useOnDeleteWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAwD,EAAE,EAAE;IAChG,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,iBAAiB,GAAG,CAAC,KAAqB,EAAE,GAAe,EAAE,EAAE;QACpE,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,qBAAqB,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QACzD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC5D,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkspaceStore } from "../WorkSpaceStore";
|
|
2
|
+
import { IWorkspace } from "../interfaces";
|
|
3
|
+
/** React hook to call action when a new workspace has been created. */
|
|
4
|
+
export declare const useOnNewWorkspace: (action: (store: WorkspaceStore, doc: IWorkspace) => void) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useWorkspaceStore } from "../WorkSpaceStore";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
/** React hook to call action when a new workspace has been created. */
|
|
4
|
+
export const useOnNewWorkspace = (action) => {
|
|
5
|
+
const store = useWorkspaceStore();
|
|
6
|
+
const onNewWorkspace = (store, doc) => {
|
|
7
|
+
console.log(`onNewWorkspace - ${doc.id} ${doc.name}`);
|
|
8
|
+
action(store, doc);
|
|
9
|
+
};
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
store.WorkspaceCreatedEvent.subscribe(onNewWorkspace);
|
|
12
|
+
return () => {
|
|
13
|
+
store.WorkspaceCreatedEvent.unsubscribe(onNewWorkspace);
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useOnNewWorkspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnNewWorkspace.js","sourceRoot":"","sources":["../../../../src/data/workspace/workspace-events/useOnNewWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAwD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,cAAc,GAAG,CAAC,KAAqB,EAAE,GAAe,EAAE,EAAE;QACjE,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,qBAAqB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACtD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApiEndPoint } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store } from "@voplus/morpho-data";
|
|
3
|
+
import { IWorkType, LoadWorkTypeOptions, WorkTypeCreateOptions, WorkTypeEditOptions } from ".";
|
|
4
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
5
|
+
/** Corporate store supply backend functions. */
|
|
6
|
+
export declare class WorkTypeStore extends Store {
|
|
7
|
+
readonly endpoint: ApiEndPoint;
|
|
8
|
+
/** Name of the store */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
constructor(endpoint: ApiEndPoint);
|
|
11
|
+
/** All currently used workType. */
|
|
12
|
+
readonly items: CountedMap<string, IWorkType>;
|
|
13
|
+
/** Create a new WorkType. */
|
|
14
|
+
create(options: WorkTypeCreateOptions): Promise<IWorkType>;
|
|
15
|
+
/** Edit an existing item on server. */
|
|
16
|
+
edit(id: string, options: WorkTypeEditOptions): Promise<void>;
|
|
17
|
+
loadList(options?: LoadDocumentListOptions): Promise<IWorkType[]>;
|
|
18
|
+
load(id: string, options: LoadWorkTypeOptions): Promise<IWorkType>;
|
|
19
|
+
}
|
|
20
|
+
/** 响应钩子检索 WorkTypeStore */
|
|
21
|
+
export declare const useWorkTypeStore: () => WorkTypeStore;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { RequestBuilder } from "@voplus/api";
|
|
2
|
+
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
|
3
|
+
import { observable } from "mobx";
|
|
4
|
+
const StoreName = "WorkTypeStore";
|
|
5
|
+
/** Corporate store supply backend functions. */
|
|
6
|
+
export class WorkTypeStore extends Store {
|
|
7
|
+
constructor(endpoint) {
|
|
8
|
+
super();
|
|
9
|
+
Object.defineProperty(this, "endpoint", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: endpoint
|
|
14
|
+
});
|
|
15
|
+
/** Name of the store */
|
|
16
|
+
Object.defineProperty(this, "name", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: StoreName
|
|
21
|
+
});
|
|
22
|
+
/** All currently used workType. */
|
|
23
|
+
Object.defineProperty(this, "items", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Create a new WorkType. */
|
|
31
|
+
async create(options) {
|
|
32
|
+
// invariant(options.name, "Name cannot be empty.");
|
|
33
|
+
return await this.action(async () => {
|
|
34
|
+
const r = await this.endpoint.post(`/api/worktypes/create`, new RequestBuilder().json(options.data));
|
|
35
|
+
const t = (await r.json());
|
|
36
|
+
return t;
|
|
37
|
+
}, options);
|
|
38
|
+
}
|
|
39
|
+
/** Edit an existing item on server. */
|
|
40
|
+
async edit(id, options) {
|
|
41
|
+
await this.action(async () => {
|
|
42
|
+
const r = await this.endpoint.post(`/api/worktypes/${id}`, new RequestBuilder().json(options.data));
|
|
43
|
+
const t = await r.json();
|
|
44
|
+
this.items.overwrite(t.id, t);
|
|
45
|
+
}, options);
|
|
46
|
+
}
|
|
47
|
+
async loadList(options) {
|
|
48
|
+
let query = "";
|
|
49
|
+
if (options === null || options === void 0 ? void 0 : options.Includes) {
|
|
50
|
+
query = query.concat(`includes=${options.Includes}`);
|
|
51
|
+
}
|
|
52
|
+
if (query)
|
|
53
|
+
query = "?".concat(query);
|
|
54
|
+
const r = await this.endpoint.post(`/api/worktypes${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
|
|
55
|
+
return (await r.json());
|
|
56
|
+
}
|
|
57
|
+
async load(id, options) {
|
|
58
|
+
let query = "";
|
|
59
|
+
if (options.includes)
|
|
60
|
+
query = query.concat(`includes=${options.includes}`);
|
|
61
|
+
if (query)
|
|
62
|
+
query = "?".concat(query);
|
|
63
|
+
const r = await this.endpoint.get(`/api/worktypes/${id}${query}`);
|
|
64
|
+
return (await r.json());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** 响应钩子检索 WorkTypeStore */
|
|
68
|
+
export const useWorkTypeStore = () => {
|
|
69
|
+
const context = useApplicationContext();
|
|
70
|
+
if (!context.getStore(StoreName)) {
|
|
71
|
+
context.addStore(new WorkTypeStore(context.api.currentEndPoint));
|
|
72
|
+
}
|
|
73
|
+
return context.getStore(StoreName);
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=WorkTypeStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkTypeStore.js","sourceRoot":"","sources":["../../../src/data/worktype/WorkTypeStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,gDAAgD;AAChD,MAAM,OAAO,aAAc,SAAQ,KAAK;IAIvC,YAAmC,QAAqB;QACvD,KAAK,EAAE,CAAC;;;;;mBAD0B;;QAHnC,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;QAMzC,mCAAmC;QACnC;;;;mBAAuD,IAAI,UAAU,CACpE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAgB,CAAA,EAC1D,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAClC;WAAC;IANF,CAAC;IAQD,6BAA6B;IACtB,KAAK,CAAC,MAAM,CAAC,OAA8B;QACjD,oDAAoD;QACpD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;YACnC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjC,uBAAuB,EACvB,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CACvC,CAAC;YACF,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAA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AAG,EAAE,CAAC;QACf,IAAI,OAAO,CAAC,QAAQ;YAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3E,IAAI,KAAK;YAAE,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;QAClE,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAc,CAAC;IACtC,CAAC;CACD;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KACjE;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IWorkType, LoadWorkTypeOptions } from ".";
|
|
2
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
|
3
|
+
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
|
4
|
+
/** React hook to retrieve a WorkType
|
|
5
|
+
* @param {string} id - id of the WorkType
|
|
6
|
+
* @param {LoadWorkTypeOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export declare const useWorkType: (id: string, options?: LoadWorkTypeOptions | undefined) => IWorkType;
|
|
9
|
+
export declare const useWorkTypeListEffect: (list: ListDataContextState<IWorkType> | null, effect: (list: any[]) => void, options?: LoadDocumentListOptions | undefined) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useWorkTypeStore } from ".";
|
|
2
|
+
import { useDocumentListLoaderEffect, } from "@voplus/morpho-document-core";
|
|
3
|
+
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
|
4
|
+
/** React hook to retrieve a WorkType
|
|
5
|
+
* @param {string} id - id of the WorkType
|
|
6
|
+
* @param {LoadWorkTypeOptions} options - options
|
|
7
|
+
*/
|
|
8
|
+
export const useWorkType = (id, options) => {
|
|
9
|
+
options = options ? options : {};
|
|
10
|
+
const store = useWorkTypeStore();
|
|
11
|
+
// const documents = useDocumentStore();
|
|
12
|
+
return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
|
|
13
|
+
};
|
|
14
|
+
export const useWorkTypeListEffect = (list, effect, options) => {
|
|
15
|
+
const deps = options ? options : {};
|
|
16
|
+
const workType = useWorkTypeStore();
|
|
17
|
+
// Call useDocumentListEffect and ensure won't load twice for same loading options.
|
|
18
|
+
return useDocumentListLoaderEffect(list, effect, () => workType.loadList(options), [deps]);
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/data/worktype/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,gBAAgB,EAAE,MAAM,GAAG,CAAC;AACrE,OAAO,EAGN,2BAA2B,GAE3B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,OAA6B,EAAE,EAAE;IACxE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA0B,CAAC;IAC1D,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,wCAAwC;IACxC,OAAO,qBAAqB,CAC3B,EAAE,EACF,KAAK,CAAC,KAAK,EACX,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAC9B,OAAO,CACM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA4C,EAC5C,MAA6B,EAC7B,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,QAAQ,GAAG,gBAAgB,EAAE,CAAC;IAEpC,mFAAmF;IACnF,OAAO,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/worktype/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|