@verdocs/web-sdk 1.10.6 → 1.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  2. package/dist/cjs/verdocs-template-create_2.cjs.entry.js +37 -7
  3. package/dist/cjs/verdocs-template-recipients.cjs.entry.js +5 -3
  4. package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +2 -2
  5. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +37 -7
  6. package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.css +11 -0
  7. package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.js +18 -2
  8. package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.stories.js +5 -4
  9. package/dist/components/verdocs-search-box2.js +1 -1
  10. package/dist/components/verdocs-template-fields2.js +37 -7
  11. package/dist/components/verdocs-template-recipients.js +5 -3
  12. package/dist/custom-elements.json +1361 -0
  13. package/dist/docs.json +11 -2
  14. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  15. package/dist/esm/verdocs-template-create_2.entry.js +37 -7
  16. package/dist/esm/verdocs-template-recipients.entry.js +5 -3
  17. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  18. package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
  19. package/dist/esm-es5/verdocs-template-recipients.entry.js +1 -1
  20. package/dist/types/components/templates/verdocs-template-recipients/verdocs-template-recipients.d.ts +4 -0
  21. package/dist/types/components/templates/verdocs-template-recipients/verdocs-template-recipients.stories.d.ts +3 -2
  22. package/dist/types/components.d.ts +4 -0
  23. package/dist/verdocs-web-sdk/p-53198827.entry.js +1 -0
  24. package/dist/verdocs-web-sdk/p-59c4e444.entry.js +1 -0
  25. package/dist/verdocs-web-sdk/p-7bc5fc1e.system.entry.js +1 -0
  26. package/dist/verdocs-web-sdk/{p-3fbe602a.system.entry.js → p-83adc0f7.system.entry.js} +1 -1
  27. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
  28. package/dist/verdocs-web-sdk/{p-205027db.entry.js → p-cf8522b5.entry.js} +1 -1
  29. package/dist/verdocs-web-sdk/{p-cf9883c7.system.entry.js → p-e82bebc9.system.entry.js} +1 -1
  30. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  31. package/package.json +2 -2
  32. package/dist/verdocs-web-sdk/p-8c3d48c1.entry.js +0 -1
  33. package/dist/verdocs-web-sdk/p-e179e3de.system.entry.js +0 -1
  34. package/dist/verdocs-web-sdk/p-f69cdc41.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 = 'search documents, templates, people...';
184
+ this.placeholder = 'Search envelopes, templates, organizations...';
185
185
  this.type = 'all';
186
186
  this.query = '';
187
187
  this.grabsFocus = false;
@@ -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);
@@ -18,7 +18,7 @@ require('./Templates-ed812768.js');
18
18
  require('./Envelopes-68058bbe.js');
19
19
  require('./Files-4bdc0c0f.js');
20
20
 
21
- const verdocsTemplateRecipientsCss = "verdocs-template-recipients{display:block;min-width:400px;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}";
21
+ const verdocsTemplateRecipientsCss = "verdocs-template-recipients{display:block;min-width:400px;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-recipients .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}";
22
22
 
