@verdocs/web-sdk 5.0.18 → 5.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Datastore-4448f6ef.js → Datastore-931fd77e.js} +7 -4
- package/dist/cjs/Datastore-931fd77e.js.map +1 -0
- package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-checkbox_6.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +18 -15
- package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.css +5 -10
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +16 -13
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js.map +1 -1
- package/dist/components/{p-d9a2e920.js → p-1ab01232.js} +3 -3
- package/dist/components/{p-d9a2e920.js.map → p-1ab01232.js.map} +1 -1
- package/dist/components/{p-efa3b8ac.js → p-1ce18a42.js} +2 -2
- package/dist/components/{p-efa3b8ac.js.map → p-1ce18a42.js.map} +1 -1
- package/dist/components/{p-c662e5f4.js → p-1f0f5448.js} +2 -2
- package/dist/components/{p-c662e5f4.js.map → p-1f0f5448.js.map} +1 -1
- package/dist/components/{p-aa59fa42.js → p-28e3b2e3.js} +14 -14
- package/dist/components/{p-aa59fa42.js.map → p-28e3b2e3.js.map} +1 -1
- package/dist/components/{p-9bcf9620.js → p-2d8b46e5.js} +2 -2
- package/dist/components/{p-9bcf9620.js.map → p-2d8b46e5.js.map} +1 -1
- package/dist/components/{p-58d027d1.js → p-3828cb31.js} +7 -4
- package/dist/components/p-3828cb31.js.map +1 -0
- package/dist/components/{p-314d698d.js → p-53168eec.js} +2 -2
- package/dist/components/{p-314d698d.js.map → p-53168eec.js.map} +1 -1
- package/dist/components/{p-bcc8771f.js → p-681e7dd4.js} +3 -3
- package/dist/components/{p-bcc8771f.js.map → p-681e7dd4.js.map} +1 -1
- package/dist/components/{p-78043e4b.js → p-78de9e65.js} +20 -17
- package/dist/components/p-78de9e65.js.map +1 -0
- package/dist/components/{p-14c80ae8.js → p-91d65fde.js} +3 -3
- package/dist/components/{p-14c80ae8.js.map → p-91d65fde.js.map} +1 -1
- package/dist/components/{p-d8340641.js → p-a415ce22.js} +3 -3
- package/dist/components/{p-d8340641.js.map → p-a415ce22.js.map} +1 -1
- package/dist/components/{p-022b87d3.js → p-b8885b5c.js} +2 -2
- package/dist/components/{p-022b87d3.js.map → p-b8885b5c.js.map} +1 -1
- package/dist/components/{p-5182136e.js → p-c4c9feda.js} +3 -3
- package/dist/components/{p-5182136e.js.map → p-c4c9feda.js.map} +1 -1
- package/dist/components/{p-2ddf4d5b.js → p-e4799d51.js} +3 -3
- package/dist/components/{p-2ddf4d5b.js.map → p-e4799d51.js.map} +1 -1
- package/dist/components/{p-261521bc.js → p-e4a97ad5.js} +3 -3
- package/dist/components/{p-261521bc.js.map → p-e4a97ad5.js.map} +1 -1
- package/dist/components/{p-c9bed8f7.js → p-e9528d9f.js} +3 -3
- package/dist/components/{p-c9bed8f7.js.map → p-e9528d9f.js.map} +1 -1
- package/dist/components/{p-8a76ec8a.js → p-e95ded6b.js} +14 -14
- package/dist/components/{p-8a76ec8a.js.map → p-e95ded6b.js.map} +1 -1
- package/dist/components/{p-7cd6c0ce.js → p-eb12a71c.js} +2 -2
- package/dist/components/{p-7cd6c0ce.js.map → p-eb12a71c.js.map} +1 -1
- package/dist/components/{p-6c4fe42c.js → p-eb2ad8d0.js} +2 -2
- package/dist/components/{p-6c4fe42c.js.map → p-eb2ad8d0.js.map} +1 -1
- package/dist/components/{p-43fa069d.js → p-ecfc85ae.js} +3 -3
- package/dist/components/{p-43fa069d.js.map → p-ecfc85ae.js.map} +1 -1
- package/dist/components/{p-211fa3e2.js → p-f6156f7a.js} +3 -3
- package/dist/components/{p-211fa3e2.js.map → p-f6156f7a.js.map} +1 -1
- package/dist/components/{p-13260b9f.js → p-fcf13666.js} +13 -13
- package/dist/components/{p-13260b9f.js.map → p-fcf13666.js.map} +1 -1
- package/dist/components/verdocs-build.js +20 -20
- package/dist/components/verdocs-envelope-recipient-link.js +1 -1
- package/dist/components/verdocs-envelope-recipient-summary.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +2 -2
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -1
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-payment.js +2 -2
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-field-textarea.js +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +2 -2
- package/dist/components/verdocs-template-attachments.js +1 -1
- package/dist/components/verdocs-template-build-tabs.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-field-properties.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-template-role-properties.js +1 -1
- package/dist/components/verdocs-template-roles.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/{Datastore-b55570ff.js → Datastore-3f924d94.js} +7 -4
- package/dist/esm/Datastore-3f924d94.js.map +1 -0
- package/dist/esm/verdocs-build.entry.js +1 -1
- package/dist/esm/verdocs-checkbox_6.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-kba-dialog_2.entry.js +1 -1
- package/dist/esm/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +18 -15
- package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/{Datastore-b55570ff.js → Datastore-3f924d94.js} +2 -2
- package/dist/esm-es5/Datastore-3f924d94.js.map +1 -0
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +2 -2
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/types/components/templates/verdocs-template-roles/verdocs-template-roles.d.ts +3 -0
- package/dist/verdocs-web-sdk/{p-19462841.system.entry.js → p-086ee7f1.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fedcc413.entry.js → p-1902bf04.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fda9c437.system.entry.js → p-208a8b41.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-00ed440b.system.entry.js → p-2175c81a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-3cc50f0b.system.entry.js → p-26106576.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-eb3ceb39.system.entry.js → p-32cf09f0.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9021fc7b.system.entry.js → p-34c2298e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d8d279a8.entry.js → p-3701b851.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-3701b851.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-58d027d1.js → p-3828cb31.js} +2 -2
- package/dist/verdocs-web-sdk/p-3828cb31.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-dced30fa.entry.js → p-471fd78e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-99d5305a.system.entry.js → p-51c7f852.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-51c7f852.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-17f35bcb.entry.js → p-60da8e6b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-35dcb386.system.js → p-65be7617.system.js} +2 -2
- package/dist/verdocs-web-sdk/p-65be7617.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-e3077c5e.system.entry.js → p-6b2fc4bd.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-37fa9d00.system.entry.js → p-7975ec40.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-27416916.entry.js → p-7ffebea3.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-bbf30adc.system.entry.js → p-90690dde.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-03399c69.entry.js → p-a4d94e2e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-882aa754.entry.js → p-c59aa521.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f2b16ddf.entry.js → p-cc230abf.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c2bca18a.entry.js → p-d4aff253.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-db1faf41.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-d23b5949.entry.js.map → p-db1faf41.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-ea078594.system.entry.js → p-dc5c275f.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-88baf4d1.entry.js → p-e84cf41e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-546daa8b.entry.js → p-f6ed768d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-41f22b0a.system.entry.js → p-ff048639.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +5 -5
- package/dist/cjs/Datastore-4448f6ef.js.map +0 -1
- package/dist/components/p-58d027d1.js.map +0 -1
- package/dist/components/p-78043e4b.js.map +0 -1
- package/dist/esm/Datastore-b55570ff.js.map +0 -1
- package/dist/esm-es5/Datastore-b55570ff.js.map +0 -1
- package/dist/verdocs-web-sdk/p-35dcb386.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-58d027d1.js.map +0 -1
- package/dist/verdocs-web-sdk/p-99d5305a.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d23b5949.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d8d279a8.entry.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-19462841.system.entry.js.map → p-086ee7f1.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fedcc413.entry.js.map → p-1902bf04.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fda9c437.system.entry.js.map → p-208a8b41.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-00ed440b.system.entry.js.map → p-2175c81a.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3cc50f0b.system.entry.js.map → p-26106576.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-eb3ceb39.system.entry.js.map → p-32cf09f0.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9021fc7b.system.entry.js.map → p-34c2298e.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-dced30fa.entry.js.map → p-471fd78e.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-17f35bcb.entry.js.map → p-60da8e6b.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e3077c5e.system.entry.js.map → p-6b2fc4bd.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-37fa9d00.system.entry.js.map → p-7975ec40.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-27416916.entry.js.map → p-7ffebea3.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-bbf30adc.system.entry.js.map → p-90690dde.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-03399c69.entry.js.map → p-a4d94e2e.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-882aa754.entry.js.map → p-c59aa521.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f2b16ddf.entry.js.map → p-cc230abf.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c2bca18a.entry.js.map → p-d4aff253.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ea078594.system.entry.js.map → p-dc5c275f.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-88baf4d1.entry.js.map → p-e84cf41e.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-546daa8b.entry.js.map → p-f6ed768d.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-41f22b0a.system.entry.js.map → p-ff048639.system.entry.js.map} +0 -0
@@ -4,20 +4,20 @@ import { VerdocsEndpoint, getTemplate, updateField, createField, integerSequence
|
|
4
4
|
import { e as updateCssTransform, f as removeCssTransform, h as setControlStyles, g as getFieldId, i as defaultWidth, j as defaultHeight } from './p-af5ecc92.js';
|
5
5
|
import { V as VerdocsToast } from './p-04c07b7b.js';
|
6
6
|
import { S as SDKError } from './p-fd97809c.js';
|
7
|
-
import { S as Store } from './p-
|
7
|
+
import { S as Store } from './p-3828cb31.js';
|
8
8
|
import { d as defineCustomElement$p } from './p-0e332769.js';
|
9
9
|
import { d as defineCustomElement$o } from './p-3201d529.js';
|
10
10
|
import { d as defineCustomElement$n } from './p-84ae0283.js';
|
11
|
-
import { d as defineCustomElement$m } from './p-
|
12
|
-
import { d as defineCustomElement$l } from './p-
|
13
|
-
import { d as defineCustomElement$k } from './p-
|
14
|
-
import { d as defineCustomElement$j } from './p-
|
15
|
-
import { d as defineCustomElement$i } from './p-
|
16
|
-
import { d as defineCustomElement$h } from './p-
|
17
|
-
import { d as defineCustomElement$g } from './p-
|
18
|
-
import { d as defineCustomElement$f } from './p-
|
19
|
-
import { d as defineCustomElement$e } from './p-
|
20
|
-
import { d as defineCustomElement$d } from './p-
|
11
|
+
import { d as defineCustomElement$m } from './p-e4799d51.js';
|
12
|
+
import { d as defineCustomElement$l } from './p-91d65fde.js';
|
13
|
+
import { d as defineCustomElement$k } from './p-e9528d9f.js';
|
14
|
+
import { d as defineCustomElement$j } from './p-a415ce22.js';
|
15
|
+
import { d as defineCustomElement$i } from './p-f6156f7a.js';
|
16
|
+
import { d as defineCustomElement$h } from './p-e4a97ad5.js';
|
17
|
+
import { d as defineCustomElement$g } from './p-681e7dd4.js';
|
18
|
+
import { d as defineCustomElement$f } from './p-1ab01232.js';
|
19
|
+
import { d as defineCustomElement$e } from './p-ecfc85ae.js';
|
20
|
+
import { d as defineCustomElement$d } from './p-c4c9feda.js';
|
21
21
|
import { d as defineCustomElement$c } from './p-7f32e087.js';
|
22
22
|
import { d as defineCustomElement$b } from './p-9c0b30f8.js';
|
23
23
|
import { d as defineCustomElement$a } from './p-1ae5d7e0.js';
|
@@ -25,8 +25,8 @@ import { d as defineCustomElement$9 } from './p-b7d080eb.js';
|
|
25
25
|
import { d as defineCustomElement$8 } from './p-6719b0d7.js';
|
26
26
|
import { d as defineCustomElement$7 } from './p-62743fd3.js';
|
27
27
|
import { d as defineCustomElement$6 } from './p-cce871bf.js';
|
28
|
-
import { d as defineCustomElement$5 } from './p-
|
29
|
-
import { d as defineCustomElement$4 } from './p-
|
28
|
+
import { d as defineCustomElement$5 } from './p-fcf13666.js';
|
29
|
+
import { d as defineCustomElement$4 } from './p-eb12a71c.js';
|
30
30
|
import { d as defineCustomElement$3 } from './p-325b3828.js';
|
31
31
|
import { d as defineCustomElement$2 } from './p-4d3b9ee9.js';
|
32
32
|
import { d as defineCustomElement$1 } from './p-2ef2d490.js';
|
@@ -505,4 +505,4 @@ function defineCustomElement() {
|
|
505
505
|
|
506
506
|
export { VerdocsTemplateFields as V, defineCustomElement as d };
|
507
507
|
|
508
|
-
//# sourceMappingURL=p-
|
508
|
+
//# sourceMappingURL=p-e95ded6b.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-8a76ec8a.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,i4QAAi4Q,CAAC;AACn6Q,oCAAe,wBAAwB;;ACQvC,MAAM,WAAW,GAAG,mJAAmJ,CAAC;AAExK,MAAM,SAAS,GACb,mZAAmZ,CAAC;AAEtZ,MAAM,SAAS,GACb,0qBAA0qB,CAAC;AAE7qB,MAAM,cAAc,GAClB,ytBAAytB,CAAC;AAE5tB,MAAM,aAAa,GAC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AE,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,KAAI,GAAG,EACpC,aAAa,EAAE,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,KAAI,GAAG,EACtC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,CAAC,CAAe,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,EAC3D,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;wBACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;wBAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;qBAChC,GACD,EACF;aACH,CAAC,CAAC;SACJ,CAAC,CACE,EACL,IAAI,CAAC,kBAAkB,KACtB,yBACE,OAAO,EAAC,qBAAqB,EAC7B,OAAO,EAAE,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,KAAI,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,4CAA4C,GAAG,oDAAoD,EACtJ,MAAM,EAAE,OAAO,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAC/C,CACH,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-fields/verdocs-template-fields.scss?tag=verdocs-template-fields","src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-fields {\n font-family: $verdocs-primary-font;\n position: relative;\n display: block;\n min-height: 600px;\n\n .page-0 {\n padding: 65px 15px 0 15px;\n box-sizing: border-box;\n\n .user-placed-fields {\n height: 100px;\n position: relative;\n background: #ffffff;\n box-shadow: 0 0 10px 5px #0000000f;\n\n .title {\n top: 0;\n left: 0;\n color: #ffffff;\n font-size: 12px;\n padding: 3px 6px;\n font-weight: bold;\n position: absolute;\n background: $verdocs-grey-blue;\n }\n }\n }\n\n .pages {\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n }\n\n #verdocs-template-fields-toolbar {\n width: 100%;\n height: 50px;\n display: flex;\n column-gap: 15px;\n font-weight: 700;\n padding: 0 20px 0 0; // Right-only to better balance the visual\n align-items: center;\n flex-direction: row;\n color: $verdocs-grey-3;\n justify-content: center;\n background: $verdocs-grey-blue;\n\n > verdocs-select-input {\n margin: 0;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n\n .add-for {\n margin: 0;\n font-weight: 500;\n color: $verdocs-grey-3;\n }\n\n verdocs-select-input {\n margin: 0 20px 0 0;\n }\n\n @media all and (max-width: 1000px) {\n column-gap: 8px;\n padding: 0 10px 0 0; // Right-only to better balance the visual\n\n svg {\n transform: scale(0.8);\n }\n\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n\n @media all and (max-width: 600px) {\n column-gap: 6px;\n\n svg {\n transform: scale(0.6);\n }\n\n .separator,\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n }\n\n &.placing-attachment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-checkbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-date {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-dropdown {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-initial {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-payment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-radio {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-signature {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textarea {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\")\n 0 14,\n pointer;\n }\n\n &.placing-timestamp {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n}\n","import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\nconst iconTimestamp =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\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, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\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 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 @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n console.log('[FIELDS] Moving toolbar');\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = this.template?.roles || [];\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\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\n this.selectedRoleName = template.roles?.[0]?.name || '';\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<number, IDocumentPageInfo> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n // console.log('[FIELDS] Page rendered', pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, pageNumber: number) {\n if (this.placing) {\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\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>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const selectableRoles = (this.template?.roles || []).map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-e95ded6b.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,i4QAAi4Q,CAAC;AACn6Q,oCAAe,wBAAwB;;ACQvC,MAAM,WAAW,GAAG,mJAAmJ,CAAC;AAExK,MAAM,SAAS,GACb,mZAAmZ,CAAC;AAEtZ,MAAM,SAAS,GACb,0qBAA0qB,CAAC;AAE7qB,MAAM,cAAc,GAClB,ytBAAytB,CAAC;AAE5tB,MAAM,aAAa,GACjB,oXAAoX,CAAC;AAEvX,MAAM,WAAW,GACf,4KAA4K,CAAC;AAE/K,MAAM,aAAa,GACjB,yRAAyR,CAAC;AAE5R,MAAM,YAAY,GAChB,0QAA0Q,CAAC;AAE7Q,MAAM,cAAc,GAClB,oWAAoW,CAAC;AAEvW,MAAM,SAAS,GAAG,iJAAiJ,CAAC;AAEpK,MAAM,WAAW,GAAG;IAClB,EAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAC;IAChF,EAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAC;IACzE,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAC;IAC9D,EAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAC;IACzE,EAAC,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAC;IAC1E,EAAC,E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BAAkB,GAAG,KAAK,CAAC,GAC/C,CACH,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-fields/verdocs-template-fields.scss?tag=verdocs-template-fields","src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-fields {\n font-family: $verdocs-primary-font;\n position: relative;\n display: block;\n min-height: 600px;\n\n .page-0 {\n padding: 65px 15px 0 15px;\n box-sizing: border-box;\n\n .user-placed-fields {\n height: 100px;\n position: relative;\n background: #ffffff;\n box-shadow: 0 0 10px 5px #0000000f;\n\n .title {\n top: 0;\n left: 0;\n color: #ffffff;\n font-size: 12px;\n padding: 3px 6px;\n font-weight: bold;\n position: absolute;\n background: $verdocs-grey-blue;\n }\n }\n }\n\n .pages {\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n }\n\n #verdocs-template-fields-toolbar {\n width: 100%;\n height: 50px;\n display: flex;\n column-gap: 15px;\n font-weight: 700;\n padding: 0 20px 0 0; // Right-only to better balance the visual\n align-items: center;\n flex-direction: row;\n color: $verdocs-grey-3;\n justify-content: center;\n background: $verdocs-grey-blue;\n\n > verdocs-select-input {\n margin: 0;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n\n .add-for {\n margin: 0;\n font-weight: 500;\n color: $verdocs-grey-3;\n }\n\n verdocs-select-input {\n margin: 0 20px 0 0;\n }\n\n @media all and (max-width: 1000px) {\n column-gap: 8px;\n padding: 0 10px 0 0; // Right-only to better balance the visual\n\n svg {\n transform: scale(0.8);\n }\n\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n\n @media all and (max-width: 600px) {\n column-gap: 6px;\n\n svg {\n transform: scale(0.6);\n }\n\n .separator,\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n }\n\n &.placing-attachment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-checkbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-date {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-dropdown {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-initial {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-payment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-radio {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-signature {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textarea {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\")\n 0 14,\n pointer;\n }\n\n &.placing-timestamp {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n}\n","import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\nconst iconTimestamp =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\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, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\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 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 @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n console.log('[FIELDS] Moving toolbar');\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = this.template?.roles || [];\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\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\n this.selectedRoleName = template.roles?.[0]?.name || '';\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<number, IDocumentPageInfo> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n // console.log('[FIELDS] Page rendered', pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, pageNumber: number) {\n if (this.placing) {\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\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>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const selectableRoles = (this.template?.roles || []).map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-324ed895.js';
|
2
2
|
import { VerdocsEndpoint, getTemplate, updateField, deleteField } from '@verdocs/js-sdk';
|
3
3
|
import { S as SDKError } from './p-fd97809c.js';
|
4
|
-
import { S as Store } from './p-
|
4
|
+
import { S as Store } from './p-3828cb31.js';
|
5
5
|
import { d as defineCustomElement$7 } from './p-0e332769.js';
|
6
6
|
import { d as defineCustomElement$6 } from './p-3201d529.js';
|
7
7
|
import { d as defineCustomElement$5 } from './p-84ae0283.js';
|
@@ -298,4 +298,4 @@ function defineCustomElement() {
|
|
298
298
|
|
299
299
|
export { VerdocsTemplateFieldProperties as V, defineCustomElement as d };
|
300
300
|
|
301
|
-
//# sourceMappingURL=p-
|
301
|
+
//# sourceMappingURL=p-eb12a71c.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-7cd6c0ce.js","mappings":";;;;;;;;;;;;AAAA,MAAM,iCAAiC,GAAG,wrKAAwrK,CAAC;AACnuK,6CAAe,iCAAiC;;ACIhD,MAAM,UAAU,GAAG,CAA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GAAG,IAAI,CAAC;gBAClB,IAAI,CAAC,cAAc,EAAE,CAAC;aACvB,GACD,CACE,CACP,CAAC,CACE,CACP,EAED,WAAK,KAAK,EAAC,SAAS,IAClB,cAAQ,KAAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,EAChH,WAAK,KAAK,EAAE,EAAC,IAAI,EAAE,GAAG,EAAC,GAAI,EAC3B,sBAAgB,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,EAC3H,sBAAgB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI,CACnH,CACD,CACF,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.scss?tag=verdocs-template-field-properties","src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-field-properties {\n padding: 20px;\n display: block;\n border-radius: 4px;\n background: #ffffff;\n border: 1px solid #ccc;\n font-family: $verdocs-primary-font;\n box-shadow: 2px 2px 10px 0 #0000001f;\n\n @media all and (max-width: 600px) {\n padding: 10px;\n transform: scale(0.8);\n }\n\n .buttons {\n display: flex;\n margin-top: 30px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n verdocs-button {\n margin-left: 16px;\n }\n }\n\n form .row {\n display: flex;\n column-gap: 15px;\n margin: 0 0 10px 0;\n align-items: center;\n flex-direction: row;\n\n .input-label {\n display: block;\n color: $label-color-light;\n font-weight: 700;\n font-size: 14px;\n margin: 0 0 4px 0;\n flex: 0 0 100px;\n }\n }\n\n verdocs-select-input {\n flex: 1;\n margin: 0;\n }\n\n verdocs-text-input {\n margin: 0;\n flex: 1;\n\n label {\n margin: 0;\n display: flex;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n }\n\n .input-label {\n flex: 0 0 100px;\n }\n\n input {\n flex: 1;\n display: flex;\n }\n }\n\n .checkbox-wrapper {\n flex: 1;\n display: flex;\n }\n\n .delete-button {\n height: 34px;\n display: flex;\n cursor: pointer;\n background: none;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #999;\n justify-content: center;\n\n &:active {\n background: #f3f3f3;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n }\n\n h6 {\n flex: 1;\n display: flex;\n font-size: 16px;\n font-weight: bold;\n margin: 0 0 8px 0;\n flex-direction: row;\n color: $verdocs-grey-0;\n\n .help-icon {\n opacity: 0.5;\n\n &:hover {\n opacity: 1;\n cursor: pointer;\n }\n }\n }\n\n .instructions {\n }\n\n .row-header {\n gap: 15px;\n display: flex;\n flex-direction: row;\n\n h6 {\n margin-bottom: 0;\n }\n\n verdocs-help-icon {\n transform: scale(0.85);\n\n svg {\n margin-bottom: -5px;\n }\n }\n\n .add-button {\n margin: 0;\n padding: 0;\n border: none;\n opacity: 0.5;\n cursor: pointer;\n background: none;\n\n &:hover {\n opacity: 1;\n }\n\n svg {\n width: 32px;\n height: 32px;\n }\n }\n }\n\n .options-header {\n gap: 10px;\n margin: 0 0 5px 0;\n display: flex;\n color: #ffffff;\n font-size: 14px;\n padding: 5px 8px;\n font-weight: 700;\n text-align: center;\n flex-direction: row;\n justify-content: center;\n background-color: #333333;\n }\n\n .options-header-label {\n display: flex;\n flex: 1;\n font-weight: 700;\n font-size: 14px;\n }\n\n .option-row {\n margin: 15px 0;\n\n .remove-button {\n height: 28px;\n display: flex;\n cursor: pointer;\n background: none;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #999;\n justify-content: center;\n\n &:active {\n background: #f3f3f3;\n }\n\n &:hover {\n svg {\n stroke: rgb(165, 0, 33);\n }\n }\n\n svg {\n width: 20px;\n height: 20px;\n stroke: #333333;\n }\n }\n }\n\n .options {\n background: #f3f3f3;\n padding: 0 0 1px 0;\n\n .row-header,\n .option-row {\n padding: 0 10px;\n }\n\n .add-option-button {\n border-radius: 5px;\n border: 1px solid #cccccc;\n background: $verdocs-grey-blue;\n color: #ffffff;\n padding: 3px 8px;\n }\n\n .option-row .input-element {\n font-size: 14px;\n }\n\n verdocs-help-icon {\n opacity: 1;\n transform: scale(0.8);\n\n svg {\n fill: #ffffff;\n }\n }\n }\n}\n","import {Component, h, Element, Event, EventEmitter, Prop, State, Host} from '@stencil/core';\nimport {deleteField, getTemplate, type ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#a50021\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0\" /></svg>`;\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\n/**\n * Displays an edit form that allows the user to adjust a field's settings.\n */\n@Component({\n tag: 'verdocs-template-field-properties',\n styleUrl: 'verdocs-template-field-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFieldProperties {\n private templateListenerId = null;\n\n @Element()\n 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 template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * The field to configure.\n */\n @Prop({mutable: true}) fieldName: string = '';\n\n /**\n * If specified, the properties card will have a \"back\" side with the help text as its content.\n */\n @Prop() helpText?: string = '';\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) close: EventEmitter;\n\n /**\n * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted,\n * the role will have already been deleted server-side.\n */\n @Event({composed: true}) delete: EventEmitter<{templateId: string; roleName: string}>;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\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 @State() dirty: boolean = false;\n @State() label = '';\n @State() type = 'textbox' as TFieldType;\n @State() name = '';\n @State() required = false;\n @State() roleName = '';\n @State() group = '';\n @State() fieldType = '';\n @State() options = [];\n @State() placeholder = '';\n @State() defaultValue = '';\n @State() showingHelp = false;\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('[SENT] 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 console.log('[SEND] Template Updated', template);\n this.template = template;\n this.loading = false;\n this.resetForm();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELD PROPERTIES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.fieldName) {\n console.error(`[FIELD PROPERTIES] Missing required field name`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELD PROPERTIES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELD PROPERTIES] Error loading template', e);\n this.loading = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n resetForm() {\n const field = (this.template?.fields || []).find(field => field.name === this.fieldName);\n if (!field) {\n console.log(`[FIELD PROPERTIES] Unable to find field \"${this.fieldName}\" in fields`);\n return;\n }\n\n this.type = field.type;\n this.name = field.name;\n this.label = field.label;\n this.group = field.group;\n this.roleName = field.role_name;\n this.required = field.required;\n this.fieldType = field.type;\n this.options = field.options || [];\n this.placeholder = field.placeholder || '';\n this.defaultValue = field.default || '';\n this.dirty = false;\n this.loading = false;\n this.cleanupOptions();\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n\n this.resetForm();\n this.close?.emit();\n document.getElementById('verdocs-template-field-properties')?.remove();\n }\n\n handleSave(e: any) {\n e.stopPropagation();\n const newProperties = {\n name: this.name,\n role_name: this.roleName,\n required: this.required,\n label: this.label,\n group: this.group,\n placeholder: this.placeholder,\n default: this.defaultValue,\n options: this.options,\n } as Partial<ITemplateField>;\n\n this.cleanupOptions();\n console.log('[FIELD PROPERTIES] Will update', this.fieldName, newProperties);\n updateField(this.endpoint, this.templateId, this.fieldName, newProperties)\n .then(updatedField => {\n console.log('[FIELD PROPERTIES] Updated', updatedField);\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === this.fieldName);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.templateId, newTemplate);\n this.settingsChanged?.emit({fieldName: this.fieldName, field: updatedField});\n this.close?.emit();\n\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(() => {\n console.log('[FIELD PROPERTIES] Update failed', e);\n });\n }\n\n async handleDelete(e: any) {\n e.stopPropagation();\n deleteField(this.endpoint, this.templateId, this.fieldName)\n .then(() => {\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields = newTemplate.fields.filter(field => field.name !== this.fieldName);\n Store.updateTemplate(this.templateId, newTemplate);\n this.delete?.emit({templateId: this.templateId, roleName: this.roleName});\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(e => {\n console.log('[FIELD PROPERTIES] Deletion error', e);\n });\n }\n\n cleanupOptions() {\n this.options = [...this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '')];\n if (!this.options.find(opt => !opt.id && !opt.label)) {\n this.options = [...this.options, {id: '', label: ''}];\n }\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>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !(this.template?.fields || []).some(field => field.name === this.fieldName)) {\n return <Host class=\"empty\" />;\n }\n\n if (this.helpText && this.showingHelp) {\n return (\n <Host>\n <h6>\n {capitalize(this.fieldType)} Settings <div style={{flex: '1'}} />\n <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = false)} />\n </h6>\n\n <p class=\"instructions\" innerHTML={this.helpText} />\n </Host>\n );\n }\n\n const hasOptions = this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '').length > 0;\n const saveDisabled = !this.dirty || (this.type === 'dropdown' && !hasOptions);\n\n return (\n <Host id=\"verdocs-template-field-properties\">\n <h6>\n {capitalize(this.fieldType.replace(/_/g, ' '))} Settings <div style={{flex: '1'}} />\n {this.helpText && <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = true)} />}\n </h6>\n\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Field Name\"\n value={this.name}\n autocomplete=\"off\"\n // helpText=\"The internal name of the field. Must be unique, and contain only letters, numbers, and dashes. After an envelope is completed, the value entered by the signer will be tagged with this key.\"\n placeholder=\"Field Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Optional Label\"\n value={this.label}\n autocomplete=\"off\"\n placeholder=\"Optional Label...\"\n onInput={(e: any) => {\n this.label = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"input-label\">Role:</div>\n <verdocs-select-input\n value={this.roleName}\n options={(this.template?.roles || []).map(role => ({label: role.name, value: role.name}))}\n onInput={(e: any) => {\n this.roleName = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-value\"\n label=\"Default Value\"\n value={this.defaultValue}\n autocomplete=\"off\"\n placeholder=\"Pre-filled value...\"\n onInput={(e: any) => {\n this.defaultValue = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.type === 'radio' && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Group\"\n value={this.group}\n autocomplete=\"off\"\n helpText=\"Enable exclusive selections. Only one option within the same group may be selected at a time.\"\n placeholder=\"Group...\"\n onInput={(e: any) => {\n this.group = (e.target.value || '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '');\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-placeholder\"\n label=\"Placeholder\"\n value={this.placeholder}\n autocomplete=\"off\"\n placeholder=\"Placeholder...\"\n onInput={(e: any) => {\n this.placeholder = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Required\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-required\"\n name=\"is-required\"\n checked={this.required}\n value=\"on\"\n onInput={(e: any) => {\n this.required = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n {this.type === 'dropdown' && (\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Options\n </label>\n </div>\n )}\n\n {this.type === 'dropdown' && (\n <div class=\"options\">\n <div class=\"options-header\">\n <div class=\"options-header-label\">ID</div>\n <dev class=\"options-header-label\">Label</dev>\n </div>\n\n {this.options.map((option, index) => (\n <div class=\"row option-row\" key={index}>\n <verdocs-text-input\n value={option.id}\n placeholder=\"Unique ID\"\n onInput={(e: any) => {\n this.options[index].id = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <verdocs-text-input\n value={option.label}\n placeholder=\"Display label\"\n onInput={(e: any) => {\n this.options[index].label = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <button\n innerHTML={TrashIcon}\n class=\"remove-button\"\n onClick={() => {\n this.options = this.options.filter(opt => opt.id !== option.id);\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <button class=\"delete-button\" disabled={this.dirty} onClick={e => this.handleDelete(e)} innerHTML={TrashIcon} />\n <div style={{flex: '1'}} />\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Cancel\" disabled={!this.dirty} onClick={e => this.handleCancel(e)} />\n <verdocs-button size=\"small\" label=\"Save\" disabled={saveDisabled} onClick={e => !saveDisabled && this.handleSave(e)} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-eb12a71c.js","mappings":";;;;;;;;;;;;AAAA,MAAM,iCAAiC,GAAG,wrKAAwrK,CAAC;AACnuK,6CAAe,iCAAiC;;ACIhD,MAA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IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAClB,IAAI,CAAC,cAAc,EAAE,CAAC;aACvB,GACD,CACE,CACP,CAAC,CACE,CACP,EAED,WAAK,KAAK,EAAC,SAAS,IAClB,cAAQ,KAAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,EAChH,WAAK,KAAK,EAAE,EAAC,IAAI,EAAE,GAAG,EAAC,GAAI,EAC3B,sBAAgB,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,EAC3H,sBAAgB,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAI,CACnH,CACD,CACF,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.scss?tag=verdocs-template-field-properties","src/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-field-properties {\n padding: 20px;\n display: block;\n border-radius: 4px;\n background: #ffffff;\n border: 1px solid #ccc;\n font-family: $verdocs-primary-font;\n box-shadow: 2px 2px 10px 0 #0000001f;\n\n @media all and (max-width: 600px) {\n padding: 10px;\n transform: scale(0.8);\n }\n\n .buttons {\n display: flex;\n margin-top: 30px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n verdocs-button {\n margin-left: 16px;\n }\n }\n\n form .row {\n display: flex;\n column-gap: 15px;\n margin: 0 0 10px 0;\n align-items: center;\n flex-direction: row;\n\n .input-label {\n display: block;\n color: $label-color-light;\n font-weight: 700;\n font-size: 14px;\n margin: 0 0 4px 0;\n flex: 0 0 100px;\n }\n }\n\n verdocs-select-input {\n flex: 1;\n margin: 0;\n }\n\n verdocs-text-input {\n margin: 0;\n flex: 1;\n\n label {\n margin: 0;\n display: flex;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n }\n\n .input-label {\n flex: 0 0 100px;\n }\n\n input {\n flex: 1;\n display: flex;\n }\n }\n\n .checkbox-wrapper {\n flex: 1;\n display: flex;\n }\n\n .delete-button {\n height: 34px;\n display: flex;\n cursor: pointer;\n background: none;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #999;\n justify-content: center;\n\n &:active {\n background: #f3f3f3;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n }\n\n h6 {\n flex: 1;\n display: flex;\n font-size: 16px;\n font-weight: bold;\n margin: 0 0 8px 0;\n flex-direction: row;\n color: $verdocs-grey-0;\n\n .help-icon {\n opacity: 0.5;\n\n &:hover {\n opacity: 1;\n cursor: pointer;\n }\n }\n }\n\n .instructions {\n }\n\n .row-header {\n gap: 15px;\n display: flex;\n flex-direction: row;\n\n h6 {\n margin-bottom: 0;\n }\n\n verdocs-help-icon {\n transform: scale(0.85);\n\n svg {\n margin-bottom: -5px;\n }\n }\n\n .add-button {\n margin: 0;\n padding: 0;\n border: none;\n opacity: 0.5;\n cursor: pointer;\n background: none;\n\n &:hover {\n opacity: 1;\n }\n\n svg {\n width: 32px;\n height: 32px;\n }\n }\n }\n\n .options-header {\n gap: 10px;\n margin: 0 0 5px 0;\n display: flex;\n color: #ffffff;\n font-size: 14px;\n padding: 5px 8px;\n font-weight: 700;\n text-align: center;\n flex-direction: row;\n justify-content: center;\n background-color: #333333;\n }\n\n .options-header-label {\n display: flex;\n flex: 1;\n font-weight: 700;\n font-size: 14px;\n }\n\n .option-row {\n margin: 15px 0;\n\n .remove-button {\n height: 28px;\n display: flex;\n cursor: pointer;\n background: none;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #999;\n justify-content: center;\n\n &:active {\n background: #f3f3f3;\n }\n\n &:hover {\n svg {\n stroke: rgb(165, 0, 33);\n }\n }\n\n svg {\n width: 20px;\n height: 20px;\n stroke: #333333;\n }\n }\n }\n\n .options {\n background: #f3f3f3;\n padding: 0 0 1px 0;\n\n .row-header,\n .option-row {\n padding: 0 10px;\n }\n\n .add-option-button {\n border-radius: 5px;\n border: 1px solid #cccccc;\n background: $verdocs-grey-blue;\n color: #ffffff;\n padding: 3px 8px;\n }\n\n .option-row .input-element {\n font-size: 14px;\n }\n\n verdocs-help-icon {\n opacity: 1;\n transform: scale(0.8);\n\n svg {\n fill: #ffffff;\n }\n }\n }\n}\n","import {Component, h, Element, Event, EventEmitter, Prop, State, Host} from '@stencil/core';\nimport {deleteField, getTemplate, type ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#a50021\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0\" /></svg>`;\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\n/**\n * Displays an edit form that allows the user to adjust a field's settings.\n */\n@Component({\n tag: 'verdocs-template-field-properties',\n styleUrl: 'verdocs-template-field-properties.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFieldProperties {\n private templateListenerId = null;\n\n @Element()\n 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 template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * The field to configure.\n */\n @Prop({mutable: true}) fieldName: string = '';\n\n /**\n * If specified, the properties card will have a \"back\" side with the help text as its content.\n */\n @Prop() helpText?: string = '';\n\n /**\n * Event fired when the user cancels the dialog.\n */\n @Event({composed: true}) close: EventEmitter;\n\n /**\n * Event fired when the user deletes the role. The parent should update its UI to reflect the removal. When this event is emitted,\n * the role will have already been deleted server-side.\n */\n @Event({composed: true}) delete: EventEmitter<{templateId: string; roleName: string}>;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\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 @State() dirty: boolean = false;\n @State() label = '';\n @State() type = 'textbox' as TFieldType;\n @State() name = '';\n @State() required = false;\n @State() roleName = '';\n @State() group = '';\n @State() fieldType = '';\n @State() options = [];\n @State() placeholder = '';\n @State() defaultValue = '';\n @State() showingHelp = false;\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('[SENT] 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 console.log('[SEND] Template Updated', template);\n this.template = template;\n this.loading = false;\n this.resetForm();\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELD PROPERTIES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.fieldName) {\n console.error(`[FIELD PROPERTIES] Missing required field name`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELD PROPERTIES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELD PROPERTIES] Error loading template', e);\n this.loading = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n resetForm() {\n const field = (this.template?.fields || []).find(field => field.name === this.fieldName);\n if (!field) {\n console.log(`[FIELD PROPERTIES] Unable to find field \"${this.fieldName}\" in fields`);\n return;\n }\n\n this.type = field.type;\n this.name = field.name;\n this.label = field.label;\n this.group = field.group;\n this.roleName = field.role_name;\n this.required = field.required;\n this.fieldType = field.type;\n this.options = field.options || [];\n this.placeholder = field.placeholder || '';\n this.defaultValue = field.default || '';\n this.dirty = false;\n this.loading = false;\n this.cleanupOptions();\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n\n this.resetForm();\n this.close?.emit();\n document.getElementById('verdocs-template-field-properties')?.remove();\n }\n\n handleSave(e: any) {\n e.stopPropagation();\n const newProperties = {\n name: this.name,\n role_name: this.roleName,\n required: this.required,\n label: this.label,\n group: this.group,\n placeholder: this.placeholder,\n default: this.defaultValue,\n options: this.options,\n } as Partial<ITemplateField>;\n\n this.cleanupOptions();\n console.log('[FIELD PROPERTIES] Will update', this.fieldName, newProperties);\n updateField(this.endpoint, this.templateId, this.fieldName, newProperties)\n .then(updatedField => {\n console.log('[FIELD PROPERTIES] Updated', updatedField);\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === this.fieldName);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n Store.updateTemplate(this.templateId, newTemplate);\n this.settingsChanged?.emit({fieldName: this.fieldName, field: updatedField});\n this.close?.emit();\n\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(() => {\n console.log('[FIELD PROPERTIES] Update failed', e);\n });\n }\n\n async handleDelete(e: any) {\n e.stopPropagation();\n deleteField(this.endpoint, this.templateId, this.fieldName)\n .then(() => {\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields = newTemplate.fields.filter(field => field.name !== this.fieldName);\n Store.updateTemplate(this.templateId, newTemplate);\n this.delete?.emit({templateId: this.templateId, roleName: this.roleName});\n document.getElementById('verdocs-template-field-properties')?.remove();\n })\n .catch(e => {\n console.log('[FIELD PROPERTIES] Deletion error', e);\n });\n }\n\n cleanupOptions() {\n this.options = [...this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '')];\n if (!this.options.find(opt => !opt.id && !opt.label)) {\n this.options = [...this.options, {id: '', label: ''}];\n }\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>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !(this.template?.fields || []).some(field => field.name === this.fieldName)) {\n return <Host class=\"empty\" />;\n }\n\n if (this.helpText && this.showingHelp) {\n return (\n <Host>\n <h6>\n {capitalize(this.fieldType)} Settings <div style={{flex: '1'}} />\n <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = false)} />\n </h6>\n\n <p class=\"instructions\" innerHTML={this.helpText} />\n </Host>\n );\n }\n\n const hasOptions = this.options.filter(opt => (opt.id || '').trim() !== '' || (opt.label || '').trim() !== '').length > 0;\n const saveDisabled = !this.dirty || (this.type === 'dropdown' && !hasOptions);\n\n return (\n <Host id=\"verdocs-template-field-properties\">\n <h6>\n {capitalize(this.fieldType.replace(/_/g, ' '))} Settings <div style={{flex: '1'}} />\n {this.helpText && <div class=\"help-icon\" innerHTML={HelpIcon} onClick={() => (this.showingHelp = true)} />}\n </h6>\n\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Field Name\"\n value={this.name}\n autocomplete=\"off\"\n // helpText=\"The internal name of the field. Must be unique, and contain only letters, numbers, and dashes. After an envelope is completed, the value entered by the signer will be tagged with this key.\"\n placeholder=\"Field Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Optional Label\"\n value={this.label}\n autocomplete=\"off\"\n placeholder=\"Optional Label...\"\n onInput={(e: any) => {\n this.label = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"input-label\">Role:</div>\n <verdocs-select-input\n value={this.roleName}\n options={(this.template?.roles || []).map(role => ({label: role.name, value: role.name}))}\n onInput={(e: any) => {\n this.roleName = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-value\"\n label=\"Default Value\"\n value={this.defaultValue}\n autocomplete=\"off\"\n placeholder=\"Pre-filled value...\"\n onInput={(e: any) => {\n this.defaultValue = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.type === 'radio' && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-label\"\n label=\"Group\"\n value={this.group}\n autocomplete=\"off\"\n helpText=\"Enable exclusive selections. Only one option within the same group may be selected at a time.\"\n placeholder=\"Group...\"\n onInput={(e: any) => {\n this.group = (e.target.value || '')\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '');\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {['textbox', 'textarea'].includes(this.type) && (\n <div class=\"row\" style={{marginTop: '10px', marginBottom: '10px'}}>\n <verdocs-text-input\n id=\"verdocs-field-placeholder\"\n label=\"Placeholder\"\n value={this.placeholder}\n autocomplete=\"off\"\n placeholder=\"Placeholder...\"\n onInput={(e: any) => {\n this.placeholder = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Required\n </label>\n <verdocs-checkbox\n id=\"verdocs-is-required\"\n name=\"is-required\"\n checked={this.required}\n value=\"on\"\n onInput={(e: any) => {\n this.required = e.target.checked;\n this.dirty = true;\n }}\n />\n </div>\n\n {this.type === 'dropdown' && (\n <div class=\"row\" style={{marginTop: '15px', marginBottom: '15px'}}>\n <label htmlFor=\"verdocs-is-required\" class=\"input-label\">\n Options\n </label>\n </div>\n )}\n\n {this.type === 'dropdown' && (\n <div class=\"options\">\n <div class=\"options-header\">\n <div class=\"options-header-label\">ID</div>\n <dev class=\"options-header-label\">Label</dev>\n </div>\n\n {this.options.map((option, index) => (\n <div class=\"row option-row\" key={index}>\n <verdocs-text-input\n value={option.id}\n placeholder=\"Unique ID\"\n onInput={(e: any) => {\n this.options[index].id = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <verdocs-text-input\n value={option.label}\n placeholder=\"Display label\"\n onInput={(e: any) => {\n this.options[index].label = e.target.value;\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n <button\n innerHTML={TrashIcon}\n class=\"remove-button\"\n onClick={() => {\n this.options = this.options.filter(opt => opt.id !== option.id);\n this.dirty = true;\n this.cleanupOptions();\n }}\n />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <button class=\"delete-button\" disabled={this.dirty} onClick={e => this.handleDelete(e)} innerHTML={TrashIcon} />\n <div style={{flex: '1'}} />\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Cancel\" disabled={!this.dirty} onClick={e => this.handleCancel(e)} />\n <verdocs-button size=\"small\" label=\"Save\" disabled={saveDisabled} onClick={e => !saveDisabled && this.handleSave(e)} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-
|
|
2
2
|
import { VerdocsEndpoint, getTemplate } from '@verdocs/js-sdk';
|
3
3
|
import { V as VerdocsToast } from './p-04c07b7b.js';
|
4
4
|
import { S as SDKError } from './p-fd97809c.js';
|
5
|
-
import { S as Store } from './p-
|
5
|
+
import { S as Store } from './p-3828cb31.js';
|
6
6
|
import { d as defineCustomElement$4 } from './p-070bebd7.js';
|
7
7
|
import { d as defineCustomElement$3 } from './p-84ae0283.js';
|
8
8
|
import { d as defineCustomElement$2 } from './p-1ae5d7e0.js';
|
@@ -172,4 +172,4 @@ function defineCustomElement() {
|
|
172
172
|
|
173
173
|
export { VerdocsTemplateBuildTabs as V, defineCustomElement as d };
|
174
174
|
|
175
|
-
//# sourceMappingURL=p-
|
175
|
+
//# sourceMappingURL=p-eb2ad8d0.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-6c4fe42c.js","mappings":";;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,8mDAA8mD,CAAC;AACnpD,uCAAe,2BAA2B;;ACM1C,MAAM,QAAQ,GACZ,q7BAAq7B,CAAC;AAEx7B,MAAM,QAAQ,GAAG,onBAAonB,CAAC;AAEtoB,MAAM,KAAK,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;MAW3D,wBAAwB;;;;;;QAC3B,uBAAkB,GAAG,IAAI,CAAC;wBAKE,eAAe,CAAC,UAAU,EAAE;0BAOE,IAAI;oBAKN,SAAS;uBAatD,IAAI;wBACe,IAAI;;IAE1C,oBAAoB;QAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,MAAM,gBAAgB;QACpB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,KAAK,CAAC,SAAS,CACb,WAAW,EACX,IAAI,CAAC,UAAU,EACf,MAAM,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,EACjD,KAAK,EACL,CAAC,QAAmB;YAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;Y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,iCAAyB,EACzB,WAAK,KAAK,EAAC,KAAK,IACd,uBAAkB,EAClB,WAAK,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,UAAU,CAAO,EAC1C,WAAK,KAAK,EAAC,aAAa,EAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,GAAI,CAClF,EACN,WAAK,KAAK,EAAC,KAAK,IACd,yBAAoB,EACpB,WAAK,KAAK,EAAC,OAAO,IAAE,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,CAAO,CAC1C,EACN,WAAK,KAAK,EAAC,KAAK,IACd,+BAA0B,EAC1B,WAAK,KAAK,EAAC,OAAO,IAAE,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,SAAS,IAAG,QAAQ,GAAG,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,WAAW,IAAG,SAAS,GAAG,QAAQ,CAAO,CAC9G,EACN,WAAK,KAAK,EAAC,KAAK,IACd,4BAAuB,EACvB,WAAK,KAAK,EAAC,OAAO,IAAE,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,IAAG,MAAM,CAAC,IAAI,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,CAAO,CACvG,EACN,WAAK,KAAK,EAAC,KAAK,IACd,yBAAoB,EACpB,WAAK,KAAK,EAAC,OAAO,IAAE,MAAA,IAAI,CAAC,QAAQ;eAAE,OAAO,aAAe,CACrD,CACF,CACe,CACnB,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.scss?tag=verdocs-template-build-tabs","src/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-build-tabs {\n flex: 1;\n gap: 15px;\n display: flex;\n align-items: center;\n flex-direction: row;\n font-family: $verdocs-primary-font;\n\n verdocs-button-panel {\n svg {\n transform: scale(0.8);\n }\n }\n\n verdocs-template-attachments,\n verdocs-template-roles {\n margin: 20px;\n }\n\n verdocs-template-fields {\n border-top: 1px solid #777777;\n }\n\n verdocs-template-attachments {\n padding: 20px;\n background: #ffffff;\n }\n\n verdocs-template-fields {\n width: 100%;\n }\n\n verdocs-preview {\n flex: 1;\n }\n}\n\n.template-details-panel {\n .row {\n display: flex;\n flex-direction: row;\n gap: 8px;\n margin: 10px 0;\n }\n\n label {\n flex: 0 0 70px;\n }\n\n .value {\n flex: 1;\n font-weight: 300;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .icon-button {\n cursor: pointer;\n opacity: 0.8;\n flex: 0;\n width: 18px;\n height: 18px;\n\n svg {\n stroke: #000000;\n width: 18px;\n height: 18px;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import {format} from 'date-fns';\nimport {getTemplate, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Event, EventEmitter, Host, Watch, State} from '@stencil/core';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" fill=\"#5c6575\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\nconst CopyIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75\" /></svg>`;\n\nconst STEPS = ['attachments', 'roles', 'settings', 'fields', 'preview'];\nexport type TVerdocsBuildStep = 'attachments' | 'roles' | 'settings' | 'fields' | 'preview';\n\n/**\n * Display a set of tabs for the template builder.\n */\n@Component({\n tag: 'verdocs-template-build-tabs',\n styleUrl: 'verdocs-template-build-tabs.scss',\n shadow: false,\n})\nexport class VerdocsTemplateBuildTabs {\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. 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 @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\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 },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[BUILD_TABS] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n @Watch('step')\n onStepChanged(newStep: TVerdocsBuildStep) {\n console.log('[BUILD_TABS] Step changed', newStep);\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD_TABS] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n this.step = 'attachments';\n console.log('[BUILD_TABS] Missing required template ID, forcing view to attachments');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[BUILD_TABS] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n setStep(e: any) {\n console.log('[BUILD_TABS] Selected step', e.detail.tab.id);\n e.stopPropagation();\n e.preventDefault();\n this.step = e.detail.tab.id;\n this.stepChanged?.emit(e.detail.tab.id);\n }\n\n copyTemplateId() {\n navigator.clipboard\n .writeText(this.templateId)\n .then(() => {\n VerdocsToast('Template ID copied', {style: 'success', duration: 3000});\n })\n .catch(e => {\n console.warn('[BUILD_TABS] Error copying to clipboard', e);\n this.sdkError?.emit(e);\n });\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>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const canEditRoles = (this.template?.documents || []).length > 0;\n let canEditFields = canEditRoles && (this.template?.roles || []).length > 0;\n const canPreview = canEditFields && (this.template?.fields || []).length > 0;\n\n let selectedStepIndex = Math.max(STEPS.indexOf(this.step), 0);\n if (!canPreview && selectedStepIndex >= 4) {\n selectedStepIndex = 3;\n }\n if (!canEditFields && selectedStepIndex >= 3) {\n selectedStepIndex = 1;\n }\n if (!canEditRoles && selectedStepIndex >= 1) {\n selectedStepIndex = 0;\n }\n\n return (\n <Host>\n <verdocs-tabs\n onSelectTab={e => this.setStep(e)}\n selectedTab={selectedStepIndex}\n tabs={[\n {id: 'attachments', disabled: false, label: 'Attachment(s)'},\n {id: 'roles', disabled: !canEditRoles, label: 'Roles'},\n {id: 'settings', disabled: !canEditFields, label: 'Settings'},\n {id: 'fields', disabled: !canEditFields, label: 'Fields'},\n {id: 'preview', disabled: !canPreview, label: 'Preview/Send'},\n ]}\n />\n\n {this.templateId && (\n <div class=\"info\">\n <verdocs-button-panel icon={HelpIcon}>\n <div class=\"template-details-panel\">\n <h6>Template Details</h6>\n <div class=\"row\">\n <label>ID:</label>\n <div class=\"value\">{this.templateId}</div>\n <div class=\"icon-button\" innerHTML={CopyIcon} onClick={() => this.copyTemplateId()} />\n </div>\n <div class=\"row\">\n <label>Name:</label>\n <div class=\"value\">{this.template?.name}</div>\n </div>\n <div class=\"row\">\n <label>Visibility:</label>\n <div class=\"value\">{this.template?.is_public ? 'Public' : this.template?.is_personal ? 'Private' : 'Shared'}</div>\n </div>\n <div class=\"row\">\n <label>Created:</label>\n <div class=\"value\">{this.template?.counter ? format(new Date(this.template?.created_at), 'P p') : ''}</div>\n </div>\n <div class=\"row\">\n <label>Used:</label>\n <div class=\"value\">{this.template?.counter} time(s)</div>\n </div>\n </div>\n </verdocs-button-panel>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-eb2ad8d0.js","mappings":";;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,8mDAA8mD,CAAC;AACnpD,uCAAe,2BAA2B;;ACM1C,MAAM,QAAQ,GACZ,q7BAAq7B,CAAC;AAEx7B,MAAM,QAAQ,GAAG,onBAAonB,CAAC;AAEtoB,MAAM,KAAK,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;MAW3D,wBAAwB;;;;;;QAC3B,uBAAkB,GAAG,IAAI,CAAC;wBAKE,eAAe,CAAC,UAAU,EAAE;0BAOE,IAAI;oBAKN,SAAS;uBAatD,IAAI;wBACe,IAAI;;IAE1C,oBAAoB;QAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAED,MAAM,gBAAgB;QACpB,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,KAAK,CAAC,SAAS,CACb,WAAW,EACX,IAAI,CAAC,UAAU,EACf,MAAM,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,EACjD,KAAK,EACL,CAAC,QAAmB;YAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACtB,CACF,CAAC;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,WAAK,KAAK,EAAC,OAAO,IAAE,IAAI,CAAC,UAAU,CAAO,EAC1C,WAAK,KAAK,EAAC,aAAa,EAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,GAAI,CAClF,EACN,WAAK,KAAK,EAAC,KAAK,IACd,yBAAoB,EACpB,WAAK,KAAK,EAAC,OAAO,IAAE,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,CAAO,CAC1C,EACN,WAAK,KAAK,EAAC,KAAK,IACd,+BAA0B,EAC1B,WAAK,KAAK,EAAC,OAAO,IAAE,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,SAAS,IAAG,QAAQ,GAAG,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,WAAW,IAAG,SAAS,GAAG,QAAQ,CAAO,CAC9G,EACN,WAAK,KAAK,EAAC,KAAK,IACd,4BAAuB,EACvB,WAAK,KAAK,EAAC,OAAO,IAAE,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,IAAG,MAAM,CAAC,IAAI,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,CAAO,CACvG,EACN,WAAK,KAAK,EAAC,KAAK,IACd,yBAAoB,EACpB,WAAK,KAAK,EAAC,OAAO,IAAE,MAAA,IAAI,CAAC,QAAQ;eAAE,OAAO,aAAe,CACrD,CACF,CACe,CACnB,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.scss?tag=verdocs-template-build-tabs","src/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-build-tabs {\n flex: 1;\n gap: 15px;\n display: flex;\n align-items: center;\n flex-direction: row;\n font-family: $verdocs-primary-font;\n\n verdocs-button-panel {\n svg {\n transform: scale(0.8);\n }\n }\n\n verdocs-template-attachments,\n verdocs-template-roles {\n margin: 20px;\n }\n\n verdocs-template-fields {\n border-top: 1px solid #777777;\n }\n\n verdocs-template-attachments {\n padding: 20px;\n background: #ffffff;\n }\n\n verdocs-template-fields {\n width: 100%;\n }\n\n verdocs-preview {\n flex: 1;\n }\n}\n\n.template-details-panel {\n .row {\n display: flex;\n flex-direction: row;\n gap: 8px;\n margin: 10px 0;\n }\n\n label {\n flex: 0 0 70px;\n }\n\n .value {\n flex: 1;\n font-weight: 300;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .icon-button {\n cursor: pointer;\n opacity: 0.8;\n flex: 0;\n width: 18px;\n height: 18px;\n\n svg {\n stroke: #000000;\n width: 18px;\n height: 18px;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import {format} from 'date-fns';\nimport {getTemplate, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Event, EventEmitter, Host, Watch, State} from '@stencil/core';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst HelpIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" fill=\"#5c6575\"><path d=\"M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z\"/></svg>';\n\nconst CopyIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75\" /></svg>`;\n\nconst STEPS = ['attachments', 'roles', 'settings', 'fields', 'preview'];\nexport type TVerdocsBuildStep = 'attachments' | 'roles' | 'settings' | 'fields' | 'preview';\n\n/**\n * Display a set of tabs for the template builder.\n */\n@Component({\n tag: 'verdocs-template-build-tabs',\n styleUrl: 'verdocs-template-build-tabs.scss',\n shadow: false,\n})\nexport class VerdocsTemplateBuildTabs {\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. 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 @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\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 },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[BUILD_TABS] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n @Watch('step')\n onStepChanged(newStep: TVerdocsBuildStep) {\n console.log('[BUILD_TABS] Step changed', newStep);\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD_TABS] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n this.step = 'attachments';\n console.log('[BUILD_TABS] Missing required template ID, forcing view to attachments');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[BUILD_TABS] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n setStep(e: any) {\n console.log('[BUILD_TABS] Selected step', e.detail.tab.id);\n e.stopPropagation();\n e.preventDefault();\n this.step = e.detail.tab.id;\n this.stepChanged?.emit(e.detail.tab.id);\n }\n\n copyTemplateId() {\n navigator.clipboard\n .writeText(this.templateId)\n .then(() => {\n VerdocsToast('Template ID copied', {style: 'success', duration: 3000});\n })\n .catch(e => {\n console.warn('[BUILD_TABS] Error copying to clipboard', e);\n this.sdkError?.emit(e);\n });\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>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const canEditRoles = (this.template?.documents || []).length > 0;\n let canEditFields = canEditRoles && (this.template?.roles || []).length > 0;\n const canPreview = canEditFields && (this.template?.fields || []).length > 0;\n\n let selectedStepIndex = Math.max(STEPS.indexOf(this.step), 0);\n if (!canPreview && selectedStepIndex >= 4) {\n selectedStepIndex = 3;\n }\n if (!canEditFields && selectedStepIndex >= 3) {\n selectedStepIndex = 1;\n }\n if (!canEditRoles && selectedStepIndex >= 1) {\n selectedStepIndex = 0;\n }\n\n return (\n <Host>\n <verdocs-tabs\n onSelectTab={e => this.setStep(e)}\n selectedTab={selectedStepIndex}\n tabs={[\n {id: 'attachments', disabled: false, label: 'Attachment(s)'},\n {id: 'roles', disabled: !canEditRoles, label: 'Roles'},\n {id: 'settings', disabled: !canEditFields, label: 'Settings'},\n {id: 'fields', disabled: !canEditFields, label: 'Fields'},\n {id: 'preview', disabled: !canPreview, label: 'Preview/Send'},\n ]}\n />\n\n {this.templateId && (\n <div class=\"info\">\n <verdocs-button-panel icon={HelpIcon}>\n <div class=\"template-details-panel\">\n <h6>Template Details</h6>\n <div class=\"row\">\n <label>ID:</label>\n <div class=\"value\">{this.templateId}</div>\n <div class=\"icon-button\" innerHTML={CopyIcon} onClick={() => this.copyTemplateId()} />\n </div>\n <div class=\"row\">\n <label>Name:</label>\n <div class=\"value\">{this.template?.name}</div>\n </div>\n <div class=\"row\">\n <label>Visibility:</label>\n <div class=\"value\">{this.template?.is_public ? 'Public' : this.template?.is_personal ? 'Private' : 'Shared'}</div>\n </div>\n <div class=\"row\">\n <label>Created:</label>\n <div class=\"value\">{this.template?.counter ? format(new Date(this.template?.created_at), 'P p') : ''}</div>\n </div>\n <div class=\"row\">\n <label>Used:</label>\n <div class=\"value\">{this.template?.counter} time(s)</div>\n </div>\n </div>\n </verdocs-button-panel>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment, d as Ho
|
|
2
2
|
import { i as interact } from './p-a901dff2.js';
|
3
3
|
import { updateField, VerdocsEndpoint, getRGBA } from '@verdocs/js-sdk';
|
4
4
|
import { S as SettingsIcon } from './p-b0766439.js';
|
5
|
-
import { S as Store } from './p-
|
5
|
+
import { S as Store } from './p-3828cb31.js';
|
6
6
|
import { d as defineCustomElement$9 } from './p-0e332769.js';
|
7
7
|
import { d as defineCustomElement$8 } from './p-3201d529.js';
|
8
8
|
import { d as defineCustomElement$7 } from './p-84ae0283.js';
|
@@ -10,7 +10,7 @@ import { d as defineCustomElement$6 } from './p-7f32e087.js';
|
|
10
10
|
import { d as defineCustomElement$5 } from './p-1ae5d7e0.js';
|
11
11
|
import { d as defineCustomElement$4 } from './p-6719b0d7.js';
|
12
12
|
import { d as defineCustomElement$3 } from './p-62743fd3.js';
|
13
|
-
import { d as defineCustomElement$2 } from './p-
|
13
|
+
import { d as defineCustomElement$2 } from './p-eb12a71c.js';
|
14
14
|
import { d as defineCustomElement$1 } from './p-325b3828.js';
|
15
15
|
|
16
16
|
const verdocsFieldTextboxCss = "@-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-field-textbox{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;width:150px;height:15px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox .edge-top,verdocs-field-textbox .edge-right,verdocs-field-textbox .edge-left,verdocs-field-textbox .edge-bottom{position:absolute;z-index:10}verdocs-field-textbox .edge-top{top:-2px;left:0;right:0;height:5px}verdocs-field-textbox .edge-right{top:0;bottom:0;right:-2px;width:5px}verdocs-field-textbox .edge-left{top:0;left:-2px;bottom:0;width:5px}verdocs-field-textbox .edge-bottom{bottom:-2px;left:0;right:0;height:5px}verdocs-field-textbox input{cursor:inherit;width:100%;height:100%;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;position:absolute;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.disabled input{opacity:0.5}verdocs-field-textbox textarea{cursor:inherit;width:100%;height:100%;resize:none;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox textarea.hide{display:none}verdocs-field-textbox.disabled textarea{opacity:0.5}verdocs-field-textbox label{top:-14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-top-left-radius:2px;border-top-right-radius:2px}verdocs-field-textbox.required{border:1px solid rgb(204, 0, 0)}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}verdocs-field-textbox .settings-icon{position:absolute;top:-4px;left:-18px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-textbox .settings-icon svg{fill:#707ae5}verdocs-field-textbox .settings-icon:hover{opacity:1}@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)}}";
|
@@ -227,4 +227,4 @@ function defineCustomElement() {
|
|
227
227
|
|
228
228
|
export { VerdocsFieldTextbox as V, defineCustomElement as d };
|
229
229
|
|
230
|
-
//# sourceMappingURL=p-
|
230
|
+
//# sourceMappingURL=p-ecfc85ae.js.map
|