@voplus/morpho-workspace 1.3.2 → 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 (102) hide show
  1. package/es/data/work/WorkStore.d.ts +12 -0
  2. package/es/data/work/WorkStore.js +21 -0
  3. package/es/data/work/WorkStore.js.map +1 -1
  4. package/es/data/work/interfaces.d.ts +17 -1
  5. package/es/data/worktype/WorkTypeStore.d.ts +6 -0
  6. package/es/data/worktype/WorkTypeStore.js +22 -0
  7. package/es/data/worktype/WorkTypeStore.js.map +1 -1
  8. package/es/data/worktype/worktype-events/index.d.ts +3 -0
  9. package/es/data/worktype/worktype-events/index.js +4 -0
  10. package/es/data/worktype/worktype-events/index.js.map +1 -0
  11. package/es/data/worktype/worktype-events/useAutoUpdateListData.d.ts +4 -0
  12. package/es/data/worktype/worktype-events/useAutoUpdateListData.js +15 -0
  13. package/es/data/worktype/worktype-events/useAutoUpdateListData.js.map +1 -0
  14. package/es/data/worktype/worktype-events/useOnDeleteWorkType.d.ts +4 -0
  15. package/es/data/worktype/worktype-events/useOnDeleteWorkType.js +16 -0
  16. package/es/data/worktype/worktype-events/useOnDeleteWorkType.js.map +1 -0
  17. package/es/data/worktype/worktype-events/useOnNewWorkType.d.ts +4 -0
  18. package/es/data/worktype/worktype-events/useOnNewWorkType.js +17 -0
  19. package/es/data/worktype/worktype-events/useOnNewWorkType.js.map +1 -0
  20. package/es/modules/work/components/NewWorkForm/index.d.ts +10 -0
  21. package/es/modules/work/components/NewWorkForm/index.js +60 -0
  22. package/es/modules/work/components/NewWorkForm/index.js.map +1 -0
  23. package/es/modules/work/components/NewWorkForm/index.less +17 -0
  24. package/es/modules/work/components/SubWorkList/index.d.ts +4 -0
  25. package/es/modules/work/components/SubWorkList/index.js +42 -0
  26. package/es/modules/work/components/SubWorkList/index.js.map +1 -0
  27. package/es/modules/work/components/SubWorkList/index.less +7 -0
  28. package/es/modules/work/components/WorkErrorList/index.js +0 -1
  29. package/es/modules/work/components/WorkErrorList/index.js.map +1 -1
  30. package/es/modules/work/components/WorkItem/index.d.ts +1 -3
  31. package/es/modules/work/components/WorkItem/index.js +20 -4
  32. package/es/modules/work/components/WorkItem/index.js.map +1 -1
  33. package/es/modules/work/components/WorkItem/index.less +11 -0
  34. package/es/modules/work/components/WorkList/index.js +4 -4
  35. package/es/modules/work/components/WorkList/index.js.map +1 -1
  36. package/es/modules/work/components/WorkPropertiesView/index.js +8 -2
  37. package/es/modules/work/components/WorkPropertiesView/index.js.map +1 -1
  38. package/es/modules/work/components/WorkTabs/index.js +10 -1
  39. package/es/modules/work/components/WorkTabs/index.js.map +1 -1
  40. package/es/modules/work/components/WorksProperties/index.js +4 -2
  41. package/es/modules/work/components/WorksProperties/index.js.map +1 -1
  42. package/es/modules/work/controls/WorkMenu/Accept.d.ts +8 -0
  43. package/es/modules/work/controls/WorkMenu/Accept.js +31 -0
  44. package/es/modules/work/controls/WorkMenu/Accept.js.map +1 -0
  45. package/es/modules/work/controls/WorkMenu/Reject.d.ts +8 -0
  46. package/es/modules/work/controls/WorkMenu/Reject.js +31 -0
  47. package/es/modules/work/controls/WorkMenu/Reject.js.map +1 -0
  48. package/es/modules/work/controls/WorkMenu/Send.d.ts +8 -0
  49. package/es/modules/work/controls/WorkMenu/Send.js +31 -0
  50. package/es/modules/work/controls/WorkMenu/Send.js.map +1 -0
  51. package/es/modules/work/controls/WorkMenu/index.d.ts +7 -0
  52. package/es/modules/work/controls/WorkMenu/index.js +27 -0
  53. package/es/modules/work/controls/WorkMenu/index.js.map +1 -0
  54. package/es/modules/work/pages/WorkDefaultView/index.less +1 -2
  55. package/es/modules/workspace/components/WorkspaceCardList/index.js +0 -1
  56. package/es/modules/workspace/components/WorkspaceCardList/index.js.map +1 -1
  57. package/es/modules/workspace/components/WorkspacePropertiesView/index.js +11 -5
  58. package/es/modules/workspace/components/WorkspacePropertiesView/index.js.map +1 -1
  59. package/es/modules/workspace/components/WorkspaceTabs/index.d.ts +5 -0
  60. package/es/modules/workspace/components/WorkspaceTabs/index.js +26 -0
  61. package/es/modules/workspace/components/WorkspaceTabs/index.js.map +1 -0
  62. package/es/modules/workspace/pages/WorkspaceDefaultView/index.js +1 -1
  63. package/es/modules/workspace/pages/WorkspaceDefaultView/index.js.map +1 -1
  64. package/es/modules/workspace/pages/WorkspacePage/index.js +1 -1
  65. package/es/modules/workspace/pages/WorkspacePage/index.js.map +1 -1
  66. package/es/modules/worktype/components/NewTypeForm/index.d.ts +10 -0
  67. package/es/modules/worktype/components/NewTypeForm/index.js +44 -0
  68. package/es/modules/worktype/components/NewTypeForm/index.js.map +1 -0
  69. package/es/modules/worktype/components/NewTypeForm/index.less +5 -0
  70. package/es/modules/worktype/components/NewTypeForm/state.d.ts +11 -0
  71. package/es/modules/worktype/components/NewTypeForm/state.js +41 -0
  72. package/es/modules/worktype/components/NewTypeForm/state.js.map +1 -0
  73. package/es/modules/worktype/components/WorkTypeCardList/index.d.ts +4 -11
  74. package/es/modules/worktype/components/WorkTypeCardList/index.js +3 -17
  75. package/es/modules/worktype/components/WorkTypeCardList/index.js.map +1 -1
  76. package/es/modules/worktype/components/WorkTypeCardList/index.less +7 -9
  77. package/es/modules/worktype/components/WorkTypeItem/index.d.ts +1 -1
  78. package/es/modules/worktype/components/WorkTypeItem/index.js +14 -2
  79. package/es/modules/worktype/components/WorkTypeItem/index.js.map +1 -1
  80. package/es/modules/worktype/components/WorkTypeItem/index.less +13 -0
  81. package/es/modules/worktype/components/WorkTypeList/index.d.ts +9 -0
  82. package/es/modules/worktype/components/WorkTypeList/index.js +44 -0
  83. package/es/modules/worktype/components/WorkTypeList/index.js.map +1 -0
  84. package/es/modules/worktype/components/WorkTypePropertiesView/index.js +13 -8
  85. package/es/modules/worktype/components/WorkTypePropertiesView/index.js.map +1 -1
  86. package/es/modules/worktype/components/WorkTypeQA/index.js +37 -36
  87. package/es/modules/worktype/components/WorkTypeQA/index.js.map +1 -1
  88. package/es/modules/worktype/components/WorkTypeQA/index.less +7 -0
  89. package/es/modules/worktype/controls/ToolBar/index.d.ts +10 -0
  90. package/es/modules/worktype/controls/ToolBar/index.js +20 -0
  91. package/es/modules/worktype/controls/ToolBar/index.js.map +1 -0
  92. package/es/modules/worktype/controls/ToolBar/index.less +55 -0
  93. package/es/modules/worktype/controls/ToolBar/state.d.ts +36 -0
  94. package/es/modules/worktype/controls/ToolBar/state.js +57 -0
  95. package/es/modules/worktype/controls/ToolBar/state.js.map +1 -0
  96. package/es/modules/worktype/controls/WorkTypeMenu/index.d.ts +14 -0
  97. package/es/modules/worktype/controls/WorkTypeMenu/index.js +26 -0
  98. package/es/modules/worktype/controls/WorkTypeMenu/index.js.map +1 -0
  99. package/es/modules/worktype/controls/WorkTypeMenu/index.less +0 -0
  100. package/es/pages/Space/pages/MySpace/index.js +4 -4
  101. package/es/pages/Space/pages/MySpace/index.js.map +1 -1
  102. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ import { __decorate } from "tslib";