23
23
  const senderLabels = {
24
24
  [VerdocsEndpoint.TemplateSenderTypes.EVERYONE]: 'Everyone',
@@ -38,6 +38,7 @@ const iconCC = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill
38
38
  const VerdocsTemplateRecipients = class {
39
39
  constructor(hostRef) {
40
40
  index.registerInstance(this, hostRef);
41
+ this.next = index.createEvent(this, "next", 7);
41
42
  this.cancel = index.createEvent(this, "cancel", 7);
42
43
  this.sdkError = index.createEvent(this, "sdkError", 7);
43
44
  this.sequences = [];
@@ -159,7 +160,9 @@ const VerdocsTemplateRecipients = class {
159
160
  (_a = this.cancel) === null || _a === void 0 ? void 0 : _a.emit();
160
161
  }
161
162
  handleSubmit(e) {
163
+ var _a;
162
164
  e.stopPropagation();
165
+ (_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
163
166
  }
164
167
  sortTemplateRoles() {
165
168
  templateStore.state.template.roles.sort((a, b) => {
@@ -229,13 +232,12 @@ const VerdocsTemplateRecipients = class {
229
232
  });
230
233
  }
231
234
  render() {
232
- // console.log('Roles', JSON.parse(JSON.stringify(TemplateStore.template.roles)));
233
235
  const roleNames = templateStore.state.template.roles.map(role => role.name);
234
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, "Recipients"), 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
235
237
  .filter(role => role.sequence === sequence)
236
238
  .map(role => {
237
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 })));
238
- }), index.h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), index.h("div", { class: "row add-sequence", "data-sequence": sequence }, index.h("div", { class: "row-recipients" }, index.h("div", { class: "icon", innerHTML: plusIcon }), index.h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), index.h("div", { class: "row" }, index.h("div", { class: "icon", innerHTML: doneIcon }), index.h("div", { class: "row-recipients" }, index.h("div", { class: "complete" }, "Document Complete")))), index.h("div", { class: "buttons" }, index.h("div", { class: "flex-fill" }), index.h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), index.h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e) }))), this.showingRoleDialog && (index.h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
240
+ }), index.h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), index.h("div", { class: "row add-sequence", "data-sequence": sequence }, index.h("div", { class: "row-recipients" }, index.h("div", { class: "icon", innerHTML: plusIcon }), index.h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), this.sequences.length < 1 && (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("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, 1) }))))), index.h("div", { class: "row" }, index.h("div", { class: "icon", innerHTML: doneIcon }), index.h("div", { class: "row-recipients" }, index.h("div", { class: "complete" }, "Document Complete")))), roleNames.length < 1 && (index.h("div", { class: "empty" }, "You must add at least one Role before proceeding.", index.h("br", null), " Click the ", index.h("span", { innerHTML: plusIcon }), " Add button above to get started.")), index.h("div", { class: "buttons" }, index.h("div", { class: "flex-fill" }), index.h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), index.h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e), disabled: roleNames.length < 1 }))), this.showingRoleDialog && (index.h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
239
241
  this.showingRoleDialog = null;
240
242
  this.forceRerender++;
241
243
  }, onDelete: e => {
@@ -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 = 'search documents, templates, people...';
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": "'search documents, templates, people...'"
96
+ "defaultValue": "'Search envelopes, templates, organizations...'"
97
97
  },
98
98
  "type": {
99
99
  "type": "string",
@@ -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);
@@ -187,6 +187,17 @@ verdocs-template-recipients .buttons {
187
187
  margin-top: 16px;
188
188
  flex-direction: row;
189
189
  }
190
+ verdocs-template-recipients .empty {
191
+ font-size: 13px;
192
+ margin-top: 15px;
193
+ margin-bottom: 5px;
194
+ }
195
+ verdocs-template-recipients .empty svg {
196
+ width: 20px;
197
+ height: 20px;
198
+ stroke: #666666;
199
+ margin-bottom: -5px;
200
+ }
190
201
  verdocs-template-recipients ::placeholder {
191
202
  color: #aaaaaa;
192
203
  }
@@ -147,7 +147,9 @@ export class VerdocsTemplateRecipients {
147
147
  (_a = this.cancel) === null || _a === void 0 ? void 0 : _a.emit();
148
148
  }
149
149
  handleSubmit(e) {
150
+ var _a;
150
151
  e.stopPropagation();
152
+ (_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
151
153
  }
152
154
  sortTemplateRoles() {
153
155
  TemplateStore.template.roles.sort((a, b) => {
@@ -217,13 +219,12 @@ export class VerdocsTemplateRecipients {
217
219
  });
218
220
  }
219
221
  render() {
220
- // console.log('Roles', JSON.parse(JSON.stringify(TemplateStore.template.roles)));
221
222
  const roleNames = TemplateStore.template.roles.map(role => role.name);
222
223
  return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Recipients"), 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
223
224
  .filter(role => role.sequence === sequence)
224
225
  .map(role => {
225
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 })));
226
- }), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-recipients" }, h("div", { class: "complete" }, "Document Complete")))), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e) }))), this.showingRoleDialog && (h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
227
+ }), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), this.sequences.length < 1 && (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, 1) }))))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-recipients" }, h("div", { class: "complete" }, "Document Complete")))), roleNames.length < 1 && (h("div", { class: "empty" }, "You must add at least one Role before proceeding.", h("br", null), " Click the ", h("span", { innerHTML: plusIcon }), " Add button above to get started.")), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e), disabled: roleNames.length < 1 }))), this.showingRoleDialog && (h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
227
228
  this.showingRoleDialog = null;
228
229
  this.forceRerender++;
