@voplus/morpho-workspace 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/es/data/notification/interfaces.d.ts +2 -1
  2. package/es/data/work/WorkStore.d.ts +12 -0
  3. package/es/data/work/WorkStore.js +21 -0
  4. package/es/data/work/WorkStore.js.map +1 -1
  5. package/es/data/work/interfaces.d.ts +17 -1
  6. package/es/data/workerror/types.d.ts +4 -0
  7. package/es/data/worktype/WorkTypeStore.d.ts +6 -0
  8. package/es/data/worktype/WorkTypeStore.js +22 -0
  9. package/es/data/worktype/WorkTypeStore.js.map +1 -1
  10. package/es/data/worktype/worktype-events/index.d.ts +3 -0
  11. package/es/data/worktype/worktype-events/index.js +4 -0
  12. package/es/data/worktype/worktype-events/index.js.map +1 -0
  13. package/es/data/worktype/worktype-events/useAutoUpdateListData.d.ts +4 -0
  14. package/es/data/worktype/worktype-events/useAutoUpdateListData.js +15 -0
  15. package/es/data/worktype/worktype-events/useAutoUpdateListData.js.map +1 -0
  16. package/es/data/worktype/worktype-events/useOnDeleteWorkType.d.ts +4 -0
  17. package/es/data/worktype/worktype-events/useOnDeleteWorkType.js +16 -0
  18. package/es/data/worktype/worktype-events/useOnDeleteWorkType.js.map +1 -0
  19. package/es/data/worktype/worktype-events/useOnNewWorkType.d.ts +4 -0
  20. package/es/data/worktype/worktype-events/useOnNewWorkType.js +17 -0
  21. package/es/data/worktype/worktype-events/useOnNewWorkType.js.map +1 -0
  22. package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.d.ts +2 -2
  23. package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.js +3 -3
  24. package/es/modules/notification/components/DocumentNotificationCard/index.js.map +1 -0
  25. package/es/modules/notification/components/NotificationList/index.js +2 -2
  26. package/es/modules/notification/components/NotificationList/index.js.map +1 -1
  27. package/es/modules/work/components/NewWorkForm/index.d.ts +10 -0
  28. package/es/modules/work/components/NewWorkForm/index.js +60 -0
  29. package/es/modules/work/components/NewWorkForm/index.js.map +1 -0
  30. package/es/modules/work/components/NewWorkForm/index.less +17 -0
  31. package/es/modules/work/components/SubWorkList/index.d.ts +4 -0
  32. package/es/modules/work/components/SubWorkList/index.js +42 -0
  33. package/es/modules/work/components/SubWorkList/index.js.map +1 -0
  34. package/es/modules/work/components/SubWorkList/index.less +7 -0
  35. package/es/modules/work/components/WorkErrorList/index.js +0 -1
  36. package/es/modules/work/components/WorkErrorList/index.js.map +1 -1
  37. package/es/modules/work/components/WorkItem/index.d.ts +1 -3
  38. package/es/modules/work/components/WorkItem/index.js +20 -4
  39. package/es/modules/work/components/WorkItem/index.js.map +1 -1
  40. package/es/modules/work/components/WorkItem/index.less +11 -0
  41. package/es/modules/work/components/WorkList/index.d.ts +3 -1
  42. package/es/modules/work/components/WorkList/index.js +35 -11
  43. package/es/modules/work/components/WorkList/index.js.map +1 -1
  44. package/es/modules/work/components/WorkPropertiesView/index.js +8 -2
  45. package/es/modules/work/components/WorkPropertiesView/index.js.map +1 -1
  46. package/es/modules/work/components/WorkTabs/index.js +10 -1
  47. package/es/modules/work/components/WorkTabs/index.js.map +1 -1
  48. package/es/modules/work/components/WorksProperties/index.js +4 -2
  49. package/es/modules/work/components/WorksProperties/index.js.map +1 -1
  50. package/es/modules/work/controls/WorkMenu/Accept.d.ts +8 -0
  51. package/es/modules/work/controls/WorkMenu/Accept.js +31 -0
  52. package/es/modules/work/controls/WorkMenu/Accept.js.map +1 -0
  53. package/es/modules/work/controls/WorkMenu/Reject.d.ts +8 -0
  54. package/es/modules/work/controls/WorkMenu/Reject.js +31 -0
  55. package/es/modules/work/controls/WorkMenu/Reject.js.map +1 -0
  56. package/es/modules/work/controls/WorkMenu/Send.d.ts +8 -0
  57. package/es/modules/work/controls/WorkMenu/Send.js +31 -0
  58. package/es/modules/work/controls/WorkMenu/Send.js.map +1 -0
  59. package/es/modules/work/controls/WorkMenu/index.d.ts +7 -0
  60. package/es/modules/work/controls/WorkMenu/index.js +27 -0
  61. package/es/modules/work/controls/WorkMenu/index.js.map +1 -0
  62. package/es/modules/work/pages/WorkDefaultView/index.less +1 -2
  63. package/es/modules/workspace/components/WorkspaceCardList/index.js +0 -1
  64. package/es/modules/workspace/components/WorkspaceCardList/index.js.map +1 -1
  65. package/es/modules/workspace/components/WorkspacePropertiesView/index.js +11 -5
  66. package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -1
  67. package/es/modules/workspace/components/WorkspaceTabs/index.d.ts +5 -0
  68. package/es/modules/workspace/components/WorkspaceTabs/index.js +26 -0
  69. package/es/modules/workspace/components/WorkspaceTabs/index.js.map +1 -0
  70. package/es/modules/workspace/pages/WorkspaceDefaultView/index.js +1 -1
  71. package/es/modules/workspace/pages/WorkspaceDefaultView/index.js.map +1 -1
  72. package/es/modules/workspace/pages/WorkspacePage/index.js +1 -1
  73. package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -1
  74. package/es/modules/worktype/components/NewTypeForm/index.d.ts +10 -0
  75. package/es/modules/worktype/components/NewTypeForm/index.js +44 -0
  76. package/es/modules/worktype/components/NewTypeForm/index.js.map +1 -0
  77. package/es/modules/worktype/components/NewTypeForm/index.less +5 -0
  78. package/es/modules/worktype/components/NewTypeForm/state.d.ts +11 -0
  79. package/es/modules/worktype/components/NewTypeForm/state.js +41 -0
  80. package/es/modules/worktype/components/NewTypeForm/state.js.map +1 -0
  81. package/es/modules/worktype/components/WorkTypeCardList/index.d.ts +4 -11
  82. package/es/modules/worktype/components/WorkTypeCardList/index.js +3 -17
  83. package/es/modules/worktype/components/WorkTypeCardList/index.js.map +1 -1
  84. package/es/modules/worktype/components/WorkTypeCardList/index.less +7 -9
  85. package/es/modules/worktype/components/WorkTypeItem/index.d.ts +1 -1
  86. package/es/modules/worktype/components/WorkTypeItem/index.js +14 -2
  87. package/es/modules/worktype/components/WorkTypeItem/index.js.map +1 -1
  88. package/es/modules/worktype/components/WorkTypeItem/index.less +13 -0
  89. package/es/modules/worktype/components/WorkTypeList/index.d.ts +9 -0
  90. package/es/modules/worktype/components/WorkTypeList/index.js +44 -0
  91. package/es/modules/worktype/components/WorkTypeList/index.js.map +1 -0
  92. package/es/modules/worktype/components/WorkTypeProperties/index.js +19 -20
  93. package/es/modules/worktype/components/WorkTypeProperties/index.js.map +1 -1
  94. package/es/modules/worktype/components/WorkTypeProperties/state.d.ts +2 -3
  95. package/es/modules/worktype/components/WorkTypeProperties/state.js +7 -15
  96. package/es/modules/worktype/components/WorkTypeProperties/state.js.map +1 -1
  97. package/es/modules/worktype/components/WorkTypePropertiesView/index.js +13 -8
  98. package/es/modules/worktype/components/WorkTypePropertiesView/index.js.map +1 -1
  99. package/es/modules/worktype/components/WorkTypeQA/index.js +37 -36
  100. package/es/modules/worktype/components/WorkTypeQA/index.js.map +1 -1
  101. package/es/modules/worktype/components/WorkTypeQA/index.less +8 -1
  102. package/es/modules/worktype/components/WorkTypeTabs/index.js +1 -1
  103. package/es/modules/worktype/components/WorkTypeTabs/index.js.map +1 -1
  104. package/es/modules/worktype/controls/ToolBar/index.d.ts +10 -0
  105. package/es/modules/worktype/controls/ToolBar/index.js +20 -0
  106. package/es/modules/worktype/controls/ToolBar/index.js.map +1 -0
  107. package/es/modules/worktype/controls/ToolBar/index.less +55 -0
  108. package/es/modules/worktype/controls/ToolBar/state.d.ts +36 -0
  109. package/es/modules/worktype/controls/ToolBar/state.js +57 -0
  110. package/es/modules/worktype/controls/ToolBar/state.js.map +1 -0
  111. package/es/modules/worktype/controls/WorkTypeMenu/index.d.ts +14 -0
  112. package/es/modules/worktype/controls/WorkTypeMenu/index.js +26 -0
  113. package/es/modules/worktype/controls/WorkTypeMenu/index.js.map +1 -0
  114. package/es/modules/worktype/controls/WorkTypeMenu/index.less +0 -0
  115. package/es/modules/worktype/pages/WorkTypeDefaultView/index.less +4 -3
  116. package/es/pages/Space/components/Tasks/index.d.ts +2 -2
  117. package/es/pages/Space/components/Tasks/index.js +50 -11
  118. package/es/pages/Space/components/Tasks/index.js.map +1 -1
  119. package/es/pages/Space/components/Works/index.d.ts +2 -2
  120. package/es/pages/Space/components/Works/index.js +13 -37
  121. package/es/pages/Space/components/Works/index.js.map +1 -1
  122. package/es/pages/Space/pages/MySpace/index.js +43 -12
  123. package/es/pages/Space/pages/MySpace/index.js.map +1 -1
  124. package/es/pages/Space/pages/MySpace/state.d.ts +27 -6
  125. package/es/pages/Space/pages/MySpace/state.js +114 -24
  126. package/es/pages/Space/pages/MySpace/state.js.map +1 -1
  127. package/package.json +1 -1
  128. package/es/modules/notification/components/MentionNotificationCard/index.js.map +0 -1
  129. /package/es/modules/notification/components/{MentionNotificationCard → DocumentNotificationCard}/index.less +0 -0
