@voplus/morpho-workspace 9.0.16 → 9.0.17

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 (78) hide show
  1. package/es/modules/notification/components/NewNotificationForm/index.d.ts +1 -1
  2. package/es/modules/notification/components/NewNotificationForm/index.js +3 -3
  3. package/es/modules/notification/components/NewNotificationForm/index.js.map +1 -1
  4. package/es/modules/notification/components/NotificationItem/index.js.map +1 -0
  5. package/es/modules/notification/components/NotificationList/index.d.ts +24 -10
  6. package/es/modules/notification/components/NotificationList/index.js +60 -84
  7. package/es/modules/notification/components/NotificationList/index.js.map +1 -1
  8. package/es/modules/notification/components/NotificationListHeader/index.d.ts +15 -6
  9. package/es/modules/notification/components/NotificationListHeader/index.js +14 -68
  10. package/es/modules/notification/components/NotificationListHeader/index.js.map +1 -1
  11. package/es/modules/notification/components/NotificationPropertiesView/index.js +5 -5
  12. package/es/modules/notification/components/NotificationPropertiesView/index.js.map +1 -1
  13. package/es/modules/notification/components/NotificationRecipients/index.js +8 -8
  14. package/es/modules/notification/components/NotificationRecipients/index.js.map +1 -1
  15. package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.d.ts +2 -2
  16. package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.js +2 -2
  17. package/es/modules/notification/components/NotificationTableItem/index.js.map +1 -0
  18. package/es/modules/notification/components/{AllNewNotificationList → NotificationTableList}/index.d.ts +7 -6
  19. package/es/modules/notification/components/{AllNewNotificationTableList → NotificationTableList}/index.js +7 -8
  20. package/es/modules/notification/components/NotificationTableList/index.js.map +1 -0
  21. package/es/modules/notification/pages/NotificationListPage/index.d.ts +2 -2
  22. package/es/modules/notification/pages/NotificationListPage/index.js +2 -2
  23. package/es/modules/notification/pages/NotificationListPage/index.js.map +1 -1
  24. package/es/modules/notification-workspace/components/DocumentNotificationCard/NotificationMobileCard.js.map +1 -0
  25. package/es/modules/notification-workspace/components/DocumentNotificationCard/index.js.map +1 -0
  26. package/es/modules/notification-workspace/components/DocumentNotificationCard/obsolete.js.map +1 -0
  27. package/es/modules/notification-workspace/components/NotificationList/index.d.ts +14 -0
  28. package/es/modules/notification-workspace/components/NotificationList/index.js +102 -0
  29. package/es/modules/notification-workspace/components/NotificationList/index.js.map +1 -0
  30. package/es/modules/notification-workspace/components/NotificationList/state.js.map +1 -0
  31. package/es/modules/notification-workspace/components/NotificationListHeader/index.d.ts +7 -0
  32. package/es/modules/notification-workspace/components/NotificationListHeader/index.js +76 -0
  33. package/es/modules/notification-workspace/components/NotificationListHeader/index.js.map +1 -0
  34. package/es/modules/notification-workspace/components/NotificationTag/index.js.map +1 -0
  35. package/es/modules/notification-workspace/pages/NotificationListPage/NotificationMobileListPage.js.map +1 -0
  36. package/es/modules/notification-workspace/pages/NotificationListPage/index.js.map +1 -0
  37. package/es/obsolete/space/components/Notifications/index.js +1 -1
  38. package/es/obsolete/space/components/Notifications/index.js.map +1 -1
  39. package/package.json +1 -1
  40. package/es/modules/notification/components/AllNewNotificationItem/index.js.map +0 -1
  41. package/es/modules/notification/components/AllNewNotificationList/index.js +0 -78
  42. package/es/modules/notification/components/AllNewNotificationList/index.js.map +0 -1
  43. package/es/modules/notification/components/AllNewNotificationListHeader/index.d.ts +0 -16
  44. package/es/modules/notification/components/AllNewNotificationListHeader/index.js +0 -23
  45. package/es/modules/notification/components/AllNewNotificationListHeader/index.js.map +0 -1
  46. package/es/modules/notification/components/AllNewNotificationTableItem/index.js.map +0 -1
  47. package/es/modules/notification/components/AllNewNotificationTableList/index.d.ts +0 -29
  48. package/es/modules/notification/components/AllNewNotificationTableList/index.js.map +0 -1
  49. package/es/modules/notification/components/DocumentNotificationCard/NotificationMobileCard.js.map +0 -1
  50. package/es/modules/notification/components/DocumentNotificationCard/index.js.map +0 -1
  51. package/es/modules/notification/components/DocumentNotificationCard/obsolete.js.map +0 -1
  52. package/es/modules/notification/components/NotificationList/state.js.map +0 -1
  53. package/es/modules/notification/components/NotificationTag/index.js.map +0 -1
  54. package/es/modules/notification/pages/NotificationListPage2/NotificationMobileListPage.js.map +0 -1
  55. package/es/modules/notification/pages/NotificationListPage2/index.js.map +0 -1
  56. /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.css +0 -0
  57. /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.d.ts +0 -0
  58. /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.js +0 -0
  59. /package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.css +0 -0
  60. /package/es/modules/notification/components/{AllNewNotificationTableList → NotificationTableList}/index.css +0 -0
  61. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/NotificationMobileCard.d.ts +0 -0
  62. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/NotificationMobileCard.js +0 -0
  63. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.css +0 -0
  64. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.d.ts +0 -0
  65. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.js +0 -0
  66. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/obsolete.d.ts +0 -0
  67. /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/obsolete.js +0 -0
  68. /package/es/modules/{notification → notification-workspace}/components/NotificationList/index.css +0 -0
  69. /package/es/modules/{notification → notification-workspace}/components/NotificationList/state.d.ts +0 -0
  70. /package/es/modules/{notification → notification-workspace}/components/NotificationList/state.js +0 -0
  71. /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.d.ts +0 -0
  72. /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.js +0 -0
  73. /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.less +0 -0
  74. /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/NotificationMobileListPage.d.ts +0 -0
  75. /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/NotificationMobileListPage.js +0 -0
  76. /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.d.ts +0 -0
  77. /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.js +0 -0
  78. /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.less +0 -0
