@verdocs/web-sdk 1.12.2 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/cjs/{interact.min-3fb55faf.js → interact.min-5b353ffd.js} +1 -1
  2. package/dist/cjs/{utils-8dcfb4ed.js → utils-66565e63.js} +30 -1
  3. package/dist/cjs/verdocs-document-page_2.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-field-signature.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-preview.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-template-create_2.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-template-document-page.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-template-roles.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  21. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +1 -1
  22. package/dist/collection/utils/utils.js +30 -1
  23. package/dist/components/utils.js +30 -1
  24. package/dist/components/verdocs-template-document-page2.js +1 -1
  25. package/dist/docs.json +1 -1
  26. package/dist/esm/{interact.min-19cd5a3f.js → interact.min-7c1428d0.js} +1 -1
  27. package/dist/esm/{utils-6d305f47.js → utils-5e8bf15b.js} +30 -1
  28. package/dist/esm/verdocs-document-page_2.entry.js +1 -1
  29. package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
  30. package/dist/esm/verdocs-field-date.entry.js +1 -1
  31. package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
  32. package/dist/esm/verdocs-field-initial.entry.js +1 -1
  33. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  34. package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
  35. package/dist/esm/verdocs-field-signature.entry.js +1 -1
  36. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  37. package/dist/esm/verdocs-field-textbox.entry.js +1 -1
  38. package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
  39. package/dist/esm/verdocs-preview.entry.js +1 -1
  40. package/dist/esm/verdocs-send.entry.js +1 -1
  41. package/dist/esm/verdocs-sign.entry.js +1 -1
  42. package/dist/esm/verdocs-template-create_2.entry.js +2 -2
  43. package/dist/esm/verdocs-template-document-page.entry.js +2 -2
  44. package/dist/esm/verdocs-template-roles.entry.js +2 -2
  45. package/dist/esm/verdocs-view.entry.js +1 -1
  46. package/dist/esm-es5/{interact.min-19cd5a3f.js → interact.min-7c1428d0.js} +1 -1
  47. package/dist/esm-es5/{utils-6d305f47.js → utils-5e8bf15b.js} +1 -1
  48. package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
  49. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  50. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  51. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  52. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  53. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  54. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  55. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  56. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  57. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  58. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  59. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  60. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  61. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  62. package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
  63. package/dist/esm-es5/verdocs-template-document-page.entry.js +1 -1
  64. package/dist/esm-es5/verdocs-template-roles.entry.js +1 -1
  65. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  66. package/dist/verdocs-web-sdk/{p-fc97d696.system.entry.js → p-02a2340e.system.entry.js} +1 -1
  67. package/dist/verdocs-web-sdk/{p-a5528dcd.entry.js → p-03d776ac.entry.js} +1 -1
  68. package/dist/verdocs-web-sdk/{p-cf3e15fa.entry.js → p-0530e2cf.entry.js} +1 -1
  69. package/dist/verdocs-web-sdk/{p-457ce7ee.system.entry.js → p-108bbaf3.system.entry.js} +1 -1
  70. package/dist/verdocs-web-sdk/{p-6c881285.entry.js → p-122c4341.entry.js} +1 -1
  71. package/dist/verdocs-web-sdk/{p-be9f3cb4.system.entry.js → p-2082f48f.system.entry.js} +1 -1
  72. package/dist/verdocs-web-sdk/{p-125ed09a.entry.js → p-25152d8e.entry.js} +1 -1
  73. package/dist/verdocs-web-sdk/{p-5a5c7806.system.entry.js → p-258546a4.system.entry.js} +1 -1
  74. package/dist/verdocs-web-sdk/{p-ad818224.entry.js → p-27149233.entry.js} +1 -1
  75. package/dist/verdocs-web-sdk/{p-402daffb.entry.js → p-3ebcf391.entry.js} +1 -1
  76. package/dist/verdocs-web-sdk/{p-de57ddbb.entry.js → p-445a768a.entry.js} +1 -1
  77. package/dist/verdocs-web-sdk/{p-6e89c9a9.system.entry.js → p-45e4f142.system.entry.js} +1 -1
  78. package/dist/verdocs-web-sdk/{p-ae195531.system.entry.js → p-48356a9c.system.entry.js} +1 -1
  79. package/dist/verdocs-web-sdk/{p-c05f7f00.system.entry.js → p-4be1ae98.system.entry.js} +1 -1
  80. package/dist/verdocs-web-sdk/{p-9ae853d2.system.entry.js → p-4fe691fd.system.entry.js} +1 -1
  81. package/dist/verdocs-web-sdk/{p-cb619459.entry.js → p-58c1392d.entry.js} +1 -1
  82. package/dist/verdocs-web-sdk/{p-d9108bf5.entry.js → p-5cd0d09d.entry.js} +1 -1
  83. package/dist/verdocs-web-sdk/{p-3ea03e42.js → p-5ce7c588.js} +1 -1
  84. package/dist/verdocs-web-sdk/{p-41e463fc.js → p-6179e4bb.js} +1 -1
  85. package/dist/verdocs-web-sdk/{p-d2a77a74.entry.js → p-69d1df85.entry.js} +1 -1
  86. package/dist/verdocs-web-sdk/{p-71b29261.entry.js → p-6cb5d278.entry.js} +1 -1
  87. package/dist/verdocs-web-sdk/{p-5a3ad0a2.entry.js → p-7048c165.entry.js} +1 -1
  88. package/dist/verdocs-web-sdk/p-7e6d7c07.system.js +1 -1
  89. package/dist/verdocs-web-sdk/{p-98fe1e7a.system.entry.js → p-7e78ed24.system.entry.js} +1 -1
  90. package/dist/verdocs-web-sdk/{p-c5e7155b.system.js → p-7f7d8f2c.system.js} +1 -1
  91. package/dist/verdocs-web-sdk/{p-3d03c50c.entry.js → p-853098e0.entry.js} +1 -1
  92. package/dist/verdocs-web-sdk/{p-f10bdaa0.system.entry.js → p-8efff54f.system.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/{p-23015028.system.entry.js → p-a4ebe8ba.system.entry.js} +1 -1
  94. package/dist/verdocs-web-sdk/{p-833cc40b.entry.js → p-a8b1f54a.entry.js} +1 -1
  95. package/dist/verdocs-web-sdk/{p-2ff0bf23.system.entry.js → p-ac9338d0.system.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/{p-a4aad6fa.system.entry.js → p-b054a21d.system.entry.js} +1 -1
  97. package/dist/verdocs-web-sdk/{p-0d1692d0.system.entry.js → p-be345c16.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/{p-970a4cf0.entry.js → p-ca9c1012.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/{p-d090ad0f.system.entry.js → p-e11bf4da.system.entry.js} +1 -1
  100. package/dist/verdocs-web-sdk/{p-daf52640.system.entry.js → p-ead6568b.system.entry.js} +1 -1
  101. package/dist/verdocs-web-sdk/{p-2e3ad71e.system.entry.js → p-ebca8e8b.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/{p-13883644.entry.js → p-eed56276.entry.js} +1 -1
  103. package/dist/verdocs-web-sdk/{p-04ca71f3.entry.js → p-f55238a6.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-6a2a5175.entry.js → p-f7f62a97.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/{p-287f83b4.system.js → p-fa7c30e1.system.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-60508155.system.entry.js → p-fe0b1efd.system.entry.js} +1 -1
  107. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  108. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const utils = require('./utils-8dcfb4ed.js');
3
+ const utils = require('./utils-66565e63.js');
4
4
 
5
5
  var interact_min = utils.createCommonjsModule(function (module, exports) {
6
6
  /* interact.js 1.10.17 | https://interactjs.io/license */
@@ -99,7 +99,7 @@ const setControlStyles = (el, field, xScale, yScale, option) => {
99
99
  var _a, _b, _c, _d;
100
100
  const settings = field.setting || field.settings;
101
101
  let { x = 0, y = 0, width = defaultWidth(field.type), height = defaultHeight(field.type) } = settings;
102
- const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;
102
+ const optionSettings = settings.options && option !== undefined && settings.options[option] ? settings.options[option] : null;
103
103
  if (optionSettings) {
104
104
  x = (_a = optionSettings.x) !== null && _a !== void 0 ? _a : x;
105
105
  y = (_b = optionSettings.y) !== null && _b !== void 0 ? _b : y;
@@ -137,6 +137,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
137
137
  console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);
138
138
  return;
139
139
  }
140
+ // @ts-ignore
140
141
  switch (field.type) {
141
142
  case 'attachment':
142
143
  case 'date':
@@ -177,6 +178,34 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
177
178
  controlsDiv.appendChild(el);
178
179
  return el;
179
180
  }
181
+ // @ts-ignore
182
+ case 'checkbox':
183
+ const id = getFieldOptionId(field, 0);
184
+ const existingField = document.getElementById(id);
185
+ if (existingField) {
186
+ setControlStyles(existingField, field, docPage.xScale, docPage.yScale, 0);
187
+ return existingField;
188
+ }
189
+ const cbEl = document.createElement(`verdocs-field-checkbox`);
190
+ cbEl.field = field;
191
+ cbEl.setAttribute('id', id);
192
+ cbEl.setAttribute('roleIndex', roleIndex);
193
+ cbEl.setAttribute('option', 0);
194
+ if (disabled) {
195
+ cbEl.setAttribute('disabled', true);
196
+ }
197
+ if (done) {
198
+ cbEl.setAttribute('done', true);
199
+ }
200
+ if (editable) {
201
+ cbEl.setAttribute('editable', true);
202
+ }
203
+ if (draggable) {
204
+ cbEl.setAttribute('draggable', true);
205
+ }
206
+ setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, 0);
207
+ controlsDiv.appendChild(cbEl);
208
+ return cbEl;
180
209
  case 'checkbox_group':
181
210
  return (field.settings || field.setting || {}).options.map((_, checkboxIndex) => {
182
211
  const id = getFieldOptionId(field, checkboxIndex);
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
- const utils = require('./utils-8dcfb4ed.js');
6
+ const utils = require('./utils-66565e63.js');
7
7
  const popper = require('./popper-11d5f714.js');
8
8
  require('./Envelopes-7381bd9a.js');
9
9
  require('./Token-576f0e8a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
- const utils = require('./utils-8dcfb4ed.js');
6
+ const utils = require('./utils-66565e63.js');
7
7
  const Colors = require('./Colors-e809dcc9.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  const index$1 = require('./index-6528b430.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  require('./Envelopes-7381bd9a.js');
10
10
  require('./Token-576f0e8a.js');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
7
  const templateStore = require('./templateStore-4e927fb4.js');
8
- const utils = require('./utils-8dcfb4ed.js');
8
+ const utils = require('./utils-66565e63.js');
9
9
  require('./index-cfa67e73.js');
10
10
  require('./Primitives-be5088cb.js');
11
11
  require('./Envelopes-7381bd9a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const Colors = require('./Colors-e809dcc9.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  const index$1 = require('./index-6528b430.js');
10
10
  require('./Envelopes-7381bd9a.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const VerdocsEndpoint = require('./VerdocsEndpoint-26bb7607.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const templateStore = require('./templateStore-4e927fb4.js');
9
9
  const Templates = require('./Templates-721828dc.js');
10
10
  const errors = require('./errors-0396da3d.js');
@@ -8,7 +8,7 @@ const Validators = require('./Validators-16e6d7d1.js');
8
8
  const Colors = require('./Colors-e809dcc9.js');
9
9
  const templateStore = require('./templateStore-4e927fb4.js');
10
10
  const Templates = require('./Templates-721828dc.js');
11
- const utils = require('./utils-8dcfb4ed.js');
11
+ const utils = require('./utils-66565e63.js');
12
12
  const errors = require('./errors-0396da3d.js');
13
13
  require('./Token-576f0e8a.js');
14
14
  require('./index-cfa67e73.js');
@@ -7,7 +7,7 @@ const Envelopes = require('./Envelopes-7381bd9a.js');
7
7
  const VerdocsEndpoint = require('./VerdocsEndpoint-26bb7607.js');
8
8
  const Validators = require('./Validators-16e6d7d1.js');
9
9
  const Primitives = require('./Primitives-be5088cb.js');
10
- const utils = require('./utils-8dcfb4ed.js');
10
+ const utils = require('./utils-66565e63.js');
11
11
  const Envelopes$1 = require('./Envelopes-2350fcf1.js');
12
12
  const errors = require('./errors-0396da3d.js');
13
13
  require('./Token-576f0e8a.js');
@@ -7,9 +7,9 @@ const Templates = require('./Templates-ed812768.js');
7
7
  const TemplateDocuments = require('./TemplateDocuments-6b395b32.js');
8
8
  const VerdocsEndpoint = require('./VerdocsEndpoint-26bb7607.js');
9
9
  const errors = require('./errors-0396da3d.js');
10
- const interact_min = require('./interact.min-3fb55faf.js');
10
+ const interact_min = require('./interact.min-5b353ffd.js');
11
11
  const Fields = require('./Fields-705a2168.js');
12
- const utils = require('./utils-8dcfb4ed.js');
12
+ const utils = require('./utils-66565e63.js');
13
13
  const templateStore = require('./templateStore-4e927fb4.js');
14
14
  const Templates$1 = require('./Templates-721828dc.js');
15
15
  require('./Token-576f0e8a.js');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const TemplateDocuments = require('./TemplateDocuments-6b395b32.js');
7
7
  const VerdocsEndpoint = require('./VerdocsEndpoint-26bb7607.js');
8
- const utils = require('./utils-8dcfb4ed.js');
8
+ const utils = require('./utils-66565e63.js');
9
9
  require('./Token-576f0e8a.js');
10
10
  require('./Envelopes-7381bd9a.js');
11
11
  require('./Files-4bdc0c0f.js');
@@ -80,7 +80,7 @@ const VerdocsTemplateDocumentPage = class {
80
80
  }
81
81
  render() {
82
82
  const height = `${this.renderedHeight}px`;
83
- return (index.h(index.Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (index.h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (index.h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
83
+ return (index.h(index.Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (index.h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height, flex: `0 0 ${height}` } })) : this.pageDisplayUri ? (index.h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
84
84
  // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that
85
85
  // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).
86
86
  // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
- const interact_min = require('./interact.min-3fb55faf.js');
6
+ const interact_min = require('./interact.min-5b353ffd.js');
7
7
  const Roles = require('./Roles-9b593b95.js');
8
8
  const VerdocsEndpoint = require('./VerdocsEndpoint-26bb7607.js');
9
9
  const Colors = require('./Colors-e809dcc9.js');
10
10
  const templateStore = require('./templateStore-4e927fb4.js');
11
11
  const Templates = require('./Templates-721828dc.js');
12
- const utils = require('./utils-8dcfb4ed.js');
12
+ const utils = require('./utils-66565e63.js');
13
13
  const errors = require('./errors-0396da3d.js');
14
14
  require('./Token-576f0e8a.js');
15
15
  require('./index-cfa67e73.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5e4233b0.js');
6
6
  const VerdocsEndpoint = require('./VerdocsEndpoint-26bb7607.js');
7
- const utils = require('./utils-8dcfb4ed.js');
7
+ const utils = require('./utils-66565e63.js');
8
8
  const Envelopes = require('./Envelopes-2350fcf1.js');
9
9
  const errors = require('./errors-0396da3d.js');
10
10
  require('./Token-576f0e8a.js');
@@ -73,7 +73,7 @@ export class VerdocsTemplateDocumentPage {
73
73
  }
74
74
  render() {
75
75
  const height = `${this.renderedHeight}px`;
76
- return (h(Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
76
+ return (h(Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height, flex: `0 0 ${height}` } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
77
77
  // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that
78
78
  // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).
79
79
  // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values
@@ -58,7 +58,7 @@ export const setControlStyles = (el, field, xScale, yScale, option) => {
58
58
  var _a, _b, _c, _d;
59
59
  const settings = field.setting || field.settings;
60
60
  let { x = 0, y = 0, width = defaultWidth(field.type), height = defaultHeight(field.type) } = settings;
61
- const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;
61
+ const optionSettings = settings.options && option !== undefined && settings.options[option] ? settings.options[option] : null;
62
62
  if (optionSettings) {
63
63
  x = (_a = optionSettings.x) !== null && _a !== void 0 ? _a : x;
64
64
  y = (_b = optionSettings.y) !== null && _b !== void 0 ? _b : y;
@@ -96,6 +96,7 @@ export const renderDocumentField = (field, docPage, roleIndex, fieldOptions) =>
96
96
  console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);
97
97
  return;
98
98
  }
99
+ // @ts-ignore
99
100
  switch (field.type) {
100
101
  case 'attachment':
101
102
  case 'date':
@@ -136,6 +137,34 @@ export const renderDocumentField = (field, docPage, roleIndex, fieldOptions) =>
136
137
  controlsDiv.appendChild(el);
137
138
  return el;
138
139
  }
140
+ // @ts-ignore
141
+ case 'checkbox':
142
+ const id = getFieldOptionId(field, 0);
143
+ const existingField = document.getElementById(id);
144
+ if (existingField) {
145
+ setControlStyles(existingField, field, docPage.xScale, docPage.yScale, 0);
146
+ return existingField;
147
+ }
148
+ const cbEl = document.createElement(`verdocs-field-checkbox`);
149
+ cbEl.field = field;
150
+ cbEl.setAttribute('id', id);
151
+ cbEl.setAttribute('roleIndex', roleIndex);
152
+ cbEl.setAttribute('option', 0);
153
+ if (disabled) {
154
+ cbEl.setAttribute('disabled', true);
155
+ }
156
+ if (done) {
157
+ cbEl.setAttribute('done', true);
158
+ }
159
+ if (editable) {
160
+ cbEl.setAttribute('editable', true);
161
+ }
162
+ if (draggable) {
163
+ cbEl.setAttribute('draggable', true);
164
+ }
165
+ setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, 0);
166
+ controlsDiv.appendChild(cbEl);
167
+ return cbEl;
139
168
  case 'checkbox_group':
140
169
  return (field.settings || field.setting || {}).options.map((_, checkboxIndex) => {
141
170
  const id = getFieldOptionId(field, checkboxIndex);
@@ -97,7 +97,7 @@ const setControlStyles = (el, field, xScale, yScale, option) => {
97
97
  var _a, _b, _c, _d;
98
98
  const settings = field.setting || field.settings;
99
99
  let { x = 0, y = 0, width = defaultWidth(field.type), height = defaultHeight(field.type) } = settings;
100
- const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;
100
+ const optionSettings = settings.options && option !== undefined && settings.options[option] ? settings.options[option] : null;
101
101
  if (optionSettings) {
102
102
  x = (_a = optionSettings.x) !== null && _a !== void 0 ? _a : x;
103
103
  y = (_b = optionSettings.y) !== null && _b !== void 0 ? _b : y;
@@ -135,6 +135,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
135
135
  console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);
136
136
  return;
137
137
  }
138
+ // @ts-ignore
138
139
  switch (field.type) {
139
140
  case 'attachment':
140
141
  case 'date':
@@ -175,6 +176,34 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
175
176
  controlsDiv.appendChild(el);
176
177
  return el;
177
178
  }
179
+ // @ts-ignore
180
+ case 'checkbox':
181
+ const id = getFieldOptionId(field, 0);
182
+ const existingField = document.getElementById(id);
183
+ if (existingField) {
184
+ setControlStyles(existingField, field, docPage.xScale, docPage.yScale, 0);
185
+ return existingField;
186
+ }
187
+ const cbEl = document.createElement(`verdocs-field-checkbox`);
188
+ cbEl.field = field;
189
+ cbEl.setAttribute('id', id);
190
+ cbEl.setAttribute('roleIndex', roleIndex);
191
+ cbEl.setAttribute('option', 0);
192
+ if (disabled) {
193
+ cbEl.setAttribute('disabled', true);
194
+ }
195
+ if (done) {
196
+ cbEl.setAttribute('done', true);
197
+ }
198
+ if (editable) {
199
+ cbEl.setAttribute('editable', true);
200
+ }
201
+ if (draggable) {
202
+ cbEl.setAttribute('draggable', true);
203
+ }
204
+ setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, 0);
205
+ controlsDiv.appendChild(cbEl);
206
+ return cbEl;
178
207
  case 'checkbox_group':
179
208
  return (field.settings || field.setting || {}).options.map((_, checkboxIndex) => {
180
209
  const id = getFieldOptionId(field, checkboxIndex);
@@ -73,7 +73,7 @@ const VerdocsTemplateDocumentPage = /*@__PURE__*/ proxyCustomElement(class exten
73
73
  }
74
74
  render() {
75
75
  const height = `${this.renderedHeight}px`;
76
- return (h(Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
76
+ return (h(Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height, flex: `0 0 ${height}` } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
77
77
  // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that
78
78
  // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).
79
79
  // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-03-02T17:28:42",
2
+ "timestamp": "2023-03-03T17:46:14",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.20.0",
@@ -1,4 +1,4 @@
1
- import { c as getDefaultExportFromCjs, d as createCommonjsModule } from './utils-6d305f47.js';
1
+ import { c as getDefaultExportFromCjs, d as createCommonjsModule } from './utils-5e8bf15b.js';
2
2
 
3
3
  var interact_min = createCommonjsModule(function (module, exports) {
4
4
  /* interact.js 1.10.17 | https://interactjs.io/license */
@@ -97,7 +97,7 @@ const setControlStyles = (el, field, xScale, yScale, option) => {
97
97
  var _a, _b, _c, _d;
98
98
  const settings = field.setting || field.settings;
99
99
  let { x = 0, y = 0, width = defaultWidth(field.type), height = defaultHeight(field.type) } = settings;
100
- const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;
100
+ const optionSettings = settings.options && option !== undefined && settings.options[option] ? settings.options[option] : null;
101
101
  if (optionSettings) {
102
102
  x = (_a = optionSettings.x) !== null && _a !== void 0 ? _a : x;
103
103
  y = (_b = optionSettings.y) !== null && _b !== void 0 ? _b : y;
@@ -135,6 +135,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
135
135
  console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);
136
136
  return;
137
137
  }
138
+ // @ts-ignore
138
139
  switch (field.type) {
139
140
  case 'attachment':
140
141
  case 'date':
@@ -175,6 +176,34 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
175
176
  controlsDiv.appendChild(el);
176
177
  return el;
177
178
  }
179
+ // @ts-ignore
180
+ case 'checkbox':
181
+ const id = getFieldOptionId(field, 0);
182
+ const existingField = document.getElementById(id);
183
+ if (existingField) {
184
+ setControlStyles(existingField, field, docPage.xScale, docPage.yScale, 0);
185
+ return existingField;
186
+ }
187
+ const cbEl = document.createElement(`verdocs-field-checkbox`);
188
+ cbEl.field = field;
189
+ cbEl.setAttribute('id', id);
190
+ cbEl.setAttribute('roleIndex', roleIndex);
191
+ cbEl.setAttribute('option', 0);
192
+ if (disabled) {
193
+ cbEl.setAttribute('disabled', true);
194
+ }
195
+ if (done) {
196
+ cbEl.setAttribute('done', true);
197
+ }
198
+ if (editable) {
199
+ cbEl.setAttribute('editable', true);
200
+ }
201
+ if (draggable) {
202
+ cbEl.setAttribute('draggable', true);
203
+ }
204
+ setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, 0);
205
+ controlsDiv.appendChild(cbEl);
206
+ return cbEl;
178
207
  case 'checkbox_group':
179
208
  return (field.settings || field.setting || {}).options.map((_, checkboxIndex) => {
180
209
  const id = getFieldOptionId(field, checkboxIndex);
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-e64d45e2.js';
2
- import { t as throttle } from './utils-6d305f47.js';
2
+ import { t as throttle } from './utils-5e8bf15b.js';
3
3
  import { c as createPopper } from './popper-f860750c.js';
4
4
  import './Envelopes-eb3eef02.js';
5
5
  import './Token-54690789.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
- import { g as getFieldSettings } from './utils-6d305f47.js';
2
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
3
3
  import { g as getRGBA } from './Colors-1b298092.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import { f as format } from './index-d264c496.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import './Envelopes-eb3eef02.js';
6
6
  import './Token-54690789.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
3
  import { s as state } from './templateStore-5cb73464.js';
4
- import { g as getFieldSettings } from './utils-6d305f47.js';
4
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
5
5
  import './index-24fd1580.js';
6
6
  import './Primitives-054bc6e5.js';
7
7
  import './Envelopes-eb3eef02.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { g as getRGBA } from './Colors-1b298092.js';
3
- import { g as getFieldSettings } from './utils-6d305f47.js';
3
+ import { g as getFieldSettings } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import { f as format } from './index-d264c496.js';
6
6
  import './Envelopes-eb3eef02.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-e64d45e2.js';
2
2
  import { V as VerdocsEndpoint } from './VerdocsEndpoint-d50a8d28.js';
3
- import { r as renderDocumentField, a as getRoleIndex } from './utils-6d305f47.js';
3
+ import { r as renderDocumentField, a as getRoleIndex } from './utils-5e8bf15b.js';
4
4
  import { s as state } from './templateStore-5cb73464.js';
5
5
  import { l as loadTemplate } from './Templates-f8a6628a.js';
6
6
  import { S as SDKError } from './errors-9b5498c8.js';
@@ -4,7 +4,7 @@ import { i as isValidEmail, a as isValidPhone } from './Validators-f110bae2.js';
4
4
  import { g as getRGBA } from './Colors-1b298092.js';
5
5
  import { s as state } from './templateStore-5cb73464.js';
6
6
  import { l as loadTemplate } from './Templates-f8a6628a.js';
7
- import { a as getRoleIndex } from './utils-6d305f47.js';
7
+ import { a as getRoleIndex } from './utils-5e8bf15b.js';
8
8
  import { S as SDKError } from './errors-9b5498c8.js';
9
9
  import './Token-54690789.js';
10
10
  import './index-24fd1580.js';
@@ -3,7 +3,7 @@ import { c as getSigningSession, u as updateEnvelopeField, d as updateEnvelopeFi
3
3
  import { V as VerdocsEndpoint } from './VerdocsEndpoint-d50a8d28.js';
4
4
  import { a as isValidPhone, i as isValidEmail } from './Validators-f110bae2.js';
5
5
  import { f as fullNameToInitials } from './Primitives-054bc6e5.js';
6
- import { s as saveAttachment, u as updateDocumentFieldValue, a as getRoleIndex, r as renderDocumentField, b as getFieldId } from './utils-6d305f47.js';
6
+ import { s as saveAttachment, u as updateDocumentFieldValue, a as getRoleIndex, r as renderDocumentField, b as getFieldId } from './utils-5e8bf15b.js';
7
7
  import { g as getEnvelopeById, s as state } from './Envelopes-7f3b60de.js';
8
8
  import { S as SDKError } from './errors-9b5498c8.js';
9
9
  import './Token-54690789.js';
@@ -3,9 +3,9 @@ import { c as createTemplate, g as getTemplate } from './Templates-8e4ab976.js';
3
3
  import { c as createTemplateDocument } from './TemplateDocuments-1214b04d.js';
4
4
  import { V as VerdocsEndpoint } from './VerdocsEndpoint-d50a8d28.js';
5
5
  import { S as SDKError } from './errors-9b5498c8.js';
6
- import { i as interact } from './interact.min-19cd5a3f.js';
6
+ import { i as interact } from './interact.min-7c1428d0.js';
7
7
  import { u as updateField, c as createField } from './Fields-c82e6df3.js';
8
- import { a as getRoleIndex, r as renderDocumentField, e as updateCssTransform, f as defaultWidth, h as defaultHeight } from './utils-6d305f47.js';
8
+ import { a as getRoleIndex, r as renderDocumentField, e as updateCssTransform, f as defaultWidth, h as defaultHeight } from './utils-5e8bf15b.js';
9
9
  import { s as state } from './templateStore-5cb73464.js';
10
10
  import { l as loadTemplate } from './Templates-f8a6628a.js';
11
11
  import './Token-54690789.js';