2
+ import { makeObservable, observable } from "mobx";
3
+ export class State {
4
+ constructor(_store) {
5
+ Object.defineProperty(this, "_store", {
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true,
9
+ value: _store
10
+ });
11
+ Object.defineProperty(this, "Params", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: {
16
+ // workspaceId: "",
17
+ Name: ""
18
+ }
19
+ });
20
+ Object.defineProperty(this, "params", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: this.Params
25
+ });
26
+ Object.defineProperty(this, "loading", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: false
31
+ });
32
+ makeObservable(this);
33
+ }
34
+ }
35
+ __decorate([
36
+ observable
37
+ ], State.prototype, "params", void 0);
38
+ __decorate([
39
+ observable
40
+ ], State.prototype, "loading", void 0);
41
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/NewTypeForm/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,OAAO,KAAK;IACjB,YAA2B,MAAW;;;;;mBAAX;;QAG3B;;;;mBAAgB;gBACf,mBAAmB;gBACnB,IAAI,EAAE,EAAE;aACR;WAAC;QACU;;;;mBAAgB,IAAI,CAAC,MAAM;WAAC;QAC5B;;;;mBAAiB,KAAK;WAAC;QAPlC,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CAOD;AAFY;IAAX,UAAU;qCAA6B;AAC5B;IAAX,UAAU;sCAAwB"}
@@ -2,15 +2,8 @@
2
2
  import "./index.less";
