@verdocs/web-sdk 1.4.6 → 1.5.1
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/dist/cjs/VerdocsEndpoint-5e6dd8ef.js +4780 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +32 -19
- package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +15 -11
- package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +5 -0
- package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +40 -35
- package/dist/cjs/verdocs-search.cjs.entry.js +6 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +26 -161
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.css +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -1
- package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +31 -1
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +30 -6
- package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +26 -0
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +1 -4
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +35 -17
- package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +36 -6
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +27 -26
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +40 -23
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +26 -0
- package/dist/components/VerdocsEndpoint.js +4766 -0
- package/dist/components/verdocs-auth.js +33 -18
- package/dist/components/verdocs-kba-dialog.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js +1 -1
- package/dist/components/verdocs-quick-functions.js +8 -1
- package/dist/components/verdocs-search-activity2.js +37 -34
- package/dist/components/verdocs-search-box2.js +6 -0
- package/dist/components/verdocs-search.js +9 -2
- package/dist/components/verdocs-sign.js +27 -162
- package/dist/components/verdocs-view2.js +6 -1
- package/dist/docs.json +117 -3
- package/dist/esm/VerdocsEndpoint-30e1b6ec.js +4766 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +32 -19
- package/dist/esm/verdocs-dropdown_12.entry.js +5 -1
- package/dist/esm/verdocs-kba-dialog.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm/verdocs-quick-functions.entry.js +5 -0
- package/dist/esm/verdocs-search-activity_2.entry.js +40 -35
- package/dist/esm/verdocs-search.entry.js +6 -1
- package/dist/esm/verdocs-sign.entry.js +26 -161
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/VerdocsEndpoint-30e1b6ec.js +7 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
- package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/elements/verdocs-quick-functions/verdocs-quick-functions.d.ts +5 -0
- package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +5 -0
- package/dist/types/components/elements/verdocs-search-box/verdocs-search-box.d.ts +5 -0
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +7 -4
- package/dist/types/components/embeds/verdocs-search/verdocs-search.d.ts +5 -0
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +6 -3
- package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +5 -0
- package/dist/types/components.d.ts +57 -0
- package/dist/verdocs-web-sdk/{p-ed5baeb4.entry.js → p-064453c3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-06f38046.js +1 -0
- package/dist/verdocs-web-sdk/p-16d62a51.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-1b4e04b7.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-1ea3b9d3.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-30cc8818.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-0353c423.entry.js → p-32ad1014.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4d80d044.system.js +7 -0
- package/dist/verdocs-web-sdk/{p-432c3151.system.entry.js → p-81fc0196.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8276345a.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -1
- package/dist/verdocs-web-sdk/p-9139a76d.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a87069d5.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-aa9fc574.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c29c2cf8.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-4368df79.system.entry.js → p-c4d03ff9.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a1143ddb.entry.js → p-d522de7d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e2e643c5.system.entry.js → p-e4ba14dc.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f6a53928.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/Auth-e68977a3.js +0 -90
- package/dist/cjs/Token-1ec62bd3.js +0 -2330
- package/dist/cjs/buffer-es6-bc8199b1.js +0 -2018
- package/dist/components/Auth.js +0 -85
- package/dist/components/Token.js +0 -2325
- package/dist/components/buffer-es6.js +0 -2010
- package/dist/esm/Auth-b330f209.js +0 -85
- package/dist/esm/Token-a587e3ad.js +0 -2325
- package/dist/esm/buffer-es6-136673c8.js +0 -2010
- package/dist/esm-es5/Auth-b330f209.js +0 -1
- package/dist/esm-es5/Token-a587e3ad.js +0 -1
- package/dist/esm-es5/buffer-es6-136673c8.js +0 -7
- package/dist/verdocs-web-sdk/p-0b1fb53f.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0c30002e.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-203fd748.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-216a4759.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2c161242.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3820c9a2.js +0 -1
- package/dist/verdocs-web-sdk/p-39633a02.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-5dfd73f9.system.js +0 -7
- package/dist/verdocs-web-sdk/p-6348272c.js +0 -1
- package/dist/verdocs-web-sdk/p-9428614b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-da850d97.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e3659c64.system.js +0 -1
- package/dist/verdocs-web-sdk/p-e93ac86f.system.js +0 -1
- package/dist/verdocs-web-sdk/p-ef932a87.js +0 -1
- package/dist/verdocs-web-sdk/p-f0e6fde0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fd853e54.system.entry.js +0 -1
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { Component, h } from '@stencil/core';
|
|
1
|
+
import { Component, h, Prop } from '@stencil/core';
|
|
2
|
+
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
|
2
3
|
export class VerdocsSearch {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
|
|
7
|
+
*/
|
|
8
|
+
this.endpoint = VerdocsEndpoint.getDefault();
|
|
9
|
+
}
|
|
3
10
|
render() {
|
|
4
11
|
return (h("div", { class: "container" },
|
|
5
|
-
h("verdocs-search-box",
|
|
12
|
+
h("verdocs-search-box", { endpoint: this.endpoint }),
|
|
6
13
|
h("div", { class: "boxes" },
|
|
7
|
-
h("verdocs-search-activity", { type: "recent" }),
|
|
8
|
-
h("verdocs-search-activity", { type: "saved" }),
|
|
9
|
-
h("verdocs-search-activity", { type: "starred" }),
|
|
10
|
-
h("search-quick-functions",
|
|
14
|
+
h("verdocs-search-activity", { type: "recent", endpoint: this.endpoint }),
|
|
15
|
+
h("verdocs-search-activity", { type: "saved", endpoint: this.endpoint }),
|
|
16
|
+
h("verdocs-search-activity", { type: "starred", endpoint: this.endpoint }),
|
|
17
|
+
h("search-quick-functions", { endpoint: this.endpoint }))));
|
|
11
18
|
}
|
|
12
19
|
static get is() { return "verdocs-search"; }
|
|
13
20
|
static get originalStyleUrls() { return {
|
|
@@ -16,4 +23,27 @@ export class VerdocsSearch {
|
|
|
16
23
|
static get styleUrls() { return {
|
|
17
24
|
"$": ["verdocs-search.css"]
|
|
18
25
|
}; }
|
|
26
|
+
static get properties() { return {
|
|
27
|
+
"endpoint": {
|
|
28
|
+
"type": "unknown",
|
|
29
|
+
"mutable": false,
|
|
30
|
+
"complexType": {
|
|
31
|
+
"original": "VerdocsEndpoint",
|
|
32
|
+
"resolved": "VerdocsEndpoint",
|
|
33
|
+
"references": {
|
|
34
|
+
"VerdocsEndpoint": {
|
|
35
|
+
"location": "import",
|
|
36
|
+
"path": "@verdocs/js-sdk"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": false,
|
|
41
|
+
"optional": false,
|
|
42
|
+
"docs": {
|
|
43
|
+
"tags": [],
|
|
44
|
+
"text": "The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used."
|
|
45
|
+
},
|
|
46
|
+
"defaultValue": "VerdocsEndpoint.getDefault()"
|
|
47
|
+
}
|
|
48
|
+
}; }
|
|
19
49
|
}
|
|
@@ -31,7 +31,7 @@ verdocs-sign .intro {
|
|
|
31
31
|
verdocs-sign .toolbar {
|
|
32
32
|
width: 100%;
|
|
33
33
|
margin: 0 auto;
|
|
34
|
-
padding: 0
|
|
34
|
+
padding: 0 14px;
|
|
35
35
|
max-width: 1028px;
|
|
36
36
|
position: relative;
|
|
37
37
|
}
|
|
@@ -61,17 +61,34 @@ verdocs-sign .document {
|
|
|
61
61
|
position: relative;
|
|
62
62
|
overflow-y: scroll;
|
|
63
63
|
}
|
|
64
|
-
verdocs-sign .agree
|
|
64
|
+
verdocs-sign .agree {
|
|
65
|
+
flex: 1;
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
margin-right: 10px;
|
|
70
|
+
}
|
|
71
|
+
verdocs-sign .agree .intro {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
verdocs-sign .agree .header {
|
|
75
|
+
flex: 0 0 56px;
|
|
76
|
+
}
|
|
77
|
+
verdocs-sign .agree .agree-checkbox {
|
|
78
|
+
background: #ccc;
|
|
65
79
|
flex: 0 0 20px;
|
|
66
80
|
display: flex;
|
|
67
81
|
width: 20px;
|
|
68
82
|
height: 20px;
|
|
69
83
|
border-radius: 3px;
|
|
70
|
-
background: #ffffff;
|
|
71
84
|
position: relative;
|
|
72
|
-
margin: 0 10px 0
|
|
85
|
+
margin: 0 10px 0 14px;
|
|
73
86
|
}
|
|
74
|
-
verdocs-sign .agree-checkbox label {
|
|
87
|
+
verdocs-sign .agree .agree-checkbox input[type=checkbox]:checked + label:after {
|
|
88
|
+
filter: alpha(opacity=100);
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
verdocs-sign .agree .agree-checkbox label {
|
|
75
92
|
left: 2px;
|
|
76
93
|
top: 2px;
|
|
77
94
|
width: 16px;
|
|
@@ -81,7 +98,11 @@ verdocs-sign .agree-checkbox label {
|
|
|
81
98
|
background: #33354c;
|
|
82
99
|
box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.8);
|
|
83
100
|
}
|
|
84
|
-
verdocs-sign .agree-checkbox label:after {
|
|
101
|
+
verdocs-sign .agree .agree-checkbox label .agree-checkbox label:hover::after {
|
|
102
|
+
filter: alpha(opacity=30);
|
|
103
|
+
opacity: 0.3;
|
|
104
|
+
}
|
|
105
|
+
verdocs-sign .agree .agree-checkbox label:after {
|
|
85
106
|
top: 2px;
|
|
86
107
|
left: 3px;
|
|
87
108
|
width: 8px;
|
|
@@ -96,26 +117,6 @@ verdocs-sign .agree-checkbox label:after {
|
|
|
96
117
|
border-top: none;
|
|
97
118
|
border-right: none;
|
|
98
119
|
}
|
|
99
|
-
verdocs-sign .agree-checkbox label:hover::after {
|
|
100
|
-
filter: alpha(opacity=30);
|
|
101
|
-
opacity: 0.3;
|
|
102
|
-
}
|
|
103
|
-
verdocs-sign .agree-checkbox input[type=checkbox]:checked + label:after {
|
|
104
|
-
filter: alpha(opacity=100);
|
|
105
|
-
opacity: 1;
|
|
106
|
-
}
|
|
107
|
-
verdocs-sign.agreed .intro {
|
|
108
|
-
display: none;
|
|
109
|
-
}
|
|
110
|
-
verdocs-sign.agreed .header {
|
|
111
|
-
flex: 0 0 56px;
|
|
112
|
-
}
|
|
113
|
-
verdocs-sign.agreed .agree-checkbox {
|
|
114
|
-
background: #ccc;
|
|
115
|
-
}
|
|
116
|
-
verdocs-sign.agreed .agree-checkbox label {
|
|
117
|
-
cursor: default;
|
|
118
|
-
}
|
|
119
120
|
verdocs-sign .page-controls {
|
|
120
121
|
position: absolute;
|
|
121
122
|
left: 50%;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { Host } from '@stencil/core';
|
|
2
|
+
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
|
3
|
+
import { Documents } from '@verdocs/js-sdk/Documents';
|
|
2
4
|
import { getRGBA } from '@verdocs/js-sdk/Utils/Colors';
|
|
3
5
|
import { rescale } from '@verdocs/js-sdk/Utils/Fields';
|
|
4
|
-
import { VerdocsEndpoint } from '@verdocs/js-sdk/HTTP';
|
|
5
6
|
import { Component, Prop, State, h } from '@stencil/core';
|
|
6
7
|
import { updateRecipientStatus } from '@verdocs/js-sdk/Documents/Recipients';
|
|
7
|
-
import { getEndpoint, setActiveEndpoint } from '@verdocs/js-sdk/HTTP/Transport';
|
|
8
8
|
import { isValidEmail, isValidPhone } from '@verdocs/js-sdk/Templates/Validators';
|
|
9
|
-
import { getSigningSession, getDocument, getDocumentFile, updateDocumentField } from '@verdocs/js-sdk/Documents/Documents';
|
|
10
|
-
const BASE_URL = 'https://stage-api.verdocs.com';
|
|
11
9
|
/**
|
|
12
10
|
* Display a document signing experience.
|
|
13
11
|
*/
|
|
14
12
|
export class VerdocsSign {
|
|
15
13
|
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
|
|
16
|
+
*/
|
|
17
|
+
this.endpoint = VerdocsEndpoint.getDefault();
|
|
16
18
|
/**
|
|
17
19
|
* If `source` is set to `verdocs-sign`, this should be set to a valid invitation code to activate a
|
|
18
20
|
* signing session.
|
|
@@ -28,7 +30,6 @@ export class VerdocsSign {
|
|
|
28
30
|
* signing session.
|
|
29
31
|
*/
|
|
30
32
|
this.invitecode = null;
|
|
31
|
-
this.endpoint = null;
|
|
32
33
|
this.recipient = null;
|
|
33
34
|
this.signerToken = null;
|
|
34
35
|
this.pdfUrl = null;
|
|
@@ -39,14 +40,10 @@ export class VerdocsSign {
|
|
|
39
40
|
this.nextButtonLabel = 'Start';
|
|
40
41
|
this.focusedField = '';
|
|
41
42
|
}
|
|
42
|
-
componentWillLoad() {
|
|
43
|
-
const endpoint = new VerdocsEndpoint().setBaseURL(BASE_URL);
|
|
44
|
-
setActiveEndpoint(endpoint);
|
|
45
|
-
}
|
|
46
43
|
async componentDidLoad() {
|
|
47
44
|
try {
|
|
48
45
|
console.log('[SIGN] Processing invite code', this.documentid, this.roleid, this.invitecode);
|
|
49
|
-
const { session, recipient, signerToken } = await getSigningSession({
|
|
46
|
+
const { session, recipient, signerToken } = await Documents.getSigningSession(this.endpoint, {
|
|
50
47
|
documentId: this.documentid,
|
|
51
48
|
roleId: this.roleid,
|
|
52
49
|
inviteCode: this.invitecode,
|
|
@@ -55,14 +52,14 @@ export class VerdocsSign {
|
|
|
55
52
|
console.log('[SIGN] Recipient', recipient);
|
|
56
53
|
this.recipient = recipient;
|
|
57
54
|
this.signerToken = signerToken;
|
|
58
|
-
|
|
55
|
+
this.endpoint.setToken(signerToken);
|
|
59
56
|
if (this.recipient.agreed) {
|
|
60
57
|
this.nextButtonLabel = 'Next';
|
|
61
58
|
}
|
|
62
|
-
const document = await getDocument(this.documentid);
|
|
59
|
+
const document = await Documents.getDocument(this.endpoint, this.documentid);
|
|
63
60
|
this.document = document;
|
|
64
61
|
console.log('[SIGN] Document', document);
|
|
65
|
-
this.pdfUrl = `${
|
|
62
|
+
this.pdfUrl = `${this.endpoint.getBaseURL()}/documents/${this.documentid}/envelope_documents/${document.envelope_document_id}?file=true`;
|
|
66
63
|
this.recipientIndex = this.document.recipients.findIndex(recipient => recipient.role_name == this.roleid);
|
|
67
64
|
if (this.recipientIndex > -1) {
|
|
68
65
|
console.log('Found recipient', this.document.recipients[this.recipientIndex]);
|
|
@@ -79,7 +76,7 @@ export class VerdocsSign {
|
|
|
79
76
|
}
|
|
80
77
|
handleClickAgree() {
|
|
81
78
|
console.log('agree clicked');
|
|
82
|
-
updateRecipientStatus(this.documentid, this.roleid, 'update', { agreed: true })
|
|
79
|
+
updateRecipientStatus(this.endpoint, this.documentid, this.roleid, 'update', { agreed: true })
|
|
83
80
|
.then(r => {
|
|
84
81
|
console.log('update result', r);
|
|
85
82
|
this.nextButtonLabel = 'Next';
|
|
@@ -91,7 +88,7 @@ export class VerdocsSign {
|
|
|
91
88
|
}
|
|
92
89
|
async savePDF() {
|
|
93
90
|
const fileName = `${this.document.name} - ${this.document.updated_at.split('T')[0]}.pdf`;
|
|
94
|
-
const data = await getDocumentFile(this.documentid, this.document.envelope_document_id);
|
|
91
|
+
const data = await Documents.getDocumentFile(this.endpoint, this.documentid, this.document.envelope_document_id);
|
|
95
92
|
// This is better in React than doing window.href= or similar to trigger a download. For a description of the technique
|
|
96
93
|
// see https://stackoverflow.com/questions/8126623/downloading-canvas-element-to-an-image
|
|
97
94
|
let xhr = new XMLHttpRequest();
|
|
@@ -133,23 +130,23 @@ export class VerdocsSign {
|
|
|
133
130
|
console.log('fieldChange', field, e.detail);
|
|
134
131
|
switch (field.type) {
|
|
135
132
|
case 'textbox':
|
|
136
|
-
updateDocumentField(this.documentid, field.name, { prepared: false, value: e.detail })
|
|
133
|
+
Documents.updateDocumentField(this.endpoint, this.documentid, field.name, { prepared: false, value: e.detail })
|
|
137
134
|
.then(r => console.log('Update result', r))
|
|
138
135
|
.catch(e => console.log('Error updating', e));
|
|
139
136
|
break;
|
|
140
137
|
case 'checkbox_group':
|
|
141
|
-
updateDocumentField(this.documentid, field.name, { prepared: false, value: { options: [{ id: optionId, checked: e.detail }] } })
|
|
138
|
+
Documents.updateDocumentField(this.endpoint, this.documentid, field.name, { prepared: false, value: { options: [{ id: optionId, checked: e.detail }] } })
|
|
142
139
|
.then(r => console.log('Update result', r))
|
|
143
140
|
.catch(e => console.log('Error updating', e));
|
|
144
141
|
break;
|
|
145
142
|
case 'radio_button_group':
|
|
146
143
|
const options = field.settings.options.map(option => ({ id: option.id, selected: optionId === option.id }));
|
|
147
|
-
updateDocumentField(this.documentid, field.name, { prepared: false, value: { options } })
|
|
144
|
+
Documents.updateDocumentField(this.endpoint, this.documentid, field.name, { prepared: false, value: { options } })
|
|
148
145
|
.then(r => console.log('Update result', r))
|
|
149
146
|
.catch(e => console.log('Error updating', e));
|
|
150
147
|
break;
|
|
151
148
|
case 'dropdown':
|
|
152
|
-
updateDocumentField(this.documentid, field.name, { prepared: false, value: e.detail })
|
|
149
|
+
Documents.updateDocumentField(this.endpoint, this.documentid, field.name, { prepared: false, value: e.detail })
|
|
153
150
|
.then(r => console.log('Update result', r))
|
|
154
151
|
.catch(e => console.log('Error updating', e));
|
|
155
152
|
break;
|
|
@@ -312,12 +309,12 @@ export class VerdocsSign {
|
|
|
312
309
|
h("div", { class: "toolbar" },
|
|
313
310
|
h("div", { class: "tools" },
|
|
314
311
|
h("verdocs-dropdown", { options: menuOptions, onOptionSelected: e => this.handleOptionSelected(e) }),
|
|
315
|
-
!((_b = this.recipient) === null || _b === void 0 ? void 0 : _b.agreed) ? (h("div", {
|
|
312
|
+
!((_b = this.recipient) === null || _b === void 0 ? void 0 : _b.agreed) ? (h("div", { class: "agree" },
|
|
316
313
|
h("div", { class: "agree-checkbox" },
|
|
317
314
|
h("input", { type: "checkbox", value: "None", id: "agree-checkbox-element", name: "agree", onChange: () => this.handleClickAgree() }),
|
|
318
315
|
h("label", { htmlFor: "agree-checkbox-element" })),
|
|
319
|
-
"I agree to use electronic records and signatures.")) : (h("div", { style: { flex: '1' } })),
|
|
320
|
-
h("verdocs-button", { label: this.nextButtonLabel, disabled: !((_c = this.recipient) === null || _c === void 0 ? void 0 : _c.agreed), onClick: () => this.handleNext() })))),
|
|
316
|
+
h("span", null, "I agree to use electronic records and signatures."))) : (h("div", { style: { flex: '1' } })),
|
|
317
|
+
h("verdocs-button", { size: "small", label: this.nextButtonLabel, disabled: !((_c = this.recipient) === null || _c === void 0 ? void 0 : _c.agreed), onClick: () => this.handleNext() })))),
|
|
321
318
|
!((_d = this.recipient) === null || _d === void 0 ? void 0 : _d.agreed) ? h("div", { class: "cover" }) : h("div", { style: { display: 'none' } }),
|
|
322
319
|
h("div", { class: "document" },
|
|
323
320
|
this.pdfUrl ? h("verdocs-view", { source: this.pdfUrl, token: this.signerToken, onDocumentRendered: e => this.handleDocumentRendered(e) }) : h("verdocs-loader", null),
|
|
@@ -334,6 +331,27 @@ export class VerdocsSign {
|
|
|
334
331
|
"$": ["verdocs-sign.css"]
|
|
335
332
|
}; }
|
|
336
333
|
static get properties() { return {
|
|
334
|
+
"endpoint": {
|
|
335
|
+
"type": "unknown",
|
|
336
|
+
"mutable": false,
|
|
337
|
+
"complexType": {
|
|
338
|
+
"original": "VerdocsEndpoint",
|
|
339
|
+
"resolved": "VerdocsEndpoint",
|
|
340
|
+
"references": {
|
|
341
|
+
"VerdocsEndpoint": {
|
|
342
|
+
"location": "import",
|
|
343
|
+
"path": "@verdocs/js-sdk"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
"required": false,
|
|
348
|
+
"optional": false,
|
|
349
|
+
"docs": {
|
|
350
|
+
"tags": [],
|
|
351
|
+
"text": "The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used."
|
|
352
|
+
},
|
|
353
|
+
"defaultValue": "VerdocsEndpoint.getDefault()"
|
|
354
|
+
},
|
|
337
355
|
"documentid": {
|
|
338
356
|
"type": "string",
|
|
339
357
|
"mutable": false,
|
|
@@ -390,7 +408,6 @@ export class VerdocsSign {
|
|
|
390
408
|
}
|
|
391
409
|
}; }
|
|
392
410
|
static get states() { return {
|
|
393
|
-
"endpoint": {},
|
|
394
411
|
"recipient": {},
|
|
395
412
|
"signerToken": {},
|
|
396
413
|
"pdfUrl": {},
|
|
@@ -3,9 +3,9 @@ export default {
|
|
|
3
3
|
title: 'Embeds/Sign',
|
|
4
4
|
component: 'verdocs-sign',
|
|
5
5
|
args: {
|
|
6
|
-
documentid: '
|
|
6
|
+
documentid: 'bd8ecb8f-6eb9-4998-802a-b8d8b7f14d63',
|
|
7
7
|
roleid: 'Recipient 1',
|
|
8
|
-
invitecode: '
|
|
8
|
+
invitecode: '9c5284cd58e6e7a86c0a94522b58d433',
|
|
9
9
|
},
|
|
10
10
|
argTypes: {
|
|
11
11
|
authenticated: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import pdf from 'pdfjs-dist';
|
|
2
|
+
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
|
2
3
|
import { VerbosityLevel, version as PDFJSversion } from 'pdfjs-dist';
|
|
3
4
|
import { Component, h, Element, Event, Prop, Watch, State } from '@stencil/core';
|
|
4
5
|
import { integerSequence } from '../../../utils/utils';
|
|
@@ -13,6 +14,10 @@ export class VerdocsView {
|
|
|
13
14
|
constructor() {
|
|
14
15
|
this.numPages = 1;
|
|
15
16
|
this.fingerprint = null;
|
|
17
|
+
/**
|
|
18
|
+
* The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
|
|
19
|
+
*/
|
|
20
|
+
this.endpoint = VerdocsEndpoint.getDefault();
|
|
16
21
|
/**
|
|
17
22
|
* Rotate the PDF in degrees
|
|
18
23
|
*/
|
|
@@ -133,6 +138,27 @@ export class VerdocsView {
|
|
|
133
138
|
"$": ["verdocs-view.css"]
|
|
134
139
|
}; }
|
|
135
140
|
static get properties() { return {
|
|
141
|
+
"endpoint": {
|
|
142
|
+
"type": "unknown",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "VerdocsEndpoint",
|
|
146
|
+
"resolved": "VerdocsEndpoint",
|
|
147
|
+
"references": {
|
|
148
|
+
"VerdocsEndpoint": {
|
|
149
|
+
"location": "import",
|
|
150
|
+
"path": "@verdocs/js-sdk"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used."
|
|
159
|
+
},
|
|
160
|
+
"defaultValue": "VerdocsEndpoint.getDefault()"
|
|
161
|
+
},
|
|
136
162
|
"rotation": {
|
|
137
163
|
"type": "number",
|
|
138
164
|
"mutable": false,
|