@voplus/morpho-document 1.0.0-dev250 → 1.0.0-dev253

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 (140) hide show
  1. package/changelog.md +1 -1
  2. package/es/DocumentUIService.d.ts +6 -0
  3. package/es/DocumentUIService.js +13 -0
  4. package/es/DocumentUIService.js.map +1 -0
  5. package/es/Modules.js +10 -3
  6. package/es/Modules.js.map +1 -1
  7. package/es/components/ActivityLog/index.js +1 -1
  8. package/es/components/ActivityLog/index.js.map +1 -1
  9. package/es/components/DocumentCard/index.d.ts +7 -3
  10. package/es/components/DocumentCard/index.js +1 -1
  11. package/es/components/DocumentCard/index.js.map +1 -1
  12. package/es/components/DocumentCardList/index.d.ts +12 -0
  13. package/es/components/DocumentCardList/index.js +31 -0
  14. package/es/components/DocumentCardList/index.js.map +1 -0
  15. package/es/components/DocumentCardList/index.less +10 -0
  16. package/es/components/DocumentHeader/index.js +17 -10
  17. package/es/components/DocumentHeader/index.js.map +1 -1
  18. package/es/components/DocumentHeader/state.d.ts +0 -1
  19. package/es/components/DocumentHeader/state.js.map +1 -1
  20. package/es/components/DocumentList/index.d.ts +1 -1
  21. package/es/components/DocumentList/index.js +2 -2
  22. package/es/components/DocumentList/index.js.map +1 -1
  23. package/es/components/DocumentList/state.d.ts +1 -21
  24. package/es/components/DocumentList/state.js.map +1 -1
  25. package/es/components/DocumentName/index.js +1 -1
  26. package/es/components/DocumentName/index.js.map +1 -1
  27. package/es/components/DocumentPropertiesView/index.js +1 -1
  28. package/es/components/DocumentPropertiesView/index.js.map +1 -1
  29. package/es/components/DocumentQuickViewDialog/index.d.ts +2 -7
  30. package/es/components/DocumentQuickViewDialog/index.js +3 -9
  31. package/es/components/DocumentQuickViewDialog/index.js.map +1 -1
  32. package/es/components/DocumentSortableTree/index.js +1 -1
  33. package/es/components/DocumentSortableTree/index.js.map +1 -1
  34. package/es/components/FileViewer/FileViewer.d.ts +1 -0
  35. package/es/components/FileViewer/PDFViewer.d.ts +2 -0
  36. package/es/components/FileViewer/PDFViewer.js +1 -2
  37. package/es/components/FileViewer/PDFViewer.js.map +1 -1
  38. package/es/components/Links/Item.js +1 -1
  39. package/es/components/Links/Item.js.map +1 -1
  40. package/es/components/NewDocumentForm/index.d.ts +1 -1
  41. package/es/components/QuickViewDialog/index.js +1 -1
  42. package/es/components/QuickViewDialog/index.js.map +1 -1
  43. package/es/components/TextQuickView/index.js +6 -9
  44. package/es/components/TextQuickView/index.js.map +1 -1
  45. package/es/controls/FlagIcon/index.d.ts +2 -2
  46. package/es/data/DocumentMetaStore.js +2 -2
  47. package/es/data/DocumentMetaStore.js.map +1 -1
  48. package/es/data/metas/LibraryMeta.d.ts +11 -0
  49. package/es/data/metas/LibraryMeta.js +19 -0
  50. package/es/data/metas/LibraryMeta.js.map +1 -0
  51. package/es/data/metas/PageMeta.d.ts +11 -0
  52. package/es/data/metas/PageMeta.js +19 -0
  53. package/es/data/metas/PageMeta.js.map +1 -0
  54. package/es/data/metas/TextMeta.d.ts +11 -0
  55. package/es/data/metas/TextMeta.js +19 -0
  56. package/es/data/metas/TextMeta.js.map +1 -0
  57. package/es/data/metas/index.d.ts +3 -0
  58. package/es/data/metas/index.js +3 -0
  59. package/es/data/metas/index.js.map +1 -1
  60. package/es/pages/Library/LibraryDefaultView/Content.d.ts +1 -0
  61. package/es/pages/Library/LibraryDefaultView/Content.js +14 -9
  62. package/es/pages/Library/LibraryDefaultView/Content.js.map +1 -1
  63. package/es/pages/Library/LibraryDefaultView/index.js +2 -4
  64. package/es/pages/Library/LibraryDefaultView/index.js.map +1 -1
  65. package/es/pages/Library/LibraryDefaultView/index.less +12 -2
  66. package/es/pages/Library/LibraryDefaultView/state.js.map +1 -1
  67. package/es/pages/Page/PageDefaultView/index.js +16 -14
  68. package/es/pages/Page/PageDefaultView/index.js.map +1 -1
  69. package/es/pages/Page/PageDefaultView/index.less +14 -3
  70. package/es/pages/Page/PageTextItem/index.js +2 -4
  71. package/es/pages/Page/PageTextItem/index.js.map +1 -1
  72. package/es/pages/Page/PageTextItem/index.less +9 -0
  73. package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.d.ts +5 -0
  74. package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.js +51 -0
  75. package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.js.map +1 -0
  76. package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.less +30 -0
  77. package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.d.ts +4 -0
  78. package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js +47 -0
  79. package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js.map +1 -0
  80. package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.less +52 -0
  81. package/es/pages/Signature/Letter/LetterContentView/index.d.ts +8 -0
  82. package/es/pages/Signature/Letter/LetterContentView/index.js +58 -0
  83. package/es/pages/Signature/Letter/LetterContentView/index.js.map +1 -0
  84. package/es/pages/Signature/Letter/LetterItem/index.d.ts +10 -0
  85. package/es/pages/Signature/Letter/LetterItem/index.js +29 -0
  86. package/es/pages/Signature/Letter/LetterItem/index.js.map +1 -0
  87. package/es/pages/Signature/Letter/LetterItem/index.less +13 -0
  88. package/es/pages/Signature/Letter/LetterItem/state.d.ts +5 -0
  89. package/es/pages/Signature/Letter/LetterItem/state.js +12 -0
  90. package/es/pages/Signature/Letter/LetterItem/state.js.map +1 -0
  91. package/es/pages/Signature/Letter/LetterList/index.d.ts +6 -0
  92. package/es/pages/Signature/Letter/LetterList/index.js +53 -0
  93. package/es/pages/Signature/Letter/LetterList/index.js.map +1 -0
  94. package/es/pages/Signature/Letter/LetterList/index.less +41 -0
  95. package/es/pages/Signature/Letter/LetterViewer/index.d.ts +9 -0
  96. package/es/pages/Signature/Letter/LetterViewer/index.js +58 -0
  97. package/es/pages/Signature/Letter/LetterViewer/index.js.map +1 -0
  98. package/es/pages/Signature/Letter/LetterViewer/index.less +60 -0
  99. package/es/pages/Signature/SignatureDialog/index.d.ts +9 -0
  100. package/es/pages/Signature/SignatureDialog/index.js +41 -0
  101. package/es/pages/Signature/SignatureDialog/index.js.map +1 -0
  102. package/es/pages/Signature/SignatureDialog/index.less +16 -0
  103. package/es/pages/Signature/SignatureTable/index.d.ts +14 -0
  104. package/es/pages/Signature/SignatureTable/index.js +91 -0
  105. package/es/pages/Signature/SignatureTable/index.js.map +1 -0
  106. package/es/pages/Signature/SignatureTable/index.less +9 -0
  107. package/es/pages/Signature/SignatureTable/state.d.ts +10 -0
  108. package/es/pages/Signature/SignatureTable/state.js +20 -0
  109. package/es/pages/Signature/SignatureTable/state.js.map +1 -0
  110. package/es/pages/Signature/SignerSelect/index.d.ts +12 -0
  111. package/es/pages/Signature/SignerSelect/index.js +32 -0
  112. package/es/pages/Signature/SignerSelect/index.js.map +1 -0
  113. package/es/pages/Signature/SignerSelect/state.d.ts +11 -0
  114. package/es/pages/Signature/SignerSelect/state.js +27 -0
  115. package/es/pages/Signature/SignerSelect/state.js.map +1 -0
  116. package/es/pages/Signature/data/EnvelopeContext.d.ts +30 -0
  117. package/es/pages/Signature/data/EnvelopeContext.js +103 -0
  118. package/es/pages/Signature/data/EnvelopeContext.js.map +1 -0
  119. package/es/pages/Signature/data/IEnvelopeState.d.ts +6 -0
  120. package/es/pages/Signature/data/IEnvelopeState.js +1 -0
  121. package/es/pages/Signature/data/IEnvelopeState.js.map +1 -0
  122. package/es/pages/Signature/data/envelope/EnvelopeStore.d.ts +15 -0
  123. package/es/pages/Signature/data/envelope/EnvelopeStore.js +26 -0
  124. package/es/pages/Signature/data/envelope/EnvelopeStore.js.map +1 -0
  125. package/es/pages/Signature/data/envelope/hook.d.ts +3 -0
  126. package/es/pages/Signature/data/envelope/hook.js +10 -0
  127. package/es/pages/Signature/data/envelope/hook.js.map +1 -0
  128. package/es/pages/Signature/data/envelope/index.d.ts +3 -0
  129. package/es/pages/Signature/data/envelope/index.js +4 -0
  130. package/es/pages/Signature/data/envelope/index.js.map +1 -0
  131. package/es/pages/Signature/data/envelope/interfaces.d.ts +35 -0
  132. package/es/pages/Signature/data/envelope/interfaces.js +1 -0
  133. package/es/pages/Signature/data/envelope/interfaces.js.map +1 -0
  134. package/es/pages/Signature/data/envelope/type.d.ts +21 -0
  135. package/es/pages/Signature/data/envelope/type.js +1 -0
  136. package/es/pages/Signature/data/envelope/type.js.map +1 -0
  137. package/es/routes.d.ts +12 -0
  138. package/es/routes.js +27 -1
  139. package/es/routes.js.map +1 -1
  140. package/package.json +9 -7