@@ -7,8 +7,9 @@ export interface INotification extends ILoadable {
7
7
  dismissDate?: Date;
8
8
  createDate: Date;
9
9
  }
10
- export interface IMentionedNotification extends INotification {
10
+ export interface IDocumentNotification extends INotification {
11
11
  content: {
12
+ title: string;
12
13
  content: string;
13
14
  documentId: string;
14
15
  };
@@ -5,6 +5,18 @@ export declare class WorkStore extends DocumentTypeStore<IWork, LoadDocumentOpti
5
5
  /** Name of the store */
6
6
  readonly name: string;
7
7
  constructor(endpoint: ApiEndPoint, documents: DocumentStore);
8
+ /** send work.
9
+ * @param {string} id - id of the work.
10
+ */
11
+ send(id: string): Promise<void>;
12
+ /** accept work.
13
+ * @param {string} id - id of the work.
14
+ */
15
+ accept(id: string): Promise<void>;
16
+ /** reject work.
17
+ * @param {string} id - id of the work.
18
+ */
19
+ reject(id: string): Promise<void>;
8
20
  }
9
21
  /** 响应钩子检索 PageStore */
10
22
  export declare const useWorkStore: () => WorkStore;
@@ -12,6 +12,27 @@ export class WorkStore extends DocumentTypeStore {
12
12
  value: StoreName
13
13
  });
