@voplus/morpho-workspace 10.0.8 → 10.0.9
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/modules/tasks/components/TaskItem/subTaskItem.css +1 -1
- package/es/modules/work/components/WorkItem/index.d.ts +0 -2
- package/es/modules/work/components/WorkItem/index.js +10 -12
- package/es/modules/work/components/WorkItem/index.js.map +1 -1
- package/es/modules/work/components/WorkTableList/TableCell.d.ts +7 -1
- package/es/modules/work/components/WorkTableList/TableCell.js +26 -13
- package/es/modules/work/components/WorkTableList/TableCell.js.map +1 -1
- package/package.json +1 -1
- package/es/modules/work/components/WorkItem/index.css +0 -8
|
@@ -5,24 +5,18 @@ import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
|
|
5
5
|
import DocumentItem from "@voplus/morpho-document/es/components/DocumentItem/DocumentItem2";
|
|
6
6
|
import WorkDataIconBar from "../../controls/WorkDataIconBar";
|
|
7
7
|
import WorkStatusLabel from "../../controls/WorkStatusLabel";
|
|
8
|
-
import classnames from "classnames";
|
|
9
8
|
import { FontAwesomeIcon as FAIcon, faAlarmExclamationRegular } from "@voplus/morpho-ui/es/faIcons";
|
|
10
9
|
import { observe } from "@voplus/morpho-ui";
|
|
11
|
-
|
|
10
|
+
const HIDDEN_DUE_STATUSES = new Set(["Done", "Closed", "Rejected"]);
|
|
12
11
|
const WorkItem = (props) => {
|
|
13
12
|
const { id } = props;
|
|
14
13
|
const work = useWork(id);
|
|
15
14
|
const workStore = useWorkStore();
|
|
16
|
-
return observe(() => (React.createElement(DocumentItem, { id: work.id,
|
|
17
|
-
React.createElement("div", {
|
|
18
|
-
React.createElement(WorkStatusLabel, { status: work.workStatus, editable: !work.readonly, onChange:
|
|
19
|
-
work.workStatus
|
|
20
|
-
|
|
21
|
-
work.workStatus !== "Rejected" && (React.createElement(Tooltip, { title: "Due Date" },
|
|
22
|
-
React.createElement("div", { className: "due-date-sub" },
|
|
23
|
-
React.createElement(FAIcon, { icon: faAlarmExclamationRegular }),
|
|
24
|
-
React.createElement("span", { className: "margin-left-5" }, work.due ? React.createElement(UTCShortDate, { value: work.due, format: "DD MMM YYYY" }) : "no data"))))) })));
|
|
25
|
-
function workStatusEdit(workStatus) {
|
|
15
|
+
return observe(() => (React.createElement(DocumentItem, { id: work.id, quickDataBar: React.createElement(WorkDataIconBar, { id: id }), rightContent: React.createElement("div", { className: "work-statue-due-date" },
|
|
16
|
+
React.createElement("div", { className: "text-right" },
|
|
17
|
+
React.createElement(WorkStatusLabel, { status: work.workStatus, editable: !work.readonly, onChange: handleWorkStatusChange })),
|
|
18
|
+
!HIDDEN_DUE_STATUSES.has(work.workStatus) && React.createElement(DueDateDisplay, { due: work.due })) })));
|
|
19
|
+
function handleWorkStatusChange(workStatus) {
|
|
26
20
|
workStore.edit(work.id, {
|
|
27
21
|
data: { workStatus },
|
|
28
22
|
error: (error) => {
|
|
@@ -31,5 +25,9 @@ const WorkItem = (props) => {
|
|
|
31
25
|
});
|
|
32
26
|
}
|
|
33
27
|
};
|
|
28
|
+
const DueDateDisplay = ({ due }) => (React.createElement(Tooltip, { title: "Due Date" },
|
|
29
|
+
React.createElement("div", { className: "h-[15px] text-font-grey text-xs text-center" },
|
|
30
|
+
React.createElement(FAIcon, { icon: faAlarmExclamationRegular }),
|
|
31
|
+
React.createElement("span", { className: "ml-[5px]" }, due ? React.createElement(UTCShortDate, { value: due, format: "DD MMM YYYY" }) : "no data"))));
|
|
34
32
|
export default WorkItem;
|
|
35
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB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AS,EAAC,YAAY;gBAC1B,oBAAC,eAAe,IACf,MAAM,EAAE,IAAI,CAAC,UAAW,EACxB,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,EACxB,QAAQ,EAAE,sBAAsB,GAC/B,CACG;YACL,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAW,CAAC,IAAI,oBAAC,cAAc,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,GAAI,CAC3E,GAEN,CACF,CAAC,CAAC;IAEH,SAAS,sBAAsB,CAAC,UAAkB;QACjD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;YACvB,IAAI,EAAE,EAAE,UAAU,EAAE;YACpB,KAAK,EAAE,CAAC,KAAY,EAAE,EAAE;gBACvB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,EAAE,GAAG,EAAoB,EAAE,EAAE,CAAC,CACrD,oBAAC,OAAO,IAAC,KAAK,EAAC,UAAU;IACxB,6BAAK,SAAS,EAAC,6CAA6C;QAC3D,oBAAC,MAAM,IAAC,IAAI,EAAE,yBAAyB,GAAI;QAC3C,8BAAM,SAAS,EAAC,UAAU,IACxB,GAAG,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAC,aAAa,GAAG,CAAC,CAAC,CAAC,SAAS,CAC9D,CACF,CACG,CACV,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
interface TableCellProps {
|
|
3
|
+
dataIndex?: string;
|
|
4
|
+
record?: any;
|
|
5
|
+
rowIndex?: number;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const TableCell: (props: TableCellProps) => React.JSX.Element;
|
|
3
9
|
export default TableCell;
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
|
3
3
|
import { Open } from "@voplus/morpho-document/es/controls/DocumentToolbar/buttons";
|
|
4
|
-
import { useDocumentStore } from "@voplus/morpho-document-core";
|
|
4
|
+
import { useDocumentStore, useMetaStore } from "@voplus/morpho-document-core";
|
|
5
5
|
import { FontAwesomeIcon as FAIcon, faEllipsisVerticalSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
6
|
-
import { useMetaStore } from "@voplus/morpho-document-core";
|
|
7
6
|
import TagView from "@voplus/morpho-org/es/modules/tag/TagView/TagView2";
|
|
8
7
|
import AvatarList from "@voplus/morpho-org/es/components/AvatarList";
|
|
9
8
|
import DocumentToolbar from "@voplus/morpho-document/es/controls/DocumentToolbar";
|
|
10
9
|
import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
|
11
10
|
import WorkDataIconBar from "../../controls/WorkDataIconBar";
|
|
12
11
|
const TableCell = (props) => {
|
|
13
|
-
const { dataIndex, record,
|
|
12
|
+
const { dataIndex, record, children } = props;
|
|
14
13
|
const meta = useMetaStore();
|
|
15
14
|
const store = useDocumentStore();
|
|
16
|
-
return observe(() => {
|
|
17
|
-
return (React.createElement("td", { ...restProps }, dataIndex === "name" ? (React.createElement(React.Fragment, null,
|
|
18
|
-
React.createElement("div", { className: "table-item-name" },
|
|
19
|
-
record.name,
|
|
20
|
-
"-",
|
|
21
|
-
record.number),
|
|
22
|
-
React.createElement("div", { className: "table-item-dataIcon" },
|
|
23
|
-
React.createElement(WorkDataIconBar, { id: record.id })))) : dataIndex === "due" ? (React.createElement(UTCShortDate, { value: record.due, format: "DD MMM YYYY" })) : dataIndex === "tags" ? (React.createElement(TagView, { id: record.id, tags: record.tags, items: store.items, maxCount: 1 })) : dataIndex === "contact" ? (React.createElement(AvatarList, { editable: false, list: record.contact ? [record.contact] : [] })) : dataIndex === "menu" ? (React.createElement(DocumentToolbar, { id: record.id, moreProps: { icon: React.createElement(FAIcon, { icon: faEllipsisVerticalSolid }) } },
|
|
24
|
-
React.createElement(Open, { url: meta.getRoute(record) }))) : (children)));
|
|
25
|
-
});
|
|
15
|
+
return observe(() => (React.createElement("td", { ...props }, renderCell(dataIndex, record, children, { meta, store }))));
|
|
26
16
|
};
|
|
17
|
+
function renderCell(dataIndex, record, children, { meta, store }) {
|
|
18
|
+
switch (dataIndex) {
|
|
19
|
+
case "name":
|
|
20
|
+
return (React.createElement(React.Fragment, null,
|
|
21
|
+
React.createElement("div", { className: "table-item-name" },
|
|
22
|
+
record.name,
|
|
23
|
+
"-",
|
|
24
|
+
record.number),
|
|
25
|
+
React.createElement("div", { className: "table-item-dataIcon" },
|
|
26
|
+
React.createElement(WorkDataIconBar, { id: record.id }))));
|
|
27
|
+
case "due":
|
|
28
|
+
return React.createElement(UTCShortDate, { value: record.due, format: "DD MMM YYYY" });
|
|
29
|
+
case "tags":
|
|
30
|
+
return React.createElement(TagView, { id: record.id, tags: record.tags, items: store.items, maxCount: 1 });
|
|
31
|
+
case "contact":
|
|
32
|
+
return React.createElement(AvatarList, { editable: false, list: record.contact ? [record.contact] : [] });
|
|
33
|
+
case "menu":
|
|
34
|
+
return (React.createElement(DocumentToolbar, { id: record.id, moreProps: { icon: React.createElement(FAIcon, { icon: faEllipsisVerticalSolid }) } },
|
|
35
|
+
React.createElement(Open, { url: meta.getRoute(record) })));
|
|
36
|
+
default:
|
|
37
|
+
return children;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
27
40
|
export default TableCell;
|
|
28
41
|
//# sourceMappingURL=TableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../../src/modules/work/components/WorkTableList/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBA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