3
3
  import { IWorkType } from "../../../../data/worktype";
4
4
  /** A worktype list view shows worktype in card style. */
5
- declare const WorkTypeCardList: {
6
- (props: {
7
- /** 设置work type item类型,默认值default */
8
- type?: "default" | "card" | undefined;
9
- /** item onclick */
10
- onItemClick?: ((item: IWorkType) => void) | undefined;
11
- }): JSX.Element;
12
- defaultProps: {
13
- type: string;
14
- };
15
- };
5
+ declare const WorkTypeCardList: (props: {
6
+ /** item onclick */
7
+ onItemClick?: ((item: IWorkType) => void) | undefined;
8
+ }) => JSX.Element;
16
9
  export default WorkTypeCardList;
@@ -2,11 +2,8 @@ import "./index.less";
2
2
  import { useWorkTypeListEffect } from "../../../../data/worktype";
3
3
  import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
4
4
  import React, { useState } from "react";
5
- import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
6
5
  import InfiniteScrollView from "@voplus/morpho-ui/es/controls/InfiniteScrollView";
7
6
  import WorkTypeCard from "../WorkTypeCard";
8
- import WorkTypeItem from "../WorkTypeItem";
9
- import classnames from "classnames";
10
7
  import { observe } from "@voplus/morpho-ui";
11
8
  import { useRenderOnChange } from "@voplus/morpho-ui";
12
9
  /** A worktype list view shows worktype in card style. */
@@ -14,7 +11,6 @@ const WorkTypeCardList = (props) => {
14
11
  const [active, setActive] = useState(null);
15
12
  const list = useCreateListDataState({
16
13
  filterDefaults: {
17
- includes: "tags",
18
14
  filters: [],
19
15
  },
20
16
  }, []);
@@ -23,17 +19,10 @@ const WorkTypeCardList = (props) => {
23
19
  /** 把ListDataState传给useWorkTypeListEffect,使之可以自動更新loading, hasmore. */
24
20
  useWorkTypeListEffect(list, (result) => list.union(result), list.filters.options);
25
21
  return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
26
- React.createElement("div", { className: classnames("worktype-list-view", { "worktype-card-list": props.type === "card" }) },
22
+ React.createElement("div", { className: "worktype-list-view" },
27
23
  React.createElement(InfiniteScrollView, { empty: list.isEmpty, loading: list.loading, hasMore: list.hasMore, loadMore: loadMore },
28
- React.createElement("div", { className: "worktype-list-content" }, list.data.map((i) => (React.createElement("div", { key: i.id, onClick: () => onItemClick(i) }, props.type === "card" ?
29
- React.createElement(WorkTypeCard, { id: i.id, active: active === i.id })
30
- :
31
- React.createElement(DocumentItemFrame, { frameProps: {
32
- active: active === i.id,
33
- hoverEffect: "background",
34
- hoverBackgroundProps: { color: "#f2f2f2" },
35
- } },
36
- React.createElement(WorkTypeItem, { id: i.id })))))))))));
24
+ React.createElement("div", { className: "worktype-list-content" }, list.data.map((i) => (React.createElement("div", { key: i.id, onClick: () => onItemClick(i) },
25
+ React.createElement(WorkTypeCard, { id: i.id, active: active === i.id }))))))))));
37
26
  function loadMore() {
38
27
  list.triggerNextPage();
39
28
  }
@@ -43,8 +32,5 @@ const WorkTypeCardList = (props) => {
43
32
  (_a = props.onItemClick) === null || _a === void 0 ? void 0 : _a.call(props, item);
44
33
  }
45
34
  };
46
- WorkTypeCardList.defaultProps = {
47
- type: "default"
48
- };
49
35
  export default WorkTypeCardList;