14
14
  }
15
+ /** send work.
16
+ * @param {string} id - id of the work.
17
+ */
18
+ async send(id) {
19
+ await this.endpoint.post(`/api/works/${id}/send`);
20
+ this.edit(id, { data: { workStatus: "New" }, error: "message" });
21
+ }
22
+ /** accept work.
23
+ * @param {string} id - id of the work.
24
+ */
25
+ async accept(id) {
26
+ await this.endpoint.post(`/api/works/${id}/accept`);
27
+ this.edit(id, { data: { workStatus: "Active" }, error: "message" });
28
+ }
29
+ /** reject work.
30
+ * @param {string} id - id of the work.
31
+ */
32
+ async reject(id) {
33
+ await this.endpoint.post(`/api/works/${id}/reject`);
34
+ this.edit(id, { data: { workStatus: "Rejected" }, error: "message" });
35
+ }
15
36
  }
16
37
  /** 响应钩子检索 PageStore */
17
38
  export const useWorkStore = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"WorkStore.js","sourceRoot":"","sources":["../../../src/data/work/WorkStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,iBAAiB,EAIjB,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,OAAO,SAAU,SAAQ,iBAO9B;IAIA,YAAmB,QAAqB,EAAE,SAAwB;QACjE,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAJ1C,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;IAIzC,CAAC;CACD;AAED,uBAAuB;AACvB,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAChC,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,OAAO,UAAU,CAChB,SAAS,EACT,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,CAAC,CAClE,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"WorkStore.js","sourceRoot":"","sources":["../../../src/data/work/WorkStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,iBAAiB,EAIjB,gBAAgB,GAChB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,UAA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AAO,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,CAAC,CAClE,CAAC;AACH,CAAC,CAAC"}
@@ -19,7 +19,22 @@ export interface IWork extends IDocument {
19
19
  id: string;
20
20
  name: string;
21
21
  };
22
- WorkStatus?: WorkStatus;
22
+ workStatus?: WorkStatus;
23
+ /** work type of the work. */
24
+ workType?: {
25
+ id: string;
26
+ name: string;
27
+ };
28
+ /** requester of the work. */
29
+ requester?: {
30
+ id: string;
31
+ name: string;
32
+ };
33
+ /** accepters of the work. */
34
+ accepters?: {
35
+ id: string;
36
+ name: string;
37
+ }[];
23
38
  }
