@voplus/morpho-document 1.4.36 → 1.4.37

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.
@@ -1,111 +1,111 @@
1
- @import "~@voplus/antd/es/style/themes/default.less";
2
- .reference-view {
3
- display: flex;
4
- flex-direction: column;
5
- height: 100%;
6
- :global {
7
- .reference-header {
8
- display: flex;
9
- margin: 5px 20px 0 20px;
10
- .multiple-remove {
11
- font-weight: 600;
12
- color: #000;
13
- cursor: pointer;
14
- .ant-btn {
15
- padding: 0 10px 0 0;
16
- font-size: 16px;
17
- }
18
- }
19
- .multiple-remove-btn {
20
- .ant-btn {
21
- padding: 0 10px;
22
- font-style: italic;
23
- }
24
- .del-btn {
25
- color: #ff4d4f;
26
- &:hover {
27
- color: #ff7875;
28
- }
29
- }
30
- .cancel-btn {
31
- color: #666;
32
- &:hover {
33
- color: @primary-color;
34
- }
35
- }
36
- }
37
- .plus-icon {
38
- display: inline-block;
39
- padding: 4px;
40
- margin-left: 10px;
41
- font-size: 13px;
42
- line-height: 1px;
43
- background: #1abc9c;
44
- cursor: pointer;
45
- }
46
- }
47
- .reference-view-page {
48
- display: block;
49
- }
50
- .reference-item {
51
- display: flex;
52
- position: relative;
53
- justify-content: space-between;
54
- align-items: center;
55
- padding: 5px 20px;
56
- &:hover {
57
- cursor: pointer;
58
- .reference-item-content {
59
- opacity: 0.4;
60
- }
61
- .reference-status-none {
62
- display: none;
63
- }
64
- .hover-operate-icon {
65
- display: block;
66
- opacity: 1;
67
- }
68
- }
69
- .reference-item-content {
70
- flex: 1;
71
- color: #000;
72
- font-weight: 500;
73
- .reference-content {
74
- display: flex;
75
- flex: 1;
76
- .type-icon {
77
- font-size: 15px;
78
- padding-right: 10px;
79
- }
80
- }
81
- .task-item-name.task-item-name_done {
82
- color: #a8a8a8;
83
- }
84
- .task-control {
85
- display: flex;
86
- align-items: center;
87
- padding: 5px 0;
88
- font-size: 13px;
89
- color: #444;
90
- font-weight: normal;
91
- > span + span {
92
- margin-left: 15px;
93
- }
94
- .svg-inline--fa {
95
- margin-right: 5px;
96
- }
97
- }
98
- }
99
-
100
- .hover-operate-icon {
101
- display: none;
102
- }
103
- }
104
- .ant-empty {
105
- font-size: 12px;
106
- .ant-empty-image {
107
- height: 35px;
108
- }
109
- }
110
- }
111
- }
1
+ @import "~@voplus/antd/es/style/themes/default.less";
2
+ .reference-view {
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ :global {
7
+ .reference-header {
8
+ display: flex;
9
+ margin: 5px 20px 0 20px;
10
+ .multiple-remove {
11
+ font-weight: 600;
12
+ color: #000;
13
+ cursor: pointer;
14
+ .ant-btn {
15
+ padding: 0 10px 0 0;
16
+ font-size: 16px;
17
+ }
18
+ }
19
+ .multiple-remove-btn {
20
+ .ant-btn {
21
+ padding: 0 10px;
22
+ font-style: italic;
23
+ }
24
+ .del-btn {
25
+ color: #ff4d4f;
26
+ &:hover {
27
+ color: #ff7875;
28
+ }
29
+ }
30
+ .cancel-btn {
31
+ color: #666;
32
+ &:hover {
33
+ color: @primary-color;
34
+ }
35
+ }
36
+ }
37
+ .plus-icon {
38
+ display: inline-block;
39
+ padding: 4px;
40
+ margin-left: 10px;
41
+ font-size: 13px;
42
+ line-height: 1px;
43
+ background: #1abc9c;
44
+ cursor: pointer;
45
+ }
46
+ }
47
+ .reference-view-page {
48
+ display: block;
49
+ }
50
+ .reference-item {
51
+ display: flex;
52
+ position: relative;
53
+ justify-content: space-between;
54
+ align-items: center;
55
+ padding: 5px 20px;
56
+ &:hover {
57
+ cursor: pointer;
58
+ .reference-item-content {
59
+ opacity: 0.4;
60
+ }
61
+ .reference-status-none {
62
+ display: none;
63
+ }
64
+ .hover-operate-icon {
65
+ display: block;
66
+ opacity: 1;
67
+ }
68
+ }
69
+ .reference-item-content {
70
+ flex: 1;
71
+ color: #000;
72
+ font-weight: 500;
73
+ .reference-content {
74
+ display: flex;
75
+ flex: 1;
76
+ .type-icon {
77
+ font-size: 15px;
78
+ padding-right: 10px;
79
+ }
80
+ }
81
+ .task-item-name.task-item-name_done {
82
+ color: #a8a8a8;
83
+ }
84
+ .task-control {
85
+ display: flex;
86
+ align-items: center;
87
+ padding: 5px 0;
88
+ font-size: 13px;
89
+ color: #444;
90
+ font-weight: normal;
91
+ > span + span {
92
+ margin-left: 15px;
93
+ }
94
+ .svg-inline--fa {
95
+ margin-right: 5px;
96
+ }
97
+ }
98
+ }
99
+
100
+ .hover-operate-icon {
101
+ display: none;
102
+ }
103
+ }
104
+ .ant-empty {
105
+ font-size: 12px;
106
+ .ant-empty-image {
107
+ height: 35px;
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare const Item: (props: {
3
+ /** document id */
4
+ id: string;
5
+ /** 是否选中 */
6
+ active?: boolean | undefined;
7
+ onClick?: ((id: string) => void) | undefined;
8
+ }) => JSX.Element;
9
+ export default Item;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+ import { observe } from "@voplus/morpho-ui";
4
+ import { useDocument } from "@voplus/morpho-document-core";
5
+ import { useMetaStore } from "../../data";
6
+ const Item = (props) => {
7
+ const { id, active } = props;
8
+ const meta = useMetaStore();
9
+ const doc = useDocument(id, { reload: false });
10
+ return observe(() => (React.createElement("div", { className: classnames("doc-item", { active: active }), onClick: () => { var _a; return (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, doc.id); } },
11
+ meta.getIcon(doc),
12
+ doc.name)));
13
+ };
14
+ export default Item;
15
+ //# sourceMappingURL=Item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../src/controls/ChildDocumentSelect/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,IAAI,GAAG,CAAC,KAMb,EAAE,EAAE;IACJ,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE/C,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,6BACC,SAAS,EAAE,UAAU,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EACrD,OAAO,EAAE,GAAG,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,OAAO,+CAAb,KAAK,EAAW,GAAG,CAAC,EAAE,CAAC,CAAA,EAAA;QAErC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;QACjB,GAAG,CAAC,IAAI,CACJ,CACN,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare const ChildDocumentSelect: (props: {
3
+ id: string;
4
+ /** 初始选中的 */
5
+ selected?: string | undefined;
6
+ className?: string | undefined;
7
+ onSelect?: ((id: string) => void) | undefined;
8
+ onCancel?: (() => void) | undefined;
9
+ }) => JSX.Element;
10
+ export default ChildDocumentSelect;
@@ -0,0 +1,40 @@
1
+ import { Empty, Modal, message } from "@voplus/antd";
2
+ import { useDocumentListEffect } from "@voplus/morpho-document-core";
3
+ import React, { useEffect, useState } from "react";
4
+ import Item from "./Item";
5
+ import { Scrollbars } from "react-custom-scrollbars";
6
+ import classnames from "classnames";
7
+ import { observe } from "@voplus/morpho-ui";
8
+ import styles from "./index.less";
9
+ import { useCreateListDataState } from "@voplus/morpho-ui/es/data";
10
+ import { useRenderOnChange } from "@voplus/morpho-ui";
11
+ const ChildDocumentSelect = (props) => {
12
+ const { id, selected } = props;
13
+ const [docId, setDocId] = useState("");
14
+ const list = useCreateListDataState({
15
+ filterDefaults: {
16
+ page: { Page: 1, PageSize: 200 },
17
+ filters: [{ c: "ParentNodeId", o: "=", l: "And", v1: id }],
18
+ },
19
+ }, [id]);
20
+ useEffect(() => {
21
+ setDocId[selected || ""];
22
+ }, [id]);
23
+ /** 如果 list.filters.useDocumentActivityListEffect 可以接收新参数*/
24
+ useRenderOnChange(() => list.filters.options);
25
+ /** useActivityListEffect,使之可以自動更新loading, hasmore. */
26
+ useDocumentListEffect(list, (result) => list.union(result), list.filters.options);
27
+ return observe(() => (React.createElement(Modal, { className: classnames(styles["doc-select-dialog"], props.className), width: 500, title: "Child Document Select", visible: true, okText: "Select", onOk: onOk, onCancel: props.onCancel },
28
+ React.createElement(Scrollbars, { autoHide: true }, list.data.length ? (list.data.map((item) => (React.createElement(Item, { key: item.id, id: item.id, active: item.id === docId, onClick: (id) => setDocId(item.id) })))) : (React.createElement(Empty, null))))));
29
+ function onOk() {
30
+ var _a;
31
+ if (docId) {
32
+ (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, docId);
33
+ }
34
+ else {
35
+ message.warn("Please select folder!");
36
+ }
37
+ }
38
+ };
39
+ export default ChildDocumentSelect;
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/ChildDocumentSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAa,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,y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AC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,EACnE,KAAK,EAAE,GAAG,EACV,KAAK,EAAC,uBAAuB,EAC7B,OAAO,EAAE,IAAI,EACb,MAAM,EAAC,QAAQ,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,KAAK,CAAC,QAAQ;QAExB,oBAAC,UAAU,IAAC,QAAQ,UAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACnB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACvB,oBAAC,IAAI,IACJ,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,KAAK,EACzB,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GACjC,CACF,CAAC,CACF,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,OAAG,CACT,CACW,CACN,CACR,CAAC,CAAC;IAEH,SAAS,IAAI;;QACZ,IAAI,KAAK,EAAE;YACV,MAAA,KAAK,CAAC,QAAQ,+CAAd,KAAK,EAAY,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACtC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,23 @@
1
+ @import "~@voplus/antd/es/style/themes/default.less";
2
+
3
+ .doc-select-dialog {
4
+ :global {
5
+ .ant-modal-body {
6
+ height: 350px;
7
+ padding: 24px 0;
8
+ }
9
+ .doc-item {
10
+ line-height: 35px;
11
+ padding: 0 24px;
12
+ svg {
13
+ margin-right: 10px;
14
+ }
15
+ &:hover {
16
+ background-color: @item-hover-bg;
17
+ }
18
+ &.active {
19
+ background-color: @item-active-bg;
20
+ }
21
+ }
22
+ }
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voplus/morpho-document",
3
- "version": "1.4.36",
3
+ "version": "1.4.37",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://voplus.visualstudio.com/morpho-document/_git/morpho-document"