@voplus/morpho-workspace 1.0.0-dev49 → 1.0.0-dev51
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/components/AvatarList/index.d.ts +1 -0
- package/es/components/AvatarList/index.js +5 -2
- package/es/components/AvatarList/index.js.map +1 -1
- package/es/components/ToolBar/index.d.ts +2 -0
- package/es/components/ToolBar/index.js +3 -3
- package/es/components/ToolBar/index.js.map +1 -1
- package/es/data/board/BoardColumnStore.d.ts +13 -3
- package/es/data/board/BoardColumnStore.js +22 -0
- package/es/data/board/BoardColumnStore.js.map +1 -1
- package/es/data/board/BoardStore.d.ts +10 -0
- package/es/data/board/BoardStore.js +22 -0
- package/es/data/board/BoardStore.js.map +1 -1
- package/es/data/board/hooks.d.ts +6 -1
- package/es/data/board/hooks.js +10 -0
- package/es/data/board/hooks.js.map +1 -1
- package/es/data/board/index.d.ts +1 -0
- package/es/data/board/index.js +1 -0
- package/es/data/board/index.js.map +1 -1
- package/es/data/board/interfaces.d.ts +19 -0
- package/es/data/board/types.d.ts +13 -0
- package/es/modules/BoardView/components/BoardColumn/index.d.ts +2 -0
- package/es/modules/BoardView/components/BoardColumn/index.js +54 -16
- package/es/modules/BoardView/components/BoardColumn/index.js.map +1 -1
- package/es/modules/BoardView/components/BoardColumn/index.less +4 -4
- package/es/modules/BoardView/components/BoardColumn/state.d.ts +7 -3
- package/es/modules/BoardView/components/BoardColumn/state.js +19 -3
- package/es/modules/BoardView/components/BoardColumn/state.js.map +1 -1
- package/es/modules/BoardView/components/BoardList/index.js +63 -15
- package/es/modules/BoardView/components/BoardList/index.js.map +1 -1
- package/es/modules/BoardView/components/BoardList/index.less +22 -4
- package/es/modules/BoardView/components/BoardList/state.d.ts +9 -3
- package/es/modules/BoardView/components/BoardList/state.js +36 -4
- package/es/modules/BoardView/components/BoardList/state.js.map +1 -1
- package/es/modules/BoardView/components/DocumentCard/index.d.ts +10 -0
- package/es/modules/BoardView/components/DocumentCard/index.js +101 -0
- package/es/modules/BoardView/components/DocumentCard/index.js.map +1 -0
- package/es/modules/BoardView/components/DocumentCard/index.less +116 -0
- package/es/modules/BoardView/components/DocumentCard/state.d.ts +15 -0
- package/es/modules/BoardView/components/DocumentCard/state.js +54 -0
- package/es/modules/BoardView/components/DocumentCard/state.js.map +1 -0
- package/es/modules/BoardView/components/{TaskList → LinkList}/index.d.ts +5 -4
- package/es/modules/BoardView/components/LinkList/index.js +60 -0
- package/es/modules/BoardView/components/LinkList/index.js.map +1 -0
- package/es/modules/BoardView/components/LinkList/state.d.ts +7 -0
- package/es/modules/BoardView/components/{TaskList → LinkList}/state.js +8 -4
- package/es/modules/BoardView/components/LinkList/state.js.map +1 -0
- package/es/modules/BoardView/components/NewTaskForm/index.js +32 -15
- package/es/modules/BoardView/components/NewTaskForm/index.js.map +1 -1
- package/es/modules/BoardView/components/NewTaskForm/index.less +23 -12
- package/es/modules/BoardView/components/NewTaskForm/state.d.ts +1 -0
- package/es/modules/BoardView/components/NewTaskForm/state.js +4 -0
- package/es/modules/BoardView/components/NewTaskForm/state.js.map +1 -1
- package/es/modules/BoardView/components/TaskCard/index.d.ts +2 -0
- package/es/modules/BoardView/components/TaskCard/index.js +20 -21
- package/es/modules/BoardView/components/TaskCard/index.js.map +1 -1
- package/es/modules/BoardView/pages/BoardViewList/index.js +4 -5
- package/es/modules/BoardView/pages/BoardViewList/index.js.map +1 -1
- package/es/modules/BoardView/pages/BoardViewList/index.less +1 -1
- package/es/modules/tasks/components/NewTaskForm/index.d.ts +1 -0
- package/es/modules/tasks/components/NewTaskForm/index.js +2 -0
- package/es/modules/tasks/components/NewTaskForm/index.js.map +1 -1
- package/es/modules/tasks/components/SubTaskList/index.js +2 -19
- package/es/modules/tasks/components/SubTaskList/index.js.map +1 -1
- package/es/modules/tasks/components/SubTaskList/index.less +3 -0
- package/es/modules/tasks/components/TaskDescription/index.less +6 -0
- package/es/modules/tasks/components/TaskDetail/index.js +8 -1
- package/es/modules/tasks/components/TaskDetail/index.js.map +1 -1
- package/es/modules/tasks/components/TaskItem/TaskItem.js.map +1 -1
- package/es/modules/tasks/pages/TaskTabView/index.js +2 -5
- package/es/modules/tasks/pages/TaskTabView/index.js.map +1 -1
- package/es/modules/tasks/pages/TaskTabView/index.less +6 -0
- package/package.json +7 -6
- package/es/modules/BoardView/components/Add/index.d.ts +0 -7
- package/es/modules/BoardView/components/Add/index.js +0 -80
- package/es/modules/BoardView/components/Add/index.js.map +0 -1
- package/es/modules/BoardView/components/Add/index.less +0 -26
- package/es/modules/BoardView/components/TaskList/index.js +0 -45
- package/es/modules/BoardView/components/TaskList/index.js.map +0 -1
- package/es/modules/BoardView/components/TaskList/state.d.ts +0 -7
- package/es/modules/BoardView/components/TaskList/state.js.map +0 -1
- package/es/modules/tasks/components/TaskDetail/index.less +0 -28
@@ -3,33 +3,81 @@ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
3
3
|
import { Input, message } from "@voplus/antd";
|
4
4
|
import Card from "@voplus/morpho-ui/es/controls/Card";
|
5
5
|
import { useObserver } from "mobx-react-lite";
|
6
|
-
import React, { useState } from "react";
|
7
|
-
import
|
8
|
-
import
|
6
|
+
import React, { useState, useEffect } from "react";
|
7
|
+
import SearchHeader from "@voplus/morpho-ui/es/components/layout/ListView/components/SearchHeader";
|
8
|
+
import SortViewDropdown from "@voplus/morpho-ui/es/components/layout/ListView/controls/SortViewDropdown";
|
9
|
+
import FilterListDropdown from "@voplus/morpho-ui/es/components/layout/ListView/controls/FilterListDropdown";
|
10
|
+
import { useBoardColumnListEffect, useBoardColumnStore } from "../../../../data/board";
|
11
|
+
import { toJS } from "mobx";
|
12
|
+
import { ListOptionsContextState, ListOptionsContext } from "@voplus/morpho-ui";
|
13
|
+
import SortDnD from "@voplus/morpho-ui/es/controls/SortDnD";
|
9
14
|
import BoardColumn from "../BoardColumn";
|
10
15
|
import styles from "./index.less";
|
11
16
|
import { State } from "./state";
|
12
17
|
const BoardList = (props) => {
|
13
18
|
const colorList = ["#765FEE", "#fe4066", "#FFC832", "#FF8F5E", "#16ecec", "#FFC832"];
|
14
|
-
const boards =
|
19
|
+
const boards = useBoardColumnStore();
|
15
20
|
const [state] = useState(new State());
|
16
|
-
|
17
|
-
|
21
|
+
const [listoptions] = useState(new ListOptionsContextState());
|
22
|
+
useBoardColumnListEffect(list => {
|
23
|
+
state.boardcolumns = list;
|
24
|
+
state.loading = false;
|
18
25
|
});
|
26
|
+
const onSort = async (value) => {
|
27
|
+
listoptions.sort = value;
|
28
|
+
};
|
29
|
+
const onFilter = async (value) => {
|
30
|
+
const { status, assignee, created, labels, dueDate } = value;
|
31
|
+
listoptions.filters = [
|
32
|
+
{ c: "LinkStatus", o: "contains", l: "And", v1: toJS(JSON.stringify(status)) }
|
33
|
+
];
|
34
|
+
};
|
35
|
+
const onSearch = (value) => {
|
36
|
+
listoptions.filters = [{ c: "Name", o: "contains", l: "And", v1: toJS(JSON.stringify(value)) }];
|
37
|
+
};
|
38
|
+
const moveAfter = async (id, afterId, list) => {
|
39
|
+
console.log("moveAfter", id, afterId, list);
|
40
|
+
await boards.moveAfter(id, afterId);
|
41
|
+
state.boardcolumns = list;
|
42
|
+
};
|
19
43
|
const onSave = async () => {
|
20
44
|
if (!state.name)
|
21
45
|
return message.warning("Title is required");
|
22
46
|
await boards.create({ Name: state.name, ParentId: props.parentId });
|
23
47
|
};
|
24
|
-
|
25
|
-
state.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
48
|
+
const onBoardColumnCreated = (s, t) => {
|
49
|
+
state.boardcolumns = !t.parentId ? [...state.boardcolumns, t] : state.boardcolumns;
|
50
|
+
state.reload = true;
|
51
|
+
};
|
52
|
+
const onBoardColumnDeleted = (s, t) => {
|
53
|
+
state.boardcolumns =
|
54
|
+
t instanceof Array
|
55
|
+
? state.boardcolumns.filter(board => !t.some(({ id }) => board.id === id))
|
56
|
+
: state.boardcolumns.filter(board => board.id !== t.id);
|
57
|
+
state.reload = true;
|
58
|
+
};
|
59
|
+
useEffect(() => {
|
60
|
+
boards.ItemCreatedEvent.subscribe(onBoardColumnCreated);
|
61
|
+
boards.ItemDeletedEvent.subscribe(onBoardColumnDeleted);
|
62
|
+
return () => {
|
63
|
+
boards.ItemCreatedEvent.unsubscribe(onBoardColumnCreated);
|
64
|
+
boards.ItemDeletedEvent.unsubscribe(onBoardColumnDeleted);
|
65
|
+
};
|
66
|
+
}, []);
|
67
|
+
return useObserver(() => (React.createElement(ListOptionsContext.Provider, { value: listoptions },
|
68
|
+
React.createElement("div", { className: styles["board_header"] },
|
69
|
+
React.createElement(SearchHeader, { onChange: onSearch }),
|
70
|
+
React.createElement("div", null,
|
71
|
+
React.createElement(SortViewDropdown, { onSort: onSort }),
|
72
|
+
React.createElement(FilterListDropdown, { className: "margin-left-10", onFilter: onFilter }))),
|
73
|
+
React.createElement("div", { className: styles["board-list"] },
|
74
|
+
React.createElement(SortDnD, { className: "board-sortDnD", list: state.boardcolumns, moveAfter: moveAfter, text: (item, index, connectDragSource) => (React.createElement(BoardColumn, { key: item.id, id: item.id, reload: state.reload, colorStyle: colorList[index % 6], connectDragSource: connectDragSource })) }),
|
75
|
+
state.AddBoardColumnAble && (React.createElement(Card, { className: "add-board-able", padding: "0 15px", style: { borderTop: ` solid 2px #3AC43A` } },
|
76
|
+
React.createElement(Input, { placeholder: "STATUS NAME", value: state.name, onChange: e => (state.name = e.target.value) }),
|
77
|
+
React.createElement(FAIcon, { icon: faCheck, onClick: onSave }),
|
78
|
+
React.createElement(FAIcon, { icon: faTimes, onClick: () => (state.AddBoardColumnAble = false) }))),
|
79
|
+
React.createElement("div", { className: "add-board" },
|
80
|
+
React.createElement("div", { onClick: () => (state.AddBoardColumnAble = true) }, "+ ADD"))))));
|
33
81
|
};
|
34
82
|
export default BoardList;
|
35
83
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/BoardView/components/BoardList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/BoardView/components/BoardList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAQ,MAAM,cAAc,CAAC;AACpD,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,EAAE,WAAW,EAAiB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,YAAY,MAAM,yEAAyE,CAAC;AACnG,OAAO,gBAAgB,MAAM,2EAA2E,CAAC;AACzG,OAAO,kBAAkB,MAAM,6EAA6E,CAAC;AAC7G,OAAO,EACN,wBAAwB,EACxB,mBAAmB,EAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,OAAO,MAAM,uCAAuC,CAAC;AAC5D,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,SAAS,GAAG,CAAC,KAA4B,EAAE,EAAE;IAClD,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,S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,GACA;YAID,KAAK,CAAC,kBAAkB,IAAI,CAC5B,oBAAC,IAAI,IACJ,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE;gBAE1C,oBAAC,KAAK,IACL,WAAW,EAAC,aAAa,EACzB,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAC3C;gBACF,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAI;gBAC1C,oBAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAAI,CACtE,CACP;YACD,6BAAK,SAAS,EAAC,WAAW;gBACzB,6BAAK,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAa,CAC7D,CACD,CACuB,CAC9B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
@@ -5,15 +5,24 @@
|
|
5
5
|
margin: 10px;
|
6
6
|
padding: 0 10px;
|
7
7
|
:global {
|
8
|
+
.board-sortDnD {
|
9
|
+
flex: 1;
|
10
|
+
display: flex;
|
11
|
+
> div {
|
12
|
+
flex: 1;
|
13
|
+
}
|
14
|
+
}
|
8
15
|
.add-board {
|
9
16
|
width: 100px;
|
17
|
+
min-width: 100px;
|
10
18
|
font-size: 16px;
|
11
19
|
text-align: center;
|
12
20
|
line-height: 50px;
|
13
|
-
|
21
|
+
> div {
|
22
|
+
cursor: pointer;
|
23
|
+
}
|
14
24
|
}
|
15
25
|
.add-board-able {
|
16
|
-
flex: 0.6;
|
17
26
|
display: flex;
|
18
27
|
justify-content: center;
|
19
28
|
align-items: center;
|
@@ -23,17 +32,26 @@
|
|
23
32
|
padding: 0 10px;
|
24
33
|
background: #ffffff;
|
25
34
|
margin-bottom: 15px;
|
26
|
-
|
35
|
+
min-width: 150px;
|
36
|
+
.ant-input {
|
27
37
|
padding: 0;
|
28
38
|
border: none;
|
29
39
|
}
|
30
40
|
.ant-input:focus {
|
31
41
|
box-shadow: none;
|
32
42
|
}
|
33
|
-
.svg-inline--fa{
|
43
|
+
.svg-inline--fa {
|
34
44
|
cursor: pointer;
|
35
45
|
margin-left: 8px;
|
36
46
|
}
|
37
47
|
}
|
38
48
|
}
|
39
49
|
}
|
50
|
+
.board_header {
|
51
|
+
display: flex;
|
52
|
+
justify-content: space-between;
|
53
|
+
align-items: center;
|
54
|
+
padding: 10px 20px;
|
55
|
+
border-bottom: 1px solid #f2f2f2;
|
56
|
+
background-color: #ffffff;
|
57
|
+
}
|
@@ -1,7 +1,13 @@
|
|
1
|
-
import {
|
1
|
+
import { IBoardColumn } from "../../../../data/board";
|
2
|
+
import { SortParameters } from "@voplus/morpho-data/es/types";
|
2
3
|
export declare class State {
|
3
|
-
|
4
|
+
boardcolumns: IBoardColumn[];
|
4
5
|
id: string;
|
5
6
|
name: string;
|
6
|
-
|
7
|
+
reload: boolean;
|
8
|
+
loading: boolean;
|
9
|
+
filterName: string;
|
10
|
+
sort: SortParameters;
|
11
|
+
filters: any[];
|
12
|
+
AddBoardColumnAble: boolean;
|
7
13
|
}
|
@@ -2,15 +2,20 @@ import { __decorate } from "tslib";
|
|
2
2
|
import { observable } from "mobx";
|
3
3
|
export class State {
|
4
4
|
constructor() {
|
5
|
-
this.
|
5
|
+
this.boardcolumns = [];
|
6
6
|
this.id = "";
|
7
7
|
this.name = "";
|
8
|
-
this.
|
8
|
+
this.reload = false;
|
9
|
+
this.loading = true;
|
10
|
+
this.filterName = "";
|
11
|
+
this.sort = {};
|
12
|
+
this.filters = ["Done", "Progress", "NotStarted", "NotAssigned"];
|
13
|
+
this.AddBoardColumnAble = false;
|
9
14
|
}
|
10
15
|
}
|
11
16
|
__decorate([
|
12
17
|
observable
|
13
|
-
], State.prototype, "
|
18
|
+
], State.prototype, "boardcolumns", void 0);
|
14
19
|
__decorate([
|
15
20
|
observable
|
16
21
|
], State.prototype, "id", void 0);
|
@@ -19,5 +24,32 @@ __decorate([
|
|
19
24
|
], State.prototype, "name", void 0);
|
20
25
|
__decorate([
|
21
26
|
observable
|
22
|
-
], State.prototype, "
|
27
|
+
], State.prototype, "reload", void 0);
|
28
|
+
__decorate([
|
29
|
+
observable
|
30
|
+
], State.prototype, "loading", void 0);
|
31
|
+
__decorate([
|
32
|
+
observable
|
33
|
+
], State.prototype, "filterName", void 0);
|
34
|
+
__decorate([
|
35
|
+
observable
|
36
|
+
], State.prototype, "sort", void 0);
|
37
|
+
__decorate([
|
38
|
+
observable
|
39
|
+
], State.prototype, "filters", void 0);
|
40
|
+
__decorate([
|
41
|
+
observable
|
42
|
+
], State.prototype, "AddBoardColumnAble", void 0);
|
43
|
+
// export const options = {
|
44
|
+
// count: 1,
|
45
|
+
// filterName: "",
|
46
|
+
// status: ["Done", "Progress", "NotStarted", "NotAssigned"],
|
47
|
+
// sort: {},
|
48
|
+
// get getFilterName() {
|
49
|
+
// return options.filterName;
|
50
|
+
// },
|
51
|
+
// setFilterName(name: string) {
|
52
|
+
// options.filterName = name;
|
53
|
+
// }
|
54
|
+
// };
|
23
55
|
//# sourceMappingURL=state.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/BoardView/components/BoardList/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/BoardView/components/BoardList/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIlC,MAAM,OAAO,KAAK;IAAlB;QACoB,iBAAY,GAAmB,EAAE,CAAC;QAClC,OAAE,GAAW,EAAE,CAAC;QAChB,SAAI,GAAW,EAAE,CAAC;QAClB,WAAM,GAAY,KAAK,CAAC;QACxB,YAAO,GAAY,IAAI,CAAC;QACxB,eAAU,GAAW,EAAE,CAAC;QACxB,SAAI,GAAmB,EAAE,CAAC;QAC1B,YAAO,GAAU,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;QACnE,uBAAkB,GAAY,KAAK,CAAC;IACxD,CAAC;CAAA;AATY;IAAX,UAAU;2CAA0C;AACzC;IAAX,UAAU;iCAAwB;AACvB;IAAX,UAAU;mCAA0B;AACzB;IAAX,UAAU;qCAAgC;AAC/B;IAAX,UAAU;sCAAgC;AAC/B;IAAX,UAAU;yCAAgC;AAC/B;IAAX,UAAU;mCAAkC;AACjC;IAAX,UAAU;sCAA2E;AAC1E;IAAX,UAAU;iDAA4C;AAGxD,2BAA2B;AAC3B,aAAa;AACb,mBAAmB;AACnB,8DAA8D;AAC9D,aAAa;AACb,yBAAyB;AACzB,+BAA+B;AAC/B,MAAM;AACN,iCAAiC;AACjC,+BAA+B;AAC/B,KAAK;AACL,KAAK"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const DocumentCard: (props: {
|
3
|
+
id: string;
|
4
|
+
leftId?: string | undefined;
|
5
|
+
linkId?: string | undefined;
|
6
|
+
reload?: boolean | undefined;
|
7
|
+
multiple?: boolean | undefined;
|
8
|
+
connectDragSource?: any;
|
9
|
+
}) => JSX.Element;
|
10
|
+
export default DocumentCard;
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import { faBars, faCommentDots, faCopy, faPaperclip, faSave, faUndo } from "@fortawesome/pro-light-svg-icons";
|
2
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
3
|
+
import { Button, Checkbox, Input, message, Spin } from "@voplus/antd";
|
4
|
+
import { useDocument, useDocumentStore } from "@voplus/morpho-document";
|
5
|
+
import { FileStore } from "@voplus/morpho-document/es/data/FileStore/FileContext";
|
6
|
+
import Card from "@voplus/morpho-ui/es/controls/Card";
|
7
|
+
import classnames from "classnames";
|
8
|
+
import { useObserver } from "mobx-react-lite";
|
9
|
+
import React, { useState } from "react";
|
10
|
+
import ToolBar from "../../../../components/ToolBar";
|
11
|
+
import FlagIcon from "../../../../controls/FlagIcon";
|
12
|
+
import styles from "./index.less";
|
13
|
+
import { State } from "./state";
|
14
|
+
const DocumentCard = (props) => {
|
15
|
+
const [state] = useState(new State());
|
16
|
+
const [store] = useState(new FileStore());
|
17
|
+
// const taskStore = useTaskStore();
|
18
|
+
const documentStore = useDocumentStore();
|
19
|
+
const [parentReadonly, setParentReadonly] = useState(false);
|
20
|
+
state.reload = !!props.reload;
|
21
|
+
state.document = useDocument(props.id, { reload: parentReadonly });
|
22
|
+
const readonly = state.document.status === "Readonly";
|
23
|
+
const onSaveMember = async (ids) => {
|
24
|
+
// state.ids = ids;
|
25
|
+
// await taskStore.edit(state.document.id, { MemberIds: ids });
|
26
|
+
};
|
27
|
+
const onSave = async () => {
|
28
|
+
if (!state.name) {
|
29
|
+
return message.warn("Title is required");
|
30
|
+
}
|
31
|
+
if (state.name.trim() === state.document.name) {
|
32
|
+
// 没有变动无需请求
|
33
|
+
return (state.editable = false);
|
34
|
+
}
|
35
|
+
state.loading = true;
|
36
|
+
await documentStore.edit(props.id, { Name: state.name });
|
37
|
+
state.editable = !state.editable;
|
38
|
+
state.loading = false;
|
39
|
+
};
|
40
|
+
const onEdit = () => {
|
41
|
+
state.name = state.document.name;
|
42
|
+
state.isHover = false;
|
43
|
+
state.editable = !state.editable;
|
44
|
+
};
|
45
|
+
const onDelete = () => {
|
46
|
+
documentStore.editLinks(props.leftId, { RemoveLinks: [props.linkId] });
|
47
|
+
};
|
48
|
+
const onMove = () => {
|
49
|
+
store.onMove([props.id]);
|
50
|
+
};
|
51
|
+
const onPaste = async () => {
|
52
|
+
if (store.moveIds.some((id) => id === props.id))
|
53
|
+
return message.warn("Cannot move to itself");
|
54
|
+
await store.onPaste(() => documentStore.move(store.moveIds, props.id));
|
55
|
+
state.reload = true;
|
56
|
+
};
|
57
|
+
const onLock = () => {
|
58
|
+
documentStore.edit(state.document.id, { Status: "Readonly" });
|
59
|
+
};
|
60
|
+
const onUnlock = () => {
|
61
|
+
documentStore.edit(state.document.id, { Status: "Normal" });
|
62
|
+
};
|
63
|
+
const onChangeImportant = (e) => {
|
64
|
+
if (readonly)
|
65
|
+
return;
|
66
|
+
e.stopPropagation();
|
67
|
+
};
|
68
|
+
const iconList = (React.createElement(React.Fragment, null,
|
69
|
+
React.createElement("span", null,
|
70
|
+
React.createElement(FAIcon, { icon: faPaperclip }),
|
71
|
+
state.document.documents || 0),
|
72
|
+
React.createElement("span", null,
|
73
|
+
React.createElement(FAIcon, { icon: faCommentDots }),
|
74
|
+
state.document.comments || 0),
|
75
|
+
React.createElement("span", null,
|
76
|
+
React.createElement(FAIcon, { icon: faCopy }),
|
77
|
+
0)));
|
78
|
+
const { multiple } = props;
|
79
|
+
return useObserver(() => (React.createElement(Card, { className: styles["task-card"], shadow: true },
|
80
|
+
React.createElement("div", { className: "task-card-item", onMouseOver: () => (state.isHover = true), onMouseLeave: () => (state.isHover = false) },
|
81
|
+
React.createElement("div", { className: "task-card-head" },
|
82
|
+
multiple && React.createElement(Checkbox, { value: state.document.id, className: "multiple-box" }),
|
83
|
+
!multiple && (React.createElement(FlagIcon, { id: state.document.id, editable: !readonly, flag: state.document.flag, color: state.isHover ? "rgba(168, 168, 168,0.5)" : "#999", onchange: onChangeImportant, className: "task-icon-star" })),
|
84
|
+
state.editable ? (React.createElement(Spin, { spinning: state.loading },
|
85
|
+
React.createElement(Input.TextArea, { className: "task-card-title", autosize: true, autoFocus: true, value: state.name, onChange: e => (state.name = e.target.value) }))) : (React.createElement("div", { className: "task-card-title" }, state.document.name))),
|
86
|
+
React.createElement("div", { className: "task-card-control" },
|
87
|
+
state.isHover &&
|
88
|
+
!multiple &&
|
89
|
+
props.connectDragSource?.(React.createElement("span", { className: classnames("task-icon-move", { show: state.editable }) }, React.createElement(FAIcon, { icon: faBars }))),
|
90
|
+
iconList),
|
91
|
+
React.createElement("div", { className: "task-card-label" },
|
92
|
+
state.isHover && !state.editable && (React.createElement("div", { className: classnames("hover-operate-icon", { show: state.isHover }) },
|
93
|
+
React.createElement(ToolBar, { size: "small", url: `/document/${props.id}`, edit: false, del: false, move: !readonly, lock: state.document.status === "Draft" || state.document.status === "Normal", unlock: state.document.status === "Readonly", hoverEdit: !readonly, hoverDel: !readonly, onDelete: onDelete, onEdit: onEdit, onMove: onMove, onPaste: onPaste, onLock: onLock, onUnlock: onUnlock }))),
|
94
|
+
state.editable && (React.createElement("div", { className: "task-card-editable-name" },
|
95
|
+
React.createElement(Button, { shape: "circle", size: "small", onClick: () => (state.editable = false) },
|
96
|
+
React.createElement(FAIcon, { icon: faUndo })),
|
97
|
+
React.createElement(Button, { type: "primary", size: "small", ghost: true, shape: "circle", onClick: onSave },
|
98
|
+
React.createElement(FAIcon, { icon: faSave })))))))));
|
99
|
+
};
|
100
|
+
export default DocumentCard;
|
101
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/BoardView/components/DocumentCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,aAAa,EACb,MAAM,EACN,WAAW,EACX,MAAM,EACN,MAAM,EACN,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAc,IAAI,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,SAAS,EAA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AK,QAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM;wBACvE,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,GAAI,CAChB,CACJ,CACN,CACI,CACD,CACA,CACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -0,0 +1,116 @@
|
|
1
|
+
@import "../../../../styles/common.less";
|
2
|
+
.task-card {
|
3
|
+
margin-bottom: 15px;
|
4
|
+
background: #ffffff;
|
5
|
+
cursor: pointer;
|
6
|
+
:global {
|
7
|
+
.task-card-head {
|
8
|
+
display: flex;
|
9
|
+
align-items: center;
|
10
|
+
.task-card-title {
|
11
|
+
flex: 1;
|
12
|
+
font-size: 16px;
|
13
|
+
color: #000000;
|
14
|
+
white-space: nowrap;
|
15
|
+
overflow: hidden;
|
16
|
+
text-overflow: ellipsis;
|
17
|
+
margin-left: 6px;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
.task-card-control {
|
21
|
+
margin-top: 6px;
|
22
|
+
display: flex;
|
23
|
+
align-items: center;
|
24
|
+
padding: 5px 0;
|
25
|
+
font-size: 13px;
|
26
|
+
color: #666;
|
27
|
+
& > span {
|
28
|
+
display: flex;
|
29
|
+
align-items: center;
|
30
|
+
}
|
31
|
+
& > span + span {
|
32
|
+
margin-left: 8px;
|
33
|
+
}
|
34
|
+
> span:hover {
|
35
|
+
color: @primary-color;
|
36
|
+
}
|
37
|
+
.task-icon-move{
|
38
|
+
&:hover{
|
39
|
+
color: #666;
|
40
|
+
}
|
41
|
+
.svg-inline--fa {
|
42
|
+
margin-right: 0;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
.svg-inline--fa {
|
46
|
+
margin-right: 5px;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
.task-card-label {
|
50
|
+
height: 23px;
|
51
|
+
margin-top: 8px;
|
52
|
+
.item {
|
53
|
+
display: inline-block;
|
54
|
+
font-size: 13px;
|
55
|
+
height: 22px;
|
56
|
+
line-height: 20px;
|
57
|
+
padding: 0 11px 0 8px;
|
58
|
+
color: #a50909;
|
59
|
+
background: #fbc7c8;
|
60
|
+
border-top-right-radius: 11px;
|
61
|
+
border-bottom-right-radius: 11px;
|
62
|
+
border-top-left-radius: 2px;
|
63
|
+
border-bottom-left-radius: 2px;
|
64
|
+
margin-right: 10px;
|
65
|
+
&.project {
|
66
|
+
color: #5d0303;
|
67
|
+
background: #d6bdbd;
|
68
|
+
}
|
69
|
+
.close {
|
70
|
+
float: right;
|
71
|
+
margin-left: 4px;
|
72
|
+
margin-top: 1px;
|
73
|
+
font-size: 10px;
|
74
|
+
}
|
75
|
+
.svg-inline--fa {
|
76
|
+
transform: scale(0.7, 0.9);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
.hover-operate-icon {
|
81
|
+
// &.show {
|
82
|
+
// display: flex;
|
83
|
+
// justify-content: flex-end;
|
84
|
+
// align-items: center;
|
85
|
+
// }
|
86
|
+
.ant-dropdown-trigger {
|
87
|
+
float: right;
|
88
|
+
}
|
89
|
+
.ant-btn {
|
90
|
+
margin: 0 8px 0 0;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
.task-card-editable-name {
|
94
|
+
display: flex;
|
95
|
+
justify-content: flex-end;
|
96
|
+
.ant-btn {
|
97
|
+
margin-right: 8px;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
.task-card-item{
|
101
|
+
.task-icon-move {
|
102
|
+
opacity: 0;
|
103
|
+
cursor: move;
|
104
|
+
font-size: 16px;
|
105
|
+
}
|
106
|
+
&:hover .task-icon-move,
|
107
|
+
.task-icon-move.show {
|
108
|
+
opacity: 1;
|
109
|
+
}
|
110
|
+
&.opacity {
|
111
|
+
opacity: 0.5;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
}
|
116
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { IDocument } from "@voplus/morpho-document";
|
2
|
+
export declare class State {
|
3
|
+
document: IDocument;
|
4
|
+
id: string;
|
5
|
+
ids: string[];
|
6
|
+
members: any[];
|
7
|
+
name: string;
|
8
|
+
editable: boolean;
|
9
|
+
loading: boolean;
|
10
|
+
visible: boolean;
|
11
|
+
visibleQuickView: boolean;
|
12
|
+
modalType: string;
|
13
|
+
isHover: boolean;
|
14
|
+
reload: boolean;
|
15
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { observable } from "mobx";
|
3
|
+
export class State {
|
4
|
+
constructor() {
|
5
|
+
this.id = "";
|
6
|
+
this.ids = [];
|
7
|
+
this.members = [];
|
8
|
+
this.name = "";
|
9
|
+
this.editable = false;
|
10
|
+
this.loading = false;
|
11
|
+
this.visible = false;
|
12
|
+
this.visibleQuickView = false;
|
13
|
+
this.modalType = "";
|
14
|
+
this.isHover = false;
|
15
|
+
this.reload = false;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
__decorate([
|
19
|
+
observable
|
20
|
+
], State.prototype, "document", void 0);
|
21
|
+
__decorate([
|
22
|
+
observable
|
23
|
+
], State.prototype, "id", void 0);
|
24
|
+
__decorate([
|
25
|
+
observable
|
26
|
+
], State.prototype, "ids", void 0);
|
27
|
+
__decorate([
|
28
|
+
observable
|
29
|
+
], State.prototype, "members", void 0);
|
30
|
+
__decorate([
|
31
|
+
observable
|
32
|
+
], State.prototype, "name", void 0);
|
33
|
+
__decorate([
|
34
|
+
observable
|
35
|
+
], State.prototype, "editable", void 0);
|
36
|
+
__decorate([
|
37
|
+
observable
|
38
|
+
], State.prototype, "loading", void 0);
|
39
|
+
__decorate([
|
40
|
+
observable
|
41
|
+
], State.prototype, "visible", void 0);
|
42
|
+
__decorate([
|
43
|
+
observable
|
44
|
+
], State.prototype, "visibleQuickView", void 0);
|
45
|
+
__decorate([
|
46
|
+
observable
|
47
|
+
], State.prototype, "modalType", void 0);
|
48
|
+
__decorate([
|
49
|
+
observable
|
50
|
+
], State.prototype, "isHover", void 0);
|
51
|
+
__decorate([
|
52
|
+
observable
|
53
|
+
], State.prototype, "reload", void 0);
|
54
|
+
//# sourceMappingURL=state.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/BoardView/components/DocumentCard/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,MAAM,OAAO,KAAK;IAAlB;QAEoB,OAAE,GAAW,EAAE,CAAC;QAChB,QAAG,GAAa,EAAE,CAAC;QACnB,YAAO,GAAU,EAAE,CAAC;QACpB,SAAI,GAAW,EAAE,CAAC;QAClB,aAAQ,GAAY,KAAK,CAAC;QAC1B,YAAO,GAAY,KAAK,CAAC;QACzB,YAAO,GAAY,KAAK,CAAC;QACzB,qBAAgB,GAAY,KAAK,CAAC;QAClC,cAAS,GAAW,EAAE,CAAC;QACvB,YAAO,GAAY,KAAK,CAAC;QACzB,WAAM,GAAY,KAAK,CAAC;IAC5C,CAAC;CAAA;AAZY;IAAX,UAAU;uCAA4B;AAC3B;IAAX,UAAU;iCAAwB;AACvB;IAAX,UAAU;kCAA2B;AAC1B;IAAX,UAAU;sCAA4B;AAC3B;IAAX,UAAU;mCAA0B;AACzB;IAAX,UAAU;uCAAkC;AACjC;IAAX,UAAU;sCAAiC;AAChC;IAAX,UAAU;sCAAiC;AAChC;IAAX,UAAU;+CAA0C;AACzC;IAAX,UAAU;wCAA+B;AAC9B;IAAX,UAAU;sCAAiC;AAChC;IAAX,UAAU;qCAAgC"}
|
@@ -1,10 +1,11 @@
|
|
1
|
-
|
2
|
-
declare const
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: React.FunctionComponent<{
|
3
3
|
id: string;
|
4
4
|
addAble?: boolean | undefined;
|
5
5
|
onAddAble?: ((params?: boolean | undefined) => void) | undefined;
|
6
6
|
checked?: boolean | undefined;
|
7
7
|
checkAll?: boolean | undefined;
|
8
8
|
onCheck?: ((params?: any) => void) | undefined;
|
9
|
-
|
10
|
-
|
9
|
+
onLinkNum?: ((params?: any) => void) | undefined;
|
10
|
+
}>;
|
11
|
+
export default _default;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { Checkbox } from "@voplus/antd";
|
2
|
+
import SortDnD from "@voplus/morpho-ui/es/controls/SortDnD";
|
3
|
+
import { useObserver, observer } from "mobx-react-lite";
|
4
|
+
import React, { useEffect, useState } from "react";
|
5
|
+
import { Scrollbars } from "react-custom-scrollbars";
|
6
|
+
import NewTaskForm from "../NewTaskForm";
|
7
|
+
import TaskCard from "../TaskCard";
|
8
|
+
import DocumentCard from "../DocumentCard";
|
9
|
+
import { State } from "./state";
|
10
|
+
import { useOnNewLink, useOnDeleteLink, useDocumentLinkListEffect } from "@voplus/morpho-document";
|
11
|
+
import { useListOptionsContext } from "@voplus/morpho-ui";
|
12
|
+
const LinkList = (props) => {
|
13
|
+
const [state] = useState(new State());
|
14
|
+
const lo = useListOptionsContext();
|
15
|
+
useEffect(() => {
|
16
|
+
state.addBoardAble = props.addAble;
|
17
|
+
}, [props.addAble]);
|
18
|
+
useEffect(() => {
|
19
|
+
state.checkIds = props.checkAll ? state.links.map(({ id }) => id) : [];
|
20
|
+
}, [props.checkAll]);
|
21
|
+
useDocumentLinkListEffect(props.id, list => {
|
22
|
+
props.onLinkNum(list.length);
|
23
|
+
state.links = list;
|
24
|
+
}, lo.listOptions);
|
25
|
+
useOnNewLink((s, doc) => {
|
26
|
+
if (doc.left.id === props.id) {
|
27
|
+
state.links.push(doc);
|
28
|
+
props.onLinkNum(state.links.length);
|
29
|
+
}
|
30
|
+
});
|
31
|
+
useOnDeleteLink((s, doc) => {
|
32
|
+
if (doc.left.id === props.id) {
|
33
|
+
state.links.splice(state.links.findIndex(item => item.id === doc.id), 1);
|
34
|
+
props.onLinkNum(state.links.length);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
const onAddAble = () => {
|
38
|
+
state.addBoardAble = !state.addBoardAble;
|
39
|
+
props.onAddAble(state.addBoardAble);
|
40
|
+
};
|
41
|
+
const moveAfter = async (id, afterId, list) => {
|
42
|
+
console.log("move", id, afterId, list);
|
43
|
+
// await boards.moveAfter(id, afterId);
|
44
|
+
// state.links = list;
|
45
|
+
};
|
46
|
+
const onCheck = (checkedValues) => {
|
47
|
+
state.checkIds = checkedValues;
|
48
|
+
const checkAll = checkedValues.length === state.links.length;
|
49
|
+
props.onCheck(checkAll);
|
50
|
+
};
|
51
|
+
return useObserver(() => (React.createElement(Scrollbars, null,
|
52
|
+
React.createElement(Checkbox.Group, { value: state.checkIds, onChange: onCheck, style: { width: "100%" } },
|
53
|
+
React.createElement(SortDnD, { list: state.links, moveAfter: moveAfter, text: (task, index, connectDragSource) => (React.createElement(React.Fragment, null,
|
54
|
+
task.right.type === "Task" && (React.createElement(TaskCard, { id: task.right.id, linkId: task.id, leftId: task.left.id, multiple: props.checked, connectDragSource: connectDragSource })),
|
55
|
+
task.right.type === "Document" && (React.createElement(DocumentCard, { id: task.right.id, linkId: task.id, leftId: task.left.id, multiple: props.checked, connectDragSource: connectDragSource })))) })),
|
56
|
+
state.addBoardAble && React.createElement(NewTaskForm, { parentId: props.id }),
|
57
|
+
React.createElement("span", { className: "addTask", onClick: onAddAble }, "+ NEW TASK"))));
|
58
|
+
};
|
59
|
+
export default observer(LinkList);
|
60
|
+
//# sourceMappingURL=index.js.map
|