24
39
  /** Custom create work options type. Use TitleCase to fit server need.
25
40
  * 新建work必须属于work type request 人员(需要work type 设定requester)
@@ -29,6 +44,7 @@ export declare type CreateWorkOptions = {
29
44
  Name: string;
30
45
  };
31
46
  export interface IWorkEditOptions extends EditDocumentDataOptions {
47
+ workStatus?: string;
32
48
  /** New checklist of the work. */
33
49
  CheckList?: {
34
50
  Checked: boolean;
@@ -24,6 +24,8 @@ export declare type CreateWorkErrorDataOptions = {
24
24
  Description?: string;
25
25
  /** list of causer's unit id */
26
26
  CauserIds?: string[];
27
+ /** incident date of the error */
28
+ IncidentDate?: string;
27
29
  };
28
30
  export declare type CreateWorkErrorOptions = {
29
31
  data: CreateWorkErrorDataOptions;
@@ -40,6 +42,8 @@ export declare type EditWorkErrorDataOptions = {
40
42
  Description?: string;
41
43
  /** list of causer's unit id */
42
44
  CauserIds?: string[];
45
+ /** incident date of the error */
46
+ IncidentDate?: string;
43
47
  };
44
48
  export declare type EditWorkErrorOptions = {
45
49
  data: EditWorkErrorDataOptions;
@@ -7,9 +7,15 @@ export declare class WorkTypeStore extends Store {
7
7
  readonly endpoint: ApiEndPoint;
8
8
  /** Name of the store */
9
9
  readonly name: string;
10
+ private readonly _worktypeDeleted;
11
+ private readonly _worktypeCreated;
10
12
  constructor(endpoint: ApiEndPoint);
11
13
  /** All currently used workType. */
12
14
  readonly items: CountedMap<string, IWorkType>;
15
+ /** Event fires when a delete worktype has been deleted. */
16
+ get WorkTypeDeletedEvent(): import("strongly-typed-events").IEvent<WorkTypeStore, IWorkType>;
17
+ /** Event fires when a new WorkType has been created. */
18
+ get WorkTypeCreatedEvent(): import("strongly-typed-events").IEvent<WorkTypeStore, IWorkType>;
13
19
  /** Create a new WorkType. */
14
20
  create(options: WorkTypeCreateOptions): Promise<IWorkType>;
15
21
  /** Edit an existing item on server. */
@@ -1,6 +1,7 @@
1
1
  import { RequestBuilder } from "@voplus/api";
2
2
  import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
3
3
  import { observable } from "mobx";
4
+ import { EventDispatcher } from "strongly-typed-events";
4
5
  const StoreName = "WorkTypeStore";
5
6
  /** Corporate store supply backend functions. */
6
7
  export class WorkTypeStore extends Store {
@@ -19,6 +20,18 @@ export class WorkTypeStore extends Store {
19
20
  writable: true,
20
21
  value: StoreName
21
22
  });
23
+ Object.defineProperty(this, "_worktypeDeleted", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: new EventDispatcher()
28
+ });
29
+ Object.defineProperty(this, "_worktypeCreated", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: new EventDispatcher()
34
+ });
22
35
  /** All currently used workType. */
23
36
  Object.defineProperty(this, "items", {
24
37
  enumerable: true,
@@ -27,12 +40,21 @@ export class WorkTypeStore extends Store {
27
40
  value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
28
41
  });
29
42
  }
43
+ /** Event fires when a delete worktype has been deleted. */
44
+ get WorkTypeDeletedEvent() {
45
+ return this._worktypeDeleted.asEvent();
46
+ }
47
+ /** Event fires when a new WorkType has been created. */
48
+ get WorkTypeCreatedEvent() {
49
+ return this._worktypeCreated.asEvent();
50
+ }
30
51
  /** Create a new WorkType. */
31
52
  async create(options) {
32
53
  // invariant(options.name, "Name cannot be empty.");
33
54
  return await this.action(async () => {
34
55
  const r = await this.endpoint.post(`/api/worktypes/create`, new RequestBuilder().json(options.data));
35
56
  const t = (await r.json());
57
+ this._worktypeCreated.dispatch(this, t);
36
58
  return t;
37
59
  }, options);
38
60
  }
@@ -1 +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,EAAE,CAAc,CAAC;YACxC,OAAO,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AAC,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,3 @@
1
+ export * from "./useOnNewWorkType";
2
+ export * from "./useOnDeleteWorkType";
3
+ export * from "./useAutoUpdateListData";
@@ -0,0 +1,4 @@
1
+ export * from "./useOnNewWorkType";
2
+ export * from "./useOnDeleteWorkType";
3
+ export * from "./useAutoUpdateListData";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IWorkType } from "../interfaces";
2
+ import { ListDataContextState } from "@voplus/morpho-ui/es/data";
3
+ /** React hook to call action when a new WorkType has been created. */
4
+ export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IWorkType, event: string) => boolean) => void;
@@ -0,0 +1,15 @@
1
+ import { useOnDeleteWorkType, useOnNewWorkType } from ".";
2
+ /** React hook to call action when a new WorkType has been created. */
3
+ export const useAutoUpdateListData = (list, shouldUpdate) => {
4
+ useOnNewWorkType((s, d) => {
5
+ console.log(s, d);
6
+ console.log(shouldUpdate(d, "new"));
7
+ if (shouldUpdate(d, "new"))
8
+ list.union([d]);
9
+ });
10
+ useOnDeleteWorkType((s, d) => {
11
+ if (shouldUpdate(d, "new"))
12
+ list.remove(d.id);
13
+ });
14
+ };
15
+ //# sourceMappingURL=useAutoUpdateListData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoUpdateListData.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/useAutoUpdateListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAK1D,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA+B,EAC/B,YAAsD,EACrD,EAAE;IACH,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;QACnC,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5B,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 { WorkTypeStore } from "../WorkTypeStore";
2
+ import { IWorkType } from "../interfaces";
3
+ /** React hook to call action when a delete WorkType has been created. */
4
+ export declare const useOnDeleteWorkType: (action: (store: WorkTypeStore, doc: IWorkType) => void) => void;
@@ -0,0 +1,16 @@
1
+ import { useWorkTypeStore } from "../WorkTypeStore";
2
+ import { useEffect } from "react";
3
+ /** React hook to call action when a delete WorkType has been created. */
4
+ export const useOnDeleteWorkType = (action) => {
5
+ const store = useWorkTypeStore();
6
+ const onDeleteWorkType = (store, doc) => {
7
+ action(store, doc);
8
+ };
9
+ useEffect(() => {
10
+ store.WorkTypeDeletedEvent.subscribe(onDeleteWorkType);
11
+ return () => {
12
+ store.WorkTypeDeletedEvent.unsubscribe(onDeleteWorkType);
13
+ };
14
+ });
15
+ };
16
+ //# sourceMappingURL=useOnDeleteWorkType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnDeleteWorkType.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/useOnDeleteWorkType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAsD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,CAAC,KAAoB,EAAE,GAAc,EAAE,EAAE;QACjE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC1D,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { WorkTypeStore } from "../WorkTypeStore";
2
+ import { IWorkType } from "../interfaces";
3
+ /** React hook to call action when a new WorkType has been created. */
4
+ export declare const useOnNewWorkType: (action: (store: WorkTypeStore, doc: IWorkType) => void) => void;
@@ -0,0 +1,17 @@
1
+ import { useWorkTypeStore } from "../WorkTypeStore";
2
+ import { useEffect } from "react";
3
+ /** React hook to call action when a new WorkType has been created. */
4
+ export const useOnNewWorkType = (action) => {
5
+ const store = useWorkTypeStore();
6
+ const onNewWorkType = (store, doc) => {
7
+ // console.log(`onNewWorkType - ${doc.id} ${doc.name}`);
8
+ action(store, doc);
9
+ };
10
+ useEffect(() => {
11
+ store.WorkTypeCreatedEvent.subscribe(onNewWorkType);
12
+ return () => {
13
+ store.WorkTypeCreatedEvent.unsubscribe(onNewWorkType);
14
+ };
15
+ });
16
+ };
17
+ //# sourceMappingURL=useOnNewWorkType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnNewWorkType.js","sourceRoot":"","sources":["../../../../src/data/worktype/worktype-events/useOnNewWorkType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAsD,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAE,GAAc,EAAE,EAAE;QAC9D,wDAAwD;QACxD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACpD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACvD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { NotificationStatus } from "../../../../data/notification";
2
2
  import React from "react";
