@voplus/morpho-workspace 6.0.44 → 6.0.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,5 +5,6 @@ export declare class WorkScheduleMeta extends DefaultDocumentTypeMeta {
5
5
  static TypeName: string;
6
6
  getRoute(node: INode): string;
7
7
  get name(): string;
8
+ getPropertiesView(node: INode): JSX.Element;
8
9
  getQuickView(node: INode, props: QuickViewProps): JSX.Element;
9
10
  }
@@ -1,6 +1,7 @@
1
1
  import { lazy } from "react";
2
2
  import { DefaultDocumentTypeMeta } from "@voplus/morpho-document";
3
3
  import { suspense } from "@voplus/morpho-ui/es/controls/Suspense";
4
+ const WorkSchedulePropertiesView = lazy(() => import("../../modules/work/work-schedule/components/WorkSchedulePropertiesView"));
4
5
  const WorkScheduleQuickViewDialog = lazy(() => import("../../modules/work/work-schedule/components/WorkScheduleQuickViewDialog"));
5
6
  export class WorkScheduleMeta extends DefaultDocumentTypeMeta {
6
7
  getRoute(node) {
@@ -9,6 +10,9 @@ export class WorkScheduleMeta extends DefaultDocumentTypeMeta {
9
10
  get name() {
10
11
  return WorkScheduleMeta.TypeName;
11
12
  }
13
+ getPropertiesView(node) {
14
+ return suspense(WorkSchedulePropertiesView)({ id: node.id });
15
+ }
12
16
  getQuickView(node, props) {
13
17
  props.id = node.id;
14
18
  return suspense(WorkScheduleQuickViewDialog)({
@@ -1 +1 @@
1
- {"version":3,"file":"metas.js","sourceRoot":"","sources":["../../../src/data/work-schedule/metas.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAElE,MAAM,2BAA2B,GAAG,IAAI,CACvC,GAAG,EAAE,CAAC,MAAM,CAAC,yEAAyE,CAAC,CACvF,CAAC;AAEF,MAAM,OAAO,gBAAiB,SAAQ,uBAAuB;IAGrD,QAAQ,CAAC,IAAW;QAC1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AqB;QACrD,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAEnB,OAAO,QAAQ,CAAC,2BAA2B,CAAC,CAAC;YAC5C,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,CAAC,CAAC;IACJ,CAAC;;AAtBa;;;;WAAW,kBAAkB;GAAC"}
@@ -1,7 +1,11 @@
1
1
  import React from "react";
2
2
  declare const CalendarEventContent: (props: {
3
- id: string;
4
- type: string;
3
+ source: {
4
+ id: string;
5
+ type: string;
6
+ nodeType: string;
7
+ title: string;
8
+ };
5
9
  onClick?: () => void;
6
10
  }) => React.JSX.Element;
7
11
  export default CalendarEventContent;
@@ -3,8 +3,8 @@ import DocumentHeader from "@voplus/morpho-document/es/components/DocumentHeader
3
3
  import React from "react";
4
4
  import { observe } from "@voplus/morpho-ui";
5
5
  const CalendarEventContent = (props) => {
6
- const { id, type, onClick } = props;
7
- return observe(() => (React.createElement(React.Fragment, null, type === "Action" ? (React.createElement(ActionCard, { id: id, onClick: onClick })) : (React.createElement(DocumentHeader, { id: id, tagsVisible: false, preVisible: false, quickDataBarVisible: false, className: "calendar-document-card", onClickName: onClick, toolsVisible: false })))));
6
+ const { id, type, nodeType, title } = props.source;
7
+ return observe(() => (React.createElement(React.Fragment, null, type === "Action" ? (React.createElement(ActionCard, { id: id, onClick: props.onClick })) : nodeType === "DocumentNode" ? (React.createElement(DocumentHeader, { id: id, tagsVisible: false, preVisible: false, quickDataBarVisible: false, className: "calendar-document-card", onClickName: props.onClick, toolsVisible: false })) : (React.createElement("div", { className: "calendar-no-document-card", onClick: props.onClick }, title)))));
8
8
  };
9
9
  export default CalendarEventContent;
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar/components/CalendarEventContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,cAAc,MAAM,sDAAsD,CAAC;AAClF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,oBAAoB,GAAG,CAAC,KAAyD,EAAE,EAAE;IAC1F,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEpC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,CAAC,QAAQ,QACb,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CACpB,oBAAC,UAAU,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI,CACxC,CAAC,CAAC,CAAC,CACH,oBAAC,cAAc,IACd,EAAE,EAAE,EAAE,EACN,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,KAAK,EACjB,mBAAmB,EAAE,KAAK,EAC1B,SAAS,EAAC,wBAAwB,EAClC,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,KAAK,GAClB,CACF,CACe,CACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar/components/CalendarEventContent/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,cAAc,MAAM,sDAAsD,CAAC;AAClF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,oBAAoB,GAAG,CAAC,KAG7B,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAEnD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,CAAC,QAAQ,QACb,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CACpB,oBAAC,UAAU,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,GAAI,CAC9C,CAAC,CAAC,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,CACjC,oBAAC,cAAc,IACd,EAAE,EAAE,EAAE,EACN,WAAW,EAAE,KAAK,EAClB,UAAU,EAAE,KAAK,EACjB,mBAAmB,EAAE,KAAK,EAC1B,SAAS,EAAC,wBAAwB,EAClC,WAAW,EAAE,KAAK,CAAC,OAAO,EAC1B,YAAY,EAAE,KAAK,GAClB,CACF,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,2BAA2B,EAAC,OAAO,EAAE,KAAK,CAAC,OAAO,IAAG,KAAK,CAAO,CAChF,CACe,CACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from "react";
2
2
  import { AsideContent, observe, useRenderOnChange, UTCDatePicker as DatePicker, } from "@voplus/morpho-ui";
3
- import { useMetaStore } from "@voplus/morpho-document-core";
3
+ import { useMetaStore, useOnDeleteDocument } from "@voplus/morpho-document-core";
4
+ import { useOnDeleteWorkSchedule } from "../../../../data/work-schedule/work-schedule-events";
4
5
  import { FilterOptionsContext, FilterOptionsContextState } from "@voplus/morpho-ui/es/data";
5
6
  import { useCalendarListEffect, useCalendarStore } from "../../../../data/calendar";
6
7
  import { faAngleLeft, faAngleRight } from "@fortawesome/pro-light-svg-icons";
@@ -51,6 +52,12 @@ const CalendarMonth = () => {
51
52
  var _a;
52
53
  setCalendarApi((_a = calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.current) === null || _a === void 0 ? void 0 : _a.getApi());
53
54
  }, [calendarRef]);
55
+ useOnDeleteDocument((s, doc) => {
56
+ state.listOptions = state.listOptions.filter((i) => i.source.id !== doc.id);
57
+ });
58
+ useOnDeleteWorkSchedule((s, doc) => {
59
+ state.listOptions = state.listOptions.filter((i) => i.source.id !== doc.id);
60
+ });
54
61
  useRenderOnChange(() => filterState.options);
55
62
  useCalendarListEffect(null, (list) => {
56
63
  runInAction(() => {
@@ -58,6 +65,7 @@ const CalendarMonth = () => {
58
65
  var _a, _b;
59
66
  item.backgroundColor = generateLightColorFromHash((_a = item === null || item === void 0 ? void 0 : item.source) === null || _a === void 0 ? void 0 : _a.type);
60
67
  item.borderColor = generateLightColorFromHash((_b = item === null || item === void 0 ? void 0 : item.source) === null || _b === void 0 ? void 0 : _b.type);
68
+ item.source.title = item.title;
61
69
  });
62
70
  state.listOptions = list;
63
71
  });
@@ -66,7 +74,7 @@ const CalendarMonth = () => {
66
74
  const eventContent = (info) => {
67
75
  const type = info.event.extendedProps.source.type;
68
76
  const id = info.event.extendedProps.source.id;
69
- return (React.createElement(CalendarEventContent, { id: id, type: type, onClick: () => {
77
+ return (React.createElement(CalendarEventContent, { source: info.event.extendedProps.source, onClick: () => {
70
78
  asideContext.openAside(meta.getPropertiesView({
71
79
  id: id,
72
80
  type: type,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/calendar/pages/CalendarMonth/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EACN,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,aAAa,IAAI,UAAU,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAa,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,WAAW,E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,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3B,WAAW,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACP,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;IAED,8BAA8B;IAC9B,SAAS,SAAS,CAAC,IAAS;QAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC;YAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,MAAM,EAAE,CAAC;QACf,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -260,4 +260,9 @@
260
260
  font-size: 15px;
261
261
  font-weight: 500;
262
262
  }
263
+ .calendar-no-document-card {
264
+ color: #000;
265
+ font-size: 15px;
266
+ font-weight: 500;
267
+ }
263
268
  }
@@ -1,7 +1,10 @@
1
1
  import React, { useState } from "react";
2
2
  import { Scrollbars } from "react-custom-scrollbars-2";
3
3
  import { observe } from "@voplus/morpho-ui";
4
+ import { useRenderOnChange } from "@voplus/morpho-ui";
5
+ import { useOnDeleteDocument, useDocumentListEffect, } from "@voplus/morpho-document-core";
4
6
  import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
7
+ import { useOnPinDocument, useOnUnPinDocument, useOnFlagChange, } from "@voplus/morpho-document-core/es/data/DocumentStore/hooks/pin-events";
5
8
  import { faExclamationCircle, faStar } from "@fortawesome/free-solid-svg-icons";
6
9
  import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
7
10
  import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
@@ -9,11 +12,30 @@ import PropertiesView from "@voplus/morpho-document-core/es/components/Propertie
9
12
  import PinnedCardList from "../PinnedCardList";
10
13
  import PageHeader from "@voplus/morpho-ui/es/components/PageHeader";
11
14
  import styles from "./index.less";
15
+ import { State } from "./state";
12
16
  const MyPinned = (props) => {
13
17
  /** 加class name 为了方便做integration tests */
14
18
  const classId = "pinned-list";
15
19
  const [asideContext] = useState(AsideContent.createContext());
16
- const list = useCreateListDataState({}, []);
20
+ const [state] = useState(new State());
21
+ const list = useCreateListDataState({
22
+ filterDefaults: {
23
+ includes: "tags",
24
+ filters: [{ c: "Pin", l: "And", o: "=", v1: "True" }],
25
+ page: { Page: 1, PageSize: 500 },
26
+ },
27
+ }, []);
28
+ /** 如果 list.filters.options变更了就重渲染,使下一行的useTaskListEffect 可以接收新参数*/
29
+ useRenderOnChange(() => list.filters.options);
30
+ /** 把ListDataState传给useTaskListEffect,使之可以自動更新loading, hasmore. */
31
+ useDocumentListEffect(list, (result, total) => {
32
+ list.union(result);
33
+ state.update(result, "new", true);
34
+ }, { ...list.filters.options, Total: true });
35
+ useOnPinDocument((s, d) => state.update([d], "new"));
36
+ useOnUnPinDocument((s, d) => state.update([d], "del"));
37
+ useOnFlagChange((s, d) => state.onChangeFlag(d));
38
+ useOnDeleteDocument((s, d) => state.update([d], "del"));
17
39
  return observe(() => (React.createElement(AsideContent, { context: asideContext },
18
40
  React.createElement(ListDataContext.Provider, { value: list },
19
41
  React.createElement("div", { className: styles["my-pinned"] },
@@ -25,15 +47,15 @@ const MyPinned = (props) => {
25
47
  React.createElement("span", { className: "pinned-list-title text-gray-700" },
26
48
  React.createElement(FAIcon, { icon: faStar, className: "margin-right-10" }),
27
49
  "Starred"),
28
- React.createElement(PinnedCardList, { filterStatus: "Star", onItemClick: onItemClick, className: classId + "-star" })),
50
+ React.createElement(PinnedCardList, { list: state.starredList, onItemClick: onItemClick, className: classId + "-star" })),
29
51
  React.createElement("div", { className: "pinned-list" },
30
52
  React.createElement("span", { className: "pinned-list-title text-gray-700" },
31
53
  React.createElement(FAIcon, { icon: faExclamationCircle, className: "margin-right-10" }),
32
54
  "Urgent"),
33
- React.createElement(PinnedCardList, { filterStatus: "Urgent", onItemClick: onItemClick, className: classId + "-urgent" })),
55
+ React.createElement(PinnedCardList, { list: state.urgentList, onItemClick: onItemClick, className: classId + "-urgent" })),
34
56
  React.createElement("div", { className: "pinned-list" },
35
57
  React.createElement("span", { className: "pinned-list-title text-gray-700" }, "Others"),
36
- React.createElement(PinnedCardList, { filterStatus: "None", onItemClick: onItemClick, className: classId + "-others" })))))))));
58
+ React.createElement(PinnedCardList, { list: state.othersList, onItemClick: onItemClick, className: classId + "-others" })))))))));
37
59
  function onItemClick(id) {
38
60
  var _a;
39
61
  asideContext.openAside(React.createElement(PropertiesView, { id: id }), { span: 12 });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/pin/components/MyPinned/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,cAAc,MAAM,2DAA2D,CAAC;AACvF,OAAO,cAAc,MAAM,mBAAmB,C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,EACxB,SAAS,EAAE,OAAO,GAAG,SAAS,GAC7B,CACG;wBACN,6BAAK,SAAS,EAAC,aAAa;4BAC3B,8BAAM,SAAS,EAAC,iCAAiC,aAAc;4BAC/D,oBAAC,cAAc,IACd,YAAY,EAAC,MAAM,EACnB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,GAAG,SAAS,GAC7B,CACG,CACM,CACR,CACD,CACoB,CACb,CACf,CAAC,CAAC;IAEH,SAAS,WAAW,CAAC,EAAU;;QAC9B,YAAY,CAAC,SAAS,CAAC,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,GAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACjE,MAAA,KAAK,CAAC,WAAW,sDAAG,EAAE,CAAC,CAAC;IACzB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/pin/components/MyPinned/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAEN,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GACf,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E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,MAAM,IAAC,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAC,iBAAiB,GAAG;yCAE3D;4BACP,oBAAC,cAAc,IACd,IAAI,EAAE,KAAK,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,GAAG,SAAS,GAC7B,CACG;wBACN,6BAAK,SAAS,EAAC,aAAa;4BAC3B,8BAAM,SAAS,EAAC,iCAAiC,aAAc;4BAC/D,oBAAC,cAAc,IACd,IAAI,EAAE,KAAK,CAAC,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,GAAG,SAAS,GAC7B,CACG,CACM,CACR,CACD,CACoB,CACb,CACf,CAAC,CAAC;IAEH,SAAS,WAAW,CAAC,EAAU;;QAC9B,YAAY,CAAC,SAAS,CAAC,oBAAC,cAAc,IAAC,EAAE,EAAE,EAAE,GAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACjE,MAAA,KAAK,CAAC,WAAW,sDAAG,EAAE,CAAC,CAAC;IACzB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { IDocument } from "@voplus/morpho-document-core";
2
+ export declare class State {
3
+ constructor();
4
+ total: number;
5
+ /** Starred, Urgent, Others
6
+ * Star, Urgent, None
7
+ */
8
+ starredList: IDocument[];
9
+ urgentList: IDocument[];
10
+ othersList: IDocument[];
11
+ update(list: IDocument[], type?: "new" | "del", reset?: boolean): void;
12
+ onChangeFlag(d: IDocument): void;
13
+ }
@@ -0,0 +1,93 @@
1
+ import { __decorate } from "tslib";
2
+ import { makeObservable, observable, action } from "mobx";
3
+ export class State {
4
+ constructor() {
5
+ Object.defineProperty(this, "total", {
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true,
9
+ value: 0
10
+ });
11
+ /** Starred, Urgent, Others
12
+ * Star, Urgent, None
13
+ */
14
+ Object.defineProperty(this, "starredList", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: []
19
+ });
20
+ Object.defineProperty(this, "urgentList", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: []
25
+ });
26
+ Object.defineProperty(this, "othersList", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: []
31
+ });
32
+ makeObservable(this);
33
+ }
34
+ update(list, type, reset) {
35
+ if (reset) {
36
+ this.starredList = [];
37
+ this.urgentList = [];
38
+ this.othersList = [];
39
+ }
40
+ list.map((i) => {
41
+ if (i.flag === "Star") {
42
+ if (type === "new")
43
+ this.starredList.push(i);
44
+ else
45
+ this.starredList = this.starredList.filter((item) => item.id !== i.id);
46
+ }
47
+ else if (i.flag === "Urgent") {
48
+ if (type === "new")
49
+ this.urgentList.push(i);
50
+ else
51
+ this.urgentList = this.urgentList.filter((item) => item.id !== i.id);
52
+ }
53
+ else if (i.flag === "None") {
54
+ if (type === "new")
55
+ this.othersList.push(i);
56
+ else
57
+ this.othersList = this.othersList.filter((item) => item.id !== i.id);
58
+ }
59
+ });
60
+ }
61
+ onChangeFlag(d) {
62
+ /** 删除 */
63
+ this.starredList = this.starredList.filter((item) => item.id !== d.id);
64
+ this.urgentList = this.urgentList.filter((item) => item.id !== d.id);
65
+ this.othersList = this.othersList.filter((item) => item.id !== d.id);
66
+ /** 新增 */
67
+ if (d.flag === "Star")
68
+ this.starredList.push(d);
69
+ if (d.flag === "Urgent")
70
+ this.urgentList.push(d);
71
+ if (d.flag === "None")
72
+ this.othersList.push(d);
73
+ }
74
+ }
75
+ __decorate([
76
+ observable
77
+ ], State.prototype, "total", void 0);
78
+ __decorate([
79
+ observable
80
+ ], State.prototype, "starredList", void 0);
81
+ __decorate([
82
+ observable
83
+ ], State.prototype, "urgentList", void 0);
84
+ __decorate([
85
+ observable
86
+ ], State.prototype, "othersList", void 0);
87
+ __decorate([
88
+ action
89
+ ], State.prototype, "update", null);
90
+ __decorate([
91
+ action
92
+ ], State.prototype, "onChangeFlag", null);
93
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../../src/modules/pin/components/MyPinned/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG1D,MAAM,OAAO,KAAK;IACjB;QAImB;;;;mBAAgB,CAAC;WAAC;QACrC;;WAEG;QACgB;;;;mBAA2B,EAAE;WAAC;QAC9B;;;;mBAA0B,EAAE;WAAC;QAC7B;;;;mBAA0B,EAAE;WAAC;QAT/C,cAAc,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAUc,MAAM,CAAC,IAAiB,EAAE,IAAoB,EAAE,KAAe;QAC7E,IAAI,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACd,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACvB,IAAI,IAAI,KAAK,KAAK;oBAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;oBACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;YAC7E,CAAC;iBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAChC,IAAI,IAAI,KAAK,KAAK;oBAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;oBACvC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC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AC,CAAC,CAAC,CAAC;IAChD,CAAC;CACD;AAtCmB;IAAlB,UAAU;oCAA0B;AAIlB;IAAlB,UAAU;0CAAsC;AAC9B;IAAlB,UAAU;yCAAqC;AAC7B;IAAlB,UAAU;yCAAqC;AAEjC;IAAd,MAAM;mCAkBN;AAEc;IAAd,MAAM;yCASN"}
@@ -1,6 +1,7 @@
1
+ import { IDocument } from "@voplus/morpho-document-core";
1
2
  import React from "react";
2
3
  declare const PinnedCardList: (props: {
3
- filterStatus: "Star" | "Urgent" | "None";
4
+ list: IDocument[];
4
5
  onItemClick?: ((id: string) => void) | undefined;
5
6
  className?: string | undefined;
6
7
  }) => React.JSX.Element;
@@ -1,75 +1,18 @@
1
- import { useDocumentListEffect, useMetaStore } from "@voplus/morpho-document-core";
1
+ import { useMetaStore } from "@voplus/morpho-document-core";
2
2
  import React, { useState } from "react";
3
- import { observe, useAutorunEffect, useRenderOnChange } from "@voplus/morpho-ui";
4
- import { useCreateListDataState, useListDataContext } from "@voplus/morpho-ui/es/data";
3
+ import { observe } from "@voplus/morpho-ui";
5
4
  import classnames from "classnames";
6
5
  import CustomIcon from "@voplus/morpho-ui/es/controls/CustomIconList/CustomIcon";
7
6
  import { Empty } from "antd";
8
- import { State } from "./state";
9
- import { runInAction } from "mobx";
10
- import { useAutoUpdateListData } from "@voplus/morpho-document-core/es/data/DocumentStore/hooks/pin-events";
11
7
  const PinnedCardList = (props) => {
8
+ const { list } = props;
12
9
  const [active, setActive] = useState("");
13
- const [state] = useState(new State());
14
- let filters = [];
15
- let sort = {};
16
10
  const meta = useMetaStore();
17
- const list = useListDataContext();
18
- useAutorunEffect(() => {
19
- var _c, _d, _e, _f, _g, _h, _j, _k, _l;
20
- if ((_d = (_c = list.filters) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.Filters) {
21
- filters = (_f = (_e = list.filters) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.Filters;
22
- const result = filters.length === ((_g = state.filters) === null || _g === void 0 ? void 0 : _g.length) &&
23
- filters.every((a) => state.filters.some((b) => a.c === b.c && a.v1 === b.v1)) &&
24
- state.filters.every((_b) => filters.some((_a) => _a.c === _b.c && _a.v1 === _b.v1));
25
- if (!result) {
26
- docList.reset();
27
- runInAction(() => {
28
- // should use useOnRenderChange
29
- docList["_loading"] = true;
30
- state.filters = filters;
31
- });
32
- }
33
- }
34
- if ((_j = (_h = list.filters) === null || _h === void 0 ? void 0 : _h.options) === null || _j === void 0 ? void 0 : _j.Sort) {
35
- sort = (_l = (_k = list.filters) === null || _k === void 0 ? void 0 : _k.options) === null || _l === void 0 ? void 0 : _l.Sort;
36
- runInAction(() => {
37
- docList.triggerSort(sort);
38
- state.Sort = sort;
39
- });
40
- }
41
- });
42
- /** 建立 ListView 和useDocumentListEffect所需的ListDataState. 会根据state.id重建所以不需reset. */
43
- const docList = useCreateListDataState({
44
- filterDefaults: {
45
- filters: [],
46
- },
47
- }, []);
48
- /** 如果 list.filters.options变更了就重渲染,使下一行的useDocumentListEffect 可以接收新参数*/
49
- useRenderOnChange(() => docList.filters.options);
50
- /** 把ListDataState传给useDocumentListEffect,使之可以自動更新loading, hasmore. */
51
- useDocumentListEffect(docList, (result) => docList.union(result), {
52
- ...docList.filters.options,
53
- Sort: state.Sort,
54
- Filters: [
55
- ...state.filters,
56
- { c: "Pin", l: "And", o: "=", v1: "True" },
57
- {
58
- c: "Flag",
59
- o: "=",
60
- l: "And",
61
- v1: props.filterStatus,
62
- },
63
- ],
64
- });
65
- /** useOnNewDocument, useOnDeleteDocument的sugar syntax 自動更新list. */
66
- useAutoUpdateListData(docList, (d) => d.flag === props.filterStatus);
67
- // return observe(() => <CustomIconList list={list.data as any} onClickItem={onItemClick} />);
68
- return observe(() => (React.createElement("div", { className: classnames("custom-icon-list", props.className) }, docList.data.length !== 0 ? (docList.data.map((item) => (React.createElement(CustomIcon, { key: item.id, id: item.id, name: item.name, icon: meta.getIcon(item), onClickItem: onClickItem, className: active === item.id ? "active" : "" })))) : (React.createElement(Empty, { className: "empty-style" })))));
11
+ return observe(() => (React.createElement("div", { className: classnames("custom-icon-list", props.className) }, list.length !== 0 ? (list.map((item) => (React.createElement(CustomIcon, { key: item.id, id: item.id, name: item.name, icon: meta.getIcon(item), onClickItem: onClickItem, className: active === item.id ? "active" : "" })))) : (React.createElement(Empty, { className: "empty-style" })))));
69
12
  function onClickItem(id) {
70
- var _c;
13
+ var _a;
71
14
  setActive(id);
72
- (_c = props.onItemClick) === null || _c === void 0 ? void 0 : _c.call(props, id);
15
+ (_a = props.onItemClick) === null || _a === void 0 ? void 0 : _a.call(props, id);
73
16
  }
74
17
  };
75
18
  export default PinnedCardList;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/pin/components/PinnedCardList/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,qBAAqB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,UAAU,MAAM,yDAAyD,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAE5G,MAAM,cAAc,GAAG,CAAC,KAIvB,EAAE,EAAE;IACJ,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,KA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GAAG,CAAC,KAIvB,EAAE,EAAE;IACJ,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAE5B,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,6BAAK,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,IAC7D,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACpB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAClB,oBAAC,UAAU,IACV,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,EAAE,EAAE,IAAI,CAAC,EAAG,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EACxB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAC5C,CACF,CAAC,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,IAAC,SAAS,EAAC,aAAa,GAAG,CACjC,CACI,CACN,CAAC,CAAC;IAEH,SAAS,WAAW,CAAC,EAAU;;QAC9B,SAAS,CAAC,EAAE,CAAC,CAAC;QACd,MAAA,KAAK,CAAC,WAAW,sDAAG,EAAE,CAAC,CAAC;IACzB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -25,8 +25,9 @@ const AddTaskDropdown = (props) => {
25
25
  props.onItemClick(key);
26
26
  }
27
27
  function onVisibleChange(visible) {
28
+ var _a;
28
29
  setVisible(visible);
29
- props.onCancelClick();
30
+ (_a = props.onCancelClick) === null || _a === void 0 ? void 0 : _a.call(props);
30
31
  }
31
32
  };
32
33
  export default AddTaskDropdown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/tasks/components/AddTaskDropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,wBAAwB;AACxB,MAAM,eAAe,GAAG,CAAC,KAMxB,EAAE,EAAE;IACJ,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IAExC,IAAI,QAAQ,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAEhD,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAE1F,aAAa;IACb,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAC1B,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC;QAC9C,oBAAC,IAAI,IAAC,OAAO,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,GAAI,CAC7D,CACN,CAAC,CAA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,CAAC,EACvD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE;gBAElC,oBAAC,MAAM,IAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,GAAI,CAC1C,CACG,CACK,CACjB,CAAC,CAAC;IAEH,SAAS,WAAW,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAO;QAC1C,QAAQ,CAAC,eAAe,EAAE,CAAC;QAC3B,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,CAAC,WAAY,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,SAAS,eAAe,CAAC,OAAgB;;QACxC,UAAU,CAAC,OAAO,CAAC,CAAC;QACpB,MAAA,KAAK,CAAC,aAAa,qDAAI,CAAC;IACzB,CAAC;AACF,CAAC,CAAC;AACF,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voplus/morpho-workspace",
3
- "version": "6.0.44",
3
+ "version": "6.0.46",
4
4
  "description": "morpho workspace module",
5
5
  "repository": {
6
6
  "type": "git",