@verdocs/web-sdk 1.12.33 → 1.12.35
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/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +13 -3
- package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +6 -1
- package/dist/cjs/verdocs-progress-bar.cjs.entry.js +23 -0
- package/dist/cjs/verdocs-send.cjs.entry.js +5 -3
- package/dist/cjs/verdocs-template-create_3.cjs.entry.js +755 -0
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/controls/verdocs-progress-bar/verdocs-progress-bar.css +31 -0
- package/dist/collection/components/controls/verdocs-progress-bar/verdocs-progress-bar.js +84 -0
- package/dist/collection/components/controls/verdocs-progress-bar/verdocs-progress-bar.stories.js +12 -0
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +27 -3
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.css +1 -0
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +4 -2
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.css +3 -1
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +20 -24
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +7 -1
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.stories.js +2 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.css +2 -0
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +1 -2
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/verdocs-build.js +79 -15
- package/dist/components/verdocs-progress-bar.d.ts +11 -0
- package/dist/components/verdocs-progress-bar.js +6 -0
- package/dist/components/verdocs-progress-bar2.js +38 -0
- package/dist/components/verdocs-send.js +5 -3
- package/dist/components/verdocs-template-create2.js +33 -31
- package/dist/components/verdocs-template-field-properties2.js +7 -1
- package/dist/components/verdocs-template-fields2.js +1 -1
- package/dist/components/verdocs-template-roles.js +1 -374
- package/dist/{esm/verdocs-template-roles.entry.js → components/verdocs-template-roles2.js} +100 -22
- package/dist/docs.json +119 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-build.entry.js +13 -3
- package/dist/esm/verdocs-button-panel_3.entry.js +6 -1
- package/dist/esm/verdocs-progress-bar.entry.js +19 -0
- package/dist/esm/verdocs-send.entry.js +5 -3
- package/dist/esm/verdocs-template-create_3.entry.js +749 -0
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-progress-bar.entry.js +1 -0
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_3.entry.js +1 -0
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/controls/verdocs-progress-bar/verdocs-progress-bar.d.ts +18 -0
- package/dist/types/components/controls/verdocs-progress-bar/verdocs-progress-bar.stories.d.ts +8 -0
- package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +6 -0
- package/dist/types/components/templates/verdocs-template-create/verdocs-template-create.d.ts +2 -0
- package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +1 -0
- package/dist/types/components.d.ts +41 -0
- package/dist/verdocs-web-sdk/p-2413519c.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-423b6ddf.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-5cf14e4c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6caf1137.system.js +1 -1
- package/dist/verdocs-web-sdk/p-6e1e787a.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a2cd33fd.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-bcc9c2d8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c4229602.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e4b18c52.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-0ba7360f.system.entry.js → p-fdbafc1f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-fe2ab7b9.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/verdocs-template-create_2.cjs.entry.js +0 -473
- package/dist/cjs/verdocs-template-roles.cjs.entry.js +0 -304
- package/dist/esm/verdocs-template-create_2.entry.js +0 -468
- package/dist/esm-es5/verdocs-template-create_2.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-roles.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0c5c9ebf.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-13b8ec6f.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-1da14840.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4ddd2113.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6f828ccb.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a2438331.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-baf138a0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cd0bdac3.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e890fc53.entry.js +0 -1
@@ -1,377 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { i as interact } from './interact.min.js';
|
3
|
-
import './Types.js';
|
4
|
-
import { u as updateRole, c as createRole, d as defineCustomElement$4 } from './verdocs-template-role-properties2.js';
|
5
|
-
import { V as VerdocsEndpoint, T as TemplateSenderTypes } from './VerdocsEndpoint.js';
|
6
|
-
import { g as getRGBA } from './Colors.js';
|
7
|
-
import { s as state } from './templateStore.js';
|
8
|
-
import { l as loadTemplate } from './Templates.js';
|
9
|
-
import { a as getRoleIndex } from './utils.js';
|
10
|
-
import { S as SDKError } from './errors.js';
|
11
|
-
import { d as defineCustomElement$b } from './verdocs-button2.js';
|
12
|
-
import { d as defineCustomElement$a } from './verdocs-checkbox2.js';
|
13
|
-
import { d as defineCustomElement$9 } from './verdocs-component-error2.js';
|
14
|
-
import { d as defineCustomElement$8 } from './verdocs-help-icon2.js';
|
15
|
-
import { d as defineCustomElement$7 } from './verdocs-loader2.js';
|
16
|
-
import { d as defineCustomElement$6 } from './verdocs-radio-button2.js';
|
17
|
-
import { d as defineCustomElement$5 } from './verdocs-select-input2.js';
|
18
|
-
import { d as defineCustomElement$3 } from './verdocs-template-sender2.js';
|
19
|
-
import { d as defineCustomElement$2 } from './verdocs-text-input2.js';
|
20
|
-
|
21
|
-
const verdocsTemplateRolesCss = "verdocs-template-roles{display:block;min-width:400px;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>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-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-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-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>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-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.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-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .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-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}";
|
22
|
-
|
23
|
-
const senderLabels = {
|
24
|
-
[TemplateSenderTypes.EVERYONE]: 'Everyone',
|
25
|
-
[TemplateSenderTypes.EVERYONE_AS_CREATOR]: 'Everyone as Me',
|
26
|
-
[TemplateSenderTypes.ORGANIZATION_MEMBER]: 'Organization member',
|
27
|
-
[TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR]: 'Organization Member as Me',
|
28
|
-
[TemplateSenderTypes.CREATOR]: 'Me',
|
29
|
-
};
|
30
|
-
const settingsIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';
|
31
|
-
const startIcon = '<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';
|
32
|
-
const stepIcon = '<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';
|
33
|
-
const doneIcon = '<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';
|
34
|
-
const plusIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>`;
|
35
|
-
const iconSigner = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';
|
36
|
-
const iconApprover = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>`;
|
37
|
-
const iconCC = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>`;
|
38
|
-
const VerdocsTemplateRoles$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
39
|
-
constructor() {
|
40
|
-
super();
|
41
|
-
this.__registerHost();
|
42
|
-
this.next = createEvent(this, "next", 7);
|
43
|
-
this.exit = createEvent(this, "exit", 7);
|
44
|
-
this.sdkError = createEvent(this, "sdkError", 7);
|
45
|
-
this.templateUpdated = createEvent(this, "templateUpdated", 7);
|
46
|
-
this.sequences = [];
|
47
|
-
this.endpoint = VerdocsEndpoint.getDefault();
|
48
|
-
this.templateId = '';
|
49
|
-
this.showingRoleDialog = null;
|
50
|
-
this.showingSenderDialog = false;
|
51
|
-
this.sender = null;
|
52
|
-
this.forceRerender = 1;
|
53
|
-
}
|
54
|
-
async componentWillLoad() {
|
55
|
-
var _a, _b, _c, _d, _e, _f;
|
56
|
-
try {
|
57
|
-
this.endpoint.loadSession();
|
58
|
-
if (!this.templateId) {
|
59
|
-
console.log(`[ROLES] Missing required template ID ${this.templateId}`);
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
if (!this.endpoint.session) {
|
63
|
-
console.log('[ROLES] Unable to start builder session, must be authenticated');
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
try {
|
67
|
-
console.log(`[ROLES] Loading template ${this.templateId}`, this.endpoint.session);
|
68
|
-
await loadTemplate(this.endpoint, this.templateId, true);
|
69
|
-
}
|
70
|
-
catch (e) {
|
71
|
-
console.log('[ROLES] Error loading template', e);
|
72
|
-
(_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
|
73
|
-
}
|
74
|
-
this.sortTemplateRoles();
|
75
|
-
this.renumberTemplateRoles();
|
76
|
-
}
|
77
|
-
catch (e) {
|
78
|
-
console.log('[FIELDS] Error with preview session', e);
|
79
|
-
(_d = this.sdkError) === null || _d === void 0 ? void 0 : _d.emit(new SDKError(e.message, (_e = e.response) === null || _e === void 0 ? void 0 : _e.status, (_f = e.response) === null || _f === void 0 ? void 0 : _f.data));
|
80
|
-
}
|
81
|
-
}
|
82
|
-
componentDidRender() {
|
83
|
-
interact.dynamicDrop(true);
|
84
|
-
interact('.recipient').draggable({
|
85
|
-
listeners: {
|
86
|
-
start: function handleStart(e) {
|
87
|
-
e.target.classList.add('dragging');
|
88
|
-
this.el.classList.add('dragging');
|
89
|
-
}.bind(this),
|
90
|
-
move: function handleMove(e) {
|
91
|
-
const oldX = +(e.target.getAttribute('posX') || 0);
|
92
|
-
const oldY = +(e.target.getAttribute('posY') || 0);
|
93
|
-
const newX = e.dx + oldX;
|
94
|
-
const newY = e.dy + oldY;
|
95
|
-
e.target.setAttribute('posX', newX);
|
96
|
-
e.target.setAttribute('posy', newY);
|
97
|
-
e.target.style.transform = `translate(${newX + 100}px, ${newY - 40}px)`;
|
98
|
-
}.bind(this),
|
99
|
-
end: function handleEnd(e) {
|
100
|
-
e.target.classList.remove('dragging');
|
101
|
-
this.el.classList.remove('dragging');
|
102
|
-
// console.log('end', event);
|
103
|
-
e.target.setAttribute('posX', 0);
|
104
|
-
e.target.setAttribute('posy', 0);
|
105
|
-
e.target.style.transform = `translate(0px, 0px)`;
|
106
|
-
}.bind(this),
|
107
|
-
},
|
108
|
-
});
|
109
|
-
interact('.dropzone').dropzone({
|
110
|
-
overlap: 0.05,
|
111
|
-
ondrop: function handleDrop(event) {
|
112
|
-
var _a, _b;
|
113
|
-
event.target.classList.remove('active');
|
114
|
-
// target will be the recipient e.g. <div class="recipient" data-rolename="Buyer" />
|
115
|
-
// relatedTarget will be the drop zone, e.g. <div class="dropzone" data-order="2" data-sequence="1" />
|
116
|
-
// console.log(event.relatedTarget, ' was dropped into ', event.target);
|
117
|
-
// We don't use the role's own order, we rely on the fact that we sorted earlier on the order field. Many legacy
|
118
|
-
// records don't have order fields yet - they're all 1. That doesn't hurt the sort but it would hurt us here if it
|
119
|
-
// went 1..1..1 instead of 1..2..3. By using half values here it's easier to handle the drop event later. We don't
|
120
|
-
// need to do a fancy find/arraymove dance. We just set the dropped element to the half value, sort the result,
|
121
|
-
// then do a final renumber. It's not expensive to do because most flows are typically a small handful (e.g. 1-4)
|
122
|
-
// recipients. They never have hundreds.
|
123
|
-
const roleName = event.relatedTarget.dataset.rolename;
|
124
|
-
const targetSequence = +event.target.dataset.sequence;
|
125
|
-
const targetOrder = +event.target.dataset.order;
|
126
|
-
const changingRole = (_a = state.template) === null || _a === void 0 ? void 0 : _a.roles.find(role => role.name === roleName);
|
127
|
-
if (changingRole) {
|
128
|
-
// To handle the renumbering, we update the role being moved to the new values, which will be some half-interval e.g.
|
129
|
-
// sequence 1.5 order 1. Then we
|
130
|
-
changingRole.sequence = targetSequence;
|
131
|
-
changingRole.order = targetOrder;
|
132
|
-
this.sortTemplateRoles();
|
133
|
-
this.renumberTemplateRoles();
|
134
|
-
this.forceRerender++;
|
135
|
-
// We have to update ALL the roles to be sure each gets new proper sequence/order numbers assigned.
|
136
|
-
// TODO: We could optimize this by tracking "dirty" states and only update the roles that have changed. But it's a LOT more
|
137
|
-
// code to do right, and since most workflows will typically only have 2-4 recipients max, it may not be worth it.
|
138
|
-
Promise.all((_b = state.template) === null || _b === void 0 ? void 0 : _b.roles.map(role => updateRole(this.endpoint, this.templateId, role.name, {
|
139
|
-
sequence: role.sequence,
|
140
|
-
order: role.order,
|
141
|
-
})))
|
142
|
-
.then(() => {
|
143
|
-
var _a;
|
144
|
-
console.log('[ROLES] Updated roles');
|
145
|
-
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'updated-role', endpoint: this.endpoint, template: state.template });
|
146
|
-
})
|
147
|
-
.catch(e => console.log('[ROLES] Role updates failed', e));
|
148
|
-
}
|
149
|
-
}.bind(this),
|
150
|
-
ondropactivate: e => {
|
151
|
-
e.target.classList.add('visible');
|
152
|
-
},
|
153
|
-
ondropdeactivate: e => {
|
154
|
-
e.target.classList.remove('visible');
|
155
|
-
},
|
156
|
-
ondragenter: e => {
|
157
|
-
e.target.classList.add('active');
|
158
|
-
},
|
159
|
-
ondragleave: e => {
|
160
|
-
e.target.classList.remove('active');
|
161
|
-
},
|
162
|
-
});
|
163
|
-
}
|
164
|
-
handleCancel(e) {
|
165
|
-
var _a;
|
166
|
-
e.stopPropagation();
|
167
|
-
(_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
|
168
|
-
}
|
169
|
-
handleSubmit(e) {
|
170
|
-
var _a;
|
171
|
-
e.stopPropagation();
|
172
|
-
(_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
|
173
|
-
}
|
174
|
-
sortTemplateRoles() {
|
175
|
-
var _a;
|
176
|
-
(_a = state.template) === null || _a === void 0 ? void 0 : _a.roles.sort((a, b) => {
|
177
|
-
return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;
|
178
|
-
});
|
179
|
-
}
|
180
|
-
extractSequenceNumbers() {
|
181
|
-
var _a;
|
182
|
-
this.sequences = [];
|
183
|
-
(_a = state.template) === null || _a === void 0 ? void 0 : _a.roles.forEach(role => {
|
184
|
-
if (!this.sequences.includes(role.sequence)) {
|
185
|
-
this.sequences.push(role.sequence);
|
186
|
-
}
|
187
|
-
});
|
188
|
-
}
|
189
|
-
renumberTemplateRoles() {
|
190
|
-
// Extract the sequence numbers because they may now be something like [2.5, 1, 2]
|
191
|
-
this.extractSequenceNumbers();
|
192
|
-
// We need to renumber each role only ONE TIME
|
193
|
-
const renumbered = [];
|
194
|
-
// If the user dragged an entry from below a row to above it, we end up here like [1,0]. Make sure it's [0,1] for the next operation.
|
195
|
-
this.sequences.sort((a, b) => a - b);
|
196
|
-
this.sequences.forEach((originalSequence, newSequenceIndex) => {
|
197
|
-
var _a;
|
198
|
-
(_a = state.template) === null || _a === void 0 ? void 0 : _a.roles.filter(role => role.sequence === originalSequence).forEach((role, newOrderIndex) => {
|
199
|
-
if (!renumbered.includes(role.name)) {
|
200
|
-
role.sequence = newSequenceIndex + 1;
|
201
|
-
role.order = newOrderIndex + 1;
|
202
|
-
renumbered.push(role.name);
|
203
|
-
}
|
204
|
-
});
|
205
|
-
});
|
206
|
-
// Now re-extract them to get our final result e.g. [1, 2, 3]
|
207
|
-
this.extractSequenceNumbers();
|
208
|
-
}
|
209
|
-
// Look for name conflicts, because they're UGC and can be anything, regardless of order.
|
210
|
-
getNextRoleName() {
|
211
|
-
var _a, _b;
|
212
|
-
let name = '';
|
213
|
-
let nextNumber = (_a = state.template) === null || _a === void 0 ? void 0 : _a.roles.length;
|
214
|
-
do {
|
215
|
-
nextNumber++;
|
216
|
-
name = `Recipient ${nextNumber}`;
|
217
|
-
} while (!name || ((_b = state.template) === null || _b === void 0 ? void 0 : _b.roles.some(role => role.name === name)));
|
218
|
-
return name;
|
219
|
-
}
|
220
|
-
handleAddRole(e, sequence) {
|
221
|
-
e.stopPropagation();
|
222
|
-
// We don't need to look for a unique order number because we're already working with a sorted/renumbered set by now.
|
223
|
-
const order = state.template.roles.filter(role => role.sequence === sequence).length + 1;
|
224
|
-
const name = this.getNextRoleName();
|
225
|
-
console.log('Will create', name, sequence, order);
|
226
|
-
createRole(this.endpoint, this.templateId, {
|
227
|
-
template_id: this.templateId,
|
228
|
-
name,
|
229
|
-
full_name: '',
|
230
|
-
email: '',
|
231
|
-
phone: '',
|
232
|
-
sequence,
|
233
|
-
order,
|
234
|
-
type: 'signer',
|
235
|
-
delegator: false,
|
236
|
-
})
|
237
|
-
.then(r => {
|
238
|
-
var _a;
|
239
|
-
console.log('Created role', r);
|
240
|
-
state.template.roles.push(r);
|
241
|
-
this.renumberTemplateRoles();
|
242
|
-
this.forceRerender++;
|
243
|
-
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'created-role', endpoint: this.endpoint, template: state.template });
|
244
|
-
})
|
245
|
-
.catch(e => {
|
246
|
-
console.log('Error creating role', e);
|
247
|
-
});
|
248
|
-
}
|
249
|
-
handleAddStep(e, sequence) {
|
250
|
-
e.stopPropagation();
|
251
|
-
const order = 1;
|
252
|
-
const name = this.getNextRoleName();
|
253
|
-
console.log('Will create', name, sequence, order);
|
254
|
-
createRole(this.endpoint, this.templateId, {
|
255
|
-
template_id: this.templateId,
|
256
|
-
name,
|
257
|
-
full_name: '',
|
258
|
-
email: '',
|
259
|
-
phone: '',
|
260
|
-
sequence,
|
261
|
-
order,
|
262
|
-
type: 'signer',
|
263
|
-
delegator: false,
|
264
|
-
})
|
265
|
-
.then(r => {
|
266
|
-
console.log('Created role', r);
|
267
|
-
state.template.roles.push(r);
|
268
|
-
this.renumberTemplateRoles();
|
269
|
-
this.forceRerender++;
|
270
|
-
})
|
271
|
-
.catch(e => {
|
272
|
-
console.log('Error creating role', e);
|
273
|
-
});
|
274
|
-
}
|
275
|
-
render() {
|
276
|
-
var _a;
|
277
|
-
if (!this.endpoint.session) {
|
278
|
-
return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
279
|
-
}
|
280
|
-
if (state.loading || !state.template) {
|
281
|
-
return (h(Host, null, h("verdocs-loader", null)));
|
282
|
-
}
|
283
|
-
const roleNames = (((_a = state.template) === null || _a === void 0 ? void 0 : _a.roles) || []).map(role => role.name);
|
284
|
-
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Roles and Workflow"), h("div", { class: "participants" }, h("div", { class: "left-line" }), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: startIcon }), h("div", { class: "row-roles" }, 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-roles" }, 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-roles" }, h("div", { class: "dropzone", "data-order": 0.5, "data-sequence": sequence }), state.template.roles
|
285
|
-
.filter(role => role.sequence === sequence)
|
286
|
-
.map(role => {
|
287
|
-
const unknown = !role.email;
|
288
|
-
return unknown ? (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 }))) : (h(Fragment, null, h("div", { class: "recipient", style: { borderColor: 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.full_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 })));
|
289
|
-
}), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), this.sequences.length > 0 && (h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-roles" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step"))))))), h("div", { class: "row", "data-sequence": this.sequences.length + 1 }, h("div", { class: "row-roles" }, h("div", { class: "icon", innerHTML: plusIcon }), h("button", { class: "add-step", innerHTML: plusIcon, onClick: e => this.handleAddStep(e, this.sequences.length + 1) }))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-roles" }, 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: () => {
|
290
|
-
this.showingRoleDialog = null;
|
291
|
-
this.forceRerender++;
|
292
|
-
}, onDelete: e => {
|
293
|
-
var _a;
|
294
|
-
console.log('deleted', e.detail);
|
295
|
-
this.renumberTemplateRoles();
|
296
|
-
this.showingRoleDialog = null;
|
297
|
-
this.forceRerender++;
|
298
|
-
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'deleted-role', endpoint: this.endpoint, template: state.template });
|
299
|
-
} })), this.showingSenderDialog && h("verdocs-template-sender", { endpoint: this.endpoint, templateId: this.templateId, onClose: () => (this.showingSenderDialog = false) })));
|
300
|
-
}
|
301
|
-
get el() { return this; }
|
302
|
-
static get style() { return verdocsTemplateRolesCss; }
|
303
|
-
}, [0, "verdocs-template-roles", {
|
304
|
-
"endpoint": [16],
|
305
|
-
"templateId": [1, "template-id"],
|
306
|
-
"showingRoleDialog": [32],
|
307
|
-
"showingSenderDialog": [32],
|
308
|
-
"sender": [32],
|
309
|
-
"forceRerender": [32]
|
310
|
-
}]);
|
311
|
-
function defineCustomElement$1() {
|
312
|
-
if (typeof customElements === "undefined") {
|
313
|
-
return;
|
314
|
-
}
|
315
|
-
const components = ["verdocs-template-roles", "verdocs-button", "verdocs-checkbox", "verdocs-component-error", "verdocs-help-icon", "verdocs-loader", "verdocs-radio-button", "verdocs-select-input", "verdocs-template-role-properties", "verdocs-template-sender", "verdocs-text-input"];
|
316
|
-
components.forEach(tagName => { switch (tagName) {
|
317
|
-
case "verdocs-template-roles":
|
318
|
-
if (!customElements.get(tagName)) {
|
319
|
-
customElements.define(tagName, VerdocsTemplateRoles$1);
|
320
|
-
}
|
321
|
-
break;
|
322
|
-
case "verdocs-button":
|
323
|
-
if (!customElements.get(tagName)) {
|
324
|
-
defineCustomElement$b();
|
325
|
-
}
|
326
|
-
break;
|
327
|
-
case "verdocs-checkbox":
|
328
|
-
if (!customElements.get(tagName)) {
|
329
|
-
defineCustomElement$a();
|
330
|
-
}
|
331
|
-
break;
|
332
|
-
case "verdocs-component-error":
|
333
|
-
if (!customElements.get(tagName)) {
|
334
|
-
defineCustomElement$9();
|
335
|
-
}
|
336
|
-
break;
|
337
|
-
case "verdocs-help-icon":
|
338
|
-
if (!customElements.get(tagName)) {
|
339
|
-
defineCustomElement$8();
|
340
|
-
}
|
341
|
-
break;
|
342
|
-
case "verdocs-loader":
|
343
|
-
if (!customElements.get(tagName)) {
|
344
|
-
defineCustomElement$7();
|
345
|
-
}
|
346
|
-
break;
|
347
|
-
case "verdocs-radio-button":
|
348
|
-
if (!customElements.get(tagName)) {
|
349
|
-
defineCustomElement$6();
|
350
|
-
}
|
351
|
-
break;
|
352
|
-
case "verdocs-select-input":
|
353
|
-
if (!customElements.get(tagName)) {
|
354
|
-
defineCustomElement$5();
|
355
|
-
}
|
356
|
-
break;
|
357
|
-
case "verdocs-template-role-properties":
|
358
|
-
if (!customElements.get(tagName)) {
|
359
|
-
defineCustomElement$4();
|
360
|
-
}
|
361
|
-
break;
|
362
|
-
case "verdocs-template-sender":
|
363
|
-
if (!customElements.get(tagName)) {
|
364
|
-
defineCustomElement$3();
|
365
|
-
}
|
366
|
-
break;
|
367
|
-
case "verdocs-text-input":
|
368
|
-
if (!customElements.get(tagName)) {
|
369
|
-
defineCustomElement$2();
|
370
|
-
}
|
371
|
-
break;
|
372
|
-
} });
|
373
|
-
}
|
374
|
-
defineCustomElement$1();
|
1
|
+
import { V as VerdocsTemplateRoles$1, d as defineCustomElement$1 } from './verdocs-template-roles2.js';
|
375
2
|
|
376
3
|
const VerdocsTemplateRoles = VerdocsTemplateRoles$1;
|
377
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,18 +1,22 @@
|
|
1
|
-
import {
|
2
|
-
import { i as interact } from './interact.min
|
3
|
-
import './Types
|
4
|
-
import { u as updateRole, c as createRole } from './
|
5
|
-
import { V as VerdocsEndpoint, T as TemplateSenderTypes } from './VerdocsEndpoint
|
6
|
-
import { g as getRGBA } from './Colors
|
7
|
-
import { s as state } from './templateStore
|
8
|
-
import { l as loadTemplate } from './Templates
|
9
|
-
import {
|
10
|
-
import { S as SDKError } from './errors
|
11
|
-
import './
|
12
|
-
import './
|
13
|
-
import './
|
14
|
-
import './
|
15
|
-
import './
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
|
2
|
+
import { i as interact } from './interact.min.js';
|
3
|
+
import './Types.js';
|
4
|
+
import { u as updateRole, c as createRole, d as defineCustomElement$3 } from './verdocs-template-role-properties2.js';
|
5
|
+
import { V as VerdocsEndpoint, T as TemplateSenderTypes } from './VerdocsEndpoint.js';
|
6
|
+
import { g as getRGBA } from './Colors.js';
|
7
|
+
import { s as state } from './templateStore.js';
|
8
|
+
import { l as loadTemplate } from './Templates.js';
|
9
|
+
import { a as getRoleIndex } from './utils.js';
|
10
|
+
import { S as SDKError } from './errors.js';
|
11
|
+
import { d as defineCustomElement$a } from './verdocs-button2.js';
|
12
|
+
import { d as defineCustomElement$9 } from './verdocs-checkbox2.js';
|
13
|
+
import { d as defineCustomElement$8 } from './verdocs-component-error2.js';
|
14
|
+
import { d as defineCustomElement$7 } from './verdocs-help-icon2.js';
|
15
|
+
import { d as defineCustomElement$6 } from './verdocs-loader2.js';
|
16
|
+
import { d as defineCustomElement$5 } from './verdocs-radio-button2.js';
|
17
|
+
import { d as defineCustomElement$4 } from './verdocs-select-input2.js';
|
18
|
+
import { d as defineCustomElement$2 } from './verdocs-template-sender2.js';
|
19
|
+
import { d as defineCustomElement$1 } from './verdocs-text-input2.js';
|
16
20
|
|
17
21
|
const verdocsTemplateRolesCss = "verdocs-template-roles{display:block;min-width:400px;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>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-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-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-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>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-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.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-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .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-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}";
|
18
22
|
|
@@ -31,9 +35,10 @@ const plusIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox
|
|
31
35
|
const iconSigner = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';
|
32
36
|
const iconApprover = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>`;
|
33
37
|
const iconCC = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>`;
|
34
|
-
const VerdocsTemplateRoles = class {
|
35
|
-
constructor(
|
36
|
-
|
38
|
+
const VerdocsTemplateRoles = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
39
|
+
constructor() {
|
40
|
+
super();
|
41
|
+
this.__registerHost();
|
37
42
|
this.next = createEvent(this, "next", 7);
|
38
43
|
this.exit = createEvent(this, "exit", 7);
|
39
44
|
this.sdkError = createEvent(this, "sdkError", 7);
|
@@ -258,10 +263,12 @@ const VerdocsTemplateRoles = class {
|
|
258
263
|
delegator: false,
|
259
264
|
})
|
260
265
|
.then(r => {
|
266
|
+
var _a;
|
261
267
|
console.log('Created role', r);
|
262
268
|
state.template.roles.push(r);
|
263
269
|
this.renumberTemplateRoles();
|
264
270
|
this.forceRerender++;
|
271
|
+
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'created-role', endpoint: this.endpoint, template: state.template });
|
265
272
|
})
|
266
273
|
.catch(e => {
|
267
274
|
console.log('Error creating role', e);
|
@@ -293,8 +300,79 @@ const VerdocsTemplateRoles = class {
|
|
293
300
|
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'deleted-role', endpoint: this.endpoint, template: state.template });
|
294
301
|
} })), this.showingSenderDialog && h("verdocs-template-sender", { endpoint: this.endpoint, templateId: this.templateId, onClose: () => (this.showingSenderDialog = false) })));
|
295
302
|
}
|
296
|
-
get el() { return
|
297
|
-
}
|
298
|
-
|
303
|
+
get el() { return this; }
|
304
|
+
static get style() { return verdocsTemplateRolesCss; }
|
305
|
+
}, [0, "verdocs-template-roles", {
|
306
|
+
"endpoint": [16],
|
307
|
+
"templateId": [1, "template-id"],
|
308
|
+
"showingRoleDialog": [32],
|
309
|
+
"showingSenderDialog": [32],
|
310
|
+
"sender": [32],
|
311
|
+
"forceRerender": [32]
|
312
|
+
}]);
|
313
|
+
function defineCustomElement() {
|
314
|
+
if (typeof customElements === "undefined") {
|
315
|
+
return;
|
316
|
+
}
|
317
|
+
const components = ["verdocs-template-roles", "verdocs-button", "verdocs-checkbox", "verdocs-component-error", "verdocs-help-icon", "verdocs-loader", "verdocs-radio-button", "verdocs-select-input", "verdocs-template-role-properties", "verdocs-template-sender", "verdocs-text-input"];
|
318
|
+
components.forEach(tagName => { switch (tagName) {
|
319
|
+
case "verdocs-template-roles":
|
320
|
+
if (!customElements.get(tagName)) {
|
321
|
+
customElements.define(tagName, VerdocsTemplateRoles);
|
322
|
+
}
|
323
|
+
break;
|
324
|
+
case "verdocs-button":
|
325
|
+
if (!customElements.get(tagName)) {
|
326
|
+
defineCustomElement$a();
|
327
|
+
}
|
328
|
+
break;
|
329
|
+
case "verdocs-checkbox":
|
330
|
+
if (!customElements.get(tagName)) {
|
331
|
+
defineCustomElement$9();
|
332
|
+
}
|
333
|
+
break;
|
334
|
+
case "verdocs-component-error":
|
335
|
+
if (!customElements.get(tagName)) {
|
336
|
+
defineCustomElement$8();
|
337
|
+
}
|
338
|
+
break;
|
339
|
+
case "verdocs-help-icon":
|
340
|
+
if (!customElements.get(tagName)) {
|
341
|
+
defineCustomElement$7();
|
342
|
+
}
|
343
|
+
break;
|
344
|
+
case "verdocs-loader":
|
345
|
+
if (!customElements.get(tagName)) {
|
346
|
+
defineCustomElement$6();
|
347
|
+
}
|
348
|
+
break;
|
349
|
+
case "verdocs-radio-button":
|
350
|
+
if (!customElements.get(tagName)) {
|
351
|
+
defineCustomElement$5();
|
352
|
+
}
|
353
|
+
break;
|
354
|
+
case "verdocs-select-input":
|
355
|
+
if (!customElements.get(tagName)) {
|
356
|
+
defineCustomElement$4();
|
357
|
+
}
|
358
|
+
break;
|
359
|
+
case "verdocs-template-role-properties":
|
360
|
+
if (!customElements.get(tagName)) {
|
361
|
+
defineCustomElement$3();
|
362
|
+
}
|
363
|
+
break;
|
364
|
+
case "verdocs-template-sender":
|
365
|
+
if (!customElements.get(tagName)) {
|
366
|
+
defineCustomElement$2();
|
367
|
+
}
|
368
|
+
break;
|
369
|
+
case "verdocs-text-input":
|
370
|
+
if (!customElements.get(tagName)) {
|
371
|
+
defineCustomElement$1();
|
372
|
+
}
|
373
|
+
break;
|
374
|
+
} });
|
375
|
+
}
|
376
|
+
defineCustomElement();
|
299
377
|
|
300
|
-
export { VerdocsTemplateRoles as
|
378
|
+
export { VerdocsTemplateRoles as V, defineCustomElement as d };
|