@@ -1,5 +1,5 @@
1
- import { NewNotificationFormProps } from "./NotificationForm";
2
1
  import React from "react";
2
+ import { NewNotificationFormProps } from "./NotificationForm";
3
3
  declare const NewNotificationFormDialog: {
4
4
  (props: NewNotificationFormProps): React.JSX.Element;
5
5
  defaultProps: {
@@ -1,7 +1,7 @@
1
- import Content from "./NotificationForm";
2
- import { observe } from "@voplus/morpho-ui";
3
- import { Modal } from "antd";
4
1
  import React from "react";
2
+ import { Modal } from "antd";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ import Content from "./NotificationForm";
5
5
  const NewNotificationFormDialog = (props) => {
6
6
  return observe(() => (React.createElement(Modal, { title: "New Notification Form Dialog", open: true, closable: false, footer: null, onCancel: props.onCancel },
7
7
  React.createElement(Content, { ...props }))));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NewNotificationForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAqC,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,yBAAyB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACrE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,IACL,KAAK,EAAC,8BAA8B,EACpC,IAAI,QACJ,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;QAExB,oBAAC,OAAO,OAAK,KAAK,GAAI,CACf,CACR,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG;IACxC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,IAAI;CAChB,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NewNotificationForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,OAAqC,MAAM,oBAAoB,CAAC;AAEvE,MAAM,yBAAyB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACrE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,IACL,KAAK,EAAC,8BAA8B,EACpC,IAAI,QACJ,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;QAExB,oBAAC,OAAO,OAAK,KAAK,GAAI,CACf,CACR,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG;IACxC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,IAAI;CAChB,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationItem/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,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,0DAA0D,CAAC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AE,KAAK,EACf,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,GAC3D,CACa;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,MAAM;gBACnC,oBAAC,YAAY,IAAC,KAAK,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAC,aAAa,GAAG,CACtD;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,IAAI,QAAQ,EAAE,KAAK,EAAC,UAAU,IACnE,OAAO,CAAC,CAAC,CAAC,CACV,oBAAC,OAAO,IAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;gBAC/B,oBAAC,IAAI,IAAC,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,GAAI;gBACvD,YAAY,CAAC,KAAK,IAAI,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CAC5D,CACV,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CACxB,oBAAC,GAAG,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAC,SAAS,YAE9C,CACN,CAAC,CAAC,CAAC,IAAI,CACO,CACJ,CACC,CACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,14 +1,28 @@
1
1
  import React from "react";
2
- import { INotification } from "../../../../data/notification-workspace";
3
- import "./index.css";
2
+ import { FilterOption } from "@voplus/morpho-data";
4
3
  export type NotificationListProps = {
5
- /** status of notifications shown on the list. */
6
- status: string;
7
- /** The current active item */
8
- active?: string;
9
- /** Call back when an item has been clicked on the list. */
10
- onClickItem?: (ev: React.MouseEvent<HTMLDivElement, MouseEvent>, item: INotification) => void;
11
- onClickStatus?: (status: string) => void;
4
+ /** 需要 corporate 或者 customer id */
5
+ parentId: string;
6
+ /** 如传入 unit Organization, 并且 mainContacts 有内容, Recipients 会自动显示 mainContacts 的内容 */
7
+ unitForRecipients?: {
8
+ id: string;
9
+ name: string;
10
+ };
11
+ defaultTemplate?: {
12
+ id: string;
13
+ name: string;
14
+ body: string;
15
+ };
16
+ /** 是否允在 listView 内部打开 aside */
17
+ asideable?: boolean;
18
+ filterOptions?: FilterOption[];
19
+ /** Call back when received total number of All New Notification. */
20
+ onTotal?: (total: number) => void;
21
+ };
22
+ declare const NotificationList: {
23
+ (props: NotificationListProps): React.JSX.Element;
24
+ defaultProps: {
25
+ asideable: boolean;
26
+ };
12
27
  };
13
- declare const NotificationList: (props: NotificationListProps) => React.JSX.Element;
14
28
  export default NotificationList;
@@ -1,102 +1,78 @@
1
- import React, { useEffect, useState, useMemo } from "react";
2
- import { useNotificationListInWorkSpaceEffect, useNotificationStore, } from "../../../../data/notification-workspace";
3
- import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
1
+ import React, { useEffect, useState } from "react";
2
+ import { useAutoUpdateListData, useNotificationListEffect, } from "../../../../data/notification";
3
+ import { useUnitStore } from "@voplus/morpho-org";
4
4
  import { observe, useRenderOnChange } from "@voplus/morpho-ui";
5
- import { message, Alert } from "antd";
6
5
  import { useApplicationContext } from "@voplus/morpho-data";
7
- import { runInAction } from "mobx";
8
- import NotificationListHeader from "../NotificationListHeader";
9
- import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
10
- import DocumentNotificationCard from "../DocumentNotificationCard";
11
- import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
12
- import Viewer from "@voplus/morpho-text/es/controls/ProseMirror/Viewer";
13
- import NodePropertiesView from "@voplus/morpho-document-core/es/components/NodePropertiesView";
14
- import { NotificationListContext, NotificationListState } from "./state";
15
- import { useUnit } from "@voplus/morpho-org/es/data";
16
- import S from "string";
17
- import "./index.css";
6
+ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
7
+ import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
8
+ import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView";
9
+ import NotificationForm from "../NewNotificationForm/NotificationForm";
10
+ import NotificationItem from "../NotificationItem";
18
11
  const NotificationList = (props) => {
19
- const store = useNotificationStore();
12
+ const { parentId, asideable, filterOptions } = props;
20
13
  const { user } = useApplicationContext();
21
- const context = useMemo(() => new NotificationListState(), []);
22
- const [asideContext] = useState(AsideContent.createContext());
23
- const list = useCreateListDataState({ filterDefaults: { filters: filters() } }, [
24
- props.status,
25
- ]);
26
- const unit = useUnit(user.info.unit.id, { includes: "notes" });
27
- /** 如果 list.filters.options变更了就重渲染,使下一行的useNotificationListEffect 可以接收新参数*/
14
+ const unitStore = useUnitStore();
15
+ const layoutContext = useViewLayoutContext();
16
+ const [recipients, setRecipients] = useState();
17
+ useEffect(() => {
18
+ var _a;
19
+ if ((_a = props.unitForRecipients) === null || _a === void 0 ? void 0 : _a.id) {
20
+ unitStore.load(props.unitForRecipients.id, { includes: "main-contacts" }).then((res) => {
21
+ var _a;
22
+ if ((_a = res === null || res === void 0 ? void 0 : res.mainContacts) === null || _a === void 0 ? void 0 : _a.length) {
23
+ setRecipients(res.mainContacts);
24
+ }
25
+ else {
26
+ setRecipients([props.unitForRecipients]);
27
+ }
28
+ });
29
+ }
30
+ }, []);
31
+ const list = useCreateListDataState({
32
+ filterDefaults: {
33
+ includes: "recipients",
34
+ filters: filters(),
35
+ },
36
+ }, [parentId, filterOptions]);
37
+ useAutoUpdateListData(list, (d) => d.target.id === parentId);
28
38
  useRenderOnChange(() => list.filters.options);
29
- /** 把ListDataState传给useNotificationListEffect,使之可以自動更新loading, hasmore. */
30
- useNotificationListInWorkSpaceEffect(list, (result, total) => {
39
+ useNotificationListEffect(list, (result, total) => {
40
+ var _a;
31
41
  list.union(result);
42
+ (_a = props.onTotal) === null || _a === void 0 ? void 0 : _a.call(props, total !== null && total !== void 0 ? total : 0);
32
43
  }, {
33
44
  Total: true,
34
45
  ...list.filters.options,
35
46
  });
36
- useEffect(() => {
37
- if (props.active) {
38
- runInAction(() => {
39
- store
40
- .load(props.active, { onError: (e) => message.error(e) })
41
- .then((res) => {
42
- if (!(list.data.filter((i) => i.id === res.id).length > 0))
43
- list.insert(res, 0);
44
- if (res.status === "Unread")
45
- editStatus(res.id, "Read");
46
- asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NodePropertiesView, { node: res.node }), { span: 12 });
47
- })
48
- .catch((e) => { });
49
- });
50
- }
51
- }, [props.active]);
52
47
  return observe(() => {
53
- var _a;
54
48
  return (React.createElement(ListDataContext.Provider, { value: list },
55
- React.createElement(AsideContent, { context: asideContext },
56
- React.createElement(NotificationListContext.Provider, { value: context },
57
- React.createElement("div", { className: "my-space-notifications" },
58
- React.createElement("div", { className: "my-space-alert-content" }, (_a = unit.notes) === null || _a === void 0 ? void 0 : _a.map((n, i) => (React.createElement(Alert, { key: i, showIcon: true, closable: true, type: (n.type.substring(0, 1).toLowerCase() + n.type.substring(1)), className: "dashboard-alert normal-alert notifications-alert", message: React.createElement(React.Fragment, null,
59
- React.createElement("div", { className: "title-group" }, n.group),
60
- React.createElement(Viewer, { html: n.note })) })))),
61
- React.createElement(NotificationListHeader, { status: props.status, onClickStatus: props.onClickStatus }),
62
- React.createElement(ListView, { headerProps: { visible: false }, className: "notifications-list", asideable: false, renderItem: ({ item }) => (React.createElement(DocumentNotificationCard, { className: "doc-notification-card", id: item.id, active: props.active === item.id, onClick: (ev) => {
63
- var _a, _b;
64
- // const path = ev.nativeEvent.composedPath();
65
- // const visible = path.some(
66
- // (item: any) => item.className === "notification-card-content"
67
- // );
68
- /** fix: notification card里的任何对话框(比如:pdf/file viewer quick view) 任何button 都按不了,一按就close */
69
- if ((_a = item === null || item === void 0 ? void 0 : item.node) === null || _a === void 0 ? void 0 : _a.id) {
70
- (_b = props.onClickItem) === null || _b === void 0 ? void 0 : _b.call(props, ev, item);
71
- }
72
- }, onChangeStatus: (status) => editStatus(item.id, status) })) }))))));
49
+ React.createElement(ListView, { className: "all-new-list-view", headerProps: {
50
+ headerToolProps: {
51
+ visible: true,
52
+ /* 暂时直接检查 是不是外部用户, 是就不显示 */
53
+ addAble: !user.info.guest,
54
+ sortable: false,
55
+ onAdd: onAdd,
56
+ searchOptions: { placeholder: "Search in notifications" },
57
+ },
58
+ }, asideable: asideable, renderItem: ({ item }) => (React.createElement(NotificationItem, { key: item.id, id: item.id })) })));
73
59
  });
74
- function filters() {
75
- if (props.status == "all")
76
- return [];
77
- return [
78
- {
79
- c: "Status",
80
- o: "=",
81
- l: "And",
82
- v1: S(props.status).capitalize().toString(),
83
- },
84
- ];
85
- }
86
- function editStatus(id, status) {
87
- runInAction(async () => {
88
- var _a;
89
- const item = store.items.get(id);
90
- const old = item.status;
91
- await store.edit(id, { data: { status: status }, error: "message" });
92
- context.updateNotificationTotal(old, item.status);
93
- if (props.status === "unread" && item.status === "Read")
94
- return;
95
- list.remove(item.id, { delay: 300 });
96
- if (((_a = list.data) === null || _a === void 0 ? void 0 : _a.length) <= 1)
97
- list.triggerNextPage();
60
+ function onAdd(asideContext) {
61
+ asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
62
+ span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
98
63
  });
99
64
  }
65
+ function filters() {
66
+ let filter = [];
67
+ if (parentId)
68
+ filter.push({ c: "Target", o: "=", l: "And", v1: parentId });
69
+ if (filterOptions)
70
+ filter = filterOptions;
71
+ return filter;
72
+ }
73
+ };
74
+ NotificationList.defaultProps = {
75
+ asideable: true,
100
76
  };
101
77
  export default NotificationList;
102
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAIN,oCAAoC,EACpC,oBAAoB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAgB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,wBAAwB,MAAM,6BAA6B,CAAC;AACnE,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,MAAM,MAAM,oDAAoD,CAAC;AACxE,OAAO,kBAAkB,MAAM,+DAA+D,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,aAAa,CAAC;AAarB,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IACzD,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,qBAAqB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,YAAY,CAAC,G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IAAI,EAAE;;YACtB,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACxB,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YACrE,OAAO,CAAC,uBAAuB,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM;gBAAE,OAAO;YAChE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YAErC,IAAI,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,KAAI,CAAC;gBAAE,IAAI,CAAC,eAAe,EAAE,CAAC;QACpD,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAEN,qBAAqB,EACrB,yBAAyB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAgB,qBAAqB,EAAgB,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4EA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,QAAQ,EAAE,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,gBAAgB,CAAC,YAAY,GAAG;IAC/B,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,7 +1,16 @@
1
- import React from "react";
2
- declare const NotificationListHeader: (props: {
3
- /** status of notifications shown on the list. */
4
- status: string;
5
- onClickStatus?: (status: string) => void;
6
- }) => React.JSX.Element;
1
+ import React, { ReactNode } from "react";
2
+ export type NotificationListHeaderProps = {
3
+ /** title */
4
+ title?: ReactNode;
5
+ /** description */
6
+ description?: ReactNode;
7
+ onAdd?: () => void;
8
+ };
9
+ declare const NotificationListHeader: {
10
+ (props: NotificationListHeaderProps): React.JSX.Element;
11
+ defaultProps: {
12
+ title: string;
13
+ description: string;
14
+ };
15
+ };
7
16
  export default NotificationListHeader;
@@ -1,76 +1,22 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React from "react";
2
2
  import { observe } from "@voplus/morpho-ui";
3
- import { Button, Divider } from "antd";
4
- import { runInAction } from "mobx";
5
- import { useLayout } from "@voplus/morpho-data";
6
- import { FlagFilter } from "@voplus/morpho-document/es/controls/filters";
7
- import { useNotificationListInWorkSpaceEffect } from "../../../../data/notification-workspace";
8
3
  import { useApplicationContext } from "@voplus/morpho-data";
9
4
  import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
10
- import { useNotificationListContext } from "../NotificationList/state";
11
- import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
12
5
  import PageHeadDashboard from "@voplus/morpho-ui/es/components/layout/headers/PageHeadDashboard";
13
- import classnames from "classnames";
14
6
  const NotificationListHeader = (props) => {
15
- const layout = useLayout();
16
- const mobile = layout.ui.mobile;
17
- const context = useApplicationContext();
18
- const nContext = useNotificationListContext();
19
- const [statusActive, setStatusActive] = useState("all");
20
- useEffect(() => {
21
- setStatusActive(props.status);
22
- }, [props.status]);
23
- useNotificationListInWorkSpaceEffect(null, (result, total) => runInAction(() => (nContext.notificationTotals.unread = total || 0)), nContext.nUnreadOptions);
24
- useNotificationListInWorkSpaceEffect(null, (result, total) => runInAction(() => (nContext.notificationTotals.read = total || 0)), nContext.nReadOptions);
25
- useNotificationListInWorkSpaceEffect(null, (result, total) => runInAction(() => (nContext.notificationTotals.later = total || 0)), nContext.nLaterOptions);
26
- useNotificationListInWorkSpaceEffect(null, (result, total) => runInAction(() => (nContext.notificationTotals.dismissed = total || 0)), nContext.nDismissedOptions);
27
- return observe(() => {
28
- const statusMenu = [
29
- {
30
- key: "all",
31
- label: "All",
32
- total: undefined,
33
- },
34
- {
35
- key: "unread",
36
- label: "Unread",
37
- total: nContext.notificationTotals.unread,
38
- },
39
- {
40
- key: "read",
41
- label: "Read",
42
- total: nContext.notificationTotals.read,
43
- },
44
- {
45
- key: "later",
46
- label: "Later",
47
- total: nContext.notificationTotals.later,
48
- },
49
- {
50
- key: "dismissed",
51
- label: "Dismissed",
52
- total: undefined,
53
- },
54
- ];
55
- const ListHeader = () => (React.createElement(ListHeaderTool, { addAble: false, filterViewProps: context.host.isTest
56
- ? {
57
- columns: [React.createElement(FlagFilter, { key: "Flag" })],
58
- }
59
- : undefined, sortable: context.host.isTest ? true : false, searchHeader: context.host.isTest ? true : false, searchOptions: { placeholder: "Search in notifications" }, preExtra: () => (React.createElement("div", { className: "notifications-status" },
60
- statusMenu.map((item) => (React.createElement(Button, { key: item.key, className: classnames(item, {
61
- active: statusActive === item.key,
62
- }), onClick: () => onClickStatus(item.key) },
63
- item.label,
64
- " ",
65
- (item === null || item === void 0 ? void 0 : item.total) ? ` (${item.total})` : ""))),
66
- context.host.isTest && !mobile && React.createElement(Divider, { type: "vertical" }))) }));
67
- return (React.createElement("div", { className: classnames("notifications-header", { mobile: mobile }) }, !mobile ? (React.createElement(PageHeadDashboard, { headerType: "page", avatarIcon: React.createElement(FAIcon, { icon: faBellSolid }), title: "Your Notifications Center", description: "Stay updated: your latest alerts and notifications", moreExpansions: React.createElement(ListHeader, null) })) : (React.createElement(ListHeader, null))));
68
- });
69
- function onClickStatus(item) {
70
- var _a;
71
- setStatusActive(item);
72
- (_a = props.onClickStatus) === null || _a === void 0 ? void 0 : _a.call(props, item);
73
- }
7
+ const { user } = useApplicationContext();
8
+ return observe(() => (React.createElement(PageHeadDashboard, { className: "all-new-notifications-header", headerType: "page", avatarIcon: React.createElement(FAIcon, { icon: faBellSolid }), title: props.title, description: props.description, listHeaderProps: {
9
+ visible: true,
10
+ /* 暂时直接检查 是不是外部用户, 是就不显示 */
11
+ addAble: !user.info.guest,
12
+ sortable: false,
13
+ onAdd: props.onAdd,
14
+ searchOptions: { placeholder: "Search in notifications" },
15
+ } })));
16
+ };
17
+ NotificationListHeader.defaultProps = {
18
+ title: "Notification Creation",
19
+ description: "Set up your notification list effortlessly.",
74
20
  };
75
21
  export default NotificationListHeader;
76
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK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IAAC,IAAI,EAAC,UAAU,GAAG,CACzD,CACN,GACA,CACF,CAAC;QAEF,OAAO,CACN,6BAAK,SAAS,EAAE,UAAU,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IACpE,CAAC,MAAM,CAAC,CAAC,CAAC,CACV,oBAAC,iBAAiB,IACjB,UAAU,EAAC,MAAM,EACjB,UAAU,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACzC,KAAK,EAAC,2BAA2B,EACjC,WAAW,EAAC,oDAAoD,EAChE,cAAc,EAAE,oBAAC,UAAU,OAAG,GAC7B,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,UAAU,OAAG,CACd,CACI,CACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,SAAS,aAAa,CAAC,IAAY;;QAClC,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,MAAA,KAAK,CAAC,aAAa,sDAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,iBAAiB,MAAM,kEAAkE,CAAC;AAUjG,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,iBAAiB,IACjB,SAAS,EAAC,8BAA8B,EACxC,UAAU,EAAC,MAAM,EACjB,UAAU,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACzC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,eAAe,EAAE;YAChB,OAAO,EAAE,IAAI;YACb,2BAA2B;YAC3B,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;YACzB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,aAAa,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE;SACzD,GACA,CACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG;IACrC,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,6CAA6C;CAC1D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,15 +1,15 @@
1
- import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
2
1
  import React, { useMemo } from "react";
3
2
  import { observe } from "@voplus/morpho-ui";
4
- import NotificationMenu from "../../controls/NotificationMenu";
5
- import NotificationTabs from "../NotificationTabs";
6
- import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
7
3
  import { useHandleError } from "@voplus/morpho-document-core";
8
4
  import { useNotification } from "../../../../data/notification";
5
+ import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
6
+ import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
9
7
  import PropertiesHeader from "@voplus/morpho-org/es/components/PropertiesHeader";
8
+ import NotificationMenu from "../../controls/NotificationMenu";
9
+ import NotificationTabs from "../NotificationTabs";
10
10
  import Routes from "../../../Routes";
11
- import "./index.css";
12
11
  import classnames from "classnames";
12
+ import "./index.css";
13
13
  const NotificationPropertiesView = (props) => {
14
14
  const id = props.id;
15
15
  const handleError = useHandleError();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,eAAe,GACf,MAAM,0DAA0D,CAAC;AAClE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,gBAAgB,MAAM,mDAAmD,CAAC;AACjF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,MAAM,0BAA0B,GAAG,CAAC,KAAwC,EAAE,EAAE;IAC/E,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAEnE,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACpB,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;YAChC,6BACC,SAAS,EAAE,UAAU,CAAC,iDAAiD,EAAE;oBACxE,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK;iBACzB,CAAC;gBAEF,oBAAC,gBAAgB,IAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACnC,QAAQ,EAAE,MAAA,YAAY,CAAC,OAAO,mCAAI,cAAc,EAChD,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,EAC9C,eAAe,EAAE,IAAI,EACrB,QAAQ,EAAE,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,GACvD;gBACF,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,SAAG,CAClC,CACgB,CACvB,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACN,WAAW,EACX,eAAe,GACf,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,gBAAgB,MAAM,mDAAmD,CAAC;AACjF,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,aAAa,CAAC;AAErB,MAAM,0BAA0B,GAAG,CAAC,KAAwC,EAAE,EAAE;IAC/E,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IAEnE,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACpB,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;YAChC,6BACC,SAAS,EAAE,UAAU,CAAC,iDAAiD,EAAE;oBACxE,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK;iBACzB,CAAC;gBAEF,oBAAC,gBAAgB,IAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACnC,QAAQ,EAAE,MAAA,YAAY,CAAC,OAAO,mCAAI,cAAc,EAChD,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,EAC9C,eAAe,EAAE,IAAI,EACrB,QAAQ,EAAE,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,GACvD;gBACF,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,SAAG,CAClC,CACgB,CACvB,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,0BAA0B,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
- import { observe } from "@voplus/morpho-ui";
3
2
  import { Empty } from "antd";
4
- import Scrollbars from "react-custom-scrollbars-2";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ import { useNotification } from "../../../../data/notification";
5
+ import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnItem";
6
+ import UnitReference from "@voplus/morpho-org/es/controls/UnitReference";
5
7
  import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
6
8
  import ItemFrame from "@voplus/morpho-ui/es/controls/ItemFrame";
7
- import UnitReference from "@voplus/morpho-org/es/controls/UnitReference";
8
- import { ColumnItem, ColumnItemCol } from "@voplus/morpho-ui/es/controls/ColumnItem";
9
- import { useNotification } from "../../../../data/notification";
9
+ import Scrollbars from "react-custom-scrollbars-2";
10
10
  import "./index.css";
11
11
  const NotificationRecipients = (props) => {
12
12
  const { id, viewTitle } = props;
@@ -17,10 +17,10 @@ const NotificationRecipients = (props) => {
17
17
  viewTitle && React.createElement("div", { className: "notification-recipient-header" }, "Messages"),
18
18
  React.createElement(Scrollbars, { autoHide: true }, ((_a = notification.recipients) === null || _a === void 0 ? void 0 : _a.length) ? (notification.recipients.map((item, index) => (React.createElement(ItemFrame, { key: index, hoverEffect: "background" },
19
19
  React.createElement(ColumnItem, { className: "notification-recipient-item" },
20
- React.createElement(ColumnItemCol, { span: 10, label: "Recipient" },
20
+ React.createElement(ColumnItemCol, { span: 8, label: "Recipient" },
21
21
  React.createElement(UnitReference, { id: item.recipient.id })),
22
- React.createElement(ColumnItemCol, { span: 10, label: "Channel" }, item.channel),
23
- React.createElement(ColumnItemCol, { span: 4, label: "Date" },
22
+ React.createElement(ColumnItemCol, { span: 8, label: "Channel" }, item.channel),
23
+ React.createElement(ColumnItemCol, { span: 8, label: "Date" },
24
24
  React.createElement(UTCShortDate, { value: item.sentDate }))))))) : (React.createElement(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE })))));
25
25
  });
26
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationRecipients/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC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AY,IAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAI,CACvB,CACJ,CACF,CACZ,CAAC,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CAC9C,CACW,CACR,CACN,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationRecipients/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,aAAa,MAAM,8CAA8C,CAAC;AACzE,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAChE,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,aAAa,CAAC;AAErB,MAAM,sBAAsB,GAAG,CAAC,KAA0C,EAAE,EAAE;IAC7E,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,EAAE;;QAAC,OAAA,CACpB,6BAAK,SAAS,EAAC,6BAA6B;YAC1C,SAAS,IAAI,6BAAK,SAAS,EAAC,+BAA+B,eAAe;YAC3E,oBAAC,UAAU,IAAC,QAAQ,UAClB,CAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,MAAM,EAAC,CAAC,CAAC,CAClC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,oBAAC,SAAS,IAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAC,YAAY;gBAC9C,oBAAC,UAAU,IAAC,SAAS,EAAC,6BAA6B;oBAClD,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,WAAW;wBACxC,oBAAC,aAAa,IAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAI,CACzB;oBAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,SAAS,IACrC,IAAI,CAAC,OAAO,CACE;oBAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,MAAM;wBACnC,oBAAC,YAAY,IAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAI,CACvB,CACJ,CACF,CACZ,CAAC,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,GAAI,CAC9C,CACW,CACR,CACN,CAAA;KAAA,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import "./index.css";
3
- declare const AllNewNotificationTableItem: (props: {
3
+ declare const NotificationTableItem: (props: {
4
4
  id: string;
5
5
  onClick?: () => void;
6
6
  }) => React.JSX.Element;
7
- export default AllNewNotificationTableItem;
7
+ export default NotificationTableItem;
@@ -12,7 +12,7 @@ import ToolBar from "@voplus/morpho-document-core/es/controls/ToolBar";
12
12
  import PropertiesView from "../NotificationPropertiesView";
13
13
  import Routes from "../../../Routes";
14
14
  import "./index.css";
15
- const AllNewNotificationTableItem = (props) => {
15
+ const NotificationTableItem = (props) => {
16
16
  const { id } = props;
17
17
  const notification = useNotification(id);
18
18
  return observe(() => (React.createElement(ItemFunction, { className: "all-new-notification-item", propertiesView: React.createElement(PropertiesView, { id: id }) },
@@ -29,5 +29,5 @@ const AllNewNotificationTableItem = (props) => {
29
29
  React.createElement(Open, { url: Routes.NotificationDefaultView.getUrl(id) }),
30
30
  notification.draft && React.createElement(NotificationMenu, { id: id, closeAside: true })))))));
31
31
  };
32
- export default AllNewNotificationTableItem;
32
+ export default NotificationTableItem;
33
33
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationTableItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,0DAA0D,CAAC;AAChF,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,uBAAuB,MAAM,wCAAwC,CAAC;AAC7E,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,OAAO,MAAM,kDAAkD,CAAC;AACvE,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,aAAa,CAAC;AAErB,MAAM,qBAAqB,GAAG,CAAC,KAA2C,EAAE,EAAE;IAC7E,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,YAAY,IAAC,SAAS,EAAC,2BAA2B,EAAC,cAAc,EAAE,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,GAAI;QAC7F,oBAAC,UA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";
3
- export type AllNewNotificationListProps = {
3
+ import { NotificationListHeaderProps } from "../NotificationListHeader";
4
+ import "./index.css";
5
+ export type NotificationTableListProps = {
4
6
  /** 需要 corporate 或者 customer id */
5
7
  parentId: string;
6
8
  /** 如传入 unit 是 Organization, 并且 mainContacts 有内容, Recipients 会自动显示 mainContacts 的内容 */
@@ -13,16 +15,15 @@ export type AllNewNotificationListProps = {
13
15
  name: string;
14
16
  body: string;
15
17
  };
18
+ headerProps?: NotificationListHeaderProps;
16
19
  /** 是否允在 listView 内部打开 aside */
17
20
  asideable?: boolean;
18
21
  filterOptions?: FilterOption[];
19
- /** Call back when received total number of All New Notification. */
20
- onTotal?: (total: number) => void;
21
22
  };
22
- declare const AllNewNotificationList: {
23
- (props: AllNewNotificationListProps): React.JSX.Element;
23
+ declare const NotificationTableList: {
24
+ (props: NotificationTableListProps): React.JSX.Element;
24
25
  defaultProps: {
25
26
  asideable: boolean;
26
27
  };
27
28
  };
28
- export default AllNewNotificationList;
29
+ export default NotificationTableList;
@@ -5,15 +5,14 @@ import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/da
5
5
  import { observe, useRenderOnChange, useAsideContentContext } from "@voplus/morpho-ui";
6
6
  import { useUnitStore } from "@voplus/morpho-org";
7
7
  import { FontAwesomeIcon as FAIcon, faBarsProgressSolid, faThumbtackSolid, faUserGroupSolid, faCalendarDaysSolid, } from "@voplus/morpho-ui/es/faIcons";
8
- // ...已合并到上方导入
9
8
  import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
10
9
  import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
11
10
  import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
12
- import AllNewNotificationListHeader from "../AllNewNotificationListHeader";
11
+ import NotificationListHeader from "../NotificationListHeader";
13
12
  import NotificationForm from "../NewNotificationForm/NotificationForm";
14
- import AllNewNotificationTableItem from "../AllNewNotificationTableItem";
13
+ import NotificationTableItem from "../NotificationTableItem";
15
14
  import "./index.css";
16
- const AllNewNotificationTableList = (props) => {
15
+ const NotificationTableList = (props) => {
17
16
  const { parentId, asideable, filterOptions } = props;
18
17
  const layoutContext = useViewLayoutContext();
19
18
  const unitStore = useUnitStore();
@@ -48,7 +47,7 @@ const AllNewNotificationTableList = (props) => {
48
47
  ...list.filters.options,
49
48
  });
50
49
  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 }), {
50
+ React.createElement(NotificationListHeader, { ...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
51
  span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
53
52
  }) }),
54
53
  React.createElement("div", { className: "all-new-notification-body" },
@@ -70,7 +69,7 @@ const AllNewNotificationTableList = (props) => {
70
69
  " ",
71
70
  React.createElement("span", { className: "sub-title" }, "Status")),
72
71
  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 })) })))));
72
+ React.createElement(ListView, { className: "all-new-list-view", headerProps: { visible: false }, asideable: false, renderItem: ({ item }) => (React.createElement(NotificationTableItem, { key: item.id, id: item.id })) })))));
74
73
  return observe(() => {
75
74
  return (React.createElement(ListDataContext.Provider, { value: list }, asideable ? React.createElement(AsideContent, { context: asideContext }, Content) : Content));
76
75
  });
@@ -83,8 +82,8 @@ const AllNewNotificationTableList = (props) => {
83
82
  return filter;
84
83
  }
85
84
  };
86
- AllNewNotificationTableList.defaultProps = {
85
+ NotificationTableList.defaultProps = {
87
86
  asideable: true,
88
87
  };
89
- export default AllNewNotificationTableList;
88
+ export default NotificationTableList;
90
89
  //# sourceMappingURL=index.js.map