@@ -0,0 +1,60 @@
1
+ :global {
2
+ .letter-viewer {
3
+ .ant-modal-body {
4
+ display: flex;
5
+ height: 600px;
6
+ padding: 0;
7
+ .file-content,
8
+ .setting-content {
9
+ height: 100%;
10
+ padding: 15px 20px;
11
+ }
12
+ .file-content {
13
+ display: flex;
14
+ flex-direction: column;
15
+ flex: 1;
16
+ flex-shrink: 0;
17
+ > div + div {
18
+ flex: 1;
19
+ }
20
+ .file-content-header {
21
+ display: flex;
22
+ font-size: 16px;
23
+ color: rgba(0, 0, 0, 0.45);
24
+ margin-bottom: 10px;
25
+ padding-bottom: 5px;
26
+ border-bottom: 1px #f2f2f2 solid;
27
+ .document-name {
28
+ flex: 1;
29
+ color: #000;
30
+ font-size: 17px;
31
+ font-weight: 500;
32
+ }
33
+ .anticon {
34
+ margin-left: 10px;
35
+ }
36
+ }
37
+ }
38
+
39
+ .ant-table {
40
+ padding-top: 10px;
41
+ }
42
+ .setting-content {
43
+ width: 55%;
44
+ flex-shrink: 0;
45
+ border-left: 1px solid #f2f2f2;
46
+ overflow-x: hidden;
47
+ .bold {
48
+ font-size: 15px;
49
+ font-weight: 500;
50
+ color: #000;
51
+ }
52
+ .setting-public {
53
+ display: flex;
54
+ justify-content: space-between;
55
+ padding-bottom: 10px;
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ import { ISignatureLine } from "../data/envelope";
4
+ declare const SignatureDialog: (props: {
5
+ envelopeId: string;
6
+ letterId: string;
7
+ signature: ISignatureLine;
8
+ }) => JSX.Element;
9
+ export default SignatureDialog;
@@ -0,0 +1,41 @@
1
+ import "./index.less";
2
+ import { Button, Modal } from "@voplus/antd";
3
+ import { useEnvelopeStore } from "../data/envelope";
4
+ import React, { useState } from "react";
5
+ import SignatureCanvas from "react-signature-canvas";
6
+ import { useEnvelopContext } from "../data/EnvelopeContext";
7
+ import { useObserver } from "mobx-react-lite";
8
+ const SignatureDialog = (props) => {
9
+ const { envelopeId, letterId, signature } = props;
10
+ const [sigPad, setSigPad] = useState();
11
+ const [loading, setLoading] = useState(false);
12
+ const envelopStore = useEnvelopeStore();
13
+ const context = useEnvelopContext();
14
+ return useObserver(() => (React.createElement(Modal, { title: `Draw your signature with your mouse for ${signature === null || signature === void 0 ? void 0 : signature.name}`, width: 600, visible: true, maskClosable: false,
15
+ // closable={false}
16
+ onOk: inset, onCancel: closeSignature, className: "signature-dialog", footer: React.createElement(React.Fragment, null,
17
+ React.createElement("div", { className: "warning-tip" }, "I understand this is a legal representation of my signature"),
18
+ React.createElement(Button, { onClick: clear }, "Clear"),
19
+ React.createElement(Button, { type: "primary", loading: loading, onClick: inset }, "Inset")) },
20
+ React.createElement("div", { style: loading ? { pointerEvents: "none" } : {} },
21
+ React.createElement(SignatureCanvas, { ref: ref => setSigPad(ref), penColor: "black", canvasProps: { width: 600, height: 280 } })))));
22
+ /** clear signature */
23
+ function clear() {
24
+ sigPad.clear();
25
+ }
26
+ /** close modal */
27
+ function closeSignature() {
28
+ context.signVisible(false);
29
+ clear();
30
+ }
31
+ /** upload signature image */
32
+ async function inset() {
33
+ setLoading(true);
34
+ await envelopStore.signature(envelopeId, letterId, signature.id, sigPad.getTrimmedCanvas().toDataURL("image/png"));
35
+ setLoading(false);
36
+ closeSignature();
37
+ context.reload();
38
+ }
39
+ };
40
+ export default SignatureDialog;
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
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AAM,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,YAE9C,CACO;QAIlB,6BAAK,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;YACnD,oBAAC,eAAe,IACf,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAC1B,QAAQ,EAAC,OAAO,EAChB,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GACvC,CACG,CACC,CACR,CAAC,CAAC;IACH,sBAAsB;IACtB,SAAS,KAAK;QACb,MAAM,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;IACD,kBAAkB;IAClB,SAAS,cAAc;QACtB,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC3B,KAAK,EAAE,CAAC;IACT,CAAC;IACD,8BAA8B;IAC9B,KAAK,UAAU,KAAK;QACnB,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,MAAM,YAAY,CAAC,SAAS,CAC3B,UAAU,EACV,QAAQ,EACR,SAAS,CAAC,EAAE,EACZ,MAAM,CAAC,gBAAgB,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAChD,CAAC;QACF,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,cAAc,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,16 @@
1
+ :global {
2
+ .signature-dialog {
3
+ .ant-modal-body {
4
+ padding: 0;
5
+ }
6
+ .ant-modal-footer {
7
+ display: flex;
8
+ text-align: left;
9
+ .warning-tip {
10
+ flex: 1;
11
+ color: #999;
12
+ font-size: 13px;
13
+ }
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ import { ISignatureLine } from "../data/envelope";
4
+ declare const SignatureTable: (props: {
5
+ /** id of envelope */
6
+ envelopeId: string;
7
+ /** id of letter of envelope */
8
+ letterId: string;
9
+ /** lines of signature of letter of envelope */
10
+ lines: ISignatureLine[];
11
+ /** 只读,不可更改 */
12
+ readonly?: boolean;
13
+ }) => JSX.Element;
14
+ export default SignatureTable;
@@ -0,0 +1,91 @@
1
+ import "./index.less";
2
+ import { Button, Input, Skeleton, Table } from "@voplus/antd";
3
+ import { useEnvelopeStore } from "../data/envelope";
4
+ import React, { useState } from "react";
5
+ import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
6
+ import { InlineEdit } from "@voplus/morpho-ui";
7
+ import SignatureDialog from "../SignatureDialog";
8
+ import SignerSelect from "../SignerSelect";
9
+ import { State } from "./state";
10
+ import { faFileSignature } from "@fortawesome/pro-duotone-svg-icons";
11
+ import moment from "moment";
12
+ import { useEnvelopContext } from "../data/EnvelopeContext";
13
+ import { useObserver } from "mobx-react-lite";
14
+ const SignatureTable = (props) => {
15
+ const { envelopeId, letterId, lines, readonly } = props;
16
+ const envelopStore = useEnvelopeStore();
17
+ const context = useEnvelopContext();
18
+ const state = context.getState(envelopeId, () => new State());
19
+ const StatusColumn = (props) => {
20
+ const { line } = props;
21
+ return useObserver(() => (React.createElement(React.Fragment, null,
22
+ line.signatureDate
23
+ ? moment(moment.utc(line.signatureDate).toDate()).format("D MMM HH:mm:ss")
24
+ : "",
25
+ React.createElement("span", { style: { display: "inline-block", minWidth: "50px", paddingLeft: "5px" } }, state.hoverKey === line.id ? (React.createElement(Button, { type: "primary", shape: "circle", size: "small", onClick: () => {
26
+ state.signature = line;
27
+ state.signVisible = true;
28
+ // context.signVisible(true);
29
+ } },
30
+ React.createElement(FAIcon, { icon: faFileSignature }))) : line.signatureDate ? ("Signed") : ("Unsigned")))));
31
+ };
32
+ const DescriptionColumn = (props) => {
33
+ const { line } = props;
34
+ const [edit, setEdit] = useState(false);
35
+ return useObserver(() => (React.createElement(React.Fragment, null, !readonly ? (edit ? (React.createElement(Input.TextArea, { autoFocus: true, value: line.description, onChange: e => (line.description = e.target.value), onBlur: () => saveDescription(line) })) : (React.createElement("div", { onClick: () => setEdit(true) }, line.description || "Add Description"))) : (React.createElement("div", null, line.description)))));
36
+ async function saveDescription(line) {
37
+ var _a;
38
+ if (!line.description)
39
+ return setEdit(false);
40
+ setEdit(false);
41
+ await envelopStore.edit(envelopeId, {
42
+ LetterEdits: [
43
+ {
44
+ Id: letterId,
45
+ LineEdits: [
46
+ {
47
+ Id: line.id,
48
+ Description: line.description,
49
+ SignerId: ((_a = line.signer) === null || _a === void 0 ? void 0 : _a.id) || ""
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ });
55
+ }
56
+ };
57
+ return useObserver(() => (React.createElement(React.Fragment, null,
58
+ context.loading ? (React.createElement(Skeleton, { active: true })) : (React.createElement(Table, { dataSource: lines, pagination: false, rowKey: "id", className: "signature-table", onRow: (record, index) => ({
59
+ onMouseEnter: () => {
60
+ state.hoverKey = record.id;
61
+ },
62
+ onMouseLeave: () => (state.hoverKey = "-1")
63
+ }) },
64
+ React.createElement(Table.Column, { title: "Signature Name", dataIndex: "name", render: (text, record) => (React.createElement(InlineEdit, { editable: !readonly, defaultValue: text, content: v => React.createElement("div", null, v.store.value), onSave: (value) => {
65
+ var _a;
66
+ value && value.trim() !== text
67
+ ? envelopStore.edit(envelopeId, {
68
+ LetterEdits: [
69
+ {
70
+ Id: letterId,
71
+ LineEdits: [
72
+ { Id: record.id, Name: value, SignerId: ((_a = record.signer) === null || _a === void 0 ? void 0 : _a.id) || "" }
73
+ ]
74
+ }
75
+ ]
76
+ })
77
+ : null;
78
+ } })) }),
79
+ React.createElement(Table.Column, { title: "Description", dataIndex: "description", render: (description, record) => React.createElement(DescriptionColumn, { line: record }) }),
80
+ React.createElement(Table.Column, { title: "Signer", dataIndex: "signer", render: (text, record) => (React.createElement(SignerSelect, { readonly: readonly, signer: text, onSave: id => save(record.id, id) })) }),
81
+ React.createElement(Table.Column, { title: "Signature Date/Status", dataIndex: "status", align: "right", width: "166px", render: (text, record) => React.createElement(StatusColumn, { line: record }) }))),
82
+ state.signVisible && (React.createElement(SignatureDialog, { envelopeId: envelopeId, letterId: letterId, signature: state.signature })))));
83
+ /** change letter signer */
84
+ async function save(Id, SignerId) {
85
+ await envelopStore.edit(envelopeId, {
86
+ LetterEdits: [{ Id: letterId, LineEdits: [{ Id, SignerId }] }]
87
+ });
88
+ }
89
+ };
90
+ export default SignatureTable;
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/Signature/SignatureTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAkB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,cAAc,GAAG,CAAC,KASvB,EAAE,EAAE;IACJ,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK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,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;SAC9D,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ :global {
2
+ .signature-table {
3
+ .ant-table-thead > tr > th,
4
+ .ant-table-tbody > tr > td {
5
+ padding: 0 10px;
6
+ height: 46px;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,10 @@
1
+ import { IEnvelopeState } from "../data/IEnvelopeState";
2
+ import { ISignatureLine } from "../data/envelope";
3
+ export declare class State implements IEnvelopeState {
4
+ /** visible of SignatureDialog */
5
+ signVisible: boolean;
6
+ /** line of signature */
7
+ signature: ISignatureLine;
8
+ /** id of hover of table row */
9
+ hoverKey: string;
10
+ }
@@ -0,0 +1,20 @@
1
+ import { __decorate } from "tslib";
2
+ import { observable } from "mobx";
3
+ export class State {
4
+ constructor() {
5
+ /** visible of SignatureDialog */
6
+ this.signVisible = false;
7
+ /** id of hover of table row */
8
+ this.hoverKey = "";
9
+ }
10
+ }
11
+ __decorate([
12
+ observable
13
+ ], State.prototype, "signVisible", void 0);
14
+ __decorate([
15
+ observable
16
+ ], State.prototype, "signature", void 0);
17
+ __decorate([
18
+ observable
19
+ ], State.prototype, "hoverKey", void 0);
20
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/pages/Signature/SignatureTable/state.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,OAAO,KAAK;IAAlB;QACC,iCAAiC;QACd,gBAAW,GAAG,KAAK,CAAC;QAGvC,gCAAgC;QACb,aAAQ,GAAG,EAAE,CAAC;IAClC,CAAC;CAAA;AALY;IAAX,UAAU;0CAA4B;AAE3B;IAAX,UAAU;wCAAkC;AAEjC;IAAX,UAAU;uCAAsB"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare const SignerSelect: (props: {
3
+ /** */
4
+ signer: {
5
+ id: string;
6
+ name: string;
7
+ };
8
+ /** 只读,不更改signer */
9
+ readonly?: boolean | undefined;
10
+ onSave?: ((id: string) => void) | undefined;
11
+ }) => JSX.Element;
12
+ export default SignerSelect;
@@ -0,0 +1,32 @@
1
+ import { useContactListEffect } from "@voplus/morpho-org";
2
+ import React, { useEffect, useState } from "react";
3
+ import { Select } from "@voplus/antd";
4
+ import { State } from "./state";
5
+ import { useObserver } from "mobx-react-lite";
6
+ const SignerSelect = (props) => {
7
+ const { signer, onSave, readonly } = props;
8
+ const [state] = useState(new State());
9
+ useContactListEffect(list => {
10
+ state.contactList = list || [];
11
+ });
12
+ useEffect(() => {
13
+ if (signer) {
14
+ state.signerId = signer.id;
15
+ state.signerName = signer.name;
16
+ }
17
+ }, [signer]);
18
+ return useObserver(() => (React.createElement(React.Fragment, null, !readonly ? (state.editable ? (React.createElement(Select, { autoFocus: true, value: state.signerId, showSearch: true, placeholder: "Input or select contact.", filterOption: filterItems, optionLabelProp: "title", onSelect: onSelectMember, onBlur: () => (state.editable = false), style: { width: "100%" } }, state.contactList.map(i => (React.createElement(Select.Option, { key: i.id, value: i.id, title: i.name }, i.name))))) : (React.createElement("span", { onClick: () => (state.editable = true) }, state.signerName || "Add Signer"))) : (React.createElement("span", null, state.signerName)))));
19
+ function filterItems(input, option) {
20
+ return option.title.toLowerCase().includes(input.toLowerCase());
21
+ }
22
+ /** selected signer */
23
+ function onSelectMember(id) {
24
+ state.signerId = id;
25
+ const item = state.contactList.find(x => x.id === id);
26
+ state.signerName = item.name;
27
+ if (onSave)
28
+ onSave(id);
29
+ }
30
+ };
31
+ export default SignerSelect;
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pages/Signature/SignerSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,oBAAoB,EAAE,MAAM,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E,IAEvB,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3B,oBAAC,MAAM,CAAC,MAAM,IAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,IAClD,CAAC,CAAC,IAAI,CACQ,CAChB,CAAC,CACM,CACT,CAAC,CAAC,CAAC,CACH,8BAAM,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAG,KAAK,CAAC,UAAU,IAAI,YAAY,CAAQ,CACvF,CACD,CAAC,CAAC,CAAC,CACH,kCAAO,KAAK,CAAC,UAAU,CAAQ,CAC/B,CACe,CACjB,CAAC,CAAC;IACH,SAAS,WAAW,CAAC,KAAU,EAAE,MAAW;QAC3C,OAAQ,MAAM,CAAC,KAAgB,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,sBAAsB;IACtB,SAAS,cAAc,CAAC,EAAO;QAC9B,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAa,CAAC;QAClE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;QAC7B,IAAI,MAAM;YAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;AACF,CAAC,CAAC;AACF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { IContact } from "@voplus/morpho-org";
2
+ export declare class State {
3
+ /** List of contact */
4
+ contactList: IContact[];
5
+ /** id of signer */
6
+ signerId: string;
7
+ /** name of signer */
8
+ signerName: string;
9
+ /** enable edit */
10
+ editable: boolean;
11
+ }
@@ -0,0 +1,27 @@
1
+ import { __decorate } from "tslib";
2
+ import { observable } from "mobx";
3
+ export class State {
4
+ constructor() {
5
+ /** List of contact */
6
+ this.contactList = [];
7
+ /** id of signer */
8
+ this.signerId = "";
9
+ /** name of signer */
10
+ this.signerName = "";
11
+ /** enable edit */
12
+ this.editable = false;
13
+ }
14
+ }
15
+ __decorate([
16
+ observable
17
+ ], State.prototype, "contactList", void 0);
18
+ __decorate([
19
+ observable
20
+ ], State.prototype, "signerId", void 0);
21
+ __decorate([
22
+ observable
23
+ ], State.prototype, "signerName", void 0);
24
+ __decorate([
25
+ observable
26
+ ], State.prototype, "editable", void 0);
27
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/pages/Signature/SignerSelect/state.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,OAAO,KAAK;IAAlB;QACC,sBAAsB;QACH,gBAAW,GAAe,EAAE,CAAC;QAChD,mBAAmB;QACA,aAAQ,GAAG,EAAE,CAAC;QACjC,qBAAqB;QACF,eAAU,GAAG,EAAE,CAAC;QACnC,mBAAmB;QACA,aAAQ,GAAG,KAAK,CAAC;IACrC,CAAC;CAAA;AAPY;IAAX,UAAU;0CAAqC;AAEpC;IAAX,UAAU;uCAAsB;AAErB;IAAX,UAAU;yCAAwB;AAEvB;IAAX,UAAU;uCAAyB"}
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { EnvelopeStore, ILetter } from "./envelope";
3
+ import { IEnvelopeState } from "./IEnvelopeState";
4
+ export declare class EnvelopeContextState {
5
+ private id?;
6
+ private store?;
7
+ /** All page item states. */
8
+ private states;
9
+ /** For duplicate id detecting */
10
+ private _ids;
11
+ /** The data of the list. */
12
+ private _data;
13
+ constructor(id?: string | undefined, store?: EnvelopeStore | undefined);
14
+ /** Try to get an existing page state or create a new one if it's not already exists.
15
+ * @param key - Key of the page options state.
16
+ * @param factory - factor to create a new option state.
17
+ */
18
+ getState<T extends IEnvelopeState>(key: string, factory: () => T): T;
19
+ signVisible(visible: boolean): void;
20
+ letterVisible(visible: boolean): void;
21
+ union(list: ILetter[]): void;
22
+ remove(id: string): void;
23
+ reload(): Promise<void>;
24
+ get signVisibility(): boolean | undefined;
25
+ get letters(): readonly ILetter[];
26
+ /** loading of reload envelope to update letters and file */
27
+ loading: boolean;
28
+ }
29
+ export declare const EnvelopeContext: import("react").Context<EnvelopeContextState>;
30
+ export declare const useEnvelopContext: () => EnvelopeContextState;
@@ -0,0 +1,103 @@
1
+ import { __decorate } from "tslib";
2
+ import { action, computed, observable } from "mobx";
3
+ import { createContext, useContext } from "react";
4
+ export class EnvelopeContextState {
5
+ constructor(id, store) {
6
+ this.id = id;
7
+ this.store = store;
8
+ /** All page item states. */
9
+ this.states = new Map();
10
+ /** For duplicate id detecting */
11
+ this._ids = new Map();
12
+ /** The data of the list. */
13
+ this._data = [];
14
+ /** loading of reload envelope to update letters and file */
15
+ this.loading = false;
16
+ }
17
+ /** Try to get an existing page state or create a new one if it's not already exists.
18
+ * @param key - Key of the page options state.
19
+ * @param factory - factor to create a new option state.
20
+ */
21
+ getState(key, factory) {
22
+ if (!this.states.has(key))
23
+ this.states.set(key, factory());
24
+ return this.states.get(key);
25
+ }
26
+ signVisible(visible) {
27
+ for (const s of this.states) {
28
+ s[1].signVisible = visible;
29
+ }
30
+ }
31
+ letterVisible(visible) {
32
+ for (const s of this.states) {
33
+ s[1].letterVisible = visible;
34
+ }
35
+ }
36
+ union(list) {
37
+ for (const letter of list || []) {
38
+ if (!this._ids.has(letter.id)) {
39
+ this._data.push(letter);
40
+ this._ids.set(letter.id, true);
41
+ }
42
+ }
43
+ }
44
+ remove(id) {
45
+ if (this._ids.has(id)) {
46
+ const index = this._data.findIndex(x => x.id === id);
47
+ this._data.splice(index, 1);
48
+ this._ids.delete(id);
49
+ }
50
+ }
51
+ async reload() {
52
+ var _a;
53
+ if (!this.id)
54
+ return;
55
+ this.loading = true;
56
+ const r = await ((_a = this.store) === null || _a === void 0 ? void 0 : _a.load(this.id, { reload: true }));
57
+ if (r)
58
+ this.union(r.letters);
59
+ this.loading = false;
60
+ }
61
+ get signVisibility() {
62
+ for (const s of this.states) {
63
+ return s[1].signVisible;
64
+ }
65
+ return false;
66
+ }
67
+ get letters() {
68
+ return this._data;
69
+ }
70
+ }
71
+ __decorate([
72
+ observable
73
+ ], EnvelopeContextState.prototype, "states", void 0);
74
+ __decorate([
75
+ observable
76
+ ], EnvelopeContextState.prototype, "_data", void 0);
77
+ __decorate([
78
+ action
79
+ ], EnvelopeContextState.prototype, "signVisible", null);
80
+ __decorate([
81
+ action
82
+ ], EnvelopeContextState.prototype, "letterVisible", null);
83
+ __decorate([
84
+ action
85
+ ], EnvelopeContextState.prototype, "union", null);
86
+ __decorate([
87
+ action
88
+ ], EnvelopeContextState.prototype, "remove", null);
89
+ __decorate([
90
+ action
91
+ ], EnvelopeContextState.prototype, "reload", null);
92
+ __decorate([
93
+ computed
94
+ ], EnvelopeContextState.prototype, "signVisibility", null);
95
+ __decorate([
96
+ computed
97
+ ], EnvelopeContextState.prototype, "letters", null);
98
+ __decorate([
99
+ observable
100
+ ], EnvelopeContextState.prototype, "loading", void 0);
101
+ export const EnvelopeContext = createContext(null);
102
+ export const useEnvelopContext = () => useContext(EnvelopeContext);
103
+ //# sourceMappingURL=EnvelopeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvelopeContext.js","sourceRoot":"","sources":["../../../../src/pages/Signature/data/EnvelopeContext.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIlD,MAAM,OAAO,oBAAoB;IAUhC,YAA2B,EAAW,EAAU,KAAqB;QAA1C,OAAE,GAAF,EAAE,CAAS;QAA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AAuB,IAAW,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface IEnvelopeState {
2
+ /** */
3
+ signVisible?: boolean;
4
+ /** */
5
+ letterVisible?: boolean;
6
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=IEnvelopeState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IEnvelopeState.js","sourceRoot":"","sources":["../../../../src/pages/Signature/data/IEnvelopeState.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { ApiEndPoint } from "@voplus/api";
2
+ import { CreateDocumentOptions, DocumentStore, DocumentTypeStore, LoadDocumentListOptions, LoadDocumentOptions } from "../../../../data";
3
+ import { EditEnvelopOptions } from "./type";
4
+ import { IEnvelope } from "./interfaces";
5
+ export declare class EnvelopeStore extends DocumentTypeStore<IEnvelope, LoadDocumentOptions, LoadDocumentListOptions, CreateDocumentOptions, EditEnvelopOptions, any> {
6
+ /** Name of the store */
7
+ readonly name: string;
8
+ constructor(endpoint: ApiEndPoint, documents: DocumentStore);
9
+ /** upload signature image */
10
+ signature(id: string, letterId: string, signatureId: string, file: File): Promise<void>;
11
+ /** word 转 pdf / download url */
12
+ download(id: string, letterId: string): Promise<Blob>;
13
+ }
14
+ /** 响应钩子检索 PageStore */
15
+ export declare const useEnvelopeStore: () => EnvelopeStore;
@@ -0,0 +1,26 @@
1
+ import { RequestBuilder } from "@voplus/api";
2
+ import { DocumentTypeStore, useDocumentStore } from "../../../../data";
3
+ import { useStore } from "@voplus/morpho-data";
4
+ const StoreName = "LibraryStore";
5
+ export class EnvelopeStore extends DocumentTypeStore {
6
+ constructor(endpoint, documents) {
7
+ super(endpoint, "/api/envelope", documents);
8
+ /** Name of the store */
9
+ this.name = StoreName;
10
+ }
11
+ /** upload signature image */
12
+ async signature(id, letterId, signatureId, file) {
13
+ await this.endpoint.post(`/api/envelope/${id}/${letterId}/${signatureId}`, new RequestBuilder().form({ file }));
14
+ }
15
+ /** word 转 pdf / download url */
16
+ async download(id, letterId) {
17
+ const r = await this.endpoint.get(`/api/envelope/${id}/${letterId}/content`);
18
+ return r.blob();
19
+ }
20
+ }
21
+ /** 响应钩子检索 PageStore */
22
+ export const useEnvelopeStore = () => {
23
+ const documents = useDocumentStore();
24
+ return useStore(StoreName, context => new EnvelopeStore(context.api.currentEndPoint, documents));
25
+ };
26
+ //# sourceMappingURL=EnvelopeStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvelopeStore.js","sourceRoot":"","sources":["../../../../../src/pages/Signature/data/envelope/EnvelopeStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAGN,iBAAiB,EAIjB,gBAAgB,EAChB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,MAAM,OAAO,aAAc,SAAQ,iBAOlC;IAIA,YAAmB,QAAqB,EAAE,SAAwB;QACjE,KAAK,CAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAJ7C,wBAAwB;QACR,SAAI,GAAW,SAAS,CAAC;IAIzC,CAAC;IAED,6BAA6B;IACtB,KAAK,CAAC,SAAS,CAAC,EAAU,EAAE,QAAgB,EAAE,WAAmB,EAAE,IAAU;QACnF,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACvB,iBAAiB,EAAE,IAAI,QAAQ,IAAI,WAAW,EAAE,EAChD,IAAI,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CACnC,CAAC;IACH,CAAC;IACD,gCAAgC;IACzB,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,QAAgB;QACjD,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,QAAQ,UAAU,CAAC,CAAC;QAC7E,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC;CACD;AAED,uBAAuB;AACvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACpC,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IACrC,OAAO,QAAQ,CACd,SAAS,EACT,OAAO,CAAC,EAAE,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,CAAC,CACpE,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { LoadDocumentOptions } from "../../../../data";
2
+ import { IEnvelope } from "./interfaces";
3
+ export declare const useEnvelope: (id: string, options?: LoadDocumentOptions | undefined) => IEnvelope;
@@ -0,0 +1,10 @@
1
+ import { useDocumentStore } from "../../../../data";
2
+ import { useEnvelopeStore } from "./EnvelopeStore";
3
+ import { useLoadCountedMapItem } from "@voplus/morpho-data";
4
+ export const useEnvelope = (id, options) => {
5
+ options = options ? options : {};
6
+ const store = useEnvelopeStore();
7
+ const documents = useDocumentStore();
8
+ return useLoadCountedMapItem(id, documents.items, () => store.load(id, options), options);
9
+ };
10
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../../../src/pages/Signature/data/envelope/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,OAA6B,EAAE,EAAE;IACxE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA0B,CAAC;IAC1D,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC;IAErC,OAAO,qBAAqB,CAC3B,EAAE,EACF,SAAS,CAAC,KAAK,EACf,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAC9B,OAAO,CACM,CAAC;AAChB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./EnvelopeStore";
2
+ export * from "./hook";
3
+ export * from "./interfaces";
@@ -0,0 +1,4 @@
1
+ export * from "./EnvelopeStore";
2
+ export * from "./hook";
3
+ export * from "./interfaces";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/pages/Signature/data/envelope/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}