@voplus/morpho-workspace 6.1.21 → 6.1.23
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/notification/components/AllNewNotificationItem/index.js +10 -11
- package/es/modules/notification/components/AllNewNotificationItem/index.js.map +1 -1
- package/es/modules/notification/components/AllNewNotificationItem/index.less +11 -16
- package/es/modules/notification/components/AllNewNotificationList/index.d.ts +0 -3
- package/es/modules/notification/components/AllNewNotificationList/index.js +20 -34
- package/es/modules/notification/components/AllNewNotificationList/index.js.map +1 -1
- package/es/modules/notification/components/AllNewNotificationTableItem/index.d.ts +7 -0
- package/es/modules/notification/components/AllNewNotificationTableItem/index.js +33 -0
- package/es/modules/notification/components/AllNewNotificationTableItem/index.js.map +1 -0
- package/es/modules/notification/components/AllNewNotificationTableItem/index.less +39 -0
- package/es/modules/notification/components/AllNewNotificationTableList/index.d.ts +29 -0
- package/es/modules/notification/components/AllNewNotificationTableList/index.js +90 -0
- package/es/modules/notification/components/AllNewNotificationTableList/index.js.map +1 -0
- package/es/modules/notification/components/NotificationOverview/index.d.ts +2 -2
- package/es/modules/notification/components/NotificationOverview/index.js +15 -8
- package/es/modules/notification/components/NotificationOverview/index.js.map +1 -1
- package/es/modules/notification/components/NotificationOverview/state.d.ts +6 -0
- package/es/modules/notification/components/NotificationOverview/state.js +47 -0
- package/es/modules/notification/components/NotificationOverview/state.js.map +1 -0
- package/es/modules/notification/pages/NotificationListPage/index.js +24 -31
- package/es/modules/notification/pages/NotificationListPage/index.js.map +1 -1
- package/es/modules/notification/pages/NotificationListPage/state.d.ts +3 -0
- package/es/modules/notification/pages/NotificationListPage/state.js +40 -1
- package/es/modules/notification/pages/NotificationListPage/state.js.map +1 -1
- package/es/modules/tasks/components/TaskOverview/index.d.ts +4 -3
- package/es/modules/tasks/components/TaskOverview/index.js +22 -12
- package/es/modules/tasks/components/TaskOverview/index.js.map +1 -1
- package/es/modules/tasks/components/TaskOverview/state.d.ts +8 -0
- package/es/modules/tasks/components/TaskOverview/state.js +65 -0
- package/es/modules/tasks/components/TaskOverview/state.js.map +1 -0
- package/es/modules/tasks/pages/TaskListPage/index.js +26 -31
- package/es/modules/tasks/pages/TaskListPage/index.js.map +1 -1
- package/es/modules/tasks/pages/TaskListPage/state.d.ts +7 -2
- package/es/modules/tasks/pages/TaskListPage/state.js +84 -13
- package/es/modules/tasks/pages/TaskListPage/state.js.map +1 -1
- package/es/modules/work/components/WorkOverview/index.d.ts +4 -4
- package/es/modules/work/components/WorkOverview/index.js +24 -12
- package/es/modules/work/components/WorkOverview/index.js.map +1 -1
- package/es/modules/work/components/WorkOverview/state.d.ts +8 -0
- package/es/modules/work/components/WorkOverview/state.js +65 -0
- package/es/modules/work/components/WorkOverview/state.js.map +1 -0
- package/es/modules/work/pages/WorkListPage2/index.js +9 -19
- package/es/modules/work/pages/WorkListPage2/index.js.map +1 -1
- package/es/modules/work/pages/WorkListPage2/state.d.ts +7 -2
- package/es/modules/work/pages/WorkListPage2/state.js +86 -24
- package/es/modules/work/pages/WorkListPage2/state.js.map +1 -1
- package/es/modules/work/work-error/components/WorkErrorPropertiesView/index.js +6 -5
- package/es/modules/work/work-error/components/WorkErrorPropertiesView/index.js.map +1 -1
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/index.d.ts +4 -2
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/index.js +20 -10
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/index.js.map +1 -1
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/state.d.ts +8 -0
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/state.js +63 -0
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/state.js.map +1 -0
- package/es/modules/work/work-schedule/pages/WorkScheduleListPage/index.js +26 -23
- package/es/modules/work/work-schedule/pages/WorkScheduleListPage/index.js.map +1 -1
- package/es/modules/work/work-schedule/pages/WorkScheduleListPage/state.d.ts +7 -2
- package/es/modules/work/work-schedule/pages/WorkScheduleListPage/state.js +92 -19
- package/es/modules/work/work-schedule/pages/WorkScheduleListPage/state.js.map +1 -1
- package/es/modules/work/work-type/components/WorkTypeHeader/index.d.ts +1 -0
- package/es/modules/work/work-type/components/WorkTypeHeader/index.js +3 -2
- package/es/modules/work/work-type/components/WorkTypeHeader/index.js.map +1 -1
- package/es/modules/work/work-type/components/WorkTypePropertiesView/index.js +1 -1
- package/es/modules/work/work-type/components/WorkTypePropertiesView/index.js.map +1 -1
- package/package.json +1 -1
- package/es/modules/notification/components/NotificationOverview/index.less +0 -24
- package/es/modules/tasks/components/TaskOverview/index.less +0 -49
- package/es/modules/work/components/WorkOverview/index.less +0 -49
- package/es/modules/work/work-schedule/components/WorkScheduleOverview/index.less +0 -58
- /package/es/modules/notification/components/{AllNewNotificationList → AllNewNotificationTableList}/index.less +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from "react";
|
1
|
+
import React, { useState } from "react";
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
3
3
|
import { useNotifications } from "../../../../data/notification";
|
4
4
|
import { Open } from "@voplus/morpho-org/es/controls/ToolBar/items";
|
@@ -6,28 +6,27 @@ import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnI
|
|
6
6
|
import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
7
7
|
import NotificationMenu from "../../controls/NotificationMenu";
|
8
8
|
import AvatarList from "@voplus/morpho-org/es/components/AvatarList";
|
9
|
-
import NotificationStatusLabel from "../../controls/NotificationStatusLabel";
|
10
9
|
import ItemFunction from "@voplus/morpho-org/es/controls/ItemFunction";
|
11
10
|
import ToolBar from "@voplus/morpho-org/es/controls/ToolBar";
|
12
11
|
import PropertiesView from "../NotificationPropertiesView";
|
13
12
|
import Routes from "../../../Routes";
|
13
|
+
import { Tag } from "antd";
|
14
14
|
import "./index.less";
|
15
15
|
const NotificationItem = (props) => {
|
16
16
|
const { id } = props;
|
17
17
|
const notification = useNotifications(id);
|
18
|
-
|
18
|
+
const [isHover, setIsHover] = useState(false);
|
19
|
+
return observe(() => (React.createElement(ItemFunction, { className: "all-new-notification-item_2", onMouseOver: () => setIsHover(true), onMouseLeave: () => setIsHover(false), propertiesView: React.createElement(PropertiesView, { id: id }) },
|
19
20
|
React.createElement(ColumnItem, { className: "notification-column-item" },
|
20
|
-
React.createElement(ColumnItemCol, { span:
|
21
|
+
React.createElement(ColumnItemCol, { span: 12 },
|
21
22
|
React.createElement("div", { className: "notification-item-name" }, notification.subject)),
|
22
|
-
React.createElement(ColumnItemCol, { span: 4 },
|
23
|
+
React.createElement(ColumnItemCol, { span: 4, label: "Created By" },
|
23
24
|
React.createElement(AvatarList, { className: "notification-item-avatar", editable: false, list: notification.createdBy ? [notification.createdBy] : [] })),
|
24
|
-
React.createElement(ColumnItemCol, { span: 4 },
|
25
|
+
React.createElement(ColumnItemCol, { span: 4, label: "Date" },
|
25
26
|
React.createElement(UTCShortDate, { value: notification.createDate, format: "DD MMM YYYY" })),
|
26
|
-
React.createElement(ColumnItemCol, { span: 4 },
|
27
|
-
|
28
|
-
React.createElement(
|
29
|
-
React.createElement(Open, { url: Routes.NotificationDefaultView.getUrl(id) }),
|
30
|
-
notification.draft && React.createElement(NotificationMenu, { id: id, closeAside: true })))))));
|
27
|
+
React.createElement(ColumnItemCol, { span: 4, align: "flex-end" }, isHover ? (React.createElement(ToolBar, { more: false, id: id },
|
28
|
+
React.createElement(Open, { url: Routes.NotificationDefaultView.getUrl(id) }),
|
29
|
+
notification.draft && React.createElement(NotificationMenu, { id: id, closeAside: true }))) : notification.draft ? (React.createElement(Tag, { className: "notification-status", color: "#ffe58f" }, "Draft")) : null)))));
|
31
30
|
};
|
32
31
|
export default NotificationItem;
|
33
32
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/AllNewNotificationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/AllNewNotificationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,UAAU,MAAM,6CAA6C,CAAC;AACrE,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,OAAO,MAAM,wCAAwC,CAAC;AAC7D,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,cAAc,CAAC;AAEtB,MAAM,gBAAgB,GAAG,CAAC,KAA2C,EAAE,EAAE;IACxE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,MAAM,YAAY,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAE1C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,YAAY,IACZ,SAAS,EAAC,6BAA6B,EACvC,WAAW,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACnC,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EACrC,cAAc,EAAE,oBAAC,cAAc,IAAC,EAA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@
|
|
1
1
|
@import "~@voplus/morpho-theme/styles/index.less";
|
2
2
|
|
3
3
|
:global {
|
4
|
-
.all-new-notification-
|
4
|
+
.all-new-notification-item_2 {
|
5
5
|
cursor: pointer;
|
6
|
+
padding: 0 20px;
|
6
7
|
|
7
8
|
&:hover {
|
8
9
|
background-color: #f5f8fd;
|
9
10
|
}
|
10
11
|
|
11
12
|
.notification-item-name {
|
12
|
-
color: #
|
13
|
-
font-weight:
|
14
|
-
|
15
|
-
|
13
|
+
color: #575757;
|
14
|
+
font-weight: 500;
|
15
|
+
word-break: break-all;
|
16
|
+
padding-right: 10px;
|
16
17
|
}
|
17
18
|
|
18
19
|
.notification-item-avatar {
|
19
20
|
.ant-avatar {
|
20
|
-
width: 29px;
|
21
|
-
height: 29px;
|
22
|
-
font-size: 12px;
|
23
|
-
line-height: 29px;
|
24
|
-
font-weight: bold;
|
25
21
|
border-radius: 2px;
|
26
|
-
background: transparent linear-gradient(180deg, @primary-color 0%, #38d6fc 100%) 0% 0% no-repeat
|
27
|
-
padding-box;
|
28
22
|
}
|
29
23
|
}
|
30
24
|
|
31
25
|
.notification-column-item {
|
32
|
-
|
26
|
+
color: #575757;
|
27
|
+
padding: 7px 0;
|
28
|
+
}
|
33
29
|
|
34
|
-
|
35
|
-
|
36
|
-
}
|
30
|
+
.notification-status {
|
31
|
+
margin-inline-end: 0;
|
37
32
|
}
|
38
33
|
}
|
39
34
|
}
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { FilterOption } from "@voplus/morpho-data";
|
3
|
-
import { AllNewNotificationListHeaderProps } from "../AllNewNotificationListHeader";
|
4
|
-
import "./index.less";
|
5
3
|
export type AllNewNotificationListProps = {
|
6
4
|
/** 需要 corporate 或者 customer id */
|
7
5
|
parentId: string;
|
@@ -15,7 +13,6 @@ export type AllNewNotificationListProps = {
|
|
15
13
|
name: string;
|
16
14
|
body: string;
|
17
15
|
};
|
18
|
-
headerProps?: AllNewNotificationListHeaderProps;
|
19
16
|
/** 是否允在 listView 内部打开 aside */
|
20
17
|
asideable?: boolean;
|
21
18
|
filterOptions?: FilterOption[];
|
@@ -1,24 +1,19 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
|
-
import { Row, Col } from "antd";
|
3
2
|
import { useAutoUpdateListData, useNotificationsListEffect, } from "../../../../data/notification";
|
3
|
+
import { useApplicationContext } from "@voplus/morpho-data";
|
4
4
|
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
|
5
|
-
import { observe, useRenderOnChange
|
5
|
+
import { observe, useRenderOnChange } from "@voplus/morpho-ui";
|
6
6
|
import { useUnitStore } from "@voplus/morpho-org";
|
7
|
-
import
|
8
|
-
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
9
|
-
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
10
|
-
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
7
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView";
|
11
8
|
import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
|
12
|
-
import AllNewNotificationListHeader from "../AllNewNotificationListHeader";
|
13
9
|
import NotificationForm from "../NewNotificationForm/NotificationForm";
|
14
10
|
import AllNewNotificationItem from "../AllNewNotificationItem";
|
15
|
-
import "./index.less";
|
16
11
|
const AllNewNotificationList = (props) => {
|
17
12
|
const { parentId, asideable, filterOptions } = props;
|
18
13
|
const layoutContext = useViewLayoutContext();
|
14
|
+
const { user } = useApplicationContext();
|
19
15
|
const unitStore = useUnitStore();
|
20
16
|
const [recipients, setRecipients] = useState();
|
21
|
-
const [asideContext] = useState(asideable ? AsideContent.createContext() : useAsideContentContext());
|
22
17
|
useEffect(() => {
|
23
18
|
var _a;
|
24
19
|
if ((_a = props.unitForRecipients) === null || _a === void 0 ? void 0 : _a.id) {
|
@@ -47,33 +42,24 @@ const AllNewNotificationList = (props) => {
|
|
47
42
|
Total: false,
|
48
43
|
...list.filters.options,
|
49
44
|
});
|
50
|
-
const Content = observe(() => (React.createElement("div", { className: "all-new-notification-list" },
|
51
|
-
React.createElement(AllNewNotificationListHeader, { ...props.headerProps, onAdd: () => asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
|
52
|
-
span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
|
53
|
-
}) }),
|
54
|
-
React.createElement("div", { className: "all-new-notification-body" },
|
55
|
-
React.createElement(Row, { align: "middle", className: "all-new-list-fixed-header" },
|
56
|
-
React.createElement(Col, { span: 8 },
|
57
|
-
React.createElement(FAIcon, { icon: faThumbtack }),
|
58
|
-
" ",
|
59
|
-
React.createElement("span", { className: "sub-title" }, "Subject")),
|
60
|
-
React.createElement(Col, { span: 4 },
|
61
|
-
React.createElement(FAIcon, { icon: faUserGroup }),
|
62
|
-
" ",
|
63
|
-
React.createElement("span", { className: "sub-title" }, "Create by")),
|
64
|
-
React.createElement(Col, { span: 4 },
|
65
|
-
React.createElement(FAIcon, { icon: faCalendarDays }),
|
66
|
-
" ",
|
67
|
-
React.createElement("span", { className: "sub-title" }, "Date")),
|
68
|
-
React.createElement(Col, { span: 4 },
|
69
|
-
React.createElement(FAIcon, { icon: faBarsProgress }),
|
70
|
-
" ",
|
71
|
-
React.createElement("span", { className: "sub-title" }, "Status")),
|
72
|
-
React.createElement(Col, { span: 4 })),
|
73
|
-
React.createElement(ListView, { className: "all-new-list-view", headerProps: { visible: false }, asideable: false, renderItem: ({ item }) => (React.createElement(AllNewNotificationItem, { key: item.id, id: item.id })) })))));
|
74
45
|
return observe(() => {
|
75
|
-
return (React.createElement(ListDataContext.Provider, { value: list },
|
46
|
+
return (React.createElement(ListDataContext.Provider, { value: list },
|
47
|
+
React.createElement(ListView, { className: "all-new-list-view", headerProps: {
|
48
|
+
headerToolProps: {
|
49
|
+
visible: true,
|
50
|
+
/* 暂时直接检查 是不是外部用户, 是就不显示 */
|
51
|
+
addAble: !user.info.guest,
|
52
|
+
sortable: false,
|
53
|
+
onAdd: onAdd,
|
54
|
+
searchOptions: { placeholder: "Search in notifications" },
|
55
|
+
},
|
56
|
+
}, asideable: asideable, renderItem: ({ item }) => (React.createElement(AllNewNotificationItem, { key: item.id, id: item.id })) })));
|
76
57
|
});
|
58
|
+
function onAdd(asideContext) {
|
59
|
+
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
|
60
|
+
span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
|
61
|
+
});
|
62
|
+
}
|
77
63
|
function filters() {
|
78
64
|
let filter = [];
|
79
65
|
if (parentId)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/AllNewNotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/AllNewNotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAGN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAgB,qBAAqB,EAAgB,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO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AE,KAAK,CAAC,QAAQ,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,KAAK,CAAC,eAAe,GACrC,EACF;YACC,IAAI,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,YAAY,EAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;SACnE,CACD,CAAC;IACH,CAAC;IAED,SAAS,OAAO;QACf,IAAI,MAAM,GAAmB,EAAE,CAAC;QAChC,IAAI,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE3E,IAAI,aAAa;YAAE,MAAM,GAAG,aAAa,CAAC;QAE1C,OAAO,MAAM,CAAC;IACf,CAAC;AACF,CAAC,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG;IACrC,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { observe } from "@voplus/morpho-ui";
|
3
|
+
import { useNotifications } from "../../../../data/notification";
|
4
|
+
import { Open } from "@voplus/morpho-org/es/controls/ToolBar/items";
|
5
|
+
import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnItem";
|
6
|
+
import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
7
|
+
import NotificationMenu from "../../controls/NotificationMenu";
|
8
|
+
import AvatarList from "@voplus/morpho-org/es/components/AvatarList";
|
9
|
+
import NotificationStatusLabel from "../../controls/NotificationStatusLabel";
|
10
|
+
import ItemFunction from "@voplus/morpho-org/es/controls/ItemFunction";
|
11
|
+
import ToolBar from "@voplus/morpho-org/es/controls/ToolBar";
|
12
|
+
import PropertiesView from "../NotificationPropertiesView";
|
13
|
+
import Routes from "../../../Routes";
|
14
|
+
import "./index.less";
|
15
|
+
const AllNewNotificationTableItem = (props) => {
|
16
|
+
const { id } = props;
|
17
|
+
const notification = useNotifications(id);
|
18
|
+
return observe(() => (React.createElement(ItemFunction, { className: "all-new-notification-item", propertiesView: React.createElement(PropertiesView, { id: id }) },
|
19
|
+
React.createElement(ColumnItem, { className: "notification-column-item" },
|
20
|
+
React.createElement(ColumnItemCol, { span: 8 },
|
21
|
+
React.createElement("div", { className: "notification-item-name" }, notification.subject)),
|
22
|
+
React.createElement(ColumnItemCol, { span: 4 },
|
23
|
+
React.createElement(AvatarList, { className: "notification-item-avatar", editable: false, list: notification.createdBy ? [notification.createdBy] : [] })),
|
24
|
+
React.createElement(ColumnItemCol, { span: 4 },
|
25
|
+
React.createElement(UTCShortDate, { value: notification.createDate, format: "DD MMM YYYY" })),
|
26
|
+
React.createElement(ColumnItemCol, { span: 4 }, notification.draft ? (React.createElement(NotificationStatusLabel, { status: notification.draft ? "Draft" : "" })) : null),
|
27
|
+
React.createElement(ColumnItemCol, { span: 4, align: "flex-end" },
|
28
|
+
React.createElement(ToolBar, { more: false, id: id },
|
29
|
+
React.createElement(Open, { url: Routes.NotificationDefaultView.getUrl(id) }),
|
30
|
+
notification.draft && React.createElement(NotificationMenu, { id: id, closeAside: true })))))));
|
31
|
+
};
|
32
|
+
export default AllNewNotificationTableItem;
|
33
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/AllNewNotificationTableItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0CAA0C,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ACpB,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CACrB,oBAAC,uBAAuB,IAAC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAI,CACtE,CAAC,CAAC,CAAC,IAAI,CACO;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,UAAU;gBACvC,oBAAC,OAAO,IAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;oBAC3B,oBAAC,IAAI,IAAC,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,GAAI;oBACvD,YAAY,CAAC,KAAK,IAAI,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CAC5D,CACK,CACJ,CACC,CACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
@import "~@voplus/morpho-theme/styles/index.less";
|
2
|
+
|
3
|
+
:global {
|
4
|
+
.all-new-notification-item {
|
5
|
+
cursor: pointer;
|
6
|
+
|
7
|
+
&:hover {
|
8
|
+
background-color: #f5f8fd;
|
9
|
+
}
|
10
|
+
|
11
|
+
.notification-item-name {
|
12
|
+
color: #5d5d5d;
|
13
|
+
font-weight: bold;
|
14
|
+
font-size: 14px;
|
15
|
+
line-height: 19px;
|
16
|
+
}
|
17
|
+
|
18
|
+
.notification-item-avatar {
|
19
|
+
.ant-avatar {
|
20
|
+
width: 29px;
|
21
|
+
height: 29px;
|
22
|
+
font-size: 12px;
|
23
|
+
line-height: 29px;
|
24
|
+
font-weight: bold;
|
25
|
+
border-radius: 2px;
|
26
|
+
background: transparent linear-gradient(180deg, @primary-color 0%, #38d6fc 100%) 0% 0% no-repeat
|
27
|
+
padding-box;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
.notification-column-item {
|
32
|
+
padding: 7px 20px;
|
33
|
+
|
34
|
+
.ant-row {
|
35
|
+
min-height: 50px;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { FilterOption } from "@voplus/morpho-data";
|
3
|
+
import { AllNewNotificationListHeaderProps } from "../AllNewNotificationListHeader";
|
4
|
+
import "./index.less";
|
5
|
+
export type AllNewNotificationTableListProps = {
|
6
|
+
/** 需要 corporate 或者 customer id */
|
7
|
+
parentId: string;
|
8
|
+
/** 如传入 unit 是 Organization, 并且 mainContacts 有内容, Recipients 会自动显示 mainContacts 的内容 */
|
9
|
+
unitForRecipients?: {
|
10
|
+
id: string;
|
11
|
+
name: string;
|
12
|
+
};
|
13
|
+
defaultTemplate?: {
|
14
|
+
id: string;
|
15
|
+
name: string;
|
16
|
+
body: string;
|
17
|
+
};
|
18
|
+
headerProps?: AllNewNotificationListHeaderProps;
|
19
|
+
/** 是否允在 listView 内部打开 aside */
|
20
|
+
asideable?: boolean;
|
21
|
+
filterOptions?: FilterOption[];
|
22
|
+
};
|
23
|
+
declare const AllNewNotificationTableList: {
|
24
|
+
(props: AllNewNotificationTableListProps): React.JSX.Element;
|
25
|
+
defaultProps: {
|
26
|
+
asideable: boolean;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
export default AllNewNotificationTableList;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import { Row, Col } from "antd";
|
3
|
+
import { useAutoUpdateListData, useNotificationsListEffect, } from "../../../../data/notification";
|
4
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
|
5
|
+
import { observe, useRenderOnChange, useAsideContentContext } from "@voplus/morpho-ui";
|
6
|
+
import { useUnitStore } from "@voplus/morpho-org";
|
7
|
+
import { faBarsProgress, faThumbtack, faUserGroup, faCalendarDays, } from "@fortawesome/pro-solid-svg-icons";
|
8
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
9
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
10
|
+
import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
|
11
|
+
import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
|
12
|
+
import AllNewNotificationListHeader from "../AllNewNotificationListHeader";
|
13
|
+
import NotificationForm from "../NewNotificationForm/NotificationForm";
|
14
|
+
import AllNewNotificationTableItem from "../AllNewNotificationTableItem";
|
15
|
+
import "./index.less";
|
16
|
+
const AllNewNotificationTableList = (props) => {
|
17
|
+
const { parentId, asideable, filterOptions } = props;
|
18
|
+
const layoutContext = useViewLayoutContext();
|
19
|
+
const unitStore = useUnitStore();
|
20
|
+
const [recipients, setRecipients] = useState();
|
21
|
+
const [asideContext] = useState(asideable ? AsideContent.createContext() : useAsideContentContext());
|
22
|
+
useEffect(() => {
|
23
|
+
var _a;
|
24
|
+
if ((_a = props.unitForRecipients) === null || _a === void 0 ? void 0 : _a.id) {
|
25
|
+
unitStore.load(props.unitForRecipients.id, { includes: "main-contacts" }).then((res) => {
|
26
|
+
var _a;
|
27
|
+
if ((_a = res === null || res === void 0 ? void 0 : res.mainContacts) === null || _a === void 0 ? void 0 : _a.length) {
|
28
|
+
setRecipients(res.mainContacts);
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
setRecipients([props.unitForRecipients]);
|
32
|
+
}
|
33
|
+
});
|
34
|
+
}
|
35
|
+
}, []);
|
36
|
+
const list = useCreateListDataState({
|
37
|
+
filterDefaults: {
|
38
|
+
includes: "recipients",
|
39
|
+
filters: filters(),
|
40
|
+
},
|
41
|
+
}, [parentId, filterOptions]);
|
42
|
+
useAutoUpdateListData(list, (d) => d.target.id === parentId);
|
43
|
+
useRenderOnChange(() => list.filters.options);
|
44
|
+
useNotificationsListEffect(list, (result, total) => {
|
45
|
+
list.union(result);
|
46
|
+
}, {
|
47
|
+
Total: false,
|
48
|
+
...list.filters.options,
|
49
|
+
});
|
50
|
+
const Content = observe(() => (React.createElement("div", { className: "all-new-notification-list" },
|
51
|
+
React.createElement(AllNewNotificationListHeader, { ...props.headerProps, onAdd: () => asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
|
52
|
+
span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
|
53
|
+
}) }),
|
54
|
+
React.createElement("div", { className: "all-new-notification-body" },
|
55
|
+
React.createElement(Row, { align: "middle", className: "all-new-list-fixed-header" },
|
56
|
+
React.createElement(Col, { span: 8 },
|
57
|
+
React.createElement(FAIcon, { icon: faThumbtack }),
|
58
|
+
" ",
|
59
|
+
React.createElement("span", { className: "sub-title" }, "Subject")),
|
60
|
+
React.createElement(Col, { span: 4 },
|
61
|
+
React.createElement(FAIcon, { icon: faUserGroup }),
|
62
|
+
" ",
|
63
|
+
React.createElement("span", { className: "sub-title" }, "Create by")),
|
64
|
+
React.createElement(Col, { span: 4 },
|
65
|
+
React.createElement(FAIcon, { icon: faCalendarDays }),
|
66
|
+
" ",
|
67
|
+
React.createElement("span", { className: "sub-title" }, "Date")),
|
68
|
+
React.createElement(Col, { span: 4 },
|
69
|
+
React.createElement(FAIcon, { icon: faBarsProgress }),
|
70
|
+
" ",
|
71
|
+
React.createElement("span", { className: "sub-title" }, "Status")),
|
72
|
+
React.createElement(Col, { span: 4 })),
|
73
|
+
React.createElement(ListView, { className: "all-new-list-view", headerProps: { visible: false }, asideable: false, renderItem: ({ item }) => (React.createElement(AllNewNotificationTableItem, { key: item.id, id: item.id })) })))));
|
74
|
+
return observe(() => {
|
75
|
+
return (React.createElement(ListDataContext.Provider, { value: list }, asideable ? React.createElement(AsideContent, { context: asideContext }, Content) : Content));
|
76
|
+
});
|
77
|
+
function filters() {
|
78
|
+
let filter = [];
|
79
|
+
if (parentId)
|
80
|
+
filter.push({ c: "Target", o: "=", l: "And", v1: parentId });
|
81
|
+
if (filterOptions)
|
82
|
+
filter = filterOptions;
|
83
|
+
return filter;
|
84
|
+
}
|
85
|
+
};
|
86
|
+
AllNewNotificationTableList.defaultProps = {
|
87
|
+
asideable: true,
|
88
|
+
};
|
89
|
+
export default AllNewNotificationTableList;
|
90
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/AllNewNotificationTableList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAGN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACN,cAAc,EACd,WAAW,EACX,WAAW,EACX,cAAc,GACd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4EAA4E,CAAC;AAClH,OAAO,4BAEN,MAAM,iCAAiC,CAAC;AACzC,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AACvE,OAAO,2BAA2B,MAAM,gCAAgC,CAAC;AACzE,OAAO,cAAc,CAAC;AActB,M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,YAAY,GAAG;IAC1C,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import "./index.less";
|
3
2
|
export type NotificationOverviewProps = {
|
4
|
-
|
3
|
+
actives?: string[];
|
4
|
+
onOverviewItemClick?: (status?: string[]) => void;
|
5
5
|
};
|
6
6
|
declare const NotificationOverview: (props: NotificationOverviewProps) => React.JSX.Element;
|
7
7
|
export default NotificationOverview;
|
@@ -1,18 +1,25 @@
|
|
1
|
-
import React from "react";
|
2
1
|
import { observe } from "@voplus/morpho-ui";
|
3
2
|
import OverviewItem from "@voplus/morpho-ui/es/controls/PanelOverview/OverviewItem";
|
4
3
|
import OverviewAll from "@voplus/morpho-ui/es/controls/PanelOverview/OverviewAll";
|
5
4
|
import { Scrollbars } from "react-custom-scrollbars-2";
|
6
|
-
import { faEye, faEyeSlash, faClock, faBan } from "@fortawesome/pro-solid-svg-icons";
|
7
5
|
import PanelOverview from "@voplus/morpho-ui/es/controls/PanelOverview";
|
8
|
-
import "
|
6
|
+
import classnames from "classnames";
|
7
|
+
import React, { useState } from "react";
|
8
|
+
import { State } from "./state";
|
9
9
|
const NotificationOverview = (props) => {
|
10
|
+
const { actives, onOverviewItemClick } = props;
|
11
|
+
const [state] = useState(new State());
|
12
|
+
state.update(actives);
|
10
13
|
return observe(() => (React.createElement(Scrollbars, { autoHide: true },
|
11
|
-
React.createElement(PanelOverview, { className: "notification-overview", overviewAll: React.createElement(OverviewAll, { total: 20, description: "Total All Notifications" }), overviewList: React.createElement(React.Fragment, null,
|
12
|
-
React.createElement(OverviewItem, { className: "
|
13
|
-
React.createElement(OverviewItem, {
|
14
|
-
React.createElement(OverviewItem, { className: "
|
15
|
-
React.createElement(OverviewItem, { className: "
|
14
|
+
React.createElement(PanelOverview, { className: "notification-overview", overviewAll: React.createElement(OverviewAll, { className: classnames({ active: state.actives.includes("All") }), total: 20, description: "Total All Notifications", onClick: () => onClick("All") }), overviewList: React.createElement(React.Fragment, null,
|
15
|
+
React.createElement(OverviewItem, { className: classnames({ active: state.actives.includes("Read") }), total: 20, description: "Read", onClick: () => onClick("Read") }),
|
16
|
+
React.createElement(OverviewItem, { className: classnames({ active: state.actives.includes("Unread") }), total: 20, description: "Unread", onClick: () => onClick("Unread") }),
|
17
|
+
React.createElement(OverviewItem, { className: classnames({ active: state.actives.includes("Later") }), total: 20, description: "Later", onClick: () => onClick("Later") }),
|
18
|
+
React.createElement(OverviewItem, { className: classnames({ active: state.actives.includes("Dismissed") }), total: 20, description: "Dismissed", onClick: () => onClick("Dismissed") })) }))));
|
19
|
+
function onClick(status) {
|
20
|
+
state.onClick(status);
|
21
|
+
onOverviewItemClick === null || onOverviewItemClick === void 0 ? void 0 : onOverviewItemClick(state.actives);
|
22
|
+
}
|
16
23
|
};
|
17
24
|
export default NotificationOverview;
|
18
25
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationOverview/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationOverview/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,0DAA0D,CAAC;AACpF,OAAO,WAAW,MAAM,yDAAyD,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,aAAa,MAAM,6CAA6C,CAAC;AACxE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAOhC,MAAM,oBAAoB,GAAG,CAAC,KAAgC,EAAE,EAAE;IACjE,MAAM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,OAAO,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAC9B;gBACF,oBAAC,YAAY,IACZ,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EACtE,KAAK,EAAE,EAAE,EACT,WAAW,EAAC,WAAW,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,GAClC,CACA,GAEH,CACU,CACb,CAAC,CAAC;IAEH,SAAS,OAAO,CAAC,MAAc;QAC9B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACtB,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { action, makeObservable, observable } from "mobx";
|
3
|
+
export class State {
|
4
|
+
constructor() {
|
5
|
+
Object.defineProperty(this, "actives", {
|
6
|
+
enumerable: true,
|
7
|
+
configurable: true,
|
8
|
+
writable: true,
|
9
|
+
value: []
|
10
|
+
});
|
11
|
+
makeObservable(this);
|
12
|
+
}
|
13
|
+
update(currents) {
|
14
|
+
if (JSON.stringify(currents) !== JSON.stringify(this.actives)) {
|
15
|
+
this.actives = currents !== null && currents !== void 0 ? currents : [];
|
16
|
+
}
|
17
|
+
}
|
18
|
+
onClick(status) {
|
19
|
+
if (status === "All") {
|
20
|
+
this.actives = [status];
|
21
|
+
}
|
22
|
+
else {
|
23
|
+
if (this.actives.includes("All")) {
|
24
|
+
this.actives = [status];
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
if (this.actives.includes(status)) {
|
28
|
+
this.actives = this.actives.filter((item) => item !== status);
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
const actives = Array.isArray(this.actives) ? [...this.actives, status] : [status];
|
32
|
+
this.actives = actives;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
__decorate([
|
39
|
+
observable
|
40
|
+
], State.prototype, "actives", void 0);
|
41
|
+
__decorate([
|
42
|
+
action
|
43
|
+
], State.prototype, "update", null);
|
44
|
+
__decorate([
|
45
|
+
action
|
46
|
+
], State.prototype, "onClick", null);
|
47
|
+
//# sourceMappingURL=state.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationOverview/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,OAAO,KAAK;IAGjB;QAFmB;;;;mBAAoB,EAAE;WAAC;QAGzC,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAEc,MAAM,CAAC,QAAmB;QACxC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/D,IAAI,CAAC,OAAO,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC;IAEc,OAAO,CAAC,MAAc;QACpC,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAClC,IAAI,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACP,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBACnC,IAAI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