@voplus/morpho-document 1.0.0-dev200 → 1.0.0-dev202

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 (111) hide show
  1. package/changelog.md +4 -0
  2. package/es/components/ActivityLog/index.js +2 -2
  3. package/es/components/ActivityLog/index.js.map +1 -1
  4. package/es/components/ActivityLog/state.d.ts +1 -0
  5. package/es/components/ActivityLog/state.js +4 -1
  6. package/es/components/ActivityLog/state.js.map +1 -1
  7. package/es/components/DocumentName/index.js +7 -2
  8. package/es/components/DocumentName/index.js.map +1 -1
  9. package/es/components/DocumentSelectDialog/index.js +4 -2
  10. package/es/components/DocumentSelectDialog/index.js.map +1 -1
  11. package/es/components/DocumentSelectDialog/index.less +3 -0
  12. package/es/components/DocumentSortableTree/index.d.ts +7 -1
  13. package/es/components/DocumentSortableTree/index.js +12 -2
  14. package/es/components/DocumentSortableTree/index.js.map +1 -1
  15. package/es/components/DocumentSortableTree/state.d.ts +6 -0
  16. package/es/components/DocumentSortableTree/state.js.map +1 -1
  17. package/es/components/FileExplorerTheme/index.d.ts +3 -0
  18. package/es/components/FileExplorerTheme/index.js +22 -0
  19. package/es/components/FileExplorerTheme/index.js.map +1 -0
  20. package/es/components/FileExplorerTheme/node-content-renderer.d.ts +3 -0
  21. package/es/components/FileExplorerTheme/node-content-renderer.js +80 -0
  22. package/es/components/FileExplorerTheme/node-content-renderer.js.map +1 -0
  23. package/es/components/FileExplorerTheme/node-content-renderer.less +332 -0
  24. package/es/components/FileExplorerTheme/tree-node-renderer.d.ts +3 -0
  25. package/es/components/FileExplorerTheme/tree-node-renderer.js +21 -0
  26. package/es/components/FileExplorerTheme/tree-node-renderer.js.map +1 -0
  27. package/es/components/FileExplorerTheme/tree-node-renderer.less +4 -0
  28. package/es/components/Links/Item.js +1 -13
  29. package/es/components/Links/Item.js.map +1 -1
  30. package/es/components/QuickAccessSearch/ObjectItem/index.d.ts +1 -1
  31. package/es/components/QuickAccessSearch/ObjectItem/index.js +2 -2
  32. package/es/components/QuickAccessSearch/ObjectItem/index.js.map +1 -1
  33. package/es/components/QuickAccessSearch/index.js +6 -16
  34. package/es/components/QuickAccessSearch/index.js.map +1 -1
  35. package/es/components/QuickAccessSearch/state.d.ts +2 -4
  36. package/es/components/QuickAccessSearch/state.js +3 -8
  37. package/es/components/QuickAccessSearch/state.js.map +1 -1
  38. package/es/components/SortableTreeDocumentTheme/index.d.ts +2 -2
  39. package/es/components/SortableTreeDocumentTheme/index.js +2 -2
  40. package/es/components/SortableTreeDocumentTheme/index.js.map +1 -1
  41. package/es/components/TagView/index.js +17 -11
  42. package/es/components/TagView/index.js.map +1 -1
  43. package/es/components/TagView/index.less +13 -0
  44. package/es/components/TagView/state.d.ts +4 -0
  45. package/es/components/TagView/state.js +10 -0
  46. package/es/components/TagView/state.js.map +1 -1
  47. package/es/components/VersionsModal/index.js.map +1 -1
  48. package/es/data/ObjectStore/hooks.d.ts +7 -0
  49. package/es/data/ObjectStore/hooks.js +19 -0
  50. package/es/data/ObjectStore/hooks.js.map +1 -0
  51. package/es/data/ObjectStore/index.d.ts +1 -0
  52. package/es/data/ObjectStore/index.js +2 -0
  53. package/es/data/ObjectStore/index.js.map +1 -0
  54. package/es/data/index.d.ts +1 -0
  55. package/es/data/index.js +1 -0
  56. package/es/data/index.js.map +1 -1
  57. package/es/data/interfaces/IObject.d.ts +11 -0
  58. package/es/data/interfaces/IObject.js +1 -0
  59. package/es/data/interfaces/IObject.js.map +1 -0
  60. package/es/data/interfaces/index.d.ts +1 -0
  61. package/es/index.d.ts +0 -1
  62. package/es/index.js +0 -1
  63. package/es/index.js.map +1 -1
  64. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.d.ts +14 -0
  65. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js +28 -0
  66. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.js.map +1 -0
  67. package/es/modules/unit/components/QuickDataIcon/UnitTeamsIcon/index.less +21 -0
  68. package/es/modules/unit/components/QuickDataIcon/index.d.ts +25 -0
  69. package/es/modules/unit/components/QuickDataIcon/index.js +45 -0
  70. package/es/modules/unit/components/QuickDataIcon/index.js.map +1 -0
  71. package/es/modules/unit/components/QuickDataIcon/index.less +0 -0
  72. package/es/modules/unit/components/UnitAvatar/index.d.ts +15 -0
  73. package/es/modules/unit/components/UnitAvatar/index.js +29 -0
  74. package/es/modules/unit/components/UnitAvatar/index.js.map +1 -0
  75. package/es/modules/unit/components/UnitAvatar/index.less +14 -0
  76. package/es/modules/unit/components/UnitHead/index.d.ts +3 -0
  77. package/es/modules/unit/components/UnitHead/index.js +7 -0
  78. package/es/modules/unit/components/UnitHead/index.js.map +1 -0
  79. package/es/modules/unit/components/UnitItem/index.d.ts +6 -0
  80. package/es/modules/unit/components/UnitItem/index.js +19 -0
  81. package/es/modules/unit/components/UnitItem/index.js.map +1 -0
  82. package/es/modules/unit/components/UnitItem/index.less +19 -0
  83. package/es/pages/TreeViewPage/index.js +1 -1
  84. package/es/pages/TreeViewPage/index.js.map +1 -1
  85. package/es/routes.d.ts +6 -0
  86. package/es/routes.js +12 -1
  87. package/es/routes.js.map +1 -1
  88. package/package.json +2 -2
  89. package/es/components/QuickAccessSearch/ObjectList/index.d.ts +0 -5
  90. package/es/components/QuickAccessSearch/ObjectList/index.js +0 -42
  91. package/es/components/QuickAccessSearch/ObjectList/index.js.map +0 -1
  92. package/es/components/QuickAccessSearch/ObjectList/index.less +0 -10
  93. package/es/components/QuickAccessSearch/ObjectList/state.d.ts +0 -40
  94. package/es/components/QuickAccessSearch/ObjectList/state.js +0 -61
  95. package/es/components/QuickAccessSearch/ObjectList/state.js.map +0 -1
  96. package/es/views/DocumentListView/index.d.ts +0 -5
  97. package/es/views/DocumentListView/index.js +0 -100
  98. package/es/views/DocumentListView/index.js.map +0 -1
  99. package/es/views/DocumentListView/state.d.ts +0 -22
  100. package/es/views/DocumentListView/state.js +0 -38
  101. package/es/views/DocumentListView/state.js.map +0 -1
  102. package/es/views/DocumentRoutes.d.ts +0 -11
  103. package/es/views/DocumentRoutes.js +0 -25
  104. package/es/views/DocumentRoutes.js.map +0 -1
  105. package/es/views/DocumentTabView/index.d.ts +0 -3
  106. package/es/views/DocumentTabView/index.js +0 -68
  107. package/es/views/DocumentTabView/index.js.map +0 -1
  108. package/es/views/DocumentTabView/index.less +0 -47
  109. package/es/views/DocumentTabView/state.d.ts +0 -6
  110. package/es/views/DocumentTabView/state.js +0 -18
  111. package/es/views/DocumentTabView/state.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voplus/morpho-document",