50
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeCardList/index.tsx"],"names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IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,QAAQ;gBAElB,6BAAK,SAAS,EAAC,uBAAuB,IACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACrB,6BAAK,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;oBAC5C,oBAAC,YAAY,IAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC,EAAE,GAAI,CAC9C,CACN,CAAC,CACG,CACc,CAChB,CACoB,CAC3B,CAAC,CAAC;IAEH,SAAS,QAAQ;QAChB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;IAED,SAAS,WAAW,CAAC,IAAe;;QACnC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnB,MAAA,KAAK,CAAC,WAAW,+CAAjB,KAAK,EAAe,IAAI,CAAC,CAAC;IAC3B,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,15 +1,13 @@
1
1
  :global {
2
2
  .worktype-list-view {
3
3
  height: 100%;
4
- &.worktype-card-list {
5
- padding: 0 12px;
6
- .worktype-list-content {
7
- display: flex;
8
- flex-wrap: wrap;
9
- > div {
10
- margin: 8px;
11
- }
4
+ padding: 0 12px;
5
+ .worktype-list-content {
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ >div {
9
+ margin: 8px;
12
10
  }
13
11
  }
14
12
  }
15
- }
13
+ }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import "./index.less";
3
3
  declare const WorkTypeItem: (props: {
4
- id?: string;
4
+ id: string;
5
5
  /** WorkType Card 显示选中时的样式 */
6
6
  active?: boolean;
7
7
  }) => JSX.Element;
@@ -1,11 +1,23 @@
1
1
  import "./index.less";
2
- import React from "react";
2
+ import React, { useState } from "react";
3
+ import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
4
+ import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
5
+ import WorkTypeMenu from "../../controls/WorkTypeMenu";
6
+ import classnames from "classnames";
3
7
  import { observe } from "@voplus/morpho-ui";
4
8
  import { useWorkType } from "../../../../data/worktype";
5
9
  const WorkTypeItem = (props) => {
6
10
  const { id, active } = props;
7
11
  const worktype = useWorkType(id, { reload: false });
8
- return observe(() => React.createElement("div", { className: "worktype-item" }, worktype.name));
12
+ const [hover, setHover] = useState(false);
13
+ return observe(() => (React.createElement("div", { className: classnames("worktype-item", { active: active }), onMouseLeave: () => setHover(false), onMouseOver: () => setHover(true) },
14
+ React.createElement("div", null, worktype.name),
15
+ React.createElement("div", { className: classnames("hover-operate-icon", {
16
+ show: hover,
17
+ }) },
18
+ React.createElement(ToolBar, { id: id, showMenu: false },
19
+ React.createElement(Open, { size: "middle", url: `/workType/${id}` }),
20
+ React.createElement(WorkTypeMenu, { id: id, size: "middle", closeAside: true }))))));
9
21
  };
10
22
  export default WorkTypeItem;
11
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,YAAY,GAAG,CAAC,KAIrB,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAG,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAErD,OAAO,OAAO,CAAC,GAAG,EAAE,CACnB,6BAAK,SAAS,EAAC,e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EAAE,EACN,QAAQ,EAAE,KAAK;gBAEf,oBAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,aAAa,EAAE,EAAE,GAAI;gBAC9C,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,QAAQ,EAAC,UAAU,EAAE,IAAI,GAAI,CAC/C,CACL,CACD,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -6,6 +6,8 @@
6
6
  font-weight: 500;
7
7
  word-break: break-all;
8
8
  padding: 20px;
9
+ display: flex;
10
+ align-items: center;
9
11
  // background: transparent;
10
12
  &:after {
11
13
  position: absolute;
@@ -15,5 +17,16 @@
15
17
  bottom: 0;
16
18
  border-bottom: 1px solid #f2f2f2;
17
19
  }
20
+ .hover-operate-icon {
21
+ display: none;
22
+ position: absolute;
23
+ right: 20px;
24
+ .ant-btn:first-child {
25
+ margin-left: 0;
26
+ }
27
+ &.show {
28
+ display: block;
29
+ }
30
+ }
18
31
  }
19
32
  }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { IWorkType } from "../../../../data/worktype";
