@verdocs/web-sdk 5.0.31 → 5.0.33
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index-ccac8641.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
- package/dist/cjs/{verdocs-envelope-recipient-link_2.cjs.entry.js → verdocs-envelope-recipient-link.cjs.entry.js} +1 -25
- package/dist/cjs/verdocs-envelope-recipient-link.cjs.entry.js.map +1 -0
- package/dist/cjs/{verdocs-preview_6.cjs.entry.js → verdocs-preview_7.cjs.entry.js} +147 -15
- package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -0
- package/dist/cjs/verdocs-switch.cjs.entry.js +32 -0
- package/dist/cjs/verdocs-switch.cjs.entry.js.map +1 -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-switch/verdocs-switch.css +2 -2
- package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js +3 -3
- package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +1 -1
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +10 -14
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.css +57 -0
- package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.js +282 -0
- package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.js.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-f4e068a9.js → p-38e1fed8.js} +4 -4
- package/dist/components/{p-f4e068a9.js.map → p-38e1fed8.js.map} +1 -1
- package/dist/components/{p-87d3651e.js → p-4c5164d0.js} +11 -15
- package/dist/components/p-4c5164d0.js.map +1 -0
- package/dist/components/p-7ad22da6.js +212 -0
- package/dist/components/p-7ad22da6.js.map +1 -0
- package/dist/components/verdocs-build.js +85 -73
- package/dist/components/verdocs-build.js.map +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-switch.js +1 -1
- package/dist/components/verdocs-template-settings.d.ts +11 -0
- package/dist/components/verdocs-template-settings.js +8 -0
- package/dist/components/verdocs-template-settings.js.map +1 -0
- package/dist/custom-elements.json +14 -1
- package/dist/esm/index-272d51a4.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-build.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js.map +1 -1
- package/dist/esm/{verdocs-envelope-recipient-link_2.entry.js → verdocs-envelope-recipient-link.entry.js} +2 -25
- package/dist/esm/verdocs-envelope-recipient-link.entry.js.map +1 -0
- package/dist/esm/{verdocs-preview_6.entry.js → verdocs-preview_7.entry.js} +148 -17
- package/dist/esm/verdocs-preview_7.entry.js.map +1 -0
- package/dist/esm/verdocs-switch.entry.js +28 -0
- package/dist/esm/verdocs-switch.entry.js.map +1 -0
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/index-272d51a4.js +1 -1
- package/dist/esm-es5/index-272d51a4.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
- package/dist/esm-es5/{verdocs-envelope-recipient-link_2.entry.js → verdocs-envelope-recipient-link.entry.js} +2 -2
- package/dist/esm-es5/verdocs-envelope-recipient-link.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-preview_7.entry.js +8 -0
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-switch.entry.js +2 -0
- package/dist/esm-es5/verdocs-switch.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
- package/dist/types/components/controls/verdocs-switch/verdocs-switch.d.ts +1 -1
- package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +2 -2
- package/dist/types/components/templates/verdocs-template-settings/verdocs-template-settings.d.ts +55 -0
- package/dist/types/components.d.ts +79 -4
- package/dist/verdocs-web-sdk/p-060dbde7.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-060dbde7.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-17457a7a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-17457a7a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-21e9abff.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-21e9abff.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-27ddc017.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-27ddc017.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6f1e2f2f.entry.js → p-8e699235.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-8e699235.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-cabfdb9d.system.entry.js → p-a63b359e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-a63b359e.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-aca6553d.system.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-aca6553d.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-dddd328d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-dddd328d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js.map +0 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +0 -1
- package/dist/components/p-87d3651e.js.map +0 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js.map +0 -1
- package/dist/esm/verdocs-preview_6.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +0 -8
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-33064db4.system.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-33064db4.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-6f1e2f2f.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-9e04b9f0.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-9e04b9f0.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-b9fee1a7.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b9fee1a7.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-cabfdb9d.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e3efeb57.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e3efeb57.system.entry.js.map +0 -1
@@ -0,0 +1,32 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-ccac8641.js');
|
6
|
+
|
7
|
+
const verdocsSwitchCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-switch{font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-switch .switch{display:-ms-inline-flexbox;display:inline-flex;height:24px;width:44px;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:12px;border:transparent;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms}verdocs-switch .switch.primary[data-state=checked]{background:#55bc81}verdocs-switch .switch.primary[data-state=unchecked]{background:#e3e3e3}verdocs-switch .switch.secondary[data-state=checked]{background:#4c56cb}verdocs-switch .switch.secondary[data-state=unchecked]{background:#e3e3e3}verdocs-switch .slider{display:block;width:20px;height:20px;border-radius:20px;background:#ffffff;-webkit-box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms}verdocs-switch .slider[data-state=checked]{-webkit-transform:translateX(16px);transform:translateX(16px)}verdocs-switch .slider[data-state=unchecked]{-webkit-transform:translateX(-4px);transform:translateX(-4px)}verdocs-switch .switch.disabled.primary,verdocs-switch .switch.disabled.secondary{cursor:not-allowed;background:#666666}";
|
8
|
+
const VerdocsSwitchStyle0 = verdocsSwitchCss;
|
9
|
+
|
10
|
+
const VerdocsSwitch = class {
|
11
|
+
constructor(hostRef) {
|
12
|
+
index.registerInstance(this, hostRef);
|
13
|
+
this.checkedChange = index.createEvent(this, "checkedChange", 7);
|
14
|
+
this.checked = false;
|
15
|
+
this.theme = 'primary';
|
16
|
+
this.disabled = false;
|
17
|
+
}
|
18
|
+
render() {
|
19
|
+
return (index.h("button", { key: 'fc02b9a9fb89d4c181a43379311d2cacf3ab136d', value: "on", type: "button", role: "switch", class: `switch ${this.theme} ${this.disabled ? 'disabled' : ''}`, "data-state": this.checked ? 'checked' : 'unchecked', "aria-checked": this.checked ? 'checked' : 'unchecked', onClick: () => {
|
20
|
+
var _a;
|
21
|
+
if (!this.disabled) {
|
22
|
+
this.checked = !this.checked;
|
23
|
+
(_a = this.checkedChange) === null || _a === void 0 ? void 0 : _a.emit(this.checked);
|
24
|
+
}
|
25
|
+
} }, index.h("span", { key: '6250418f78aa5293ae3a21e4ecbfd6b8ebd6c80f', "data-state": this.checked ? 'checked' : 'unchecked', class: "slider" })));
|
26
|
+
}
|
27
|
+
};
|
28
|
+
VerdocsSwitch.style = VerdocsSwitchStyle0;
|
29
|
+
|
30
|
+
exports.verdocs_switch = VerdocsSwitch;
|
31
|
+
|
32
|
+
//# sourceMappingURL=verdocs-switch.cjs.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"verdocs-switch.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,44EAA44E,CAAC;AACt6E,4BAAe,gBAAgB;;MCYlB,aAAa;;;;uBACkB,KAAK;qBAKN,SAAS;wBAKtB,KAAK;;IAIjC,MAAM;QACJ,QACEA,qEACE,KAAK,EAAC,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,UAAU,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,EAAE,gBACpD,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,kBACpC,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,EACpD,OAAO,EAAE;;gBACP,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;oBAClB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC7B,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACxC;aACF,IAEDA,iFAAkB,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,WAAW,EAAE,KAAK,EAAC,QAAQ,GAAQ,CACzE,EACT;KACH;;;;;;","names":["h"],"sources":["src/components/controls/verdocs-switch/verdocs-switch.scss?tag=verdocs-switch","src/components/controls/verdocs-switch/verdocs-switch.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-switch {\n font-family: $primary-font;\n\n .switch {\n display: inline-flex;\n height: 24px;\n width: 44px;\n flex-shrink: 0;\n align-items: center;\n cursor: pointer;\n border-radius: 12px;\n border: transparent;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n\n .switch.primary[data-state='checked'] {\n background: $primary-color;\n }\n\n .switch.primary[data-state='unchecked'] {\n background: $extra-light-border-color;\n }\n\n .switch.secondary[data-state='checked'] {\n background: $secondary-color;\n }\n\n .switch.secondary[data-state='unchecked'] {\n background: $extra-light-border-color;\n }\n\n .slider {\n display: block;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n background: #ffffff;\n box-shadow:\n 0 10px 15px -3px rgb(0 0 0 / 0.1),\n 0 4px 6px -4px rgb(0 0 0 / 0.1);\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n\n .slider[data-state='checked'] {\n transform: translateX(16px);\n }\n\n .slider[data-state='unchecked'] {\n transform: translateX(-4px);\n }\n\n .switch.disabled.primary,\n .switch.disabled.secondary {\n cursor: not-allowed;\n background: $dark-disabled-color;\n }\n}\n","import {Component, Prop, h, EventEmitter, Event} from '@stencil/core';\n\n/**\n * Displays a toggle switch\n *\n * ```ts\n * <verdocs-switch checked={sendReminders} onCheckedChange={setSendReminders} />\n * ```\n */\n@Component({\n tag: 'verdocs-switch',\n styleUrl: 'verdocs-switch.scss',\n})\nexport class VerdocsSwitch {\n @Prop({mutable: true}) checked: boolean = false;\n\n /**\n * Select purple or green treatments.\n */\n @Prop() theme: 'primary' | 'secondary' = 'primary';\n\n /**\n * Should the field be disabled?\n */\n @Prop() disabled: boolean = false;\n\n @Event({composed: true}) checkedChange: EventEmitter<boolean>;\n\n render() {\n return (\n <button\n value=\"on\"\n type=\"button\"\n role=\"switch\"\n class={`switch ${this.theme} ${this.disabled ? 'disabled' : ''}`}\n data-state={this.checked ? 'checked' : 'unchecked'}\n aria-checked={this.checked ? 'checked' : 'unchecked'}\n onClick={() => {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.checkedChange?.emit(this.checked);\n }\n }}\n >\n <span data-state={this.checked ? 'checked' : 'unchecked'} class=\"slider\"></span>\n </button>\n );\n }\n}\n"],"version":3}
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
19
19
|
|
20
20
|
patchBrowser().then(async (options) => {
|
21
21
|
await appGlobals.globalScripts();
|
22
|
-
return index.bootstrapLazy(JSON.parse("[[\"verdocs-build.cjs\",[[0,\"verdocs-build\",{\"endpoint\":[16],\"templateId\":[1537,\"template-id\"],\"step\":[1537],\"loading\":[32],\"template\":[32]},null,{\"templateId\":[\"onTemplateIdChanged\"],\"step\":[\"onStepChanged\"]}]]],[\"verdocs-envelopes-list.cjs\",[[0,\"verdocs-envelopes-list\",{\"endpoint\":[16],\"view\":[1537],\"status\":[1537],\"sort\":[1537],\"match\":[1537],\"showPagination\":[4,\"show-pagination\"],\"rowsPerPage\":[2,\"rows-per-page\"],\"selectedPage\":[2,\"selected-page\"],\"count\":[32],\"initiallyLoaded\":[32],\"loading\":[32],\"selectedEnvelopes\":[32],\"envelopes\":[32]},null,{\"view\":[\"handleViewUpdated\"],\"status\":[\"handleStatusUpdated\"],\"sort\":[\"handleSortUpdated\"],\"match\":[\"handleMatchUpdated\"],\"selectedPage\":[\"handlePageUpdated\"]}]]],[\"verdocs-sign.cjs\",[[0,\"verdocs-sign\",{\"endpoint\":[1040],\"envelopeId\":[513,\"envelope-id\"],\"roleId\":[513,\"role-id\"],\"inviteCode\":[513,\"invite-code\"],\"headerTargetId\":[1,\"header-target-id\"],\"roleNames\":[32],\"sortedRecipients\":[32],\"recipient\":[32],\"hasSignature\":[32],\"nextButtonLabel\":[32],\"nextSubmits\":[32],\"fatalErrorHeader\":[32],\"fatalErrorMessage\":[32],\"focusedField\":[32],\"submitting\":[32],\"submitted\":[32],\"isDone\":[32],\"showDone\":[32],\"showLoadError\":[32],\"finishLater\":[32],\"showFinishLater\":[32],\"agreed\":[32],\"documentsSingularPlural\":[32],\"kbaStep\":[32],\"kbaQuestions\":[32],\"showSpinner\":[32],\"kbaChoices\":[32],\"loading\":[32],\"envelope\":[32]}]]],[\"verdocs-templates-list.cjs\",[[0,\"verdocs-templates-list\",{\"endpoint\":[16],\"visibility\":[1537],\"starred\":[1537],\"sort\":[1537],\"name\":[1537],\"allowedActions\":[1040],\"showPagination\":[4,\"show-pagination\"],\"rowsPerPage\":[2,\"rows-per-page\"],\"selectedPage\":[2,\"selected-page\"],\"count\":[32],\"initiallyLoaded\":[32],\"loading\":[32],\"confirmDelete\":[32],\"templates\":[32],\"localNameFilter\":[32]},null,{\"sharing\":[\"handleSharingUpdated\"],\"starred\":[\"handleStarredUpdated\"],\"sort\":[\"handleSortUpdated\"],\"name\":[\"handleNameUpdated\"],\"selectedPage\":[\"handlePageUpdated\"]}]]],[\"verdocs-field-payment.cjs\",[[0,\"verdocs-field-payment\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"done\":[516],\"editable\":[516],\"moveable\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"fields\":[16],\"pageNum\":[2,\"page-num\"],\"roleName\":[1,\"role-name\"],\"fieldId\":[1,\"field-id\"],\"recipients\":[8],\"selectedRoleName\":[1,\"selected-role-name\"],\"pdfPages\":[16],\"currentSignature\":[1,\"current-signature\"],\"currentSignatureId\":[1,\"current-signature-id\"],\"currentInitial\":[1,\"current-initial\"],\"currentInitialId\":[1,\"current-initial-id\"],\"signed\":[4],\"roleindex\":[2],\"showingProperties\":[32],\"focused\":[32],\"preparedMessage\":[32],\"signatureUrl\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}]]],[\"verdocs-envelope-sidebar.cjs\",[[0,\"verdocs-envelope-sidebar\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"activeTab\":[32],\"panelOpen\":[32],\"showRecipientDialog\":[32],\"showCancelDialog\":[32],\"showReinviteDialog\":[32],\"remindersEnabled\":[32],\"updatingReminders\":[32],\"initialReminder\":[32],\"followupReminders\":[32],\"loading\":[32],\"envelope\":[32]}]]],[\"verdocs-template-create.cjs\",[[0,\"verdocs-template-create\",{\"endpoint\":[16],\"maxSize\":[1026,\"max-size\"],\"file\":[32],\"creating\":[32],\"progressLabel\":[32],\"progressPercent\":[32],\"errorMessage\":[32]}]]],[\"verdocs-auth.cjs\",[[0,\"verdocs-auth\",{\"endpoint\":[16],\"visible\":[4],\"logo\":[1],\"displayMode\":[1025,\"display-mode\"],\"org_name\":[32],\"first_name\":[32],\"last_name\":[32],\"email\":[32],\"verificationCode\":[32],\"newPassword\":[32],\"password\":[32],\"confirmpass\":[32],\"submitting\":[32],\"resendDisabled\":[32],\"session\":[32],\"profile\":[32]}]]],[\"verdocs-envelope-recipient-summary.cjs\",[[0,\"verdocs-envelope-recipient-summary\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"canSendAnother\":[4,\"can-send-another\"],\"canView\":[4,\"can-view\"],\"canDone\":[4,\"can-done\"],\"isOpen\":[32],\"recipientStatusIcons\":[32],\"containerId\":[32],\"gettingLinks\":[32],\"links\":[32],\"loading\":[32],\"envelope\":[32]}]]],[\"verdocs-dialog.cjs\",[[4,\"verdocs-dialog\"]]],[\"verdocs-quick-functions.cjs\",[[0,\"verdocs-quick-functions\",{\"endpoint\":[16]}]]],[\"verdocs-radio-button.cjs\",[[0,\"verdocs-radio-button\",{\"checked\":[4],\"name\":[1],\"value\":[1],\"disabled\":[4]}]]],[\"verdocs-search-box.cjs\",[[0,\"verdocs-search-box\",{\"endpoint\":[16],\"placeholder\":[1],\"type\":[1],\"query\":[1],\"grabsFocus\":[4,\"grabs-focus\"],\"focusField\":[64]}]]],[\"verdocs-search-tabs.cjs\",[[0,\"verdocs-search-tabs\",{\"selected\":[32]}]]],[\"verdocs-table.cjs\",[[0,\"verdocs-table\",{\"columns\":[16],\"data\":[16]}]]],[\"verdocs-template-card.cjs\",[[0,\"verdocs-template-card\",{\"template\":[16]}]]],[\"verdocs-template-tags.cjs\",[[0,\"verdocs-template-tags\",{\"tags\":[16]}]]],[\"verdocs-toggle.cjs\",[[0,\"verdocs-toggle\",{\"options\":[16],\"theme\":[1],\"selectedOption\":[32]}]]],[\"verdocs-status-indicator.cjs\",[[0,\"verdocs-status-indicator\",{\"size\":[1],\"theme\":[1],\"status\":[1],\"envelope\":[16],\"isOpen\":[32],\"containerId\":[32]}]]],[\"verdocs-template-star.cjs\",[[0,\"verdocs-template-star\",{\"endpoint\":[16],\"template\":[1040],\"updating\":[32]}]]],[\"verdocs-envelope-document-page.cjs\",[[0,\"verdocs-envelope-document-page\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"documentId\":[1,\"document-id\"],\"pageNumber\":[2,\"page-number\"],\"virtualWidth\":[2,\"virtual-width\"],\"virtualHeight\":[1026,\"virtual-height\"],\"layers\":[16],\"type\":[1],\"containerId\":[32],\"renderedWidth\":[32],\"renderedHeight\":[32],\"naturalWidth\":[32],\"naturalHeight\":[32],\"aspectRatio\":[32],\"skipFirstNotification\":[32],\"pageDisplayUri\":[32]}]]],[\"verdocs-button_2.cjs\",[[0,\"verdocs-help-icon\",{\"text\":[1],\"icon\":[1],\"containerId\":[32]}],[0,\"verdocs-button\",{\"label\":[1],\"startIcon\":[1,\"start-icon\"],\"endIcon\":[1,\"end-icon\"],\"size\":[1],\"type\":[1],\"variant\":[1],\"disabled\":[4]}]]],[\"verdocs-kba-dialog_2.cjs\",[[0,\"verdocs-view\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"headerTargetId\":[1,\"header-target-id\"],\"canceling\":[32],\"showCancelDone\":[32],\"showLoadError\":[32],\"loading\":[32],\"envelope\":[32]}],[0,\"verdocs-kba-dialog\",{\"step\":[2],\"steps\":[2],\"helptitle\":[1],\"helptext\":[1],\"mode\":[1],\"label\":[1],\"placeholder\":[1],\"recipient\":[16],\"choices\":[16],\"response\":[32],\"updatedRecipient\":[32]}]]],[\"verdocs-envelope-recipient-link_2.cjs\",[[0,\"verdocs-envelope-recipient-link\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"roleName\":[1,\"role-name\"],\"isOpen\":[32],\"gettingLink\":[32],\"link\":[32],\"loading\":[32],\"envelope\":[32],\"recipient\":[32]}],[0,\"verdocs-switch\",{\"checked\":[1028],\"theme\":[1],\"disabled\":[4]}]]],[\"verdocs-menu-panel_2.cjs\",[[0,\"verdocs-template-role-properties\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"roleName\":[1,\"role-name\"],\"dirty\":[32],\"saving\":[32],\"name\":[32],\"type\":[32],\"first_name\":[32],\"last_name\":[32],\"email\":[32],\"phone\":[32],\"delegator\":[32],\"loading\":[32],\"template\":[32]}],[4,\"verdocs-menu-panel\",{\"side\":[1],\"overlay\":[4],\"width\":[2]},[[4,\"click\",\"handleClick\"]]]]],[\"verdocs-button-panel_2.cjs\",[[4,\"verdocs-button-panel\",{\"icon\":[1],\"showPanel\":[64],\"hidePanel\":[64],\"toggle\":[64]}],[4,\"verdocs-tabs\",{\"tabs\":[16],\"selectedTab\":[2,\"selected-tab\"]}]]],[\"verdocs-pagination_2.cjs\",[[0,\"verdocs-pagination\",{\"selectedPage\":[1538,\"selected-page\"],\"itemCount\":[2,\"item-count\"],\"perPage\":[2,\"per-page\"]}],[0,\"verdocs-quick-filter\",{\"options\":[16],\"label\":[1],\"value\":[1537],\"placeholder\":[1],\"open\":[32]}]]],[\"verdocs-ok-dialog.cjs\",[[0,\"verdocs-ok-dialog\",{\"heading\":[1],\"message\":[1],\"buttonLabel\":[1,\"button-label\"],\"showCancel\":[4,\"show-cancel\"],\"closed\":[32]}]]],[\"verdocs-template-document-page_2.cjs\",[[0,\"verdocs-toolbar-icon\",{\"text\":[1],\"icon\":[1],\"placement\":[1],\"containerId\":[32]}],[0,\"verdocs-template-document-page\",{\"endpoint\":[16],\"editable\":[4],\"disabled\":[4],\"done\":[4],\"templateId\":[1,\"template-id\"],\"documentId\":[1,\"document-id\"],\"pageNumber\":[2,\"page-number\"],\"virtualWidth\":[2,\"virtual-width\"],\"virtualHeight\":[1026,\"virtual-height\"],\"layers\":[16],\"containerId\":[32],\"renderedWidth\":[32],\"renderedHeight\":[32],\"naturalWidth\":[32],\"naturalHeight\":[32],\"aspectRatio\":[32],\"skipFirstNotification\":[32],\"pageDisplayUri\":[32],\"xScale\":[32],\"yScale\":[32],\"loading\":[32],\"template\":[32]}]]],[\"verdocs-contact-picker_2.cjs\",[[0,\"verdocs-contact-picker\",{\"endpoint\":[16],\"templateRole\":[16],\"contactSuggestions\":[16],\"first_name\":[32],\"last_name\":[32],\"email\":[32],\"phone\":[32],\"zip\":[32],\"address\":[32],\"message\":[32],\"showSuggestions\":[32],\"showMessage\":[32],\"delegator\":[32],\"showKba\":[32],\"kba_method\":[32],\"kba_pin\":[32],\"nameFieldId\":[32],\"firstNameFieldId\":[32],\"lastNameFieldId\":[32],\"emailFieldId\":[32],\"phoneFieldId\":[32]}],[0,\"verdocs-toggle-button\",{\"active\":[4],\"icon\":[1],\"label\":[1],\"size\":[1],\"_active\":[32]}]]],[\"verdocs-file-chooser_2.cjs\",[[0,\"verdocs-file-chooser\",{\"endpoint\":[16],\"file\":[32]}],[0,\"verdocs-progress-bar\",{\"label\":[1],\"showPercent\":[4,\"show-percent\"],\"percent\":[2]}]]],[\"verdocs-spinner.cjs\",[[0,\"verdocs-spinner\",{\"size\":[2],\"mode\":[1]}]]],[\"verdocs-organization-card_2.cjs\",[[0,\"verdocs-organization-card\",{\"organization\":[16],\"hovered\":[32]},[[1,\"mouseover\",\"onMouseOver\"],[1,\"mouseout\",\"onMouseOut\"]]],[4,\"verdocs-portal\",{\"anchor\":[1],\"voffset\":[2]},[[11,\"scroll\",\"handleScroll\"],[9,\"resize\",\"handleResize\"],[4,\"click\",\"handleClick\"]]]]],[\"verdocs-dropdown.cjs\",[[0,\"verdocs-dropdown\",{\"options\":[16],\"containerId\":[32],\"showPicker\":[32]}]]],[\"verdocs-checkbox_6.cjs\",[[0,\"verdocs-template-field-properties\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"fieldName\":[1025,\"field-name\"],\"helpText\":[1,\"help-text\"],\"dirty\":[32],\"label\":[32],\"type\":[32],\"name\":[32],\"required\":[32],\"roleName\":[32],\"group\":[32],\"fieldType\":[32],\"options\":[32],\"placeholder\":[32],\"defaultValue\":[32],\"showingHelp\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-checkbox\",{\"checked\":[4],\"name\":[1],\"label\":[1],\"value\":[1],\"theme\":[1],\"disabled\":[4]}],[0,\"verdocs-select-input\",{\"value\":[1],\"label\":[1],\"options\":[16],\"disabled\":[4]}],[0,\"verdocs-component-error\",{\"message\":[1]}],[0,\"verdocs-loader\"],[0,\"verdocs-text-input\",{\"value\":[1537],\"label\":[1],\"placeholder\":[1],\"autocomplete\":[1],\"helpText\":[1,\"help-text\"],\"clearable\":[4],\"copyable\":[4],\"type\":[1],\"disabled\":[4],\"required\":[4],\"showingPw\":[32]}]]],[\"verdocs-field-attachment_13.cjs\",[[0,\"verdocs-field-attachment\",{\"endpoint\":[16],\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"dialogOpen\":[32],\"selectedFile\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-initial\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"initials\":[513],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"tempInitials\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-signature\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"name\":[513],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"tempSignature\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-checkbox\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"done\":[516],\"editable\":[516],\"moveable\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-date\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"field\":[16],\"containerId\":[32],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-dropdown\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-radio\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"required\":[516],\"done\":[516],\"editable\":[516],\"moveable\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-textarea\",{\"endpoint\":[16],\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-textbox\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"multiline\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-timestamp\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[2],\"showingProperties\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-initial-dialog\",{\"initials\":[1],\"fontLoaded\":[32],\"enteredInitials\":[32],\"mode\":[32]}],[0,\"verdocs-signature-dialog\",{\"name\":[1],\"fontLoaded\":[32],\"enteredName\":[32],\"mode\":[32]}],[0,\"verdocs-upload-dialog\",{\"maxSize\":[1026,\"max-size\"],\"existingFile\":[1032,\"existing-file\"],\"draggingOver\":[32],\"confirmDelete\":[32],\"selectedFiles\":[32],\"errorMessage\":[32]}]]],[\"verdocs-preview_6.cjs\",[[0,\"verdocs-template-fields\",{\"endpoint\":[16],\"templateId\":[1537,\"template-id\"],\"toolbarTargetId\":[1,\"toolbar-target-id\"],\"placing\":[32],\"showMustSelectRole\":[32],\"selectedRoleName\":[32],\"loading\":[32],\"template\":[32]},[[4,\"keydown\",\"handleKeyDown\"]],{\"templateId\":[\"onTemplateIdChanged\"]}],[0,\"verdocs-preview\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"loading\":[32],\"template\":[32]},null,{\"templateId\":[\"onTemplateIdChanged\"]}],[0,\"verdocs-send\",{\"endpoint\":[16],\"templateId\":[513,\"template-id\"],\"environment\":[1],\"containerId\":[32],\"showPickerForId\":[32],\"sessionContacts\":[32],\"sending\":[32],\"rolesCompleted\":[32],\"loading\":[32],\"template\":[32],\"reset\":[64]},null,{\"templateId\":[\"onTemplateIdChanged\"]}],[0,\"verdocs-template-roles\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"showingRoleDialog\":[32],\"sender\":[32],\"dragging\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-template-attachments\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"uploading\":[32],\"progressLabel\":[32],\"progressPercent\":[32],\"showDeleteError\":[32],\"confirmDeleteDocument\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-template-build-tabs\",{\"endpoint\":[16],\"templateId\":[1537,\"template-id\"],\"step\":[1537],\"loading\":[32],\"template\":[32]},null,{\"templateId\":[\"onTemplateIdChanged\"],\"step\":[\"onStepChanged\"]}]]]]"), options);
|
22
|
+
return index.bootstrapLazy(JSON.parse("[[\"verdocs-build.cjs\",[[0,\"verdocs-build\",{\"endpoint\":[16],\"templateId\":[1537,\"template-id\"],\"step\":[1537],\"loading\":[32],\"template\":[32]},null,{\"templateId\":[\"onTemplateIdChanged\"],\"step\":[\"onStepChanged\"]}]]],[\"verdocs-envelopes-list.cjs\",[[0,\"verdocs-envelopes-list\",{\"endpoint\":[16],\"view\":[1537],\"status\":[1537],\"sort\":[1537],\"match\":[1537],\"showPagination\":[4,\"show-pagination\"],\"rowsPerPage\":[2,\"rows-per-page\"],\"selectedPage\":[2,\"selected-page\"],\"count\":[32],\"initiallyLoaded\":[32],\"loading\":[32],\"selectedEnvelopes\":[32],\"envelopes\":[32]},null,{\"view\":[\"handleViewUpdated\"],\"status\":[\"handleStatusUpdated\"],\"sort\":[\"handleSortUpdated\"],\"match\":[\"handleMatchUpdated\"],\"selectedPage\":[\"handlePageUpdated\"]}]]],[\"verdocs-sign.cjs\",[[0,\"verdocs-sign\",{\"endpoint\":[1040],\"envelopeId\":[513,\"envelope-id\"],\"roleId\":[513,\"role-id\"],\"inviteCode\":[513,\"invite-code\"],\"headerTargetId\":[1,\"header-target-id\"],\"roleNames\":[32],\"sortedRecipients\":[32],\"recipient\":[32],\"hasSignature\":[32],\"nextButtonLabel\":[32],\"nextSubmits\":[32],\"fatalErrorHeader\":[32],\"fatalErrorMessage\":[32],\"focusedField\":[32],\"submitting\":[32],\"submitted\":[32],\"isDone\":[32],\"showDone\":[32],\"showLoadError\":[32],\"finishLater\":[32],\"showFinishLater\":[32],\"agreed\":[32],\"documentsSingularPlural\":[32],\"kbaStep\":[32],\"kbaQuestions\":[32],\"showSpinner\":[32],\"kbaChoices\":[32],\"loading\":[32],\"envelope\":[32]}]]],[\"verdocs-templates-list.cjs\",[[0,\"verdocs-templates-list\",{\"endpoint\":[16],\"visibility\":[1537],\"starred\":[1537],\"sort\":[1537],\"name\":[1537],\"allowedActions\":[1040],\"showPagination\":[4,\"show-pagination\"],\"rowsPerPage\":[2,\"rows-per-page\"],\"selectedPage\":[2,\"selected-page\"],\"count\":[32],\"initiallyLoaded\":[32],\"loading\":[32],\"confirmDelete\":[32],\"templates\":[32],\"localNameFilter\":[32]},null,{\"sharing\":[\"handleSharingUpdated\"],\"starred\":[\"handleStarredUpdated\"],\"sort\":[\"handleSortUpdated\"],\"name\":[\"handleNameUpdated\"],\"selectedPage\":[\"handlePageUpdated\"]}]]],[\"verdocs-field-payment.cjs\",[[0,\"verdocs-field-payment\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"done\":[516],\"editable\":[516],\"moveable\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"fields\":[16],\"pageNum\":[2,\"page-num\"],\"roleName\":[1,\"role-name\"],\"fieldId\":[1,\"field-id\"],\"recipients\":[8],\"selectedRoleName\":[1,\"selected-role-name\"],\"pdfPages\":[16],\"currentSignature\":[1,\"current-signature\"],\"currentSignatureId\":[1,\"current-signature-id\"],\"currentInitial\":[1,\"current-initial\"],\"currentInitialId\":[1,\"current-initial-id\"],\"signed\":[4],\"roleindex\":[2],\"showingProperties\":[32],\"focused\":[32],\"preparedMessage\":[32],\"signatureUrl\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}]]],[\"verdocs-envelope-sidebar.cjs\",[[0,\"verdocs-envelope-sidebar\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"activeTab\":[32],\"panelOpen\":[32],\"showRecipientDialog\":[32],\"showCancelDialog\":[32],\"showReinviteDialog\":[32],\"remindersEnabled\":[32],\"updatingReminders\":[32],\"initialReminder\":[32],\"followupReminders\":[32],\"loading\":[32],\"envelope\":[32]}]]],[\"verdocs-template-create.cjs\",[[0,\"verdocs-template-create\",{\"endpoint\":[16],\"maxSize\":[1026,\"max-size\"],\"file\":[32],\"creating\":[32],\"progressLabel\":[32],\"progressPercent\":[32],\"errorMessage\":[32]}]]],[\"verdocs-auth.cjs\",[[0,\"verdocs-auth\",{\"endpoint\":[16],\"visible\":[4],\"logo\":[1],\"displayMode\":[1025,\"display-mode\"],\"org_name\":[32],\"first_name\":[32],\"last_name\":[32],\"email\":[32],\"verificationCode\":[32],\"newPassword\":[32],\"password\":[32],\"confirmpass\":[32],\"submitting\":[32],\"resendDisabled\":[32],\"session\":[32],\"profile\":[32]}]]],[\"verdocs-envelope-recipient-summary.cjs\",[[0,\"verdocs-envelope-recipient-summary\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"canSendAnother\":[4,\"can-send-another\"],\"canView\":[4,\"can-view\"],\"canDone\":[4,\"can-done\"],\"isOpen\":[32],\"recipientStatusIcons\":[32],\"containerId\":[32],\"gettingLinks\":[32],\"links\":[32],\"loading\":[32],\"envelope\":[32]}]]],[\"verdocs-dialog.cjs\",[[4,\"verdocs-dialog\"]]],[\"verdocs-quick-functions.cjs\",[[0,\"verdocs-quick-functions\",{\"endpoint\":[16]}]]],[\"verdocs-radio-button.cjs\",[[0,\"verdocs-radio-button\",{\"checked\":[4],\"name\":[1],\"value\":[1],\"disabled\":[4]}]]],[\"verdocs-search-box.cjs\",[[0,\"verdocs-search-box\",{\"endpoint\":[16],\"placeholder\":[1],\"type\":[1],\"query\":[1],\"grabsFocus\":[4,\"grabs-focus\"],\"focusField\":[64]}]]],[\"verdocs-search-tabs.cjs\",[[0,\"verdocs-search-tabs\",{\"selected\":[32]}]]],[\"verdocs-table.cjs\",[[0,\"verdocs-table\",{\"columns\":[16],\"data\":[16]}]]],[\"verdocs-template-card.cjs\",[[0,\"verdocs-template-card\",{\"template\":[16]}]]],[\"verdocs-template-tags.cjs\",[[0,\"verdocs-template-tags\",{\"tags\":[16]}]]],[\"verdocs-toggle.cjs\",[[0,\"verdocs-toggle\",{\"options\":[16],\"theme\":[1],\"selectedOption\":[32]}]]],[\"verdocs-button_2.cjs\",[[0,\"verdocs-help-icon\",{\"text\":[1],\"icon\":[1],\"containerId\":[32]}],[0,\"verdocs-button\",{\"label\":[1],\"startIcon\":[1,\"start-icon\"],\"endIcon\":[1,\"end-icon\"],\"size\":[1],\"type\":[1],\"variant\":[1],\"disabled\":[4]}]]],[\"verdocs-envelope-recipient-link.cjs\",[[0,\"verdocs-envelope-recipient-link\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"roleName\":[1,\"role-name\"],\"isOpen\":[32],\"gettingLink\":[32],\"link\":[32],\"loading\":[32],\"envelope\":[32],\"recipient\":[32]}]]],[\"verdocs-status-indicator.cjs\",[[0,\"verdocs-status-indicator\",{\"size\":[1],\"theme\":[1],\"status\":[1],\"envelope\":[16],\"isOpen\":[32],\"containerId\":[32]}]]],[\"verdocs-template-star.cjs\",[[0,\"verdocs-template-star\",{\"endpoint\":[16],\"template\":[1040],\"updating\":[32]}]]],[\"verdocs-envelope-document-page.cjs\",[[0,\"verdocs-envelope-document-page\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"documentId\":[1,\"document-id\"],\"pageNumber\":[2,\"page-number\"],\"virtualWidth\":[2,\"virtual-width\"],\"virtualHeight\":[1026,\"virtual-height\"],\"layers\":[16],\"type\":[1],\"containerId\":[32],\"renderedWidth\":[32],\"renderedHeight\":[32],\"naturalWidth\":[32],\"naturalHeight\":[32],\"aspectRatio\":[32],\"skipFirstNotification\":[32],\"pageDisplayUri\":[32]}]]],[\"verdocs-switch.cjs\",[[0,\"verdocs-switch\",{\"checked\":[1028],\"theme\":[1],\"disabled\":[4]}]]],[\"verdocs-menu-panel_2.cjs\",[[0,\"verdocs-template-role-properties\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"roleName\":[1,\"role-name\"],\"dirty\":[32],\"saving\":[32],\"name\":[32],\"type\":[32],\"first_name\":[32],\"last_name\":[32],\"email\":[32],\"phone\":[32],\"delegator\":[32],\"loading\":[32],\"template\":[32]}],[4,\"verdocs-menu-panel\",{\"side\":[1],\"overlay\":[4],\"width\":[2]},[[4,\"click\",\"handleClick\"]]]]],[\"verdocs-button-panel_2.cjs\",[[4,\"verdocs-button-panel\",{\"icon\":[1],\"showPanel\":[64],\"hidePanel\":[64],\"toggle\":[64]}],[4,\"verdocs-tabs\",{\"tabs\":[16],\"selectedTab\":[2,\"selected-tab\"]}]]],[\"verdocs-pagination_2.cjs\",[[0,\"verdocs-pagination\",{\"selectedPage\":[1538,\"selected-page\"],\"itemCount\":[2,\"item-count\"],\"perPage\":[2,\"per-page\"]}],[0,\"verdocs-quick-filter\",{\"options\":[16],\"label\":[1],\"value\":[1537],\"placeholder\":[1],\"open\":[32]}]]],[\"verdocs-contact-picker_2.cjs\",[[0,\"verdocs-contact-picker\",{\"endpoint\":[16],\"templateRole\":[16],\"contactSuggestions\":[16],\"first_name\":[32],\"last_name\":[32],\"email\":[32],\"phone\":[32],\"zip\":[32],\"address\":[32],\"message\":[32],\"showSuggestions\":[32],\"showMessage\":[32],\"delegator\":[32],\"showKba\":[32],\"kba_method\":[32],\"kba_pin\":[32],\"nameFieldId\":[32],\"firstNameFieldId\":[32],\"lastNameFieldId\":[32],\"emailFieldId\":[32],\"phoneFieldId\":[32]}],[0,\"verdocs-toggle-button\",{\"active\":[4],\"icon\":[1],\"label\":[1],\"size\":[1],\"_active\":[32]}]]],[\"verdocs-file-chooser_2.cjs\",[[0,\"verdocs-file-chooser\",{\"endpoint\":[16],\"file\":[32]}],[0,\"verdocs-progress-bar\",{\"label\":[1],\"showPercent\":[4,\"show-percent\"],\"percent\":[2]}]]],[\"verdocs-organization-card_2.cjs\",[[0,\"verdocs-organization-card\",{\"organization\":[16],\"hovered\":[32]},[[1,\"mouseover\",\"onMouseOver\"],[1,\"mouseout\",\"onMouseOut\"]]],[4,\"verdocs-portal\",{\"anchor\":[1],\"voffset\":[2]},[[11,\"scroll\",\"handleScroll\"],[9,\"resize\",\"handleResize\"],[4,\"click\",\"handleClick\"]]]]],[\"verdocs-dropdown.cjs\",[[0,\"verdocs-dropdown\",{\"options\":[16],\"containerId\":[32],\"showPicker\":[32]}]]],[\"verdocs-ok-dialog.cjs\",[[0,\"verdocs-ok-dialog\",{\"heading\":[1],\"message\":[1],\"buttonLabel\":[1,\"button-label\"],\"showCancel\":[4,\"show-cancel\"],\"closed\":[32]}]]],[\"verdocs-checkbox_6.cjs\",[[0,\"verdocs-template-field-properties\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"fieldName\":[1025,\"field-name\"],\"helpText\":[1,\"help-text\"],\"dirty\":[32],\"label\":[32],\"type\":[32],\"name\":[32],\"required\":[32],\"roleName\":[32],\"group\":[32],\"fieldType\":[32],\"options\":[32],\"placeholder\":[32],\"defaultValue\":[32],\"showingHelp\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-checkbox\",{\"checked\":[4],\"name\":[1],\"label\":[1],\"value\":[1],\"theme\":[1],\"disabled\":[4]}],[0,\"verdocs-select-input\",{\"value\":[1],\"label\":[1],\"options\":[16],\"disabled\":[4]}],[0,\"verdocs-component-error\",{\"message\":[1]}],[0,\"verdocs-loader\"],[0,\"verdocs-text-input\",{\"value\":[1537],\"label\":[1],\"placeholder\":[1],\"autocomplete\":[1],\"helpText\":[1,\"help-text\"],\"clearable\":[4],\"copyable\":[4],\"type\":[1],\"disabled\":[4],\"required\":[4],\"showingPw\":[32]}]]],[\"verdocs-kba-dialog_2.cjs\",[[0,\"verdocs-view\",{\"endpoint\":[16],\"envelopeId\":[1,\"envelope-id\"],\"headerTargetId\":[1,\"header-target-id\"],\"canceling\":[32],\"showCancelDone\":[32],\"showLoadError\":[32],\"loading\":[32],\"envelope\":[32]}],[0,\"verdocs-kba-dialog\",{\"step\":[2],\"steps\":[2],\"helptitle\":[1],\"helptext\":[1],\"mode\":[1],\"label\":[1],\"placeholder\":[1],\"recipient\":[16],\"choices\":[16],\"response\":[32],\"updatedRecipient\":[32]}]]],[\"verdocs-field-attachment_13.cjs\",[[0,\"verdocs-field-attachment\",{\"endpoint\":[16],\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"dialogOpen\":[32],\"selectedFile\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-initial\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"initials\":[513],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"tempInitials\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-signature\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"name\":[513],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"tempSignature\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-checkbox\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"done\":[516],\"editable\":[516],\"moveable\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-date\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"field\":[16],\"containerId\":[32],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-dropdown\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-radio\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"required\":[516],\"done\":[516],\"editable\":[516],\"moveable\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-textarea\",{\"endpoint\":[16],\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-textbox\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"multiline\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[514],\"showingProperties\":[32],\"focused\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-field-timestamp\",{\"source\":[513],\"sourceid\":[513],\"fieldname\":[513],\"field\":[16],\"disabled\":[516],\"editable\":[516],\"moveable\":[516],\"done\":[516],\"xscale\":[514],\"yscale\":[514],\"pagenumber\":[2],\"showingProperties\":[32],\"focusField\":[64],\"showSettingsPanel\":[64],\"hideSettingsPanel\":[64]}],[0,\"verdocs-initial-dialog\",{\"initials\":[1],\"fontLoaded\":[32],\"enteredInitials\":[32],\"mode\":[32]}],[0,\"verdocs-signature-dialog\",{\"name\":[1],\"fontLoaded\":[32],\"enteredName\":[32],\"mode\":[32]}],[0,\"verdocs-upload-dialog\",{\"maxSize\":[1026,\"max-size\"],\"existingFile\":[1032,\"existing-file\"],\"draggingOver\":[32],\"confirmDelete\":[32],\"selectedFiles\":[32],\"errorMessage\":[32]}]]],[\"verdocs-template-document-page_2.cjs\",[[0,\"verdocs-toolbar-icon\",{\"text\":[1],\"icon\":[1],\"placement\":[1],\"containerId\":[32]}],[0,\"verdocs-template-document-page\",{\"endpoint\":[16],\"editable\":[4],\"disabled\":[4],\"done\":[4],\"templateId\":[1,\"template-id\"],\"documentId\":[1,\"document-id\"],\"pageNumber\":[2,\"page-number\"],\"virtualWidth\":[2,\"virtual-width\"],\"virtualHeight\":[1026,\"virtual-height\"],\"layers\":[16],\"containerId\":[32],\"renderedWidth\":[32],\"renderedHeight\":[32],\"naturalWidth\":[32],\"naturalHeight\":[32],\"aspectRatio\":[32],\"skipFirstNotification\":[32],\"pageDisplayUri\":[32],\"xScale\":[32],\"yScale\":[32],\"loading\":[32],\"template\":[32]}]]],[\"verdocs-spinner.cjs\",[[0,\"verdocs-spinner\",{\"size\":[2],\"mode\":[1]}]]],[\"verdocs-preview_7.cjs\",[[0,\"verdocs-template-fields\",{\"endpoint\":[16],\"templateId\":[1537,\"template-id\"],\"toolbarTargetId\":[1,\"toolbar-target-id\"],\"placing\":[32],\"showMustSelectRole\":[32],\"selectedRoleName\":[32],\"loading\":[32],\"template\":[32]},[[4,\"keydown\",\"handleKeyDown\"]],{\"templateId\":[\"onTemplateIdChanged\"]}],[0,\"verdocs-preview\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"loading\":[32],\"template\":[32]},null,{\"templateId\":[\"onTemplateIdChanged\"]}],[0,\"verdocs-send\",{\"endpoint\":[16],\"templateId\":[513,\"template-id\"],\"environment\":[1],\"containerId\":[32],\"showPickerForId\":[32],\"sessionContacts\":[32],\"sending\":[32],\"rolesCompleted\":[32],\"loading\":[32],\"template\":[32],\"reset\":[64]},null,{\"templateId\":[\"onTemplateIdChanged\"]}],[0,\"verdocs-template-roles\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"showingRoleDialog\":[32],\"sender\":[32],\"dragging\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-template-settings\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"name\":[32],\"visibility\":[32],\"sender\":[32],\"sendReminders\":[32],\"initialReminder\":[32],\"followupReminders\":[32],\"dirty\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-template-attachments\",{\"endpoint\":[16],\"templateId\":[1,\"template-id\"],\"uploading\":[32],\"progressLabel\":[32],\"progressPercent\":[32],\"showDeleteError\":[32],\"confirmDeleteDocument\":[32],\"loading\":[32],\"template\":[32]}],[0,\"verdocs-template-build-tabs\",{\"endpoint\":[16],\"templateId\":[1537,\"template-id\"],\"step\":[1537],\"loading\":[32],\"template\":[32]},null,{\"templateId\":[\"onTemplateIdChanged\"],\"step\":[\"onStepChanged\"]}]]]]"), options);
|
23
23
|
});
|
24
24
|
|
25
25
|
exports.setNonce = index.setNonce;
|
@@ -67,6 +67,7 @@
|
|
67
67
|
"components/templates/verdocs-template-fields/verdocs-template-fields.js",
|
68
68
|
"components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js",
|
69
69
|
"components/templates/verdocs-template-roles/verdocs-template-roles.js",
|
70
|
+
"components/templates/verdocs-template-settings/verdocs-template-settings.js",
|
70
71
|
"components/templates/verdocs-template-star/verdocs-template-star.js",
|
71
72
|
"components/templates/verdocs-template-tags/verdocs-template-tags.js"
|
72
73
|
],
|
@@ -49,10 +49,10 @@ verdocs-switch .slider {
|
|
49
49
|
transition-duration: 150ms;
|
50
50
|
}
|
51
51
|
verdocs-switch .slider[data-state=checked] {
|
52
|
-
transform: translateX(
|
52
|
+
transform: translateX(16px);
|
53
53
|
}
|
54
54
|
verdocs-switch .slider[data-state=unchecked] {
|
55
|
-
transform: translateX(
|
55
|
+
transform: translateX(-4px);
|
56
56
|
}
|
57
57
|
verdocs-switch .switch.disabled.primary,
|
58
58
|
verdocs-switch .switch.disabled.secondary {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { h } from "@stencil/core";
|
2
2
|
/**
|
3
|
-
* Displays a toggle switch
|
3
|
+
* Displays a toggle switch
|
4
4
|
*
|
5
5
|
* ```ts
|
6
6
|
* <verdocs-switch checked={sendReminders} onCheckedChange={setSendReminders} />
|
@@ -13,13 +13,13 @@ export class VerdocsSwitch {
|
|
13
13
|
this.disabled = false;
|
14
14
|
}
|
15
15
|
render() {
|
16
|
-
return (h("button", { key: '
|
16
|
+
return (h("button", { key: 'fc02b9a9fb89d4c181a43379311d2cacf3ab136d', value: "on", type: "button", role: "switch", class: `switch ${this.theme} ${this.disabled ? 'disabled' : ''}`, "data-state": this.checked ? 'checked' : 'unchecked', "aria-checked": this.checked ? 'checked' : 'unchecked', onClick: () => {
|
17
17
|
var _a;
|
18
18
|
if (!this.disabled) {
|
19
19
|
this.checked = !this.checked;
|
20
20
|
(_a = this.checkedChange) === null || _a === void 0 ? void 0 : _a.emit(this.checked);
|
21
21
|
}
|
22
|
-
} }, h("span", { key: '
|
22
|
+
} }, h("span", { key: '6250418f78aa5293ae3a21e4ecbfd6b8ebd6c80f', "data-state": this.checked ? 'checked' : 'unchecked', class: "slider" })));
|
23
23
|
}
|
24
24
|
static get is() { return "verdocs-switch"; }
|
25
25
|
static get originalStyleUrls() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"verdocs-switch.js","sourceRoot":"","sources":["../../../../src/components/controls/verdocs-switch/verdocs-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAgB,KAAK,EAAC,MAAM,eAAe,CAAC;AAEtE;;;;;;GAMG;AAKH,MAAM,OAAO,aAAa;;uBACkB,KAAK;qBAKN,SAAS;wBAKtB,KAAK;;IAIjC,MAAM;QACJ,OAAO,CACL,+DACE,KAAK,EAAC,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,UAAU,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,gBACpD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,kBACpC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EACpD,OAAO,EAAE,GAAG,EAAE;;gBACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACnB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC7B,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YAED,2EAAkB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,EAAC,QAAQ,GAAQ,CACzE,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, h, EventEmitter, Event} from '@stencil/core';\n\n/**\n * Displays a toggle switch
|
1
|
+
{"version":3,"file":"verdocs-switch.js","sourceRoot":"","sources":["../../../../src/components/controls/verdocs-switch/verdocs-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAgB,KAAK,EAAC,MAAM,eAAe,CAAC;AAEtE;;;;;;GAMG;AAKH,MAAM,OAAO,aAAa;;uBACkB,KAAK;qBAKN,SAAS;wBAKtB,KAAK;;IAIjC,MAAM;QACJ,OAAO,CACL,+DACE,KAAK,EAAC,IAAI,EACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,UAAU,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,gBACpD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,kBACpC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EACpD,OAAO,EAAE,GAAG,EAAE;;gBACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACnB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC7B,MAAA,IAAI,CAAC,aAAa,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YAED,2EAAkB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,EAAC,QAAQ,GAAQ,CACzE,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, h, EventEmitter, Event} from '@stencil/core';\n\n/**\n * Displays a toggle switch\n *\n * ```ts\n * <verdocs-switch checked={sendReminders} onCheckedChange={setSendReminders} />\n * ```\n */\n@Component({\n tag: 'verdocs-switch',\n styleUrl: 'verdocs-switch.scss',\n})\nexport class VerdocsSwitch {\n @Prop({mutable: true}) checked: boolean = false;\n\n /**\n * Select purple or green treatments.\n */\n @Prop() theme: 'primary' | 'secondary' = 'primary';\n\n /**\n * Should the field be disabled?\n */\n @Prop() disabled: boolean = false;\n\n @Event({composed: true}) checkedChange: EventEmitter<boolean>;\n\n render() {\n return (\n <button\n value=\"on\"\n type=\"button\"\n role=\"switch\"\n class={`switch ${this.theme} ${this.disabled ? 'disabled' : ''}`}\n data-state={this.checked ? 'checked' : 'unchecked'}\n aria-checked={this.checked ? 'checked' : 'unchecked'}\n onClick={() => {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.checkedChange?.emit(this.checked);\n }\n }}\n >\n <span data-state={this.checked ? 'checked' : 'unchecked'} class=\"slider\"></span>\n </button>\n );\n }\n}\n"]}
|
@@ -116,7 +116,7 @@ export class VerdocsBuild {
|
|
116
116
|
if (!this.endpoint.session) {
|
117
117
|
return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
118
118
|
}
|
119
|
-
return (h(Host, null, h("div", { class: "content" }, h("verdocs-template-build-tabs", { endpoint: this.endpoint, templateId: this.templateId, step: this.step, onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, onStepChanged: e => this.handleStepChanged(e.detail) }), this.step === 'attachments' && (h("verdocs-template-attachments", { templateId: this.templateId, endpoint: this.endpoint, onExit: () => this.handleCancel(), onNext: () => this.handleAttachmentsNext(), onTemplateUpdated: e => this.handleTemplateUpdated(e) })), this.step === 'roles' && (h("verdocs-template-roles", { templateId: this.templateId, endpoint: this.endpoint, onExit: () => this.handleCancel(), onNext: () => this.handleRolesNext(), onRolesUpdated: e => this.handleRolesUpdated(e) })), this.step === 'settings' &&
|
119
|
+
return (h(Host, null, h("div", { class: "content" }, h("verdocs-template-build-tabs", { endpoint: this.endpoint, templateId: this.templateId, step: this.step, onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, onStepChanged: e => this.handleStepChanged(e.detail) }), this.step === 'attachments' && (h("verdocs-template-attachments", { templateId: this.templateId, endpoint: this.endpoint, onExit: () => this.handleCancel(), onNext: () => this.handleAttachmentsNext(), onTemplateUpdated: e => this.handleTemplateUpdated(e) })), this.step === 'roles' && (h("verdocs-template-roles", { templateId: this.templateId, endpoint: this.endpoint, onExit: () => this.handleCancel(), onNext: () => this.handleRolesNext(), onRolesUpdated: e => this.handleRolesUpdated(e) })), this.step === 'settings' && h("verdocs-template-settings", { templateId: this.templateId, endpoint: this.endpoint, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), this.step === 'fields' && h("verdocs-template-fields", { templateId: this.templateId, endpoint: this.endpoint, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), this.step === 'preview' && (h("div", { class: "preview-container" }, h("div", { class: "preview-send-wrapper" }, h("verdocs-send", { templateId: this.templateId, endpoint: this.endpoint, onSend: e => { var _a; return (_a = this.send) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, style: { width: '100%' } })), h("div", { class: "preview-preview-wrapper" }, h("verdocs-preview", { templateId: this.templateId, endpoint: this.endpoint, style: { display: 'flex', flex: '1', maxWidth: '1000px' } })))))));
|
120
120
|
}
|
121
121
|
static get is() { return "verdocs-build"; }
|
122
122
|
static get originalStyleUrls() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"verdocs-build.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-build/verdocs-build.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAA8C,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACnG,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAI/C;;;;;;;;;GASG;AAMH,MAAM,OAAO,YAAY;;QACf,uBAAkB,GAAG,IAAI,CAAC;wBAOE,eAAe,CAAC,UAAU,EAAE;0BAOE,IAAI;oBAKN,SAAS;uBAiCtD,IAAI;wBACe,IAAI;;IAG1C,mBAAmB,CAAC,aAAqB,EAAE,aAAqB;QAC9D,IAAI,CAAC,aAAa,IAAI,aAAa,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YACnE,IAAI,CAAC,IAAI,GAAG,SA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M,CAAC,CAAA,EAAA,EAAE,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GAAI,CAClI;oBACN,WAAK,KAAK,EAAC,yBAAyB;wBAClC,uBAAiB,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAC,GAAI,CAC9H,CACF,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {getTemplate, ICreateEnvelopeRecipient, IRole, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Element, Event, EventEmitter, Host, Watch, State} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nexport type TVerdocsBuildStep = 'attachments' | 'roles' | 'settings' | 'fields' | 'preview';\n\n/**\n * Display a template building experience. Several event callbacks provide status updates to the\n * parent application to support interface updates.\n *\n * ```ts\n * <verdocs-build templateId={templateId} step=\"preview\" onSend={(detail) => {\n * console.log('Sent envelope from template', detail);\n * }} />\n * ```\n */\n@Component({\n tag: 'verdocs-build',\n styleUrl: 'verdocs-build.scss',\n shadow: false,\n})\nexport class VerdocsBuild {\n private templateListenerId = null;\n\n @Element() el!: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from. Unlike most other components, this is an optional parameter here.\n * If the template ID is known, `step` may also be specified to force displaying a specific step in the creation process.\n * If it is not specified, `step` will be ignored and the create step will be shown.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * The step in the creation process to display.\n */\n @Prop({reflect: true, mutable: true}) step: TVerdocsBuildStep = 'preview';\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user selects a different step.\n */\n @Event({composed: true}) stepChanged: EventEmitter<TVerdocsBuildStep>;\n\n /**\n * The user completed the Send form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string}>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when the template is created by the upload step.\n */\n @Event({composed: true}) templateCreated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when roles are updated in the roles step.\n */\n @Event({composed: true}) rolesUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; roles: IRole[]}>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string, oldTemplateId: string) {\n if (!oldTemplateId && newTemplateId && this.step === 'attachments') {\n this.step = 'preview';\n }\n\n this.loadTemplate(newTemplateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n @Watch('step')\n onStepChanged() {\n // We reload the template here even if only the step changed in case\n // we were out of sync before\n this.loadTemplate(this.templateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[BUILD] No template ID, activating upload mode`);\n this.step = 'attachments';\n return;\n }\n\n try {\n this.loadTemplate(this.templateId).catch(e => console.log('[BUILD] Unable to load template', e));\n } catch (e) {\n console.log('[BUILD] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n } catch (e) {\n console.log('[BUILD] Error with builder session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async loadTemplate(templateId: string) {\n if (templateId) {\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n }\n\n disconnectedCallback() {\n console.log('[BUILD] Disconnected');\n this.unlistenToTemplate();\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n handleCancel() {\n this.step = 'preview';\n }\n\n async handleTemplateCreated(templateId: string) {\n await this.loadTemplate(templateId);\n this.templateId = templateId;\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n async handleRolesUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n async handleTemplateUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n handleAttachmentsNext() {\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n handleRolesNext() {\n this.step = 'fields';\n this.stepChanged?.emit('fields');\n }\n\n handleStepChanged(step: TVerdocsBuildStep) {\n this.step = step;\n this.stepChanged?.emit(step);\n }\n\n render() {\n if (this.loading) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"content\">\n <verdocs-template-build-tabs\n endpoint={this.endpoint}\n templateId={this.templateId}\n step={this.step}\n onSdkError={e => this.sdkError?.emit(e.detail)}\n onStepChanged={e => this.handleStepChanged(e.detail)}\n />\n\n {this.step === 'attachments' && (\n <verdocs-template-attachments\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleAttachmentsNext()}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n )}\n\n {this.step === 'roles' && (\n <verdocs-template-roles\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleRolesNext()}\n onRolesUpdated={e => this.handleRolesUpdated(e)}\n />\n )}\n\n {this.step === 'settings' && (\n <div style={{flexDirection: 'column', gap: '20px', display: 'flex', maxWidth: '400px', margin: '20px'}}>\n <verdocs-template-name\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n <verdocs-template-reminders\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n <verdocs-template-visibility\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n </div>\n )}\n\n {this.step === 'fields' && <verdocs-template-fields templateId={this.templateId} endpoint={this.endpoint} onTemplateUpdated={e => this.handleTemplateUpdated(e)} />}\n\n {this.step === 'preview' && (\n <div class=\"preview-container\">\n <div class=\"preview-send-wrapper\">\n <verdocs-send templateId={this.templateId} endpoint={this.endpoint} onSend={e => this.send?.emit(e.detail)} style={{width: '100%'}} />\n </div>\n <div class=\"preview-preview-wrapper\">\n <verdocs-preview templateId={this.templateId} endpoint={this.endpoint} style={{display: 'flex', flex: '1', maxWidth: '1000px'}} />\n </div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"verdocs-build.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-build/verdocs-build.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAA8C,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACzG,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACnG,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAI/C;;;;;;;;;GASG;AAMH,MAAM,OAAO,YAAY;;QACf,uBAAkB,GAAG,IAAI,CAAC;wBAOE,eAAe,CAAC,UAAU,EAAE;0BAOE,IAAI;oBAKN,SAAS;uBAiCtD,IAAI;wBACe,IAAI;;IAG1C,mBAAmB,CAAC,aAAqB,EAAE,aAAqB;QAC9D,IAAI,CAAC,aAAa,IAAI,aAAa,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YACnE,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;IAGD,aAAa;QACX,oEAAoE;QACpE,6BAA6B;QAC7B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,KAAK,CAAC,iBAAiB;;QACrB,IAAI,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,WAAW,EAA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,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA,EAAA,EAAE,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,GAAI,CAClI;oBACN,WAAK,KAAK,EAAC,yBAAyB;wBAClC,uBAAiB,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAC,GAAI,CAC9H,CACF,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {getTemplate, ICreateEnvelopeRecipient, IRole, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Element, Event, EventEmitter, Host, Watch, State} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nexport type TVerdocsBuildStep = 'attachments' | 'roles' | 'settings' | 'fields' | 'preview';\n\n/**\n * Display a template building experience. Several event callbacks provide status updates to the\n * parent application to support interface updates.\n *\n * ```ts\n * <verdocs-build templateId={templateId} step=\"preview\" onSend={(detail) => {\n * console.log('Sent envelope from template', detail);\n * }} />\n * ```\n */\n@Component({\n tag: 'verdocs-build',\n styleUrl: 'verdocs-build.scss',\n shadow: false,\n})\nexport class VerdocsBuild {\n private templateListenerId = null;\n\n @Element() el!: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from. Unlike most other components, this is an optional parameter here.\n * If the template ID is known, `step` may also be specified to force displaying a specific step in the creation process.\n * If it is not specified, `step` will be ignored and the create step will be shown.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * The step in the creation process to display.\n */\n @Prop({reflect: true, mutable: true}) step: TVerdocsBuildStep = 'preview';\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user selects a different step.\n */\n @Event({composed: true}) stepChanged: EventEmitter<TVerdocsBuildStep>;\n\n /**\n * The user completed the Send form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string}>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when the template is created by the upload step.\n */\n @Event({composed: true}) templateCreated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when roles are updated in the roles step.\n */\n @Event({composed: true}) rolesUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; roles: IRole[]}>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string, oldTemplateId: string) {\n if (!oldTemplateId && newTemplateId && this.step === 'attachments') {\n this.step = 'preview';\n }\n\n this.loadTemplate(newTemplateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n @Watch('step')\n onStepChanged() {\n // We reload the template here even if only the step changed in case\n // we were out of sync before\n this.loadTemplate(this.templateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[BUILD] No template ID, activating upload mode`);\n this.step = 'attachments';\n return;\n }\n\n try {\n this.loadTemplate(this.templateId).catch(e => console.log('[BUILD] Unable to load template', e));\n } catch (e) {\n console.log('[BUILD] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n } catch (e) {\n console.log('[BUILD] Error with builder session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async loadTemplate(templateId: string) {\n if (templateId) {\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n }\n\n disconnectedCallback() {\n console.log('[BUILD] Disconnected');\n this.unlistenToTemplate();\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n handleCancel() {\n this.step = 'preview';\n }\n\n async handleTemplateCreated(templateId: string) {\n await this.loadTemplate(templateId);\n this.templateId = templateId;\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n async handleRolesUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n async handleTemplateUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n handleAttachmentsNext() {\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n handleRolesNext() {\n this.step = 'fields';\n this.stepChanged?.emit('fields');\n }\n\n handleStepChanged(step: TVerdocsBuildStep) {\n this.step = step;\n this.stepChanged?.emit(step);\n }\n\n render() {\n if (this.loading) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"content\">\n <verdocs-template-build-tabs\n endpoint={this.endpoint}\n templateId={this.templateId}\n step={this.step}\n onSdkError={e => this.sdkError?.emit(e.detail)}\n onStepChanged={e => this.handleStepChanged(e.detail)}\n />\n\n {this.step === 'attachments' && (\n <verdocs-template-attachments\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleAttachmentsNext()}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n )}\n\n {this.step === 'roles' && (\n <verdocs-template-roles\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleRolesNext()}\n onRolesUpdated={e => this.handleRolesUpdated(e)}\n />\n )}\n\n {this.step === 'settings' && <verdocs-template-settings templateId={this.templateId} endpoint={this.endpoint} onTemplateUpdated={e => this.handleTemplateUpdated(e)} />}\n\n {this.step === 'fields' && <verdocs-template-fields templateId={this.templateId} endpoint={this.endpoint} onTemplateUpdated={e => this.handleTemplateUpdated(e)} />}\n\n {this.step === 'preview' && (\n <div class=\"preview-container\">\n <div class=\"preview-send-wrapper\">\n <verdocs-send templateId={this.templateId} endpoint={this.endpoint} onSend={e => this.send?.emit(e.detail)} style={{width: '100%'}} />\n </div>\n <div class=\"preview-preview-wrapper\">\n <verdocs-preview templateId={this.templateId} endpoint={this.endpoint} style={{display: 'flex', flex: '1', maxWidth: '1000px'}} />\n </div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -45,7 +45,8 @@ export class VerdocsSend {
|
|
45
45
|
async listenToTemplate() {
|
46
46
|
console.log('[SEND] Loading template', this.templateId);
|
47
47
|
this.unlistenToTemplate();
|
48
|
-
Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId),
|
48
|
+
Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId), true, (template) => {
|
49
|
+
console.log('[SEND] Got new template', template);
|
49
50
|
this.template = template;
|
50
51
|
this.loading = false;
|
51
52
|
this.rolesCompleted = {};
|
@@ -123,7 +124,7 @@ export class VerdocsSend {
|
|
123
124
|
}
|
124
125
|
});
|
125
126
|
}
|
126
|
-
|
127
|
+
getSequenceNumbers() {
|
127
128
|
var _a;
|
128
129
|
// TODO: This is cleaner with a Set but we found a regression in some target environments where
|
129
130
|
// this breaks down. Reverting to an older technique while we diagnose it.
|
@@ -131,9 +132,8 @@ export class VerdocsSend {
|
|
131
132
|
(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || []).forEach(role => {
|
132
133
|
sequences[role.sequence] = true;
|
133
134
|
});
|
134
|
-
console.log('[SEND] Sequences', sequences);
|
135
135
|
return Object.keys(sequences)
|
136
|
-
.map(s => +s
|
136
|
+
.map(s => +s)
|
137
137
|
.sort((a, b) => a - b);
|
138
138
|
// const levels = [...new Set((this.template?.roles || []).map(role => role.sequence - 1))];
|
139
139
|
// levels.sort((a, b) => a - b);
|
@@ -142,7 +142,7 @@ export class VerdocsSend {
|
|
142
142
|
getRolesAtLevel(level) {
|
143
143
|
var _a;
|
144
144
|
const rolesAtLevel = (((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])
|
145
|
-
.filter(role => role.sequence
|
145
|
+
.filter(role => role.sequence === level)
|
146
146
|
.map((role, index) => ({
|
147
147
|
...role,
|
148
148
|
id: `r-${level}-${index}`,
|
@@ -153,11 +153,10 @@ export class VerdocsSend {
|
|
153
153
|
return rolesAtLevel;
|
154
154
|
}
|
155
155
|
getLevelIcon(level) {
|
156
|
-
|
157
|
-
if (level < 0) {
|
156
|
+
if (level === 'start') {
|
158
157
|
return h("div", { class: "level-icon", innerHTML: startIcon });
|
159
158
|
}
|
160
|
-
else if (level
|
159
|
+
else if (level === 'end') {
|
161
160
|
return h("div", { class: "level-icon", innerHTML: doneIcon });
|
162
161
|
}
|
163
162
|
else {
|
@@ -229,16 +228,13 @@ export class VerdocsSend {
|
|
229
228
|
if (!this.endpoint.session) {
|
230
229
|
return (h(Host, { style: { display: 'flex' } }, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
231
230
|
}
|
232
|
-
const levels = this.
|
231
|
+
const levels = this.getSequenceNumbers();
|
233
232
|
console.log('[SEND] Rendering levels', levels);
|
234
233
|
const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) && recipient.first_name && recipient.last_name);
|
235
234
|
// TODO: Reactivate once SMS is re-enabled
|
236
235
|
// const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) || isValidPhone(recipient.phone));
|
237
236
|
const allRolesAssigned = rolesAssigned.length >= getRoleNames(this.template).length;
|
238
|
-
return (h(Host, { class: { sendable: (_a = this.template) === null || _a === void 0 ? void 0 : _a.is_sendable } }, h("div", { class: "recipients" }, h("div", { class: "left-line" }), h("div", { class: `level level-start` }, this.getLevelIcon(
|
239
|
-
console.log('Rendering level', level, this.getRolesAtLevel(level));
|
240
|
-
return '';
|
241
|
-
}, this.getRolesAtLevel(level).map(role => {
|
237
|
+
return (h(Host, { class: { sendable: (_a = this.template) === null || _a === void 0 ? void 0 : _a.is_sendable } }, h("div", { class: "recipients" }, h("div", { class: "left-line" }), h("div", { class: `level level-start` }, this.getLevelIcon('start'), h("div", { class: "complete" }, "Send Envelope")), levels.map(level => (h("div", { class: `level level-${level}` }, this.getLevelIcon('sequence'), this.getRolesAtLevel(level).map(role => {
|
242
238
|
var _a, _b, _c;
|
243
239
|
const unknown = !role.email || !role.first_name || !role.last_name;
|
244
240
|
const roleName = ((_a = this.rolesCompleted[role.id]) === null || _a === void 0 ? void 0 : _a.first_name) ? formatFullName(this.rolesCompleted[role.id]) : unknown ? role.role_name : formatFullName(role);
|
@@ -251,7 +247,7 @@ export class VerdocsSend {
|
|
251
247
|
border: completed ? '2px solid #55bc81' : '2px solid #dddddd',
|
252
248
|
};
|
253
249
|
return unknown ? (h("div", { class: "recipient", "data-ri": roleIndex, "data-rn": role.role_name, style: style, onClick: e => this.handleClickRole(e, role), id: elId }, roleName, h("div", { class: "icon", innerHTML: editIcon }), this.showPickerForId === role.id && (h("verdocs-portal", { anchor: elId, onClickAway: () => (this.showPickerForId = '') }, h("verdocs-contact-picker", { onExit: () => (this.showPickerForId = ''), onNext: e => this.handleSelectContact(e, role), contactSuggestions: this.sessionContacts, templateRole: (_b = this.rolesCompleted[role.id]) !== null && _b !== void 0 ? _b : role, onSearchContacts: e => { var _a; return (_a = this.searchContacts) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } }))))) : (h("div", { class: "recipient", "data-ri": roleIndex, "data-rn": role.role_name, style: style, onClick: e => this.handleClickRole(e, role), id: elId }, roleName, h("div", { class: "icon", innerHTML: editIcon }), this.showPickerForId === role.id && (h("verdocs-portal", { anchor: elId, onClickAway: () => (this.showPickerForId = '') }, h("verdocs-contact-picker", { onExit: () => (this.showPickerForId = ''), onNext: e => this.handleSelectContact(e, role), contactSuggestions: this.sessionContacts, templateRole: ((_c = this.rolesCompleted[role.id]) !== null && _c !== void 0 ? _c : role), onSearchContacts: e => { var _a; return (_a = this.searchContacts) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } })))));
|
254
|
-
})))), h("div", { class: `level level-done` }, this.getLevelIcon(
|
250
|
+
})))), h("div", { class: `level level-done` }, this.getLevelIcon('end'), h("div", { class: "complete" }, "Signing Complete"))), h("div", { class: "buttons" }, h("verdocs-button", { label: "Cancel", size: "small", variant: "outline", onClick: e => this.handleCancel(e), disabled: this.sending }), h("verdocs-button", { label: "Send", size: "small", disabled: !allRolesAssigned || this.sending, onClick: e => this.handleSend(e) }), this.sending && h("verdocs-spinner", null))));
|
255
251
|
}
|
256
252
|
static get is() { return "verdocs-send"; }
|
257
253
|
static get originalStyleUrls() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"verdocs-send.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-send/verdocs-send.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,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ACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport {createEnvelope, formatFullName, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipient, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst editIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"></path></svg>';\n\nconst startIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><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>';\n\nconst stepIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><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>';\n\nconst doneIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><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>';\n\n/**\n * Display a form to send a template to one or more recipients in an envelope for signing.\n * Host applications should ensure the template is \"sendable\" before displaying this component.\n * To be sendable, a template must have at least one document attached, at least one participant\n * defined, and at least one field assigned to every \"signer\" participant. This component will\n * hide itself if the template is not sendable.\n *\n * ```ts\n * <verdocs-send\n * templateId={templateId}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={(e) => { console.log('Send cancelled.', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-send',\n styleUrl: 'verdocs-send.scss',\n shadow: false,\n})\nexport class VerdocsSend {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true}) templateId: string | null = null;\n\n /**\n * The environment the control is being called from, e.g. 'web'. This has an impact on how certain\n * operations such as email communications are handled to ensure users receive the correct URLs for\n * their invitations. Setting this to unknown values may produce unexpected/incorrect behaviors.\n * If environment is not known, do this set this property.\n */\n @Prop() environment: string = '';\n\n /**\n * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string}>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string; envelope_id: string; envelope: IEnvelope}>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user enters text in a search field. The parent application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() showPickerForId = '';\n @State() sessionContacts = [];\n @State() sending = false;\n @State() rolesCompleted: Record<string, Partial<IRecipient>> = {};\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n console.log('[SEND] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n this.rolesCompleted = {};\n this.recomputeRolesCompleted();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method() async reset() {\n this.rolesCompleted = {};\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[SEND] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.onSessionChanged((_endpoint, _session, profile) => {\n if (!profile) {\n return;\n }\n\n const me = {\n id: profile.id,\n first_name: profile.first_name,\n last_name: profile.last_name,\n email: profile.email,\n phone: profile.phone,\n };\n\n if (profile) {\n this.sessionContacts = [me];\n\n getOrganizationContacts(this.endpoint)\n .then(contacts => {\n console.log('[SEND] Got contacts', contacts);\n this.sessionContacts = [...contacts, me];\n })\n .catch(e => {\n console.log('[SEND] Error getting contacts', e);\n });\n }\n });\n\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[SEND] Unable to start Send operation, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[SEND] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SEND] Error with send session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n recomputeRolesCompleted() {\n this.rolesCompleted = {};\n\n const rolesAtLevel: Record<number, Partial<IRecipient>[]> = {};\n (this.template?.roles || []).forEach(role => {\n const level = role.sequence - 1;\n rolesAtLevel[level] ||= [];\n const id = `r-${level}-${rolesAtLevel[level].length}`;\n rolesAtLevel[level].push({...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name});\n\n // TODO: Re-activate once SMS is re-enabled\n // if (role.first_name && (isValidEmail(role.email) || isValidPhone(role.phone))) {\n if (role.first_name && isValidEmail(role.email)) {\n this.rolesCompleted[id] = {...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name};\n }\n });\n }\n\n getLevels() {\n // TODO: This is cleaner with a Set but we found a regression in some target environments where\n // this breaks down. Reverting to an older technique while we diagnose it.\n const sequences: Record<number, boolean> = {};\n (this.template?.roles || []).forEach(role => {\n sequences[role.sequence] = true;\n });\n console.log('[SEND] Sequences', sequences);\n return Object.keys(sequences)\n .map(s => +s - 1) // We subtract 1 here because the sequence is 1-based and our rendering is 0-based\n .sort((a, b) => a - b);\n\n // const levels = [...new Set((this.template?.roles || []).map(role => role.sequence - 1))];\n // levels.sort((a, b) => a - b);\n // return levels;\n }\n\n getRolesAtLevel(level: number) {\n const rolesAtLevel = (this.template?.roles || [])\n .filter(role => role.sequence - 1 === level)\n .map((role, index) => ({\n ...role,\n id: `r-${level}-${index}`,\n role_name: role.name,\n first_name: role.first_name,\n last_name: role.last_name,\n }));\n return rolesAtLevel as Partial<IRecipient>[];\n }\n\n getLevelIcon(level: number) {\n const levels = this.getLevels();\n if (level < 0) {\n return <div class=\"level-icon\" innerHTML={startIcon} />;\n } else if (level >= levels.length) {\n return <div class=\"level-icon\" innerHTML={doneIcon} />;\n } else {\n return <div class=\"level-icon\" innerHTML={stepIcon} />;\n }\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n e.preventDefault();\n this.rolesCompleted[role.id] = {...role, ...e.detail};\n this.showPickerForId = '';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.showPickerForId = role.id;\n }\n\n handleSend(e: any) {\n if (this.sending) {\n console.log('[SEND] Skipping duplicate send', e);\n return;\n }\n\n console.log('[SEND] Sending', e);\n e.preventDefault();\n e.stopPropagation();\n\n this.sending = true;\n\n const details: ICreateEnvelopeFromTemplateRequest = {\n template_id: this.templateId,\n name: this.template?.name || 'New Envelope',\n environment: this.environment,\n initial_reminder: 0,\n followup_reminders: 0,\n recipients: Object.values(this.rolesCompleted) as ICreateEnvelopeRecipient[],\n // TODO: Pre-filled fields support\n fields: [],\n };\n\n const beforeSendResult = this.beforeSend.emit({...details, name: details.name!});\n if (beforeSendResult.defaultPrevented) {\n console.log('[SEND] Send cancelled by parent', details);\n this.sending = false;\n return;\n }\n\n console.log('[SEND] Creating envelope', details);\n createEnvelope(this.endpoint, details)\n .then(r => {\n console.log('[SEND] Send envelope', r);\n this.reset().catch((e: any) => console.log('Unknown Error', e));\n this.sending = false;\n this.send?.emit({...details, name: details.name!, envelope_id: r.id, envelope: r});\n })\n .catch(e => {\n console.log('[SEND] Send error', e);\n VerdocsToast(e.response?.data?.error || 'Error creating envelope, please try again later.');\n this.sending = false;\n this.sdkError?.emit(e);\n });\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.exit?.emit();\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host style={{display: 'flex'}}>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const levels = this.getLevels();\n console.log('[SEND] Rendering levels', levels);\n const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) && recipient.first_name && recipient.last_name);\n // TODO: Reactivate once SMS is re-enabled\n // const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) || isValidPhone(recipient.phone));\n const allRolesAssigned = rolesAssigned.length >= getRoleNames(this.template).length;\n\n return (\n <Host class={{sendable: this.template?.is_sendable}}>\n <div class=\"recipients\">\n <div class=\"left-line\" />\n <div class={`level level-start`}>\n {this.getLevelIcon(-1)}\n <div class=\"complete\">Send Envelope</div>\n </div>\n\n {levels.map(level => (\n <div class={`level level-${level}`}>\n {this.getLevelIcon(level)}\n\n {() => {\n console.log('Rendering level', level, this.getRolesAtLevel(level));\n return '';\n }}\n {this.getRolesAtLevel(level).map(role => {\n const unknown = !role.email || !role.first_name || !role.last_name;\n const roleName = this.rolesCompleted[role.id]?.first_name ? formatFullName(this.rolesCompleted[role.id]) : unknown ? role.role_name : formatFullName(role);\n const elId = `verdocs-send-recipient-${role.role_name}`;\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const rgba = getRGBA(roleIndex);\n const completed = rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n\n const style = {\n backgroundColor: rgba,\n border: completed ? '2px solid #55bc81' : '2px solid #dddddd',\n };\n\n return unknown ? (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={this.rolesCompleted[role.id] ?? role}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n ) : (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {/*<div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={{borderColor: rgba}} onClick={e => this.handleClickRole(e, role)} id={elId}>*/}\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={(this.rolesCompleted[role.id] ?? role) as IRecipient}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n );\n })}\n </div>\n ))}\n\n <div class={`level level-done`}>\n {this.getLevelIcon(levels.length)}\n <div class=\"complete\">Signing Complete</div>\n </div>\n </div>\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" size=\"small\" variant=\"outline\" onClick={e => this.handleCancel(e)} disabled={this.sending} />\n <verdocs-button label=\"Send\" size=\"small\" disabled={!allRolesAssigned || this.sending} onClick={e => this.handleSend(e)} />\n {this.sending && <verdocs-spinner />}\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"verdocs-send.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-send/verdocs-send.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAClG,OA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CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,mCAAI,IAAI,CAAe,EAClE,gBAAgB,EAAE,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA,EAAA,GAC1D,CACa,CAClB,CACG,CACP,CAAC;oBACJ,CAAC,CAAC,CACE,CACP,CAAC;gBAEF,WAAK,KAAK,EAAE,kBAAkB;oBAC3B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;oBACzB,WAAK,KAAK,EAAC,UAAU,uBAAuB,CACxC,CACF;YAEN,WAAK,KAAK,EAAC,SAAS;gBAClB,sBAAgB,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,GAAI;gBAC5H,sBAAgB,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,CAAC,gBAAgB,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI;gBAC1H,IAAI,CAAC,OAAO,IAAI,0BAAmB,CAChC,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport {createEnvelope, formatFullName, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipient, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst editIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><path d=\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\"></path></svg>';\n\nconst startIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><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>';\n\nconst stepIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><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>';\n\nconst doneIcon =\n '<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" tabindex=\"-1\"><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>';\n\n/**\n * Display a form to send a template to one or more recipients in an envelope for signing.\n * Host applications should ensure the template is \"sendable\" before displaying this component.\n * To be sendable, a template must have at least one document attached, at least one participant\n * defined, and at least one field assigned to every \"signer\" participant. This component will\n * hide itself if the template is not sendable.\n *\n * ```ts\n * <verdocs-send\n * templateId={templateId}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={(e) => { console.log('Send cancelled.', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-send',\n styleUrl: 'verdocs-send.scss',\n shadow: false,\n})\nexport class VerdocsSend {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true}) templateId: string | null = null;\n\n /**\n * The environment the control is being called from, e.g. 'web'. This has an impact on how certain\n * operations such as email communications are handled to ensure users receive the correct URLs for\n * their invitations. Setting this to unknown values may produce unexpected/incorrect behaviors.\n * If environment is not known, do this set this property.\n */\n @Prop() environment: string = '';\n\n /**\n * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string}>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string; envelope_id: string; envelope: IEnvelope}>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user enters text in a search field. The parent application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() showPickerForId = '';\n @State() sessionContacts = [];\n @State() sending = false;\n @State() rolesCompleted: Record<string, Partial<IRecipient>> = {};\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n console.log('[SEND] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n true,\n (template: ITemplate) => {\n console.log('[SEND] Got new template', template);\n this.template = template;\n this.loading = false;\n this.rolesCompleted = {};\n this.recomputeRolesCompleted();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method() async reset() {\n this.rolesCompleted = {};\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[SEND] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.onSessionChanged((_endpoint, _session, profile) => {\n if (!profile) {\n return;\n }\n\n const me = {\n id: profile.id,\n first_name: profile.first_name,\n last_name: profile.last_name,\n email: profile.email,\n phone: profile.phone,\n };\n\n if (profile) {\n this.sessionContacts = [me];\n\n getOrganizationContacts(this.endpoint)\n .then(contacts => {\n console.log('[SEND] Got contacts', contacts);\n this.sessionContacts = [...contacts, me];\n })\n .catch(e => {\n console.log('[SEND] Error getting contacts', e);\n });\n }\n });\n\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[SEND] Unable to start Send operation, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[SEND] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SEND] Error with send session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n recomputeRolesCompleted() {\n this.rolesCompleted = {};\n\n const rolesAtLevel: Record<number, Partial<IRecipient>[]> = {};\n (this.template?.roles || []).forEach(role => {\n const level = role.sequence - 1;\n rolesAtLevel[level] ||= [];\n const id = `r-${level}-${rolesAtLevel[level].length}`;\n rolesAtLevel[level].push({...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name});\n\n // TODO: Re-activate once SMS is re-enabled\n // if (role.first_name && (isValidEmail(role.email) || isValidPhone(role.phone))) {\n if (role.first_name && isValidEmail(role.email)) {\n this.rolesCompleted[id] = {...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name};\n }\n });\n }\n\n getSequenceNumbers() {\n // TODO: This is cleaner with a Set but we found a regression in some target environments where\n // this breaks down. Reverting to an older technique while we diagnose it.\n const sequences: Record<number, boolean> = {};\n (this.template?.roles || []).forEach(role => {\n sequences[role.sequence] = true;\n });\n return Object.keys(sequences)\n .map(s => +s)\n .sort((a, b) => a - b);\n\n // const levels = [...new Set((this.template?.roles || []).map(role => role.sequence - 1))];\n // levels.sort((a, b) => a - b);\n // return levels;\n }\n\n getRolesAtLevel(level: number) {\n const rolesAtLevel = (this.template?.roles || [])\n .filter(role => role.sequence === level)\n .map((role, index) => ({\n ...role,\n id: `r-${level}-${index}`,\n role_name: role.name,\n first_name: role.first_name,\n last_name: role.last_name,\n }));\n return rolesAtLevel as Partial<IRecipient>[];\n }\n\n getLevelIcon(level: 'start' | 'end' | 'sequence') {\n if (level === 'start') {\n return <div class=\"level-icon\" innerHTML={startIcon} />;\n } else if (level === 'end') {\n return <div class=\"level-icon\" innerHTML={doneIcon} />;\n } else {\n return <div class=\"level-icon\" innerHTML={stepIcon} />;\n }\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n e.preventDefault();\n this.rolesCompleted[role.id] = {...role, ...e.detail};\n this.showPickerForId = '';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.showPickerForId = role.id;\n }\n\n handleSend(e: any) {\n if (this.sending) {\n console.log('[SEND] Skipping duplicate send', e);\n return;\n }\n\n console.log('[SEND] Sending', e);\n e.preventDefault();\n e.stopPropagation();\n\n this.sending = true;\n\n const details: ICreateEnvelopeFromTemplateRequest = {\n template_id: this.templateId,\n name: this.template?.name || 'New Envelope',\n environment: this.environment,\n initial_reminder: 0,\n followup_reminders: 0,\n recipients: Object.values(this.rolesCompleted) as ICreateEnvelopeRecipient[],\n // TODO: Pre-filled fields support\n fields: [],\n };\n\n const beforeSendResult = this.beforeSend.emit({...details, name: details.name!});\n if (beforeSendResult.defaultPrevented) {\n console.log('[SEND] Send cancelled by parent', details);\n this.sending = false;\n return;\n }\n\n console.log('[SEND] Creating envelope', details);\n createEnvelope(this.endpoint, details)\n .then(r => {\n console.log('[SEND] Send envelope', r);\n this.reset().catch((e: any) => console.log('Unknown Error', e));\n this.sending = false;\n this.send?.emit({...details, name: details.name!, envelope_id: r.id, envelope: r});\n })\n .catch(e => {\n console.log('[SEND] Send error', e);\n VerdocsToast(e.response?.data?.error || 'Error creating envelope, please try again later.');\n this.sending = false;\n this.sdkError?.emit(e);\n });\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.exit?.emit();\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host style={{display: 'flex'}}>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const levels = this.getSequenceNumbers();\n console.log('[SEND] Rendering levels', levels);\n const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) && recipient.first_name && recipient.last_name);\n // TODO: Reactivate once SMS is re-enabled\n // const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) || isValidPhone(recipient.phone));\n const allRolesAssigned = rolesAssigned.length >= getRoleNames(this.template).length;\n\n return (\n <Host class={{sendable: this.template?.is_sendable}}>\n <div class=\"recipients\">\n <div class=\"left-line\" />\n <div class={`level level-start`}>\n {this.getLevelIcon('start')}\n <div class=\"complete\">Send Envelope</div>\n </div>\n\n {levels.map(level => (\n <div class={`level level-${level}`}>\n {this.getLevelIcon('sequence')}\n\n {this.getRolesAtLevel(level).map(role => {\n const unknown = !role.email || !role.first_name || !role.last_name;\n const roleName = this.rolesCompleted[role.id]?.first_name ? formatFullName(this.rolesCompleted[role.id]) : unknown ? role.role_name : formatFullName(role);\n const elId = `verdocs-send-recipient-${role.role_name}`;\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const rgba = getRGBA(roleIndex);\n const completed = rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n\n const style = {\n backgroundColor: rgba,\n border: completed ? '2px solid #55bc81' : '2px solid #dddddd',\n };\n\n return unknown ? (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={this.rolesCompleted[role.id] ?? role}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n ) : (\n <div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={style} onClick={e => this.handleClickRole(e, role)} id={elId}>\n {/*<div class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} style={{borderColor: rgba}} onClick={e => this.handleClickRole(e, role)} id={elId}>*/}\n {roleName}\n <div class=\"icon\" innerHTML={editIcon} />\n {this.showPickerForId === role.id && (\n <verdocs-portal anchor={elId} onClickAway={() => (this.showPickerForId = '')}>\n <verdocs-contact-picker\n onExit={() => (this.showPickerForId = '')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={(this.rolesCompleted[role.id] ?? role) as IRecipient}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </verdocs-portal>\n )}\n </div>\n );\n })}\n </div>\n ))}\n\n <div class={`level level-done`}>\n {this.getLevelIcon('end')}\n <div class=\"complete\">Signing Complete</div>\n </div>\n </div>\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" size=\"small\" variant=\"outline\" onClick={e => this.handleCancel(e)} disabled={this.sending} />\n <verdocs-button label=\"Send\" size=\"small\" disabled={!allRolesAssigned || this.sending} onClick={e => this.handleSend(e)} />\n {this.sending && <verdocs-spinner />}\n </div>\n </Host>\n );\n }\n}\n"]}
|