229
230
  }, onDelete: e => {
@@ -297,6 +298,21 @@ export class VerdocsTemplateRecipients {
297
298
  }
298
299
  static get events() {
299
300
  return [{
301
+ "method": "next",
302
+ "name": "next",
303
+ "bubbles": true,
304
+ "cancelable": true,
305
+ "composed": true,
306
+ "docs": {
307
+ "tags": [],
308
+ "text": "Event fired when the user clicks to proceed."
309
+ },
310
+ "complexType": {
311
+ "original": "any",
312
+ "resolved": "any",
313
+ "references": {}
314
+ }
315
+ }, {
300
316
  "method": "cancel",
301
317
  "name": "cancel",
302
318
  "bubbles": true,
@@ -3,11 +3,12 @@ export default {
3
3
  title: 'Templates/Recipients',
4
4
  component: 'verdocs-template-recipients',
5
5
  args: {
6
- templateId: '056b837f-b183-4039-b50a-d68acbf81b67',
7
- // templateId: 'd2338742-f3a1-465b-8592-806587413cc1',
6
+ templateId: '951016b0-c5ef-450d-b628-9a0c5b84b163',
7
+ // templateId: '056b837f-b183-4039-b50a-d68acbf81b67',
8
8
  },
9
9
  argTypes: {
10
- close: { action: 'cancel' },
10
+ onSave: { action: 'save' },
11
+ onCancel: { action: 'cancel' },
11
12
  },
12
13
  };
13
- export const Recipients = ({ templateId, cancel }) => html `<verdocs-template-recipients .templateId=${templateId} @cancel=${cancel} />`;
14
+ export const Recipients = ({ templateId, onCancel, onSave }) => html `<verdocs-template-recipients .templateId=${templateId} @cancel=${onCancel} @save=${onSave} />`;
@@ -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 = 'search documents, templates, people...';
16
+ this.placeholder = 'Search envelopes, templates, organizations...';
17
17
  this.type = 'all';
18
18
  this.query = '';
19
19
  this.grabsFocus = false;
@@ -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);
@@ -15,7 +15,7 @@ import { d as defineCustomElement$5 } from './verdocs-select-input2.js';
15
15
  import { d as defineCustomElement$3 } from './verdocs-template-sender2.js';
16
16
  import { d as defineCustomElement$2 } from './verdocs-text-input2.js';
17
17
 
18
- const verdocsTemplateRecipientsCss = "verdocs-template-recipients{display:block;min-width:400px;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}";
18
+ const verdocsTemplateRecipientsCss = "verdocs-template-recipients{display:block;min-width:400px;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-recipients .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}";
19
19
 
20
20
  const senderLabels = {
21
21
  [TemplateSenderTypes.EVERYONE]: 'Everyone',
@@ -36,6 +36,7 @@ const VerdocsTemplateRecipients$1 = /*@__PURE__*/ proxyCustomElement(class exten
36
36
  constructor() {
37
37
  super();
38
38
  this.__registerHost();
39
+ this.next = createEvent(this, "next", 7);
39
40
  this.cancel = createEvent(this, "cancel", 7);
40
41
  this.sdkError = createEvent(this, "sdkError", 7);
41
42
  this.sequences = [];
@@ -157,7 +158,9 @@ const VerdocsTemplateRecipients$1 = /*@__PURE__*/ proxyCustomElement(class exten
157
158
  (_a = this.cancel) === null || _a === void 0 ? void 0 : _a.emit();
158
159
  }
159
160
  handleSubmit(e) {
161
+ var _a;
160
162
  e.stopPropagation();
163
+ (_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
161
164
  }
162
165
  sortTemplateRoles() {
163
166
  state.template.roles.sort((a, b) => {
@@ -227,13 +230,12 @@ const VerdocsTemplateRecipients$1 = /*@__PURE__*/ proxyCustomElement(class exten
227
230
  });
228
231
  }
229
232
  render() {
230
- // console.log('Roles', JSON.parse(JSON.stringify(TemplateStore.template.roles)));
231
233
  const roleNames = state.template.roles.map(role => role.name);
232
234
  return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Recipients"), 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
235
  .filter(role => role.sequence === sequence)
234
236
  .map(role => {
235
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 })));
236
- }), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-recipients" }, h("div", { class: "complete" }, "Document Complete")))), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e) }))), this.showingRoleDialog && (h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
238
+ }), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), this.sequences.length < 1 && (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, 1) }))))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-recipients" }, h("div", { class: "complete" }, "Document Complete")))), roleNames.length < 1 && (h("div", { class: "empty" }, "You must add at least one Role before proceeding.", h("br", null), " Click the ", h("span", { innerHTML: plusIcon }), " Add button above to get started.")), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e), disabled: roleNames.length < 1 }))), this.showingRoleDialog && (h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
237
239
  this.showingRoleDialog = null;
238
240
  this.forceRerender++;
239
241
  }, onDelete: e => {