3
+ declare const WorkTypeList: (props: {
4
+ workspaceId: string;
5
+ active?: string | undefined;
6
+ /** item onclick */
7
+ onClickItem?: ((item: IWorkType) => void) | undefined;
8
+ }) => JSX.Element;
9
+ export default WorkTypeList;
@@ -0,0 +1,44 @@
1
+ import React, { useState } from "react";
2
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
3
+ import { useRenderOnChange } from "@voplus/morpho-ui";
4
+ import { observe } from "@voplus/morpho-ui";
5
+ import { useAutoUpdateListData } from "../../../../data/worktype/worktype-events";
6
+ import { useWorkTypeListEffect } from "../../../../data/worktype";
7
+ // import InfiniteScrollView from "@voplus/morpho-ui/es/controls/InfiniteScrollView";
8
+ import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
9
+ import DocumentItemFrame from "@voplus/morpho-document/es/controls/DocumentItemFrame";
10
+ import WorkTypeItem from "../WorkTypeItem";
11
+ import NewTypeForm from "../NewTypeForm";
12
+ const WorkTypeList = (props) => {
13
+ const [activeId, setActiveId] = useState("");
14
+ const [showAdd, setShowAdd] = useState(false);
15
+ const list = useCreateListDataState({
16
+ filterDefaults: {
17
+ filters: [],
18
+ },
19
+ }, []);
20
+ useAutoUpdateListData(list, (d) => true);
21
+ /** 如果 list.filters.options变更了就重渲染,使下一行的useWorkTypeListEffect 可以接收新参数*/
22
+ useRenderOnChange(() => list.filters.options);
23
+ /** 把ListDataState传给useWorkTypeListEffect,使之可以自動更新loading, hasmore. */
24
+ useWorkTypeListEffect(list, (result) => list.union(result), list.filters.options);
25
+ return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
26
+ React.createElement(ListView, { headerProps: {
27
+ viewTitle: "",
28
+ sortable: false,
29
+ onAdd: () => setShowAdd(true),
30
+ }, className: "work-type-list", formViewTitle: "Add WorkType", renderItem: ({ item, connectDragSource }) => (React.createElement(React.Fragment, null,
31
+ React.createElement(DocumentItemFrame, { key: item.id, frameProps: {
32
+ active: activeId === item.id,
33
+ hoverEffect: "background",
34
+ hoverBackgroundProps: { color: "#f2f2f2" },
35
+ }, onClick: () => {
36
+ var _a;
37
+ setActiveId(item.id);
38
+ (_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, item);
39
+ } },
40
+ React.createElement(WorkTypeItem, { id: item.id })))) }),
41
+ showAdd && (React.createElement(NewTypeForm, { workspaceId: props.workspaceId, onCancel: () => setShowAdd(false), onSave: () => setShowAdd(false) })))));
42
+ };
43
+ export default WorkTypeList;
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EA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AS,EAAE,EAAE;gBACb,QAAQ,EAAE,KAAK;gBACf,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;aAC7B,EACD,SAAS,EAAC,gBAAgB,EAC1B,aAAa,EAAC,cAAc,EAC5B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAO,EAAE,EAAE,CAAC,CACjD,oBAAC,KAAK,CAAC,QAAQ;gBACd,oBAAC,iBAAiB,IACjB,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,UAAU,EAAE;wBACX,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAE;wBAC5B,WAAW,EAAE,YAAY;wBACzB,oBAAoB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;qBAC1C,EACD,OAAO,EAAE,GAAG,EAAE;;wBACb,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACrB,MAAA,KAAK,CAAC,WAAW,+CAAjB,KAAK,EAAe,IAAI,CAAC,CAAC;oBAC3B,CAAC;oBAED,oBAAC,YAAY,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,GAAI,CACV,CACJ,CACjB,GACA;QACD,OAAO,IAAI,CACX,oBAAC,WAAW,IACX,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EACjC,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAC9B,CACF,CACyB,CAC3B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,14 +1,16 @@
1
- import React, { useEffect, useState } from "react";
2
- import { useDocumentStore } from "@voplus/morpho-document-core";
3
- import { useApplicationContext } from "@voplus/morpho-data";
4
- import { runInAction } from "mobx";
1
+ import "./index.less";
5
2
  import { InlineEdit, observe } from "@voplus/morpho-ui";
3
+ import React, { useEffect, useState } from "react";
6
4
  import { useWorkType, useWorkTypeStore } from "../../../../data/worktype";
5
+ import { Open } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
7
6
  import { State } from "./state";
8
- import WorkspaceMenu from "../../../workspace/controls/WorkspaceMenu";
9
- import WorktypeCompleteWorksChart from "../../controls/WorktypeCompleteWorksChart";
7
+ import ToolBar from "@voplus/morpho-document/es/controls/ToolBar/ToolBar2";
8
+ import WorkTypeMenu from "../../controls/WorkTypeMenu";
10
9
  import WorkTypePropertiesTabs from '../WorkTypePropertiesTabs';
11
- import "./index.less";
10
+ import WorktypeCompleteWorksChart from "../../controls/WorktypeCompleteWorksChart";
11
+ import { runInAction } from "mobx";
12
+ import { useApplicationContext } from "@voplus/morpho-data";
13
+ import { useDocumentStore } from "@voplus/morpho-document-core";
12
14
  const WorkTypePropertiesView = (props) => {
13
15
  const id = props.id;
14
16
  const store = useWorkTypeStore();
@@ -26,7 +28,10 @@ const WorkTypePropertiesView = (props) => {
26
28
  React.createElement("div", { className: "worktype-header" },
27
29
  React.createElement("div", { className: "worktype-name" },
28
30
  React.createElement(InlineEdit, { defaultValue: worktype.name, content: (v) => React.createElement("div", null, worktype.name), onSave: (value) => state.save(value, worktype.name, { Name: value }) }),
29
- React.createElement(WorkspaceMenu, { id: id, closeAside: true }))),
31
+ React.createElement("div", { className: "tools-bar" },
32
+ React.createElement(ToolBar, { id: id, showMenu: false },
33
+ React.createElement(Open, { url: `/workType/${id}` }),
34
+ React.createElement(WorkTypeMenu, { id: id, closeAside: true }))))),
30
35
  React.createElement(WorktypeCompleteWorksChart, { id: props.id }),
31
36
  React.createElement(WorkTypePropertiesTabs, { id: id }))))));