3
- declare const MentionNotificationCard: (props: {
3
+ declare const DocumentNotificationCard: (props: {
4
4
  id: string;
5
5
  active?: boolean | undefined;
6
6
  className?: string | undefined;
7
7
  onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
8
8
  onChangeStatus?: ((state: NotificationStatus) => void) | undefined;
9
9
  }) => JSX.Element;
10
- export default MentionNotificationCard;
10
+ export default DocumentNotificationCard;
@@ -7,13 +7,13 @@ import classnames from "classnames";
7
7
  import moment from "moment";
8
8
  import { observe } from "@voplus/morpho-ui";
9
9
  import styles from "./index.less";
10
- const MentionNotificationCard = (props) => {
10
+ const DocumentNotificationCard = (props) => {
11
11
  const notification = useNotification(props.id);
12
12
  return observe(() => (React.createElement(Card, { className: classnames(styles["notification-card"], props.className, { active: props.active }), bordered: true,
13
13
  //hoverShadow
14
14
  shadow: true },
15
15
  React.createElement("div", { onClick: props.onClick },
16
- React.createElement("h3", null, "Mention Notification"),
16
+ React.createElement("h3", null, notification.content.title),
17
17
  React.createElement(ProseMirrorViewer, { html: notification.content.content }),
18
18
  React.createElement("div", { className: "notification-footer" },
19
19
  React.createElement("div", { className: "notification-date" }, moment(notification.createDate).format("DD MMM yyyy")),
@@ -27,5 +27,5 @@ const MentionNotificationCard = (props) => {
27
27
  ev.stopPropagation();
28
28
  }
29
29
  };
30
- export default MentionNotificationCard;
30
+ export default DocumentNotificationCard;
31
31
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/DocumentNotificationCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAGN,eAAe,GACf,MAAM,+BAA+B,CAAC;AAEvC,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC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C,EAAO,EAAE,MAA0B;;QAC1D,MAAA,KAAK,CAAC,cAAc,+CAApB,KAAK,EAAkB,MAAM,CAAC,CAAC;QAC/B,EAAE,CAAC,eAAe,EAAE,CAAC;IACtB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -4,8 +4,8 @@ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/da
4
4
  import React from "react";
5
5
  import { observe, useRenderOnChange } from "@voplus/morpho-ui";
6
6
  import { CSSTransition } from "react-transition-group";
7
+ import DocumentNotificationCard from "../DocumentNotificationCard";
7
8
  import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
8
- import MentionNotificationCard from "../MentionNotificationCard";
9
9
  import PropertiesView from "@voplus/morpho-document/es/components/PropertiesView";
10
10
  import S from "string";
11
11
  import { runInAction } from "mobx";
@@ -38,7 +38,7 @@ const NotificationList = (props) => {
38
38
  return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
39
39
  React.createElement(ListView, { headerProps: { viewTitle: "My Notifications", addAble: false, sortable: false }, className: "my-space-notifications", renderItem: ({ item }) => {
40
40
  return (React.createElement(CSSTransition, { key: item.id, in: list.isRemoving(item.id) !== true, timeout: 300, classNames: "notification-card" },
41
- React.createElement(MentionNotificationCard, { id: item.id, active: props.active === item.id ? true : false, onClick: (ev) => { var _a; return (_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, ev, item); }, onChangeStatus: (status) => editStatus(item.id, status) })));
41
+ React.createElement(DocumentNotificationCard, { id: item.id, active: props.active === item.id ? true : false, onClick: (ev) => { var _a; return (_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, ev, item); }, onChangeStatus: (status) => editStatus(item.id, status) })));
42
42
  }, propertiesView: (id, item) => React.createElement(PropertiesView, { id: item.content.documentId }) }))));
43
43
  function filters() {
44
44
  if (!props.status || props.status == "all")
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/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WorkForm: (props: {
4
+ className?: string | undefined;
5
+ simple?: boolean | undefined;
6
+ showView?: boolean | undefined;
7
+ onSave?: ((params?: any) => void) | undefined;
8
+ onCancel?: (() => void) | undefined;
9
+ }) => JSX.Element;
10
+ export default NewWorkForm;
@@ -0,0 +1,60 @@
1
+ import "./index.less";
2
+ import { Button, Col, Form, Input, Row, Space, message } from "@voplus/antd";
3
+ import React, { useState } from "react";
4
+ import WorkPropertiesView from "../WorkPropertiesView";
5
+ import WorkTypeSelect from "../../../../pages/WorkType/WorkTypeSelect";
6
+ import classnames from "classnames";
7
+ import { observe } from "@voplus/morpho-ui";
8
+ import { useApplicationContext } from "@voplus/morpho-data";
9
+ import { useAsideContentContext } from "@voplus/morpho-ui/es/components/layout/AsideContent";
10
+ import { useWorkStore } from "../../../../data/work";
11
+ const NewWorkForm = (props) => {
12
+ const { user } = useApplicationContext();
13
+ const [form] = Form.useForm();
14
+ const [loading, setLoading] = useState(false);
15
+ const [workType, setWorkType] = useState();
16
+ const asideContext = useAsideContentContext();
17
+ const works = useWorkStore();
18
+ return observe(() => (React.createElement("div", { className: classnames("new-work-form", { "sub-work-simply-form": props.simple }, props.className) },
19
+ React.createElement(Form, { form: form, layout: "vertical", onFinish: onFinish },
20
+ !props.simple ?
21
+ React.createElement(React.Fragment, null,
22
+ React.createElement(Form.Item, { name: "Name", label: "Work Name" },
23
+ React.createElement(Input, { placeholder: "Enter a title for this work" })),
24
+ React.createElement(Form.Item, { name: "WorkTypeId", label: "Work Type" },
25
+ React.createElement(WorkTypeSelect, { onChange: (id, data) => setWorkType(data) })))
26
+ :
27
+ React.createElement(Row, { gutter: 20 },
28
+ React.createElement(Col, { span: 12 },
29
+ React.createElement(Form.Item, { name: "Name" },
30
+ React.createElement(Input, { placeholder: "Enter a title for this work" }))),
31
+ React.createElement(Col, { span: 12 },
32
+ React.createElement(Form.Item, { name: "WorkTypeId" },
33
+ React.createElement(WorkTypeSelect, { onChange: (id, data) => setWorkType(data) })))),
34
+ React.createElement(Form.Item, { className: "from-footer" },
35
+ React.createElement(Row, { justify: "end" },
36
+ React.createElement(Space, null,
37
+ React.createElement(Button, { onClick: onCancel }, "Cancel"),
38
+ React.createElement(Button, { type: "primary", htmlType: "submit", loading: loading }, "Submit"))))))));
39
+ /** submit work */
40
+ async function onFinish(values) {
41
+ var _a;
42
+ if (!values.Name)
43
+ return message.warning("Title is required");
44
+ setLoading(true);
45
+ const res = await works.create({ data: { ...values }, error: "message" });
46
+ setLoading(false);
47
+ (_a = props.onSave) === null || _a === void 0 ? void 0 : _a.call(props, values);
48
+ if (props.showView)
49
+ return asideContext.openAside(React.createElement(WorkPropertiesView, { id: res.id }), { span: 12 });
50
+ }
51
+ // cancel add work
52
+ function onCancel() {
53
+ var _a;
54
+ if (props.showView)
55
+ return asideContext.closeAside();
56
+ (_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
57
+ }
58
+ };
59
+ export default NewWorkForm;
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/NewWorkForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMxC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM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kB;IAClB,SAAS,QAAQ;;QAChB,IAAI,KAAK,CAAC,QAAQ;YAAE,OAAO,YAAa,CAAC,UAAU,EAAE,CAAC;QACtD,MAAA,KAAK,CAAC,QAAQ,+CAAd,KAAK,CAAa,CAAC;IACpB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,17 @@
1
+ :global {
2
+ .new-work-form {
3
+ &.sub-work-simply-form {
4
+ padding: 10px 20px;
5
+ .from-footer {
6
+ margin-bottom: 0;
7
+ }
8
+ }
9
+ .ant-tabs-tabpane {
10
+ padding: 24px;
11
+ }
12
+ .new-work-form_btn {
13
+ text-align: right;
14
+ margin-top: 20px;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ declare const SubWorkList: () => JSX.Element;
4
+ export default SubWorkList;
@@ -0,0 +1,42 @@
1
+ import "./index.less";
2
+ import { useWorkListEffect } from "../../../../data/work";
3
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
4
+ import React, { useState } from "react";
5
+ import { useAutoUpdateListData, useDocumentStore } from "@voplus/morpho-document-core";
6
+ import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
7
+ import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
8
+ import NewWorkForm from "../NewWorkForm";
9
+ import WorkItem from '../WorkItem';
10
+ import { observe } from "@voplus/morpho-ui";
11
+ import { useRenderOnChange } from "@voplus/morpho-ui";
12
+ const SubWorkList = () => {
13
+ const [addAble, setAddAble] = useState(false);
14
+ const documentStore = useDocumentStore();
15
+ const list = useCreateListDataState({
16
+ filterDefaults: {}
17
+ }, []);
18
+ /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
19
+ useAutoUpdateListData(list, (d) => d.type === "Work");
20
+ useRenderOnChange(() => list.filters.options);
21
+ /** 把ListDataState传给useWorkListEffect,使之可以自動更新loading, hasmore. */
22
+ useWorkListEffect(list, (result) => { list.union(result); }, list.filters.options);
23
+ return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
24
+ React.createElement("div", { className: "sub-work-list" },
25
+ React.createElement(ListView, { headerProps: {
26
+ viewTitle: "My Works",
27
+ sortable: false,
28
+ onAdd: () => (setAddAble(!addAble)),
29
+ }, className: "work-list", moveAfter: moveAfter, renderItem: ({ item, connectDragSource }) => (React.createElement(React.Fragment, null,
30
+ React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
31
+ hoverEffect: "background",
32
+ hoverBackgroundProps: { color: "#f2f2f2" },
33
+ style: { border: "none", flex: "1" },
34
+ } },
35
+ React.createElement(WorkItem, { id: item.id })))) }),
36
+ addAble && (React.createElement(NewWorkForm, { simple: true, onSave: () => setAddAble(false), onCancel: () => setAddAble(false) }))))));
37
+ async function moveAfter(id, afterId) {
38
+ await documentStore.moveAfter(id, afterId);
39
+ }
40
+ };
41
+ export default SubWorkList;
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/SubWorkList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAS,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,OAAO,iBAAiB,MAAM,uDAAuD,CAAC;AACtF,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,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AAE,EAAE,KAAK,EAAE,SAAS,EAAE;4BAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE;yBACvC;wBAED,oBAAC,QAAQ,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,GAAI,CACT,CACP,CACpB,GACH;YACD,OAAO,IAAI,CACR,oBAAC,WAAW,IACR,MAAM,EAAE,IAAI,EACZ,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GACnC,CACL,CACC,CACiB,CAC9B,CAAC,CAAC;IAEH,KAAK,UAAU,SAAS,CAAC,EAAU,EAAE,OAAe;QAChD,MAAM,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ :global {
2
+ .sub-work-list {
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ }
7
+ }
@@ -13,7 +13,6 @@ const WorkErrorList = (props) => {
13
13
  /** 建立 ListView 和useWorkErrorListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
14
14
  const list = useCreateListDataState({
15
15
  filterDefaults: {
16
- includes: "tags",
17
16
  filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: props.id }]
18
17
  },
19
18
  }, [props.id]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkErrorList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAc,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OA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AC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACrB,oBAAC,iBAAiB,IACd,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,UAAU,EAAE;oBACR,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAE;oBAC5B,WAAW,EAAE,MAAM;oBACnB,YAAY,EAAE,QAAQ;oBACtB,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE;iBACrE,EACD,OAAO,EAAE,GAAG,EAAE;;oBACV,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACrB,MAAA,KAAK,CAAC,WAAW,+CAAjB,KAAK,EAAe,IAAI,CAAC,EAAE,CAAC,CAAC;gBACjC,CAAC;gBAED,oBAAC,aAAa,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,GAAI,CACd,CAEvB,CAAC,CACe,CACnB,CACiB,CAE9B,CAAC,CAAC;IAEH,SAAS,QAAQ;QACb,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,11 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import "./index.less";
3
- import { DocumentHeaderProps } from "@voplus/morpho-document-core/es/props/DocumentHeaderProps";
4
3
  export declare type WorkItemProps = {
5
4
  id: string;
6
5
  reload?: boolean;
7
- /** Header props */
8
- headerProps?: Partial<DocumentHeaderProps>;
6
+ toolsVisible?: boolean;
9
7
  };
10
8
  declare const WorkItem: (props: WorkItemProps) => JSX.Element;
11
9
  export default WorkItem;