@verdocs/web-sdk 1.10.7 → 1.10.9
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/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-create_2.cjs.entry.js +38 -8
- package/dist/cjs/verdocs-template-recipients.cjs.entry.js +1 -1
- package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +2 -2
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.css +0 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +37 -7
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.js +1 -1
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.stories.js +1 -1
- package/dist/components/verdocs-search-box2.js +1 -1
- package/dist/components/verdocs-template-create2.js +1 -1
- package/dist/components/verdocs-template-fields2.js +37 -7
- package/dist/components/verdocs-template-recipients.js +1 -1
- package/dist/docs.json +2 -2
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-template-create_2.entry.js +38 -8
- package/dist/esm/verdocs-template-recipients.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-recipients.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-3fbe602a.system.entry.js → p-83adc0f7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-950a8083.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-7bc5fc1e.system.entry.js → p-96835e27.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c0538993.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-205027db.entry.js → p-cf8522b5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-fc751bc4.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-53198827.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8c3d48c1.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cf9883c7.system.entry.js +0 -1
|
@@ -181,7 +181,7 @@ const VerdocsSearchBox = class {
|
|
|
181
181
|
this.typeChanged = index.createEvent(this, "typeChanged", 7);
|
|
182
182
|
this.queryChanged = index.createEvent(this, "queryChanged", 7);
|
|
183
183
|
this.endpoint = VerdocsEndpoint.VerdocsEndpoint.getDefault();
|
|
184
|
-
this.placeholder = '
|
|
184
|
+
this.placeholder = 'Search envelopes, templates, organizations...';
|
|
185
185
|
this.type = 'all';
|
|
186
186
|
this.query = '';
|
|
187
187
|
this.grabsFocus = false;
|
|
@@ -46,7 +46,7 @@ var createTemplateDocument = function (endpoint, templateId, file, onUploadProgr
|
|
|
46
46
|
.then(function (r) { return r.data; });
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column
|
|
49
|
+
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{max-width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}";
|
|
50
50
|
|
|
51
51
|
// import {ITemplate, ITemplateDocument} from '@verdocs/js-sdk/Templates/Types';
|
|
52
52
|
// import {createPage} from '@verdocs/js-sdk/Templates/Pages';
|
|
@@ -290,14 +290,44 @@ const VerdocsTemplateFields = class {
|
|
|
290
290
|
required: true,
|
|
291
291
|
page_sequence: pageNumber,
|
|
292
292
|
validator: null,
|
|
293
|
-
setting: {
|
|
294
|
-
width,
|
|
295
|
-
height,
|
|
296
|
-
x,
|
|
297
|
-
y,
|
|
298
|
-
result: '',
|
|
299
|
-
},
|
|
293
|
+
setting: { x, y }, // In the future, this is all we should send, see below
|
|
300
294
|
};
|
|
295
|
+
// TODO: Fix how the server validates all this. It uses a JSON schema and is very particular about shapes for each field type.
|
|
296
|
+
// That makes it harder for third party developers to create fields via API calls. It would be better to always set X/Y and
|
|
297
|
+
// let the server normalize the rest, discarding properties that are invalid and back-filling defaults as needed.
|
|
298
|
+
switch (field.type) {
|
|
299
|
+
case 'attachment':
|
|
300
|
+
case 'payment':
|
|
301
|
+
field.setting = { x, y };
|
|
302
|
+
break;
|
|
303
|
+
case 'initial':
|
|
304
|
+
case 'signature':
|
|
305
|
+
field.setting = { x, y, result: '' };
|
|
306
|
+
break;
|
|
307
|
+
case 'checkbox_group':
|
|
308
|
+
field.setting = { x, y, minimum_checked: 0, maximum_checked: 1000 };
|
|
309
|
+
break;
|
|
310
|
+
case 'date':
|
|
311
|
+
field.setting = { x, y, width, height, result: '' };
|
|
312
|
+
break;
|
|
313
|
+
// TODO: Remove this everywhere
|
|
314
|
+
// case 'checkbox':break;
|
|
315
|
+
// TODO: What is this?
|
|
316
|
+
// case 'placeholder':break;
|
|
317
|
+
case 'dropdown':
|
|
318
|
+
field.setting = { x, y, width, height, value: '', placeholder: 'Select a value' };
|
|
319
|
+
break;
|
|
320
|
+
case 'radio_button_group':
|
|
321
|
+
field.setting = { x, y };
|
|
322
|
+
break;
|
|
323
|
+
// TODO: What about textareas?
|
|
324
|
+
case 'textbox':
|
|
325
|
+
field.setting = { x, y, width, height, result: '', leading: 0, alignment: 0, upperCase: false };
|
|
326
|
+
break;
|
|
327
|
+
case 'timestamp':
|
|
328
|
+
field.setting = { x, y, width, height };
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
301
331
|
const saved = await Fields.createField(this.endpoint, this.templateId, field);
|
|
302
332
|
console.log('Saved field', saved);
|
|
303
333
|
templateStore.state.fields.push(saved);
|
|
@@ -233,7 +233,7 @@ const VerdocsTemplateRecipients = class {
|
|
|
233
233
|
}
|
|
234
234
|
render() {
|
|
235
235
|
const roleNames = templateStore.state.template.roles.map(role => role.name);
|
|
236
|
-
return (index.h(index.Host, null, index.h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, index.h("h5", null, "
|
|
236
|
+
return (index.h(index.Host, null, index.h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, index.h("h5", null, "Roles"), index.h("div", { class: "participants" }, index.h("div", { class: "left-line" }), index.h("div", { class: "row" }, index.h("div", { class: "icon", innerHTML: startIcon }), index.h("div", { class: "row-recipients" }, index.h("div", { class: "sender" }, index.h("span", { class: "label" }, "Sender:"), " ", senderLabels[templateStore.state.template.sender], ' ', index.h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingSenderDialog = true), "aria-role": "button" })))), index.h("div", { class: "row add-sequence", "data-sequence": 0 }, index.h("div", { class: "icon", innerHTML: plusIcon }), index.h("div", { class: "row-recipients" }, index.h("div", { class: "dropzone", "data-sequence": 0, "data-order": 1 }, "Add Step"))), this.sequences.map(sequence => (index.h(index.Fragment, null, index.h("div", { class: "row" }, index.h("div", { class: "icon", innerHTML: stepIcon }), index.h("div", { class: "row-recipients" }, index.h("div", { class: "dropzone", "data-order": 0.5, "data-sequence": sequence }), templateStore.state.template.roles
|
|
237
237
|
.filter(role => role.sequence === sequence)
|
|
238
238
|
.map(role => {
|
|
239
239
|
return (index.h(index.Fragment, null, index.h("div", { class: "recipient", style: { backgroundColor: Colors.getRGBA(utils.getRoleIndex(roleNames, role.name)) }, "data-rolename": role.name }, index.h("span", { class: "type-icon", innerHTML: role.type === 'signer' ? iconSigner : role.type === 'cc' ? iconCC : iconApprover }), role.name, " ", index.h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingRoleDialog = role.name), "aria-role": "button" })), index.h("div", { class: "dropzone", "data-order": role.order + 0.5, "data-sequence": sequence })));
|
|
@@ -11,7 +11,7 @@ const CloseIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" x
|
|
|
11
11
|
export class VerdocsSearchBox {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.endpoint = VerdocsEndpoint.getDefault();
|
|
14
|
-
this.placeholder = '
|
|
14
|
+
this.placeholder = 'Search envelopes, templates, organizations...';
|
|
15
15
|
this.type = 'all';
|
|
16
16
|
this.query = '';
|
|
17
17
|
this.grabsFocus = false;
|
|
@@ -93,7 +93,7 @@ export class VerdocsSearchBox {
|
|
|
93
93
|
},
|
|
94
94
|
"attribute": "placeholder",
|
|
95
95
|
"reflect": false,
|
|
96
|
-
"defaultValue": "'
|
|
96
|
+
"defaultValue": "'Search envelopes, templates, organizations...'"
|
|
97
97
|
},
|
|
98
98
|
"type": {
|
|
99
99
|
"type": "string",
|
package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js
CHANGED
|
@@ -176,14 +176,44 @@ export class VerdocsTemplateFields {
|
|
|
176
176
|
required: true,
|
|
177
177
|
page_sequence: pageNumber,
|
|
178
178
|
validator: null,
|
|
179
|
-
setting: {
|
|
180
|
-
width,
|
|
181
|
-
height,
|
|
182
|
-
x,
|
|
183
|
-
y,
|
|
184
|
-
result: '',
|
|
185
|
-
},
|
|
179
|
+
setting: { x, y }, // In the future, this is all we should send, see below
|
|
186
180
|
};
|
|
181
|
+
// TODO: Fix how the server validates all this. It uses a JSON schema and is very particular about shapes for each field type.
|
|
182
|
+
// That makes it harder for third party developers to create fields via API calls. It would be better to always set X/Y and
|
|
183
|
+
// let the server normalize the rest, discarding properties that are invalid and back-filling defaults as needed.
|
|
184
|
+
switch (field.type) {
|
|
185
|
+
case 'attachment':
|
|
186
|
+
case 'payment':
|
|
187
|
+
field.setting = { x, y };
|
|
188
|
+
break;
|
|
189
|
+
case 'initial':
|
|
190
|
+
case 'signature':
|
|
191
|
+
field.setting = { x, y, result: '' };
|
|
192
|
+
break;
|
|
193
|
+
case 'checkbox_group':
|
|
194
|
+
field.setting = { x, y, minimum_checked: 0, maximum_checked: 1000 };
|
|
195
|
+
break;
|
|
196
|
+
case 'date':
|
|
197
|
+
field.setting = { x, y, width, height, result: '' };
|
|
198
|
+
break;
|
|
199
|
+
// TODO: Remove this everywhere
|
|
200
|
+
// case 'checkbox':break;
|
|
201
|
+
// TODO: What is this?
|
|
202
|
+
// case 'placeholder':break;
|
|
203
|
+
case 'dropdown':
|
|
204
|
+
field.setting = { x, y, width, height, value: '', placeholder: 'Select a value' };
|
|
205
|
+
break;
|
|
206
|
+
case 'radio_button_group':
|
|
207
|
+
field.setting = { x, y };
|
|
208
|
+
break;
|
|
209
|
+
// TODO: What about textareas?
|
|
210
|
+
case 'textbox':
|
|
211
|
+
field.setting = { x, y, width, height, result: '', leading: 0, alignment: 0, upperCase: false };
|
|
212
|
+
break;
|
|
213
|
+
case 'timestamp':
|
|
214
|
+
field.setting = { x, y, width, height };
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
187
217
|
const saved = await createField(this.endpoint, this.templateId, field);
|
|
188
218
|
console.log('Saved field', saved);
|
|
189
219
|
TemplateStore.fields.push(saved);
|
|
@@ -220,7 +220,7 @@ export class VerdocsTemplateRecipients {
|
|
|
220
220
|
}
|
|
221
221
|
render() {
|
|
222
222
|
const roleNames = TemplateStore.template.roles.map(role => role.name);
|
|
223
|
-
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "
|
|
223
|
+
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Roles"), h("div", { class: "participants" }, h("div", { class: "left-line" }), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: startIcon }), h("div", { class: "row-recipients" }, h("div", { class: "sender" }, h("span", { class: "label" }, "Sender:"), " ", senderLabels[TemplateStore.template.sender], ' ', h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingSenderDialog = true), "aria-role": "button" })))), h("div", { class: "row add-sequence", "data-sequence": 0 }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-sequence": 0, "data-order": 1 }, "Add Step"))), this.sequences.map(sequence => (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-order": 0.5, "data-sequence": sequence }), TemplateStore.template.roles
|
|
224
224
|
.filter(role => role.sequence === sequence)
|
|
225
225
|
.map(role => {
|
|
226
226
|
return (h(Fragment, null, h("div", { class: "recipient", style: { backgroundColor: getRGBA(getRoleIndex(roleNames, role.name)) }, "data-rolename": role.name }, h("span", { class: "type-icon", innerHTML: role.type === 'signer' ? iconSigner : role.type === 'cc' ? iconCC : iconApprover }), role.name, " ", h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingRoleDialog = role.name), "aria-role": "button" })), h("div", { class: "dropzone", "data-order": role.order + 0.5, "data-sequence": sequence })));
|
|
@@ -3,7 +3,7 @@ export default {
|
|
|
3
3
|
title: 'Templates/Recipients',
|
|
4
4
|
component: 'verdocs-template-recipients',
|
|
5
5
|
args: {
|
|
6
|
-
templateId: '
|
|
6
|
+
templateId: '951016b0-c5ef-450d-b628-9a0c5b84b163',
|
|
7
7
|
// templateId: '056b837f-b183-4039-b50a-d68acbf81b67',
|
|
8
8
|
},
|
|
9
9
|
argTypes: {
|
|
@@ -13,7 +13,7 @@ const VerdocsSearchBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
13
13
|
this.typeChanged = createEvent(this, "typeChanged", 7);
|
|
14
14
|
this.queryChanged = createEvent(this, "queryChanged", 7);
|
|
15
15
|
this.endpoint = VerdocsEndpoint.getDefault();
|
|
16
|
-
this.placeholder = '
|
|
16
|
+
this.placeholder = 'Search envelopes, templates, organizations...';
|
|
17
17
|
this.type = 'all';
|
|
18
18
|
this.query = '';
|
|
19
19
|
this.grabsFocus = false;
|
|
@@ -34,7 +34,7 @@ var createTemplateDocument = function (endpoint, templateId, file, onUploadProgr
|
|
|
34
34
|
.then(function (r) { return r.data; });
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column
|
|
37
|
+
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{max-width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}";
|
|
38
38
|
|
|
39
39
|
// import {ITemplate, ITemplateDocument} from '@verdocs/js-sdk/Templates/Types';
|
|
40
40
|
// import {createPage} from '@verdocs/js-sdk/Templates/Pages';
|
|
@@ -185,14 +185,44 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
185
185
|
required: true,
|
|
186
186
|
page_sequence: pageNumber,
|
|
187
187
|
validator: null,
|
|
188
|
-
setting: {
|
|
189
|
-
width,
|
|
190
|
-
height,
|
|
191
|
-
x,
|
|
192
|
-
y,
|
|
193
|
-
result: '',
|
|
194
|
-
},
|
|
188
|
+
setting: { x, y }, // In the future, this is all we should send, see below
|
|
195
189
|
};
|
|
190
|
+
// TODO: Fix how the server validates all this. It uses a JSON schema and is very particular about shapes for each field type.
|
|
191
|
+
// That makes it harder for third party developers to create fields via API calls. It would be better to always set X/Y and
|
|
192
|
+
// let the server normalize the rest, discarding properties that are invalid and back-filling defaults as needed.
|
|
193
|
+
switch (field.type) {
|
|
194
|
+
case 'attachment':
|
|
195
|
+
case 'payment':
|
|
196
|
+
field.setting = { x, y };
|
|
197
|
+
break;
|
|
198
|
+
case 'initial':
|
|
199
|
+
case 'signature':
|
|
200
|
+
field.setting = { x, y, result: '' };
|
|
201
|
+
break;
|
|
202
|
+
case 'checkbox_group':
|
|
203
|
+
field.setting = { x, y, minimum_checked: 0, maximum_checked: 1000 };
|
|
204
|
+
break;
|
|
205
|
+
case 'date':
|
|
206
|
+
field.setting = { x, y, width, height, result: '' };
|
|
207
|
+
break;
|
|
208
|
+
// TODO: Remove this everywhere
|
|
209
|
+
// case 'checkbox':break;
|
|
210
|
+
// TODO: What is this?
|
|
211
|
+
// case 'placeholder':break;
|
|
212
|
+
case 'dropdown':
|
|
213
|
+
field.setting = { x, y, width, height, value: '', placeholder: 'Select a value' };
|
|
214
|
+
break;
|
|
215
|
+
case 'radio_button_group':
|
|
216
|
+
field.setting = { x, y };
|
|
217
|
+
break;
|
|
218
|
+
// TODO: What about textareas?
|
|
219
|
+
case 'textbox':
|
|
220
|
+
field.setting = { x, y, width, height, result: '', leading: 0, alignment: 0, upperCase: false };
|
|
221
|
+
break;
|
|
222
|
+
case 'timestamp':
|
|
223
|
+
field.setting = { x, y, width, height };
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
196
226
|
const saved = await createField(this.endpoint, this.templateId, field);
|
|
197
227
|
console.log('Saved field', saved);
|
|
198
228
|
state.fields.push(saved);
|
|
@@ -231,7 +231,7 @@ const VerdocsTemplateRecipients$1 = /*@__PURE__*/ proxyCustomElement(class exten
|
|
|
231
231
|
}
|
|
232
232
|
render() {
|
|
233
233
|
const roleNames = state.template.roles.map(role => role.name);
|
|
234
|
-
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "
|
|
234
|
+
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Roles"), h("div", { class: "participants" }, h("div", { class: "left-line" }), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: startIcon }), h("div", { class: "row-recipients" }, h("div", { class: "sender" }, h("span", { class: "label" }, "Sender:"), " ", senderLabels[state.template.sender], ' ', h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingSenderDialog = true), "aria-role": "button" })))), h("div", { class: "row add-sequence", "data-sequence": 0 }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-sequence": 0, "data-order": 1 }, "Add Step"))), this.sequences.map(sequence => (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-order": 0.5, "data-sequence": sequence }), state.template.roles
|
|
235
235
|
.filter(role => role.sequence === sequence)
|
|
236
236
|
.map(role => {
|
|
237
237
|
return (h(Fragment, null, h("div", { class: "recipient", style: { backgroundColor: getRGBA(getRoleIndex(roleNames, role.name)) }, "data-rolename": role.name }, h("span", { class: "type-icon", innerHTML: role.type === 'signer' ? iconSigner : role.type === 'cc' ? iconCC : iconApprover }), role.name, " ", h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingRoleDialog = role.name), "aria-role": "button" })), h("div", { class: "dropzone", "data-order": role.order + 0.5, "data-sequence": sequence })));
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2023-02-
|
|
2
|
+
"timestamp": "2023-02-13T03:30:09",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "2.20.0",
|
|
@@ -4283,7 +4283,7 @@
|
|
|
4283
4283
|
"reflectToAttr": false,
|
|
4284
4284
|
"docs": "The placeholder to display in the input field.",
|
|
4285
4285
|
"docsTags": [],
|
|
4286
|
-
"default": "'
|
|
4286
|
+
"default": "'Search envelopes, templates, organizations...'",
|
|
4287
4287
|
"values": [
|
|
4288
4288
|
{
|
|
4289
4289
|
"type": "string"
|
|
@@ -177,7 +177,7 @@ const VerdocsSearchBox = class {
|
|
|
177
177
|
this.typeChanged = createEvent(this, "typeChanged", 7);
|
|
178
178
|
this.queryChanged = createEvent(this, "queryChanged", 7);
|
|
179
179
|
this.endpoint = VerdocsEndpoint.getDefault();
|
|
180
|
-
this.placeholder = '
|
|
180
|
+
this.placeholder = 'Search envelopes, templates, organizations...';
|
|
181
181
|
this.type = 'all';
|
|
182
182
|
this.query = '';
|
|
183
183
|
this.grabsFocus = false;
|
|
@@ -42,7 +42,7 @@ var createTemplateDocument = function (endpoint, templateId, file, onUploadProgr
|
|
|
42
42
|
.then(function (r) { return r.data; });
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column
|
|
45
|
+
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{max-width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}";
|
|
46
46
|
|
|
47
47
|
// import {ITemplate, ITemplateDocument} from '@verdocs/js-sdk/Templates/Types';
|
|
48
48
|
// import {createPage} from '@verdocs/js-sdk/Templates/Pages';
|
|
@@ -286,14 +286,44 @@ const VerdocsTemplateFields = class {
|
|
|
286
286
|
required: true,
|
|
287
287
|
page_sequence: pageNumber,
|
|
288
288
|
validator: null,
|
|
289
|
-
setting: {
|
|
290
|
-
width,
|
|
291
|
-
height,
|
|
292
|
-
x,
|
|
293
|
-
y,
|
|
294
|
-
result: '',
|
|
295
|
-
},
|
|
289
|
+
setting: { x, y }, // In the future, this is all we should send, see below
|
|
296
290
|
};
|
|
291
|
+
// TODO: Fix how the server validates all this. It uses a JSON schema and is very particular about shapes for each field type.
|
|
292
|
+
// That makes it harder for third party developers to create fields via API calls. It would be better to always set X/Y and
|
|
293
|
+
// let the server normalize the rest, discarding properties that are invalid and back-filling defaults as needed.
|
|
294
|
+
switch (field.type) {
|
|
295
|
+
case 'attachment':
|
|
296
|
+
case 'payment':
|
|
297
|
+
field.setting = { x, y };
|
|
298
|
+
break;
|
|
299
|
+
case 'initial':
|
|
300
|
+
case 'signature':
|
|
301
|
+
field.setting = { x, y, result: '' };
|
|
302
|
+
break;
|
|
303
|
+
case 'checkbox_group':
|
|
304
|
+
field.setting = { x, y, minimum_checked: 0, maximum_checked: 1000 };
|
|
305
|
+
break;
|
|
306
|
+
case 'date':
|
|
307
|
+
field.setting = { x, y, width, height, result: '' };
|
|
308
|
+
break;
|
|
309
|
+
// TODO: Remove this everywhere
|
|
310
|
+
// case 'checkbox':break;
|
|
311
|
+
// TODO: What is this?
|
|
312
|
+
// case 'placeholder':break;
|
|
313
|
+
case 'dropdown':
|
|
314
|
+
field.setting = { x, y, width, height, value: '', placeholder: 'Select a value' };
|
|
315
|
+
break;
|
|
316
|
+
case 'radio_button_group':
|
|
317
|
+
field.setting = { x, y };
|
|
318
|
+
break;
|
|
319
|
+
// TODO: What about textareas?
|
|
320
|
+
case 'textbox':
|
|
321
|
+
field.setting = { x, y, width, height, result: '', leading: 0, alignment: 0, upperCase: false };
|
|
322
|
+
break;
|
|
323
|
+
case 'timestamp':
|
|
324
|
+
field.setting = { x, y, width, height };
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
297
327
|
const saved = await createField(this.endpoint, this.templateId, field);
|
|
298
328
|
console.log('Saved field', saved);
|
|
299
329
|
state.fields.push(saved);
|
|
@@ -229,7 +229,7 @@ const VerdocsTemplateRecipients = class {
|
|
|
229
229
|
}
|
|
230
230
|
render() {
|
|
231
231
|
const roleNames = state.template.roles.map(role => role.name);
|
|
232
|
-
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "
|
|
232
|
+
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Roles"), h("div", { class: "participants" }, h("div", { class: "left-line" }), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: startIcon }), h("div", { class: "row-recipients" }, h("div", { class: "sender" }, h("span", { class: "label" }, "Sender:"), " ", senderLabels[state.template.sender], ' ', h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingSenderDialog = true), "aria-role": "button" })))), h("div", { class: "row add-sequence", "data-sequence": 0 }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-sequence": 0, "data-order": 1 }, "Add Step"))), this.sequences.map(sequence => (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-order": 0.5, "data-sequence": sequence }), state.template.roles
|
|
233
233
|
.filter(role => role.sequence === sequence)
|
|
234
234
|
.map(role => {
|
|
235
235
|
return (h(Fragment, null, h("div", { class: "recipient", style: { backgroundColor: getRGBA(getRoleIndex(roleNames, role.name)) }, "data-rolename": role.name }, h("span", { class: "type-icon", innerHTML: role.type === 'signer' ? iconSigner : role.type === 'cc' ? iconCC : iconApprover }), role.name, " ", h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingRoleDialog = role.name), "aria-role": "button" })), h("div", { class: "dropzone", "data-order": role.order + 0.5, "data-sequence": sequence })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-f78d163d.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-7f17b088.js";import{a as getTemplates}from"./Templates-8e4ab976.js";import"./Token-54690789.js";var __awaiter=undefined&&undefined.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(n=0)),n)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;i=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1];o=c;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(c);break}if(o[2])n.ops.pop();n.trys.pop();continue}c=t.call(e,n)}catch(e){c=[6,e];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var getSearchHistory=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e.api.get("/search/history").then((function(e){return e.data}))]}))}))};var verdocsQuickFunctionsCss='verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}';var DocumentIcon$1='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var TemplateIcon='<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>';var VerdocsQuickFunctions=function(){function e(e){registerInstance(this,e);this.createTemplate=createEvent(this,"createTemplate",7);this.createDocument=createEvent(this,"createDocument",7);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.handleCreateTemplate=function(){this.createTemplate.emit()};e.prototype.handleCreateDocument=function(){this.createDocument.emit()};e.prototype.render=function(){var e=this;return h("div",{class:"container"},h("p",{class:"title"},"Quick Create"),h("button",{onClick:function(){return e.handleCreateTemplate()},innerHTML:TemplateIcon},"Template"),h("button",{onClick:function(){return e.handleCreateDocument()},innerHTML:DocumentIcon$1},"Document"))};return e}();VerdocsQuickFunctions.style=verdocsQuickFunctionsCss;var verdocsSearchActivityCss='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:#1e2031}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#cccccc}';var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var VerdocsSearchActivity=function(){function e(e){registerInstance(this,e);this.entrySelected=createEvent(this,"entrySelected",7);this.endpoint=VerdocsEndpoint.getDefault();this.type="recent";this.options=undefined;this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;this.endpoint.loadSession();var t=function(t){var n;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((n=t===null||t===void 0?void 0:t.response)===null||n===void 0?void 0:n.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";getSearchHistory(this.endpoint).then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";getSearchHistory(this.endpoint).then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";getTemplates(this.endpoint,{is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return h("div",{class:"container"},h("p",{class:"title"},this.title),h("div",{class:"items"},this.recent.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"},"Test")))})),this.saved.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"})))})),t&&h("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}();VerdocsSearchActivity.style=verdocsSearchActivityCss;var verdocsSearchBoxCss='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:#707ae5}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#55bc81;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var SearchIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/></svg>';var CloseIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/></svg>';var VerdocsSearchBox=function(){function e(e){registerInstance(this,e);this.searchClicked=createEvent(this,"searchClicked",7);this.typeChanged=createEvent(this,"typeChanged",7);this.queryChanged=createEvent(this,"queryChanged",7);this.endpoint=VerdocsEndpoint.getDefault();this.placeholder="search documents, templates, people...";this.type="all";this.query="";this.grabsFocus=false}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.inputEl.focus();return[2]}))}))};e.prototype.componentDidRender=function(){if(this.grabsFocus){this.inputEl.focus()}};e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return h("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&h("span",{class:"type"},this.type,"s ",h("button",{class:"remove",innerHTML:CloseIcon,onClick:function(){return e.handleClearFilter()}})),h("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)},ref:function(t){return e.inputEl=t}}),h("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},h("span",{innerHTML:SearchIcon}),"Search"))};return e}();VerdocsSearchBox.style=verdocsSearchBoxCss;export{VerdocsQuickFunctions as verdocs_quick_functions,VerdocsSearchActivity as verdocs_search_activity,VerdocsSearchBox as verdocs_search_box};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-f78d163d.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-7f17b088.js";import{a as getTemplates}from"./Templates-8e4ab976.js";import"./Token-54690789.js";var __awaiter=undefined&&undefined.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(n=0)),n)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;i=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1];o=c;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(c);break}if(o[2])n.ops.pop();n.trys.pop();continue}c=t.call(e,n)}catch(e){c=[6,e];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var getSearchHistory=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e.api.get("/search/history").then((function(e){return e.data}))]}))}))};var verdocsQuickFunctionsCss='verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}';var DocumentIcon$1='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var TemplateIcon='<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>';var VerdocsQuickFunctions=function(){function e(e){registerInstance(this,e);this.createTemplate=createEvent(this,"createTemplate",7);this.createDocument=createEvent(this,"createDocument",7);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.handleCreateTemplate=function(){this.createTemplate.emit()};e.prototype.handleCreateDocument=function(){this.createDocument.emit()};e.prototype.render=function(){var e=this;return h("div",{class:"container"},h("p",{class:"title"},"Quick Create"),h("button",{onClick:function(){return e.handleCreateTemplate()},innerHTML:TemplateIcon},"Template"),h("button",{onClick:function(){return e.handleCreateDocument()},innerHTML:DocumentIcon$1},"Document"))};return e}();VerdocsQuickFunctions.style=verdocsQuickFunctionsCss;var verdocsSearchActivityCss='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:#1e2031}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#cccccc}';var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var VerdocsSearchActivity=function(){function e(e){registerInstance(this,e);this.entrySelected=createEvent(this,"entrySelected",7);this.endpoint=VerdocsEndpoint.getDefault();this.type="recent";this.options=undefined;this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;this.endpoint.loadSession();var t=function(t){var n;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((n=t===null||t===void 0?void 0:t.response)===null||n===void 0?void 0:n.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";getSearchHistory(this.endpoint).then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";getSearchHistory(this.endpoint).then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";getTemplates(this.endpoint,{is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return h("div",{class:"container"},h("p",{class:"title"},this.title),h("div",{class:"items"},this.recent.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"},"Test")))})),this.saved.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"})))})),t&&h("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}();VerdocsSearchActivity.style=verdocsSearchActivityCss;var verdocsSearchBoxCss='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:#707ae5}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#55bc81;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var SearchIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/></svg>';var CloseIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/></svg>';var VerdocsSearchBox=function(){function e(e){registerInstance(this,e);this.searchClicked=createEvent(this,"searchClicked",7);this.typeChanged=createEvent(this,"typeChanged",7);this.queryChanged=createEvent(this,"queryChanged",7);this.endpoint=VerdocsEndpoint.getDefault();this.placeholder="Search envelopes, templates, organizations...";this.type="all";this.query="";this.grabsFocus=false}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.inputEl.focus();return[2]}))}))};e.prototype.componentDidRender=function(){if(this.grabsFocus){this.inputEl.focus()}};e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return h("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&h("span",{class:"type"},this.type,"s ",h("button",{class:"remove",innerHTML:CloseIcon,onClick:function(){return e.handleClearFilter()}})),h("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)},ref:function(t){return e.inputEl=t}}),h("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},h("span",{innerHTML:SearchIcon}),"Search"))};return e}();VerdocsSearchBox.style=verdocsSearchBoxCss;export{VerdocsQuickFunctions as verdocs_quick_functions,VerdocsSearchActivity as verdocs_search_activity,VerdocsSearchBox as verdocs_search_box};
|