32
37
  // async function onChange(ids: string[], members: IUnit[]) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypePropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,g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gBAC7B,oBAAC,UAAU,IACV,YAAY,EAAE,QAAQ,CAAC,IAAI,EAC3B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,QAAQ,CAAC,IAAI,CAAO,EAC1C,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GACxE;gBACF,6BAAK,SAAS,EAAC,WAAW;oBACzB,oBAAC,OAAO,IACP,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,KAAK;wBAEf,oBAAC,IAAI,IAAC,GAAG,EAAE,aAAa,EAAE,EAAE,GAAI;wBAChC,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CACjC,CACL,CACD,CAOD;QACN,oBAAC,0BAA0B,IAAC,EAAE,EAAE,KAAK,CAAC,EAAE,GAAI;QAC5C,oBAAC,sBAAsB,IAAC,EAAE,EAAE,EAAE,GAAI,CAClB,CACjB,CACI,CACN,CAAC,CAAC;IAEH,6DAA6D;IAC7D,4EAA4E;IAC5E,qDAAqD;IACrD,IAAI;AACL,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,15 +1,16 @@
1
- import "./index.less";
2
- import { Form, InputNumber } from "@voplus/antd";
3
1
  import React, { useState } from "react";
2
+ import { Form, InputNumber } from "@voplus/antd";
3
+ import { Scrollbars } from "react-custom-scrollbars";
4
+ import { State } from "./state";
4
5
  import { useWorkType, useWorkTypeStore } from "../../../../data/worktype";
6
+ import { observe } from "@voplus/morpho-ui";
7
+ import { runInAction } from "mobx";
8
+ import { useApplicationContext } from "@voplus/morpho-data";
5
9
  import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
6
10
  import AvatarList from "@voplus/morpho-document/es/components/AvatarList";
7
11
  import CheckList from "@voplus/morpho-ui/es/controls/CheckList";
8
- import { State } from "./state";
9
12
  import TaskQuickViewDialog from "../../../tasks/components/TaskQuickViewDialog";