3
- "version": "1.0.0-dev200",
3
+ "version": "1.0.0-dev202",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://voplus.visualstudio.com/morpho-document/_git/morpho-document"
@@ -56,7 +56,7 @@
56
56
  "@voplus/morpho-client-test": "^1.0.0-dev014",
57
57
  "@voplus/morpho-collaboration": "^1.0.0-dev021-antd4",
58
58
  "@voplus/morpho-config": "^1.0.0-dev42",
59
- "@voplus/morpho-data": "^1.0.0-dev090",
59
+ "@voplus/morpho-data": "^1.0.0-dev092",
60
60
  "@voplus/morpho-org": "^1.0.0-dev032-antd4",
61
61
  "@voplus/morpho-text": "^1.0.0-dev016",
62
62
  "@voplus/morpho-ui": "^1.0.0-dev098",
@@ -1,5 +0,0 @@
1
- import "./index.less";
2
- import { ObjectListProps } from "./state";
3
- import React from "react";
4
- declare const _default: React.ForwardRefExoticComponent<ObjectListProps & React.RefAttributes<unknown>>;
5
- export default _default;
@@ -1,42 +0,0 @@
1
- import "./index.less";
2
- import { Empty, Spin } from "@voplus/antd";
3
- import { State } from "./state";
4
- import React, { forwardRef, useEffect, useImperativeHandle, useState } from "react";
5
- import InfiniteScroll from "react-infinite-scroller";
6
- import { LoadingOutlined } from "@ant-design/icons";
7
- import { Scrollbars } from "react-custom-scrollbars";
8
- import { useObserver } from "mobx-react-lite";
9
- const ObjectList = (props, ref) => {
10
- const { data, contactData, loading, children, description, imageStyle, image, scrollParentRef } = props;
11
- const [state] = useState(new State());
12
- state.pageSize = props.pageSize || 20;
13
- state.props = props;
14
- useEffect(() => {
15
- state.data = data;
16
- state.list = props.page > 1 ? state.deduplicate : data;
17
- if (!loading && (!data.length || data.length < state.pageSize)) {
18
- state.hasMore = false;
19
- }
20
- else {
21
- state.hasMore = true;
22
- }
23
- }, [data]);
24
- /** 自定在使用 ref 时,公开给父组件的实例值,必须和forwardRef一起使用。 */
25
- useImperativeHandle(ref, () => ({
26
- reset: reset,
27
- list: state.list
28
- }));
29
- return useObserver(() => (React.createElement(Scrollbars, { autoHide: true },
30
- React.createElement(InfiniteScroll, { initialLoad: false, pageStart: 1, loadMore: () => state.loadMore(), hasMore: loading && !!state.hasMore, useWindow: false, threshold: 250, getScrollParent: () => scrollParentRef },
31
- children(state.list, contactData),
32
- loading && state.hasMore && (React.createElement("div", { className: "page-list-view_loading" },
33
- React.createElement(Spin, { tip: "Loading...", indicator: React.createElement(LoadingOutlined, null) }))),
34
- !loading && !state.list.length && !(contactData === null || contactData === void 0 ? void 0 : contactData.length) && (React.createElement(Empty, { className: "page-list-view-empty", description: description, imageStyle: imageStyle, image: image }))))));
35
- /** reset 重置 */
36
- function reset() {
37
- state.list = [];
38
- state.hasMore = true;
39
- }
40
- };
41
- export default forwardRef(ObjectList);
42
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/QuickAccessSearch/ObjectList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAmB,KAAK,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,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BAAC,UAAU,IAAC,QAAQ;QACnB,oBAAC,cAAc,IACd,WAAW,EAAE,KAAK,EAClB,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EAChC,OAAO,EAAE,OAAO,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,EACnC,SAAS,EAAE,KAAK,EAChB,SAAS,EAAE,GAAG,EACd,eAAe,EAAE,GAAG,EAAE,CAAC,eAAe;YAErC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC;YACjC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,CAC5B,6BAAK,SAAS,EAAC,wBAAwB;gBACtC,oBAAC,IAAI,IAAC,GAAG,EAAC,YAAY,EAAC,SAAS,EAAE,oBAAC,eAAe,OAAG,GAAI,CACpD,CACN;YACA,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,EAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAA,IAAI,CAC1D,oBAAC,KAAK,IACL,SAAS,EAAC,sBAAsB,EAChC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,GACX,CACF,CACe,CACL,CACb,CAAC,CAAC;IAEH,eAAe;IACf,SAAS,KAAK;QACb,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,UAAU,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- :global{
2
- .page-list-view_loading {
3
- padding-top: 20px;
4
- text-align: center;
5
- }
6
- .page-list-view-empty {
7
- padding: 20px 0;
8
- }
9
-
10
- }
@@ -1,40 +0,0 @@
1
- import React from "react";
2
- export declare type ObjectListProps = {
3
- /** list data */
4
- data: any[];
5
- /** contact data */
6
- contactData?: any[];
7
- /** list page */
8
- page?: number;
9
- /** list pageSize */
10
- pageSize?: number;
11
- /** data loading */
12
- loading?: boolean;
13
- /** load more data */
14
- loadMore?: (() => void) | undefined;
15
- scrollParentRef?: any;
16
- /** empty data description */
17
- description?: React.ReactNode;
18
- /** empty data imageStyle */
19
- imageStyle?: React.CSSProperties | undefined;
20
- /** empty data image */
21
- image?: React.ReactNode;
22
- /** list item */
23
- children?: any;
24
- className?: string;
25
- };
26
- export declare class State {
27
- props: ObjectListProps;
28
- list: any[];
29
- data: any[];
30
- page: number;
31
- pageSize: number;
32
- loading: boolean;
33
- loaded: boolean;
34
- /** 是否有更多项要加载。如果为false,则移除事件侦听器。*/
35
- hasMore: boolean;
36
- /** A callback when more items are requested by the user. load more items here */
37
- loadMore: () => Promise<any>;
38
- /** deduplicate */
39
- get deduplicate(): any[];
40
- }
@@ -1,61 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { action, computed, observable } from "mobx";
3
- import { message } from "@voplus/antd";
4
- export class State {
5
- constructor() {
6
- this.list = [];
7
- this.data = [];
8
- this.page = 1;
9
- this.pageSize = 20;
10
- this.loading = false;
11
- this.loaded = true;
12
- /** 是否有更多项要加载。如果为false,则移除事件侦听器。*/
13
- this.hasMore = true;
14
- /** A callback when more items are requested by the user. load more items here */
15
- this.loadMore = async () => {
16
- var _a, _b;
17
- if (this.props.loading)
18
- return;
19
- if (!this.data.length || this.data.length < this.pageSize)
20
- this.hasMore = false;
21
- if (this.list.length && !this.hasMore)
22
- return message.warning("List loaded all");
23
- (_b = (_a = this.props).loadMore) === null || _b === void 0 ? void 0 : _b.call(_a);
24
- };
25
- }
26
- /** deduplicate */
27
- get deduplicate() {
28
- return [...this.list.filter(item => !this.data.some(d => d.id === item.id)), ...this.data];
29
- }
30
- }
31
- __decorate([
32
- observable
33
- ], State.prototype, "props", void 0);
34
- __decorate([
35
- observable
36
- ], State.prototype, "list", void 0);
37
- __decorate([
38
- observable
39
- ], State.prototype, "data", void 0);
40
- __decorate([
41
- observable
42
- ], State.prototype, "page", void 0);
43
- __decorate([
44
- observable
45
- ], State.prototype, "pageSize", void 0);
46
- __decorate([
47
- observable
48
- ], State.prototype, "loading", void 0);
49
- __decorate([
50
- observable
51
- ], State.prototype, "loaded", void 0);
52
- __decorate([
53
- observable
54
- ], State.prototype, "hasMore", void 0);
55
- __decorate([
56
- action
57
- ], State.prototype, "loadMore", void 0);
58
- __decorate([
59
- computed
60
- ], State.prototype, "deduplicate", null);
61
- //# sourceMappingURL=state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/components/QuickAccessSearch/ObjectList/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA2BvC,MAAM,OAAO,KAAK;IAAlB;QAEoB,SAAI,GAAU,EAAE,CAAC;QACjB,SAAI,GAAU,EAAE,CAAC;QACjB,SAAI,GAAG,CAAC,CAAC;QACT,aAAQ,GAAG,EAAE,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAG,IAAI,CAAC;QACjC,kCAAkC;QACf,YAAO,GAAG,IAAI,CAAC;QAElC,kFAAkF;QAE3E,aAAQ,GAAG,KAAK,IAAI,EAAE;;YAC5B,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;gBAAE,OAAO;YAC/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ;gBAAE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YAChF,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,OAAO,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACjF,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,QAAQ,mDAAK;QACzB,CAAC,CAAC;IAOH,CAAC;IALA,kBAAkB;IAElB,IAAW,WAAW;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5F,CAAC;CACD;AAxBY;IAAX,UAAU;oCAA+B;AAC9B;IAAX,UAAU;mCAAyB;AACxB;IAAX,UAAU;mCAAyB;AACxB;IAAX,UAAU;mCAAiB;AAChB;IAAX,UAAU;uCAAsB;AACrB;IAAX,UAAU;sCAAwB;AACvB;IAAX,UAAU;qCAAsB;AAErB;IAAX,UAAU;sCAAuB;AAIlC;IADC,MAAM;uCAML;AAIF;IADC,QAAQ;wCAGR"}
@@ -1,5 +0,0 @@
1
- import { DocumentListProps } from "./state";
2
- import React from "react";
3
- export declare const DocumentListContext: React.Context<any>;
4
- declare const DocumentList: (props: DocumentListProps) => JSX.Element;
5
- export default DocumentList;
@@ -1,100 +0,0 @@
1
- import { State } from "./state";
2
- import { useDocumentListEffect, useDocumentStore, useOnDeleteDocument, useOnNewDocument } from "../../data";
3
- import React, { createContext, useEffect, useState } from "react";
4
- import { useLocalStore, useObserver } from "mobx-react-lite";
5
- import DocumentItem from "../../components/DocumentItem";
6
- import DocumentPropertiesView from "../../components/DocumentPropertiesView";
7
- import { ListView } from "@voplus/morpho-ui";
8
- import NewDocumentForm from "../../components/NewDocumentForm";
9
- import { toJS } from "mobx";
10
- export const DocumentListContext = createContext(null);
11
- const DocumentList = (props) => {
12
- const documentstore = useDocumentStore();
13
- const [state] = useState(new State(documentstore));
14
- state.props = props;
15
- state.breadCrumbs[0].id = props.id;
16
- const [id, setId] = useState(props.id);
17
- const filtersList = [
18
- { name: "Draft", value: "Draft", counts: "n", color: "#e6ad51" },
19
- { name: "Normal", value: "Normal", counts: "n", color: "#ff5c86" },
20
- { name: "Readonly", value: "Readonly", counts: "n", color: "#4bd8e0" },
21
- { name: "Archived", value: "Archived", counts: "n", color: "#52c41a" },
22
- { name: "Deleted", value: "Deleted", counts: "n", color: "#823f3f" }
23
- ];
24
- const documentType = ["Document", "File", "Text", "Project", "Task", "Meeting", "Agenda"];
25
- const exclude = props.exclude || [];
26
- const typeExclude = documentType.filter(item => !exclude.includes(item));
27
- const loadData = () => {
28
- state.loading = true;
29
- state.page = state.page + 1;
30
- };
31
- const onFilter = (value) => {
32
- reset();
33
- const { status } = value;
34
- state.filters = status;
35
- };
36
- const reset = () => {
37
- state.page = 1;
38
- state.lists = [];
39
- state.loading = true;
40
- // ref?.current?.reset();
41
- };
42
- const onDriveClick = (value) => {
43
- const { id, name, type, parentId, parentName } = value;
44
- setId(id);
45
- if (type === "bread") {
46
- const breadIndex = state.breadCrumbs.findIndex(item => item.id === id) + 1;
47
- state.breadCrumbs.splice(breadIndex, state.breadCrumbs.length - breadIndex);
48
- }
49
- else {
50
- if (parentId)
51
- state.breadCrumbs.push({ name: parentName, id: parentId, path: "drive" });
52
- if (name)
53
- state.breadCrumbs.push({ name: name, id: id, path: "drive" });
54
- }
55
- };
56
- const store = useLocalStore(() => ({
57
- type: "drive-sub",
58
- onDriveClick: onDriveClick
59
- }));
60
- useDocumentListEffect(list => {
61
- state.lists = list;
62
- state.loading = false;
63
- }, {
64
- Filters: [
65
- { c: "ParentNodeId", o: "=", l: "And", v1: id },
66
- {
67
- c: "Status",
68
- o: "contains",
69
- l: "And",
70
- v1: toJS(JSON.stringify(state.filters))
71
- },
72
- { c: "Type", o: "contains", l: "And", v1: toJS(JSON.stringify(typeExclude)) }
73
- ],
74
- Page: { Page: state.page, PageSize: 20 }
75
- });
76
- useOnNewDocument((s, doc) => {
77
- if (doc.parentNodeId === id && !exclude.includes(doc.type)) {
78
- state.lists.push(doc);
79
- }
80
- });
81
- useOnDeleteDocument((s, doc) => {
82
- if (doc.parentNodeId === id) {
83
- state.lists.splice(state.lists.findIndex((item) => item.id === doc.id), 1);
84
- }
85
- });
86
- useEffect(() => {
87
- reset();
88
- state.filters = ["Draft", "Normal", "Readonly", "Archived", "Deleted"];
89
- }, [id]);
90
- // reset
91
- useEffect(() => {
92
- state.page = 1;
93
- state.lists = [];
94
- state.loading = true;
95
- }, [JSON.stringify(state.filters)]);
96
- return useObserver(() => (React.createElement(DocumentListContext.Provider, { value: store },
97
- React.createElement(ListView, { renderId: id, type: "breadCrumbs", filterable: true, sortable: false, loading: state.loading, page: state.page, data: state.lists, formViewTitle: "Add Document", formView: React.createElement(NewDocumentForm, { showView: true, parentId: id }), defaultView: (id) => React.createElement(DocumentPropertiesView, { id: id }), loadMore: loadData, statusList: state.filters, statusMenus: filtersList, onFilter: onFilter, onBreadCrumb: onDriveClick, path: "drive", breadCrumbs: state.breadCrumbs, renderItem: ({ item, index }) => (React.createElement(DocumentItem, { id: item.id, type: "drive", reload: state.reload })) }))));
98
- };
99
- export default DocumentList;
100
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/DocumentListView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAGN,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,sBAAsB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,eAAe,MAA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E,KAAK,CAAC,KAAK,EACjB,aAAa,EAAC,cAAc,EAC5B,QAAQ,EAAE,oBAAC,eAAe,IAAC,QAAQ,QAAC,QAAQ,EAAE,EAAE,GAAI,EACpD,WAAW,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,oBAAC,sBAAsB,IAAC,EAAE,EAAE,EAAE,GAAI,EAC/D,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,KAAK,CAAC,OAAO,EACzB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAO,EAAE,EAAE,CAAC,CACrC,oBAAC,YAAY,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,CAChE,GACA,CAC4B,CAC/B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,22 +0,0 @@
1
- import { DocumentStore, IDocument } from "../../data";
2
- export interface IBreadCrumb {
3
- id: string;
4
- name: string;
5
- path?: string;
6
- }
7
- export declare type DocumentListProps = {
8
- id: string;
9
- exclude?: string[];
10
- };
11
- export declare class State {
12
- private _store;
13
- props: DocumentListProps;
14
- constructor(_store: DocumentStore);
15
- lists: IDocument[];
16
- page: number;
17
- filters: any[];
18
- breadCrumbs: IBreadCrumb[];
19
- loading: boolean;
20
- reload: boolean;
21
- readonly: boolean;
22
- }
@@ -1,38 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { observable } from "mobx";
3
- export class State {
4
- constructor(_store) {
5
- this._store = _store;
6
- this.lists = [];
7
- this.page = 1;
8
- this.filters = ["Draft", "Normal", "Readonly", "Archived", "Deleted"];
9
- this.breadCrumbs = [
10
- { name: "Drive", id: (this.props && this.props.id) || "", path: "drive" }
11
- ];
12
- this.loading = true;
13
- this.reload = false;
14
- this.readonly = false;
15
- }
16
- }
17
- __decorate([
18
- observable
19
- ], State.prototype, "lists", void 0);
20
- __decorate([
21
- observable
22
- ], State.prototype, "page", void 0);
23
- __decorate([
24
- observable
25
- ], State.prototype, "filters", void 0);
26
- __decorate([
27
- observable
28
- ], State.prototype, "breadCrumbs", void 0);
29
- __decorate([
30
- observable
31
- ], State.prototype, "loading", void 0);
32
- __decorate([
33
- observable
34
- ], State.prototype, "reload", void 0);
35
- __decorate([
36
- observable
37
- ], State.prototype, "readonly", void 0);
38
- //# sourceMappingURL=state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/views/DocumentListView/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAalC,MAAM,OAAO,KAAK;IAEjB,YAA2B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QAC7B,UAAK,GAAgB,EAAE,CAAC;QACxB,SAAI,GAAG,CAAC,CAAC;QACT,YAAO,GAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QACxE,gBAAW,GAAkB;YAC/C,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SACzE,CAAC;QACiB,YAAO,GAAG,IAAI,CAAC;QACf,WAAM,GAAG,KAAK,CAAC;QACf,aAAQ,GAAG,KAAK,CAAC;IATe,CAAC;CAUpD;AATY;IAAX,UAAU;oCAAgC;AAC/B;IAAX,UAAU;mCAAiB;AAChB;IAAX,UAAU;sCAAgF;AAC/E;IAAX,UAAU;0CAET;AACU;IAAX,UAAU;sCAAuB;AACtB;IAAX,UAAU;qCAAuB;AACtB;IAAX,UAAU;uCAAyB"}
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- declare const Routes: {
3
- Document: {
4
- route: string;
5
- tabPattern: RegExp;
6
- getUrl: (id: string) => string;
7
- component: () => JSX.Element;
8
- };
9
- addRoutes: () => void;
10
- };
11
- export default Routes;
@@ -1,25 +0,0 @@
1
- import React from "react";
2
- import { Route, Switch } from "react-router";
3
- import { BaseRoutes } from "@voplus/morpho-data";
4
- import DocumentTabView from "./DocumentTabView";
5
- const TaskRoutes = () => {
6
- return (React.createElement(Switch, null,
7
- React.createElement(Route, { path: Routes.Document.route, exact: true, component: Routes.Document.component })));
8
- };
9
- const Routes = {
10
- Document: {
11
- route: "/document/:id",
12
- tabPattern: RegExp("/document/[^/]+"),
13
- getUrl: (id) => `/document/${id}`,
14
- component: DocumentTabView
15
- },
16
- addRoutes: () => {
17
- BaseRoutes.routes.push({
18
- name: "document",
19
- tabBasePattern: Routes.Document.tabPattern,
20
- component: React.createElement(TaskRoutes, null)
21
- });
22
- }
23
- };
24
- export default Routes;
25
- //# sourceMappingURL=DocumentRoutes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DocumentRoutes.js","sourceRoot":"","sources":["../../src/views/DocumentRoutes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,UAAU,GAAG,GAAG,EAAE;IACvB,OAAO,CACN,oBAAC,MAAM;QAEN,oBAAC,KAAK,IAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,GAAI,CACjF,CACT,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG;IACd,QAAQ,EAAE;QACT,KAAK,EAAE,eAAe;QACtB,UAAU,EAAE,MAAM,CAAC,iBAAiB,CAAC;QACrC,MAAM,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,aAAa,EAAE,EAAE;QACzC,SAAS,EAAE,eAAe;KAC1B;IAED,SAAS,EAAE,GAAG,EAAE;QACf,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,IAAI,EAAE,UAAU;YAChB,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU;YAC1C,SAAS,EAAE,oBAAC,UAAU,OAAG;SACzB,CAAC,CAAC;IACJ,CAAC;CACD,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const DocumentTabView: () => JSX.Element;
3
- export default DocumentTabView;
@@ -1,68 +0,0 @@
1
- import { Breadcrumb, Tabs, Tooltip } from "@voplus/antd";
2
- import React, { useEffect, useState } from "react";
3
- import { useLayout, useTabItem } from "@voplus/morpho-data";
4
- import ActivityLog from "../../components/ActivityLog";
5
- import AsideContent from "@voplus/morpho-ui/es/components/layout/AsideContent";
6
- import Comment from "@voplus/morpho-collaboration/es/components/Comment";
7
- import DocumentDescription from "../../components/DocumentDescription";
8
- import DocumentHeader from "../../components/DocumentHeader";
9
- import { Scrollbars } from "react-custom-scrollbars";
10
- import { State } from "./state";
11
- import classnames from "classnames";
12
- import styles from "./index.less";
13
- import { useDocument } from "../../data";
14
- import { useObserver } from "mobx-react-lite";
15
- import { useParams } from "react-router";
16
- const DocumentTabView = () => {
17
- const [asideContext] = useState(AsideContent.createContext());
18
- const params = useParams();
19
- const [state] = useState(new State());
20
- state.id = params.id;
21
- state.document = useDocument(state.id, { reload: true, includes: "path" });
22
- const [breadcrumbs, setBreadcrumbs] = useState();
23
- const layout = useLayout();
24
- const tab = useTabItem();
25
- tab.title = state.document.name;
26
- useEffect(() => {
27
- asideContext.openAside(AsideElement, { span: 12 });
28
- }, []);
29
- useObserver(() => {
30
- const breadcrumbs = (state.document.path || []).map(item => ({
31
- breadcrumbName: item.name,
32
- id: item.id,
33
- path: "/document"
34
- }));
35
- setBreadcrumbs(breadcrumbs);
36
- });
37
- const AsideElement = (React.createElement("div", { className: "module-tab-view_aside", style: { display: state.loading ? "none" : "block" } }, !state.loading && (React.createElement(Tabs, { defaultActiveKey: "1" },
38
- React.createElement(Tabs.TabPane, { tab: "Comments", key: "Comments" },
39
- React.createElement(Comment, { channelId: state.document.id })),
40
- React.createElement(Tabs.TabPane, { tab: "Activities", key: "Activities" },
41
- React.createElement(Scrollbars, null,
42
- React.createElement(ActivityLog, { id: state.document.id, className: styles["task-box"] }))),
43
- React.createElement(Tabs.TabPane, { tab: "Reference", key: "Reference" },
44
- React.createElement(Scrollbars, null,
45
- React.createElement("div", { className: styles["task-box"] }, "Reference")))))));
46
- const subStrName = (name) => {
47
- return state.document.path.length > 4 && name.length > 30 ? name.substr(0, 20) + "..." : name;
48
- };
49
- const toPath = (id) => {
50
- layout.history.replace(`/document/${id}`);
51
- };
52
- const itemRender = (route) => {
53
- return (React.createElement(Tooltip, { title: route.breadcrumbName },
54
- React.createElement("span", { onClick: () => toPath(route.id), className: classnames("breadcrumb-name", { "breadcrumb-active": route.id === state.id }) }, subStrName(route.breadcrumbName))));
55
- };
56
- return useObserver(() => (React.createElement("div", { className: "module-tab-view" },
57
- !!(breadcrumbs && (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length)) && (React.createElement("div", { className: styles["breadcrumb-container"] },
58
- React.createElement(Breadcrumb, { separator: ">", itemRender: itemRender, routes: breadcrumbs }))),
59
- React.createElement(AsideContent, { context: asideContext },
60
- React.createElement("div", { className: styles["task-tab-view"] },
61
- React.createElement("div", { className: "task-tab-view_header" },
62
- React.createElement(DocumentHeader, { id: state.id, onOpen: () => asideContext.asideContent
63
- ? asideContext.closeAside()
64
- : asideContext.openAside(AsideElement, { span: 12 }) })),
65
- React.createElement(DocumentDescription, { id: state.id }))))));
66
- };
67
- export default DocumentTabView;
68
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/views/DocumentTabView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,OAAO,MAAM,oDAAoD,CAAC;AACzE,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AACvE,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC5B,MAAM,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,SAAS,EAAkB,CAAC;IAC3C,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,KAAK,CAAC,QAAQ,GAAG,WAAW,CAAC,KAAK,CAA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AE,CAAC,CACxB,6BAAK,SAAS,EAAC,iBAAiB;QAC9B,CAAC,CAAC,CAAC,WAAW,KAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAA,CAAC,IAAI,CAC1C,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC;YAC7C,oBAAC,UAAU,IAAC,SAAS,EAAC,GAAG,EAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAI,CACpE,CACN;QACD,oBAAC,YAAY,IAAC,OAAO,EAAE,YAAY;YAClC,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC;gBACtC,6BAAK,SAAS,EAAC,sBAAsB;oBACpC,oBAAC,cAAc,IACd,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,MAAM,EAAE,GAAG,EAAE,CACZ,YAAY,CAAC,YAAY;4BACxB,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE;4BAC3B,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAErD,CACG;gBACN,oBAAC,mBAAmB,IAAC,EAAE,EAAE,KAAK,CAAC,EAAE,GAAI,CAEhC,CACQ,CACV,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -1,47 +0,0 @@
1
- @import "../../components/styles/common.less";
2
- .task-tab-view {
3
- display: flex;
4
- flex-direction: column;
5
- height: 100%;
6
- background: #fff;
7
- :global {
8
- .task-tab-view_header {
9
- padding: 10px 20px;
10
- .task-tab-view_name {
11
- display: flex;
12
- justify-content: space-between;
13
- padding-bottom: 20px;
14
- }
15
- .task-tool-bar {
16
- text-align: right;
17
- }
18
- }
19
- .task-description {
20
- padding: 10px 20px;
21
- }
22
- }
23
- }
24
- .breadcrumb-container {
25
- background: #fff;
26
- padding: 5px 20px;
27
- border-bottom: 1px solid #d9d9d9;
28
- cursor: pointer;
29
- :global {
30
- .ant-breadcrumb span {
31
- display: inline-block;
32
- vertical-align: middle;
33
- }
34
- .breadcrumb-name {
35
- display: inline-block;
36
- overflow: hidden;
37
- text-overflow: ellipsis;
38
- white-space: nowrap;
39
- }
40
- .breadcrumb-active {
41
- color: @primary-color;
42
- }
43
- }
44
- }
45
- .task-box {
46
- padding: 0 20px;
47
- }
@@ -1,6 +0,0 @@
1
- import { IDocument } from "src/data";
2
- export declare class State {
3
- id: string;
4
- document: IDocument;
5
- loading: boolean;
6
- }
@@ -1,18 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { observable } from "mobx";
3
- export class State {
4
- constructor() {
5
- this.id = "";
6
- this.loading = false;
7
- }
8
- }
9
- __decorate([
10
- observable
11
- ], State.prototype, "id", void 0);
12
- __decorate([
13
- observable
14
- ], State.prototype, "document", void 0);
15
- __decorate([
16
- observable
17
- ], State.prototype, "loading", void 0);
18
- //# sourceMappingURL=state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/views/DocumentTabView/state.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,MAAM,OAAO,KAAK;IAAlB;QACoB,OAAE,GAAG,EAAE,CAAC;QAER,YAAO,GAAG,KAAK,CAAC;IACpC,CAAC;CAAA;AAHY;IAAX,UAAU;iCAAgB;AACf;IAAX,UAAU;uCAA4B;AAC3B;IAAX,UAAU;sCAAwB"}