@voplus/morpho-document 1.0.0-dev251 → 1.0.0-dev254
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.
- package/changelog.md +1 -1
- package/es/DocumentUIService.d.ts +6 -0
- package/es/DocumentUIService.js +13 -0
- package/es/DocumentUIService.js.map +1 -0
- package/es/Modules.js +10 -3
- package/es/Modules.js.map +1 -1
- package/es/components/ActivityLog/index.js +1 -1
- package/es/components/ActivityLog/index.js.map +1 -1
- package/es/components/DocumentCard/index.d.ts +7 -3
- package/es/components/DocumentCard/index.js +1 -1
- package/es/components/DocumentCard/index.js.map +1 -1
- package/es/components/DocumentCardList/index.d.ts +6 -1
- package/es/components/DocumentCardList/index.js +6 -2
- package/es/components/DocumentCardList/index.js.map +1 -1
- package/es/components/DocumentCardList/index.less +1 -0
- package/es/components/DocumentHeader/index.js +23 -13
- package/es/components/DocumentHeader/index.js.map +1 -1
- package/es/components/DocumentHeader/state.d.ts +2 -0
- package/es/components/DocumentHeader/state.js.map +1 -1
- package/es/components/DocumentList/index.d.ts +1 -1
- package/es/components/DocumentList/index.js +2 -2
- package/es/components/DocumentList/index.js.map +1 -1
- package/es/components/DocumentList/state.d.ts +1 -21
- package/es/components/DocumentList/state.js.map +1 -1
- package/es/components/DocumentName/index.js +1 -1
- package/es/components/DocumentName/index.js.map +1 -1
- package/es/components/DocumentQuickViewDialog/index.d.ts +2 -7
- package/es/components/DocumentQuickViewDialog/index.js +3 -9
- package/es/components/DocumentQuickViewDialog/index.js.map +1 -1
- package/es/components/FileViewer/FileViewer.d.ts +1 -0
- package/es/components/FileViewer/PDFViewer.d.ts +2 -0
- package/es/components/FileViewer/PDFViewer.js +1 -2
- package/es/components/FileViewer/PDFViewer.js.map +1 -1
- package/es/components/Links/Item.js +1 -1
- package/es/components/Links/Item.js.map +1 -1
- package/es/components/NewDocumentForm/index.d.ts +1 -1
- package/es/controls/FlagIcon/index.d.ts +2 -2
- package/es/data/DocumentMetaStore.js +2 -2
- package/es/data/DocumentMetaStore.js.map +1 -1
- package/es/data/metas/LibraryMeta.d.ts +11 -0
- package/es/data/metas/LibraryMeta.js +19 -0
- package/es/data/metas/LibraryMeta.js.map +1 -0
- package/es/data/metas/PageMeta.d.ts +11 -0
- package/es/data/metas/PageMeta.js +19 -0
- package/es/data/metas/PageMeta.js.map +1 -0
- package/es/data/metas/TextMeta.d.ts +11 -0
- package/es/data/metas/TextMeta.js +19 -0
- package/es/data/metas/TextMeta.js.map +1 -0
- package/es/data/metas/index.d.ts +3 -0
- package/es/data/metas/index.js +3 -0
- package/es/data/metas/index.js.map +1 -1
- package/es/pages/Library/LibraryDefaultView/Content.d.ts +1 -0
- package/es/pages/Library/LibraryDefaultView/Content.js +13 -8
- package/es/pages/Library/LibraryDefaultView/Content.js.map +1 -1
- package/es/pages/Library/LibraryDefaultView/index.js +2 -4
- package/es/pages/Library/LibraryDefaultView/index.js.map +1 -1
- package/es/pages/Library/LibraryDefaultView/index.less +12 -2
- package/es/pages/Page/PageDefaultView/index.js +16 -14
- package/es/pages/Page/PageDefaultView/index.js.map +1 -1
- package/es/pages/Page/PageDefaultView/index.less +12 -3
- package/es/pages/Page/PageTextItem/index.js +1 -1
- package/es/pages/Page/PageTextItem/index.js.map +1 -1
- package/es/pages/Page/PageTextItem/index.less +5 -0
- package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.d.ts +5 -0
- package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.js +51 -0
- package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.js.map +1 -0
- package/es/pages/Signature/Envelope/EnvelopeDefaultView/index.less +30 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.d.ts +4 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js +46 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.js.map +1 -0
- package/es/pages/Signature/Envelope/EnvelopeRecipientView/index.less +41 -0
- package/es/pages/Signature/Letter/LetterContentView/index.d.ts +9 -0
- package/es/pages/Signature/Letter/LetterContentView/index.js +59 -0
- package/es/pages/Signature/Letter/LetterContentView/index.js.map +1 -0
- package/es/pages/Signature/Letter/LetterContentView/index.less +21 -0
- package/es/pages/Signature/Letter/LetterItem/index.d.ts +10 -0
- package/es/pages/Signature/Letter/LetterItem/index.js +29 -0
- package/es/pages/Signature/Letter/LetterItem/index.js.map +1 -0
- package/es/pages/Signature/Letter/LetterItem/index.less +13 -0
- package/es/pages/Signature/Letter/LetterItem/state.d.ts +5 -0
- package/es/pages/Signature/Letter/LetterItem/state.js +12 -0
- package/es/pages/Signature/Letter/LetterItem/state.js.map +1 -0
- package/es/pages/Signature/Letter/LetterList/index.d.ts +6 -0
- package/es/pages/Signature/Letter/LetterList/index.js +53 -0
- package/es/pages/Signature/Letter/LetterList/index.js.map +1 -0
- package/es/pages/Signature/Letter/LetterList/index.less +41 -0
- package/es/pages/Signature/Letter/LetterViewer/index.d.ts +9 -0
- package/es/pages/Signature/Letter/LetterViewer/index.js +58 -0
- package/es/pages/Signature/Letter/LetterViewer/index.js.map +1 -0
- package/es/pages/Signature/Letter/LetterViewer/index.less +60 -0
- package/es/pages/Signature/SignatureDialog/index.d.ts +9 -0
- package/es/pages/Signature/SignatureDialog/index.js +41 -0
- package/es/pages/Signature/SignatureDialog/index.js.map +1 -0
- package/es/pages/Signature/SignatureDialog/index.less +16 -0
- package/es/pages/Signature/SignatureTable/index.d.ts +14 -0
- package/es/pages/Signature/SignatureTable/index.js +91 -0
- package/es/pages/Signature/SignatureTable/index.js.map +1 -0
- package/es/pages/Signature/SignatureTable/index.less +9 -0
- package/es/pages/Signature/SignatureTable/state.d.ts +10 -0
- package/es/pages/Signature/SignatureTable/state.js +20 -0
- package/es/pages/Signature/SignatureTable/state.js.map +1 -0
- package/es/pages/Signature/SignerSelect/index.d.ts +12 -0
- package/es/pages/Signature/SignerSelect/index.js +32 -0
- package/es/pages/Signature/SignerSelect/index.js.map +1 -0
- package/es/pages/Signature/SignerSelect/state.d.ts +11 -0
- package/es/pages/Signature/SignerSelect/state.js +27 -0
- package/es/pages/Signature/SignerSelect/state.js.map +1 -0
- package/es/pages/Signature/data/EnvelopeContext.d.ts +30 -0
- package/es/pages/Signature/data/EnvelopeContext.js +103 -0
- package/es/pages/Signature/data/EnvelopeContext.js.map +1 -0
- package/es/pages/Signature/data/IEnvelopeState.d.ts +6 -0
- package/es/pages/Signature/data/IEnvelopeState.js +1 -0
- package/es/pages/Signature/data/IEnvelopeState.js.map +1 -0
- package/es/pages/Signature/data/envelope/EnvelopeStore.d.ts +15 -0
- package/es/pages/Signature/data/envelope/EnvelopeStore.js +26 -0
- package/es/pages/Signature/data/envelope/EnvelopeStore.js.map +1 -0
- package/es/pages/Signature/data/envelope/hook.d.ts +3 -0
- package/es/pages/Signature/data/envelope/hook.js +10 -0
- package/es/pages/Signature/data/envelope/hook.js.map +1 -0
- package/es/pages/Signature/data/envelope/index.d.ts +3 -0
- package/es/pages/Signature/data/envelope/index.js +4 -0
- package/es/pages/Signature/data/envelope/index.js.map +1 -0
- package/es/pages/Signature/data/envelope/interfaces.d.ts +35 -0
- package/es/pages/Signature/data/envelope/interfaces.js +1 -0
- package/es/pages/Signature/data/envelope/interfaces.js.map +1 -0
- package/es/pages/Signature/data/envelope/type.d.ts +21 -0
- package/es/pages/Signature/data/envelope/type.js +1 -0
- package/es/pages/Signature/data/envelope/type.js.map +1 -0
- package/es/routes.d.ts +12 -0
- package/es/routes.js +27 -1
- package/es/routes.js.map +1 -1
- package/package.json +9 -7
|
@@ -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;AA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UAAU,IAAI,CAAC,EAAU,EAAE,QAAgB;QAC/C,MAAM,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE;YACnC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,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,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,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,YAAY,GAAG,CAAC,KAMrB,EAAE,EAAE;IACJ,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE3C,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IAEtC,oBAAoB,CAAC,IAAI,CAAC,EAAE;QAC3B,KAAK,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,MAAM,EAAE;YACX,KAAK,CAAC,QAAQ,G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AE,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;QAAU,UAAK,GAAL,KAAK,CAAgB;QATrE,4BAA4B;QAEpB,WAAM,GAAgC,IAAI,GAAG,EAAE,CAAC;QAExD,iCAAiC;QACzB,SAAI,GAAG,IAAI,GAAG,EAAmB,CAAC;QAC1C,4BAA4B;QACR,UAAK,GAAc,EAAE,CAAC;QAwE1C,4DAA4D;QACzC,YAAO,GAAG,KAAK,CAAC;IAvEqC,CAAC;IAEzE;;;OAGG;IACI,QAAQ,CAA2B,GAAW,EAAE,OAAgB;QACtE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAM,CAAC;IAClC,CAAC;IAIM,WAAW,CAAC,OAAgB;QAClC,KAAK,MAAM,CAAC,IAAI,IAAI,CA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AI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC;IAGD,IAAW,cAAc;QACxB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;SACxB;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAES,IAAI,OAAO;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;CAID;AA/EA;IADC,UAAU;oDAC6C;AAK5C;IAAX,UAAU;mDAA+B;AAe1C;IAFC,MAAM;uDAMN;AAID;IAFC,MAAM;yDAMN;AAID;IAFC,MAAM;iDASN;AAID;IAFC,MAAM;kDAQN;AAID;IAFC,MAAM;kDAQN;AAGD;IADC,QAAQ;0DAMR;AAES;IAAT,QAAQ;mDAER;AAGW;IAAX,UAAU;qDAAwB;AAGpC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAuB,IAAW,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -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 @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eAAe,EAAE,SAAS,CAAC,CACpE,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -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 @@
|
|
|
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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IDocument } from "../../../../data/interfaces";
|
|
2
|
+
export interface ISignatureLine {
|
|
3
|
+
/** id of the signature line */
|
|
4
|
+
id: string;
|
|
5
|
+
/** name of the signature line */
|
|
6
|
+
name: string;
|
|
7
|
+
/** unit id of the signature line signer */
|
|
8
|
+
signer?: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
/** description of the signature line signer */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** date of the signature */
|
|
15
|
+
signatureDate?: Date;
|
|
16
|
+
}
|
|
17
|
+
export interface ILetter {
|
|
18
|
+
/** doc of the letter */
|
|
19
|
+
document: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
/** id of letter */
|
|
24
|
+
id: string;
|
|
25
|
+
/** public of letter */
|
|
26
|
+
public: boolean;
|
|
27
|
+
/** description of letter */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** lines of signature */
|
|
30
|
+
signatureLines: ISignatureLine[];
|
|
31
|
+
}
|
|
32
|
+
export interface IEnvelope extends IDocument {
|
|
33
|
+
/** list of the envelope letters */
|
|
34
|
+
letters: ILetter[];
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/pages/Signature/data/envelope/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EditDocumentOptions } from "../../../../data";
|
|
2
|
+
export declare type EditSignatureLineOptions = {
|
|
3
|
+
/** id of the signature line */
|
|
4
|
+
Id: string;
|
|
5
|
+
/** name of the signature line */
|
|
6
|
+
Name?: string;
|
|
7
|
+
/** description of the signature line */
|
|
8
|
+
Description?: string;
|
|
9
|
+
/** description of the signature line signer */
|
|
10
|
+
SignerId: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type EditEnvelopOptions = {
|
|
13
|
+
LetterEdits?: {
|
|
14
|
+
/** id of the letter */
|
|
15
|
+
Id: string;
|
|
16
|
+
/** public of the letter */
|
|
17
|
+
Public?: boolean;
|
|
18
|
+
/** lines of the letter signature */
|
|
19
|
+
LineEdits?: EditSignatureLineOptions[];
|
|
20
|
+
}[];
|
|
21
|
+
} & EditDocumentOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../../src/pages/Signature/data/envelope/type.ts"],"names":[],"mappings":""}
|
package/es/routes.d.ts
CHANGED
|
@@ -74,6 +74,18 @@ declare const Routes: {
|
|
|
74
74
|
getUrl: (id: string) => string;
|
|
75
75
|
component: () => JSX.Element;
|
|
76
76
|
};
|
|
77
|
+
EnvelopeDefaultView: {
|
|
78
|
+
route: string;
|
|
79
|
+
tabPattern: RegExp;
|
|
80
|
+
getUrl: (id: string) => string;
|
|
81
|
+
component: () => JSX.Element;
|
|
82
|
+
};
|
|
83
|
+
EnvelopeRecipientView: {
|
|
84
|
+
route: string;
|
|
85
|
+
tabPattern: RegExp;
|
|
86
|
+
getUrl: (id: string) => string;
|
|
87
|
+
component: () => JSX.Element;
|
|
88
|
+
};
|
|
77
89
|
addRoutes: () => void;
|
|
78
90
|
};
|
|
79
91
|
export default Routes;
|
package/es/routes.js
CHANGED
|
@@ -2,6 +2,8 @@ import { Route, Switch } from "react-router";
|
|
|
2
2
|
import ArchivePage from "./pages/ArchivedPage";
|
|
3
3
|
import { BaseRoutes } from "@voplus/morpho-data";
|
|
4
4
|
import DrivePage from "./pages/DrivePage";
|
|
5
|
+
import EnvelopeDefaultView from "./pages/Signature/Envelope/EnvelopeDefaultView";
|
|
6
|
+
import EnvelopeRecipientView from "./pages/Signature/Envelope/EnvelopeRecipientView";
|
|
5
7
|
import { FileContentPage } from "./pages";
|
|
6
8
|
import GraphPage from "./pages/GraphEditorPage";
|
|
7
9
|
import LibraryDefaultView from "./pages/Library/LibraryDefaultView";
|
|
@@ -23,7 +25,9 @@ const RouteComponent = () => {
|
|
|
23
25
|
React.createElement(Route, { path: Routes.Unit.route, exact: true, component: Routes.Unit.component }),
|
|
24
26
|
React.createElement(Route, { path: Routes.UnitTree.route, exact: true, component: Routes.UnitTree.component }),
|
|
25
27
|
React.createElement(Route, { path: Routes.PageDefaultView.route, exact: true, component: Routes.PageDefaultView.component }),
|
|
26
|
-
React.createElement(Route, { path: Routes.LibraryDefaultView.route, exact: true, component: Routes.LibraryDefaultView.component })
|
|
28
|
+
React.createElement(Route, { path: Routes.LibraryDefaultView.route, exact: true, component: Routes.LibraryDefaultView.component }),
|
|
29
|
+
React.createElement(Route, { path: Routes.EnvelopeDefaultView.route, exact: true, component: Routes.EnvelopeDefaultView.component }),
|
|
30
|
+
React.createElement(Route, { path: Routes.EnvelopeRecipientView.route, exact: true, component: Routes.EnvelopeRecipientView.component })));
|
|
27
31
|
};
|
|
28
32
|
const Routes = {
|
|
29
33
|
Drive: {
|
|
@@ -92,6 +96,18 @@ const Routes = {
|
|
|
92
96
|
getUrl: (id) => `/library/${id}`,
|
|
93
97
|
component: LibraryDefaultView
|
|
94
98
|
},
|
|
99
|
+
EnvelopeDefaultView: {
|
|
100
|
+
route: "/envelope/:id",
|
|
101
|
+
tabPattern: RegExp("/envelope/[^/]+"),
|
|
102
|
+
getUrl: (id) => `/envelope/${id}`,
|
|
103
|
+
component: EnvelopeDefaultView
|
|
104
|
+
},
|
|
105
|
+
EnvelopeRecipientView: {
|
|
106
|
+
route: "/envelope-recipient/:id",
|
|
107
|
+
tabPattern: RegExp("/envelope-recipient/[^/]+"),
|
|
108
|
+
getUrl: (id) => `/envelope-recipient/${id}`,
|
|
109
|
+
component: EnvelopeRecipientView
|
|
110
|
+
},
|
|
95
111
|
addRoutes: () => {
|
|
96
112
|
BaseRoutes.routes.push({
|
|
97
113
|
name: "drive",
|
|
@@ -148,6 +164,16 @@ const Routes = {
|
|
|
148
164
|
tabBasePattern: Routes.LibraryDefaultView.tabPattern,
|
|
149
165
|
component: React.createElement(RouteComponent, null)
|
|
150
166
|
});
|
|
167
|
+
BaseRoutes.routes.push({
|
|
168
|
+
name: "envelope",
|
|
169
|
+
tabBasePattern: Routes.EnvelopeDefaultView.tabPattern,
|
|
170
|
+
component: React.createElement(RouteComponent, null)
|
|
171
|
+
});
|
|
172
|
+
BaseRoutes.routes.push({
|
|
173
|
+
name: "envelope-recipient",
|
|
174
|
+
tabBasePattern: Routes.EnvelopeRecipientView.tabPattern,
|
|
175
|
+
component: React.createElement(RouteComponent, null)
|
|
176
|
+
});
|
|
151
177
|
}
|
|
152
178
|
};
|
|
153
179
|
export default Routes;
|