10
- import { observe } from "@voplus/morpho-ui";
11
- import { runInAction } from "mobx";
12
- import { useApplicationContext } from "@voplus/morpho-data";
13
+ import "./index.less";
13
14
  const WorkTypeQA = (props) => {
14
15
  const { id } = props;
15
16
  const [form] = Form.useForm();
@@ -23,37 +24,37 @@ const WorkTypeQA = (props) => {
23
24
  return observe(() => {
24
25
  var _a, _b, _c, _d, _e, _f;
25
26
  return (React.createElement(AsideContent, { context: asideContext },
26
- React.createElement("div", null,
27
+ React.createElement("div", { className: "work-type-qa" },
27
28
  React.createElement("div", { className: "work-type-qa-head" }, "Quality Assurance Setting"),
28
- React.createElement(Form, { className: "work-type-qa-content", form: form, labelAlign: "left", labelCol: { span: 10 }, scrollToFirstError: true },
29
- React.createElement(Form.Item, { label: "Reviewer" },
30
- React.createElement(AvatarList, { organizationId: user.info.organizationId, multiple: true, buttonText: "Ok", list: state.worktype.reviewers, onChange: (ids) => {
31
- state.save({ ReviewerIds: ids });
32
- } })),
33
- React.createElement(Form.Item, { label: "Auditor" },
34
- React.createElement(AvatarList, { organizationId: user.info.organizationId, multiple: true, buttonText: "Ok", list: (_a = state.worktype.audit) === null || _a === void 0 ? void 0 : _a.auditors, onChange: (ids) => {
35
- state.save({ AuditorIds: ids });
36
- } })),
37
- ((_c = (_b = state.worktype
38
- .audit) === null || _b === void 0 ? void 0 : _b.auditors) === null || _c === void 0 ? void 0 : _c.length) && (React.createElement(React.Fragment, null,
39
- React.createElement(Form.Item, { label: "Audit Rate" }, state.auditRateEdit ? (React.createElement(InputNumber, { defaultValue: ((_d = state.worktype.audit) === null || _d === void 0 ? void 0 : _d.auditRate) || 0, min: 0, max: 100, formatter: (value) => `${value}%`, parser: (value) => value.replace("%", ""), onChange: (value) => {
40
- state.save({ AuditRate: value });
41
- }, onBlur: () => runInAction(() => (state.auditRateEdit = false)) })) : (React.createElement("div", { onClick: () => runInAction(() => (state.auditRateEdit = true)) }, ((_e = state.worktype.audit) === null || _e === void 0 ? void 0 : _e.auditRate)
42
- ? `${(_f = state.worktype.audit) === null || _f === void 0 ? void 0 : _f.auditRate}%`
43
- : "Add Audit Rate"))),
44
- React.createElement(Form.Item, { label: "Audit Task" },
45
- React.createElement("div", { className: "open-btn", onClick: () => setVisible(true) }, "Open")))),
46
- React.createElement(Form.Item, { label: "Reject Reasons" },
47
- React.createElement(CheckList, { headerProps: {
48
- viewTitle: " ",
49
- visible: true
50
- }, allowAdd: true, list: state.rejectReasons, onChange: (item) => state.onChangeRejectReasons(item), onCreate: (item) => state.onCreateRejectReasons(item), onDelete: (item) => state.onDeleteRejectReasons(item) })),
51
- React.createElement(Form.Item, { label: "Error Types" },
52
- React.createElement(CheckList, { headerProps: {
53
- viewTitle: " ",
54
- visible: true
55
- }, allowAdd: true, list: state.errorTypes, onChange: (item) => state.onChangeErrorTypes(item), onCreate: (item) => state.onCreateErrorTypes(item), onDelete: (item) => state.onDeleteErrorTypes(item) }))),
56
- React.createElement(TaskQuickViewDialog, { id: props.id, visible: visible, onCancel: () => setVisible(false) }))));
29
+ React.createElement(Scrollbars, { autoHide: true },
30
+ React.createElement(Form, { className: "work-type-qa-content", form: form, labelAlign: "left", labelCol: { span: 10 }, scrollToFirstError: true },
31
+ React.createElement(Form.Item, { label: "Reviewer" },
32
+ React.createElement(AvatarList, { organizationId: user.info.organizationId, multiple: true, buttonText: "Ok", list: state.worktype.reviewers, onChange: (ids) => {
33
+ state.save({ ReviewerIds: ids });
34
+ } })),
35
+ React.createElement(Form.Item, { label: "Auditor" },
36
+ React.createElement(AvatarList, { organizationId: user.info.organizationId, multiple: true, buttonText: "Ok", list: (_a = state.worktype.audit) === null || _a === void 0 ? void 0 : _a.auditors, onChange: (ids) => {
37
+ state.save({ AuditorIds: ids });
38
+ } })),
39
+ ((_c = (_b = state.worktype.audit) === null || _b === void 0 ? void 0 : _b.auditors) === null || _c === void 0 ? void 0 : _c.length) && (React.createElement(React.Fragment, null,
40
+ React.createElement(Form.Item, { label: "Audit Rate" }, state.auditRateEdit ? (React.createElement(InputNumber, { defaultValue: ((_d = state.worktype.audit) === null || _d === void 0 ? void 0 : _d.auditRate) || 0, min: 0, max: 100, formatter: (value) => `${value}%`, parser: (value) => value.replace("%", ""), onChange: (value) => {
41
+ state.save({ AuditRate: value });
42
+ }, onBlur: () => runInAction(() => (state.auditRateEdit = false)) })) : (React.createElement("div", { onClick: () => runInAction(() => (state.auditRateEdit = true)) }, ((_e = state.worktype.audit) === null || _e === void 0 ? void 0 : _e.auditRate)
43
+ ? `${(_f = state.worktype.audit) === null || _f === void 0 ? void 0 : _f.auditRate}%`
44
+ : "Add Audit Rate"))),
45
+ React.createElement(Form.Item, { label: "Audit Task" },
46
+ React.createElement("div", { className: "open-btn", onClick: () => setVisible(true) }, "Open")))),
47
+ React.createElement(Form.Item, { label: "Reject Reasons" },
48
+ React.createElement(CheckList, { headerProps: {
49
+ viewTitle: " ",
50
+ visible: true,
51
+ }, allowAdd: true, list: state.rejectReasons, onChange: (item) => state.onChangeRejectReasons(item), onCreate: (item) => state.onCreateRejectReasons(item), onDelete: (item) => state.onDeleteRejectReasons(item) })),
52
+ React.createElement(Form.Item, { label: "Error Types" },
53
+ React.createElement(CheckList, { headerProps: {
54
+ viewTitle: " ",
55
+ visible: true,
56
+ }, allowAdd: true, list: state.errorTypes, onChange: (item) => state.onChangeErrorTypes(item), onCreate: (item) => state.onCreateErrorTypes(item), onDelete: (item) => state.onDeleteErrorTypes(item) }))),
57
+ React.createElement(TaskQuickViewDialog, { id: props.id, visible: visible, onCancel: () => setVisible(false) })))));
57
58
  });
58
59
  };
59
60
  export default WorkTypeQA;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/components/WorkTypeQA/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjD,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C,IAAI,CAAC,EACrD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,GACpD,CACS;wBACZ,oBAAC,IAAI,CAAC,IAAI,IAAC,KAAK,EAAC,aAAa;4BAC7B,oBAAC,SAAS,IACT,WAAW,EAAE;oCACZ,SAAS,EAAE,GAAG;oCACd,OAAO,EAAE,IAAI;iCACb,EACD,QAAQ,QACR,IAAI,EAAE,KAAK,CAAC,UAAU,EACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,GACjD,CACS,CACN;oBACP,oBAAC,mBAAmB,IAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAI,CAC9E,CACR,CACQ,CACf,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,4 +1,11 @@
1
1
  :global {
2
+ .work-type-qa{
3
+ width: 100%;
4
+ height: 100%;
5
+ // overflow: hidden;
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
2
9
  .work-type-qa-head {
3
10
  padding: 10px 20px;
4
11
  background: #fff;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ToolBarProps } from "./state";
3
+ import "./index.less";
4
+ declare const Toolbar: {
5
+ (props: ToolBarProps): JSX.Element;
6
+ defaultProps: {
7
+ showMenu: boolean;
8
+ };
9
+ };
10
+ export default Toolbar;
@@ -0,0 +1,20 @@
1
+ import React, { useState } from "react";
2
+ import { observe } from "@voplus/morpho-ui";
3
+ import { More } from "@voplus/morpho-document/es/controls/ToolBar/buttons";
4
+ import { ToolBarContext, ToolBarState } from "./state";
5
+ import { useWorkTypeStore } from "../../../../data/worktype";
6
+ import "./index.less";
7
+ const Toolbar = (props) => {
8
+ const { children, visible, showMenu, moreProps: dropDownMenuProps } = props;
9
+ const store = useWorkTypeStore();
10
+ const [state] = useState(new ToolBarState(store));
11
+ state.props = props;
12
+ return observe(() => (React.createElement(ToolBarContext.Provider, { value: state }, visible !== false ? (React.createElement("span", { className: "tool-bar" },
13
+ children,
14
+ showMenu && React.createElement(More, { ...dropDownMenuProps }))) : (React.createElement(React.Fragment, null)))));
15
+ };
16
+ Toolbar.defaultProps = {
17
+ showMenu: true,
18
+ };
19
+ export default Toolbar;
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/worktype/controls/ToolBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAgB,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,cAAc,CAAC;AAEtB,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;IACvC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAEpB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACnC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CACpB,8BAAM,SAAS,EAAC,UAAU;QACxB,QAAQ;QACR,QAAQ,IAAI,oBAAC,IAAI,OAAK,iBAAiB,GAAI,CACtC,CACP,CAAC,CAAC,CAAC,CACH,yCAAK,CACL,CACwB,CAC1B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,CAAC,YAAY,GAAG;IACtB,QAAQ,EAAE,IAAI;CACd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,55 @@
1
+ :global {
2
+ .tool-bar {
3
+ .ant-btn + .ant-btn {
4
+ margin-left: 5px;
5
+ }
6
+ .ant-tooltip-disabled-compatible-wrapper {
7
+ margin: 0 5px;
8
+ & + .ant-tooltip-disabled-compatible-wrapper {
9
+ margin-left: 0;
10
+ }
11
+ }
12
+ .archive-btn {
13
+ background: #fff;
14
+ border-color: #faad14;
15
+ color: #faad14;
16
+ }
17
+ .archive-btn:active,
18
+ .archive-btn.active,
19
+ .archive-btn:hover {
20
+ background-color: #faad14;
21
+ color: #fff;
22
+ }
23
+ }
24
+ .tool-bar-menu {
25
+ padding: 4px 0;
26
+ list-style-type: none;
27
+ background-color: #fff;
28
+ background-clip: padding-box;
29
+ border-radius: 2px;
30
+ outline: none;
31
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
32
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05);
33
+
34
+ .ant-btn {
35
+ display: block;
36
+ width: 100%;
37
+ padding: 0 12px;
38
+ height: 34px;
39
+ color: #666;
40
+ text-align: left;
41
+ &[disabled] {
42
+ color: rgba(0, 0, 0, 0.25);
43
+ }
44
+ &:hover {
45
+ background-color: #f5f5f5;
46
+ }
47
+ > span {
48
+ margin-left: 10px;
49
+ }
50
+ }
51
+ .delete {
52
+ color: #f5222d;
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,36 @@
1
+ import { ReactNode } from "react";
2
+ import { MoreButtonProps } from "@voplus/morpho-document/es/controls/ToolBar/buttons/More";
3
+ import { WorkTypeStore } from "../../../../data/worktype";
4
+ export declare type ToolBarProps = {
5
+ /** id of document */
6
+ id?: string;
7
+ children?: ReactNode;
8
+ /** show toolbar */
9
+ visible?: boolean;
10
+ /** show drop down menu */
11
+ showMenu?: boolean;
12
+ /** Props for dropd */
13
+ moreProps?: MoreButtonProps;
14
+ };
15
+ export interface IToolBarState {
16
+ disabled?: boolean;
17
+ }
18
+ export declare class ToolBarState {
19
+ store: WorkTypeStore;
20
+ /** Current tools states. */
21
+ private states;
22
+ props: ToolBarProps;
23
+ constructor(store: WorkTypeStore);
24
+ /** Try to get an existing icons state or create a new one if it's not already exists.
25
+ * @param key - Key of the icons state.
26
+ * @param factory - factor to create a new option state.
27
+ */
28
+ getState<T extends IToolBarState>(key: string, factory: () => T): T;
29
+ /** id */
30
+ get id(): string;
31
+ collapsed: boolean;
32
+ }
33
+ /** React context for ToolBarState. */
34
+ export declare const ToolBarContext: import("react").Context<ToolBarState>;
35
+ /** React hook to retrieve the nearest ToolBarContext. */
36
+ export declare const useToolBarContext: () => ToolBarState;