@verdocs/web-sdk 5.0.25 → 5.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{Datastore-931fd77e.js → Datastore-e39f8315.js} +29 -24
- package/dist/cjs/Datastore-e39f8315.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 +6 -4
- 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-fields/verdocs-template-fields.js +4 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +1 -2
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js.map +1 -1
- package/dist/components/{p-e4a97ad5.js → p-143a763f.js} +3 -3
- package/dist/components/{p-e4a97ad5.js.map → p-143a763f.js.map} +1 -1
- package/dist/components/{p-2d8b46e5.js → p-16b073b8.js} +2 -2
- package/dist/components/{p-2d8b46e5.js.map → p-16b073b8.js.map} +1 -1
- package/dist/components/{p-e9528d9f.js → p-1d4829fb.js} +3 -3
- package/dist/components/{p-e9528d9f.js.map → p-1d4829fb.js.map} +1 -1
- package/dist/components/{p-ca3e45f3.js → p-27a8eef0.js} +2 -2
- package/dist/components/{p-ca3e45f3.js.map → p-27a8eef0.js.map} +1 -1
- package/dist/components/{p-fcf13666.js → p-550377ba.js} +13 -13
- package/dist/components/{p-fcf13666.js.map → p-550377ba.js.map} +1 -1
- package/dist/components/{p-1ce18a42.js → p-619747d7.js} +2 -2
- package/dist/components/{p-1ce18a42.js.map → p-619747d7.js.map} +1 -1
- package/dist/components/{p-e95ded6b.js → p-631808d5.js} +18 -15
- package/dist/components/p-631808d5.js.map +1 -0
- package/dist/components/{p-e4799d51.js → p-7bd7baa6.js} +3 -3
- package/dist/components/{p-e4799d51.js.map → p-7bd7baa6.js.map} +1 -1
- package/dist/components/{p-1ab01232.js → p-813ed998.js} +3 -3
- package/dist/components/{p-1ab01232.js.map → p-813ed998.js.map} +1 -1
- package/dist/components/{p-a415ce22.js → p-8c965486.js} +3 -3
- package/dist/components/{p-a415ce22.js.map → p-8c965486.js.map} +1 -1
- package/dist/components/{p-78de9e65.js → p-90e3fae6.js} +4 -5
- package/dist/components/p-90e3fae6.js.map +1 -0
- package/dist/components/{p-681e7dd4.js → p-99128b47.js} +3 -3
- package/dist/components/{p-681e7dd4.js.map → p-99128b47.js.map} +1 -1
- package/dist/components/{p-53168eec.js → p-ac7694c0.js} +2 -2
- package/dist/components/{p-53168eec.js.map → p-ac7694c0.js.map} +1 -1
- package/dist/components/{p-ecfc85ae.js → p-b5e479db.js} +3 -3
- package/dist/components/{p-ecfc85ae.js.map → p-b5e479db.js.map} +1 -1
- package/dist/components/{p-f6156f7a.js → p-c422d9a0.js} +3 -3
- package/dist/components/{p-f6156f7a.js.map → p-c422d9a0.js.map} +1 -1
- package/dist/components/{p-c4c9feda.js → p-c4310332.js} +3 -3
- package/dist/components/{p-c4c9feda.js.map → p-c4310332.js.map} +1 -1
- package/dist/components/{p-91d65fde.js → p-c5045788.js} +3 -3
- package/dist/components/{p-91d65fde.js.map → p-c5045788.js.map} +1 -1
- package/dist/components/{p-3828cb31.js → p-d4be87ef.js} +29 -24
- package/dist/components/p-d4be87ef.js.map +1 -0
- package/dist/components/{p-28e3b2e3.js → p-d54466ed.js} +14 -14
- package/dist/components/{p-28e3b2e3.js.map → p-d54466ed.js.map} +1 -1
- package/dist/components/{p-eb2ad8d0.js → p-e39c327c.js} +2 -2
- package/dist/components/{p-eb2ad8d0.js.map → p-e39c327c.js.map} +1 -1
- package/dist/components/{p-eb12a71c.js → p-f238b25b.js} +2 -2
- package/dist/components/{p-eb12a71c.js.map → p-f238b25b.js.map} +1 -1
- package/dist/components/{p-bfed2f8d.js → p-f7cf2401.js} +2 -2
- package/dist/components/{p-bfed2f8d.js.map → p-f7cf2401.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-3f924d94.js → Datastore-77cb8d9c.js} +29 -24
- package/dist/esm/Datastore-77cb8d9c.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 +6 -4
- 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-77cb8d9c.js +2 -0
- package/dist/esm-es5/Datastore-77cb8d9c.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/verdocs-web-sdk/{p-f6ed768d.entry.js → p-00063a35.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b1a9dc79.entry.js → p-0a745e87.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-0a745e87.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-1902bf04.entry.js → p-104863b5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9ab8bcaa.system.entry.js → p-1f2c019d.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fc29a754.entry.js → p-25aa3bd3.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-52c3e8b0.system.js +2 -0
- package/dist/verdocs-web-sdk/p-52c3e8b0.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7975ec40.system.entry.js → p-578e65d4.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-407c0725.system.entry.js → p-5bcf921b.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-26106576.system.entry.js → p-5c065719.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7ffebea3.entry.js → p-5ebfe76c.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-086ee7f1.system.entry.js → p-6eee289a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-cc230abf.entry.js → p-6f1e2f2f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4e3790db.system.entry.js → p-70247599.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e84cf41e.entry.js → p-8369273d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f84ba101.entry.js → p-a285560f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-80952d72.system.entry.js → p-a41e6f04.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-a41e6f04.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-75e53ae1.entry.js → p-b7799ec0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a4d94e2e.entry.js → p-b8945173.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d4aff253.entry.js → p-b9fee1a7.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-34c2298e.system.entry.js → p-cabfdb9d.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-90690dde.system.entry.js → p-d1d95df4.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-60da8e6b.entry.js → p-d3a8c6b8.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-d4be87ef.js +2 -0
- package/dist/verdocs-web-sdk/p-d4be87ef.js.map +1 -0
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-208a8b41.system.entry.js → p-e3efeb57.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-dc5c275f.system.entry.js → p-e83d06d4.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-32cf09f0.system.entry.js → p-ecfe8987.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/Datastore-931fd77e.js.map +0 -1
- package/dist/components/p-3828cb31.js.map +0 -1
- package/dist/components/p-78de9e65.js.map +0 -1
- package/dist/components/p-e95ded6b.js.map +0 -1
- package/dist/esm/Datastore-3f924d94.js.map +0 -1
- package/dist/esm-es5/Datastore-3f924d94.js +0 -2
- package/dist/esm-es5/Datastore-3f924d94.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3828cb31.js +0 -2
- package/dist/verdocs-web-sdk/p-3828cb31.js.map +0 -1
- package/dist/verdocs-web-sdk/p-65be7617.system.js +0 -2
- package/dist/verdocs-web-sdk/p-65be7617.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-80952d72.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-b1a9dc79.entry.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-f6ed768d.entry.js.map → p-00063a35.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-1902bf04.entry.js.map → p-104863b5.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9ab8bcaa.system.entry.js.map → p-1f2c019d.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fc29a754.entry.js.map → p-25aa3bd3.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7975ec40.system.entry.js.map → p-578e65d4.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-407c0725.system.entry.js.map → p-5bcf921b.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-26106576.system.entry.js.map → p-5c065719.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7ffebea3.entry.js.map → p-5ebfe76c.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-086ee7f1.system.entry.js.map → p-6eee289a.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-cc230abf.entry.js.map → p-6f1e2f2f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4e3790db.system.entry.js.map → p-70247599.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e84cf41e.entry.js.map → p-8369273d.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f84ba101.entry.js.map → p-a285560f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-75e53ae1.entry.js.map → p-b7799ec0.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-a4d94e2e.entry.js.map → p-b8945173.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d4aff253.entry.js.map → p-b9fee1a7.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-34c2298e.system.entry.js.map → p-cabfdb9d.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-90690dde.system.entry.js.map → p-d1d95df4.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-60da8e6b.entry.js.map → p-d3a8c6b8.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-208a8b41.system.entry.js.map → p-e3efeb57.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-dc5c275f.system.entry.js.map → p-e83d06d4.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-32cf09f0.system.entry.js.map → p-ecfe8987.system.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
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;KACH;IAED,kBAAkB;QAChB,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACjD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;SAChC;KACF;IAGD,mBAAmB,CAAC,aAAqB;QACv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,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-e39c327c.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;KACH;IAED,kBAAkB;QAChB,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACjD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;SAChC;KACF;IAGD,mBAAmB,CAAC,aAAqB;QACvC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,aAAa,CAAC,CAAC;QA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E,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,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-d4be87ef.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-f238b25b.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-eb12a71c.js","mappings":";;;;;;;;;;;;AAAA,MAAM,iCAAiC,GAAG,wrKAAwrK,CAAC;AACnuK,6CAAe,iCAAiC;;ACIhD,MAAM,UAAU,GAAG,CAAC,GAAW,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE/E,MAAM,SAAS,GAAG,ukBAAukB,CAAC;AAE1lB,MAAM,QAAQ,GACZ,s6BAAs6B,CAAC;MAU55B,8BAA8B;;;;;;;;QACjC,uBAAkB,GAAG,IAAI,CAAC;wBAQE,eAAe,CAAC,UAAU,EAAE;0BAKnC,EAAE;yBAKY,EAAE;wBAKjB,EAAE;qBAwBJ,KAAK;qBACd,EAAE;oBACH,SAAuB;oBACvB,EAAE;wBACE,KAAK;wBACL,EAAE;qBACL,EAAE;yBACE,EAAE;uBACJ,EAAE;2BACE,EAAE;4BACD,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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-f238b25b.js","mappings":";;;;;;;;;;;;AAAA,MAAM,iCAAiC,GAAG,wrKAAwrK,CAAC;AACnuK,6CAAe,iCAAiC;;ACIhD,MAAM,UAAU,GAAG,CAAC,GAAW,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE/E,MAAM,SAAS,GAAG,ukBAAukB,CAAC;AAE1lB,MAAM,QAAQ,GACZ,s6BAAs6B,CAAC;MAU55B,8BAA8B;;;;;;;;QACjC,uBAAkB,GAAG,IAAI,CAAC;wBAQE,eAAe,CAAC,UAAU,EAAE;0BAKnC,EAAE;yBAKY,EAAE;wBAKjB,EAAE;qBAwBJ,KAAK;qBACd,EAAE;oBACH,SAAuB;oBACvB,EAAE;wBACE,KAAK;wBACL,EAAE;qBACL,EAAE;yBACE,EAAE;uBACJ,EAAE;2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AAC,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, F as Fragme
|
|
2
2
|
import { VerdocsEndpoint, getEnvelope, getDocumentDownloadLink, cancelEnvelope, userCanCancelEnvelope, integerSequence } from '@verdocs/js-sdk';
|
3
3
|
import { s as saveEnvelopesAsZip } from './p-af5ecc92.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-d4be87ef.js';
|
6
6
|
import { d as defineCustomElement$6 } from './p-0e332769.js';
|
7
7
|
import { d as defineCustomElement$5 } from './p-9fb98ea2.js';
|
8
8
|
import { d as defineCustomElement$4 } from './p-b99b485b.js';
|
@@ -262,4 +262,4 @@ function defineCustomElement() {
|
|
262
262
|
|
263
263
|
export { VerdocsView as V, defineCustomElement as d };
|
264
264
|
|
265
|
-
//# sourceMappingURL=p-
|
265
|
+
//# sourceM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/embeds/verdocs-view/verdocs-view.scss?tag=verdocs-view","src/components/embeds/verdocs-view/verdocs-view.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-view {\n display: flex;\n overflow: hidden;\n min-height: 600px;\n position: relative;\n align-items: center;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n\n .document {\n flex: 1;\n width: 100%;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n max-width: 1200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n //justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .loading-indicator {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 10000;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.7);\n }\n}\n\n// Styled separately because the header is often re-parented\n#verdocs-view-header {\n width: 100%;\n color: #fff;\n display: flex;\n z-index: 1000;\n flex: 0 0 56px;\n padding: 0 20px;\n font-size: 12px;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow:\n 0 4px 4px 0 rgb(0 0 0 / 24%),\n 0 0 4px 0 rgb(0 0 0 / 12%);\n\n @media all and (max-width: 500px) {\n padding: 0 10px;\n }\n\n .inner {\n width: 100%;\n display: flex;\n margin: 0 auto;\n padding: 0 20px;\n max-width: 1200px;\n align-items: center;\n flex-direction: row;\n\n @media all and (max-width: 500px) {\n padding: 0 10px;\n }\n }\n\n .logo {\n width: 80px;\n display: none;\n margin: -6px 0 0 0;\n }\n\n .title {\n font-size: 18px;\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n}\n","import {cancelEnvelope, getDocumentDownloadLink, getEnvelope, IEnvelope, integerSequence, userCanCancelEnvelope, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Element, Event, Host, Prop, EventEmitter, Fragment, State} from '@stencil/core';\nimport {saveEnvelopesAsZip} from '../../../utils/utils';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Render the documents attached to an envelope in read-only (view) mode. All documents are\n * displayed in order.\n *\n * ```ts\n * <verdocs-view\n * envelopeId={envelopeId}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-view',\n styleUrl: 'verdocs-view.scss',\n shadow: false,\n})\nexport class VerdocsView {\n private envelopeListenerId = null;\n\n @Element() component: HTMLElement;\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 | null = null;\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the header 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 (e.g. \"fixed\").\n *\n * The movement of the header 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 header's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() headerTargetId: 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 envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n /**\n * Event fired when the user clicks Send Another to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) another: EventEmitter;\n\n /**\n * Event fired when the user clicks Send Another to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) view: EventEmitter;\n\n /**\n * Event fired when the user clicks Done to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) next: EventEmitter;\n @State() canceling = false;\n @State() showCancelDone = false;\n @State() showLoadError = false;\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n async componentWillLoad() {\n if (!this.endpoint) {\n this.endpoint = VerdocsEndpoint.getDefault();\n this.endpoint.loadSession();\n }\n\n if (!this.envelopeId) {\n console.error(`[VIEW] Missing required envelopeId`);\n return;\n }\n\n this.listenToEnvelope();\n if (!this.envelope) {\n try {\n console.log('[VIEW] Loading envelope...');\n this.envelope = await getEnvelope(this.endpoint, this.envelopeId);\n console.log('[VIEW] Loaded envelope', this.envelope);\n } catch (e) {\n this.showLoadError = true;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n }\n\n componentDidRender() {\n const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;\n const headerEl = document.getElementById('verdocs-view-header');\n if (headerTarget && headerEl) {\n console.log('[VIEW] Moving header');\n headerEl.remove();\n headerTarget.append(headerEl);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToEnvelope();\n }\n\n async listenToEnvelope() {\n console.log('[SIDEBAR] Loading envelope', this.envelopeId);\n this.unlistenToEnvelope();\n Store.subscribe(\n 'envelopes',\n this.envelopeId,\n () => getEnvelope(this.endpoint, this.envelopeId),\n true,\n (envelope: IEnvelope) => {\n this.envelope = envelope;\n this.loading = false;\n },\n );\n }\n\n unlistenToEnvelope() {\n if (this.envelopeListenerId) {\n Store.store.delListener(this.envelopeListenerId);\n this.envelopeListenerId = null;\n }\n }\n\n handlePageRendered(_e: any) {\n // const pageInfo = e.detail as IDocumentPageInfo;\n // console.log('[VIEW] Page rendered', pageInfo);\n }\n\n async handleOptionSelected(e: any) {\n switch (e.detail.id) {\n case 'cancel':\n // TODO: Better option for inline-flow confirmation and alert dialogs.\n if (confirm('Are you sure you wish to cancel this envelope? This action cannot be undone.')) {\n this.canceling = true;\n cancelEnvelope(this.endpoint, this.envelopeId)\n .then(r => {\n this.canceling = false;\n console.log('[VIEW] Envelope canceled', r);\n return getEnvelope(this.endpoint, this.envelopeId);\n })\n .then(env => {\n console.log('[VIEW] Loaded new envelope details', env);\n this.envelope = env;\n })\n .catch(e => {\n this.canceling = false;\n console.log('[VIEW] Error canceling envelope', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n this.showCancelDone = true;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'canceled'});\n }\n break;\n\n case 'print':\n window.print();\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'printed'});\n break;\n\n case 'download-attachments':\n // TODO: Multiple document support\n {\n const firstDoc = this.envelope.documents.find(doc => doc.type === 'attachment');\n if (firstDoc) {\n const url = await getDocumentDownloadLink(this.endpoint, this.envelopeId, firstDoc.id);\n window.open(url, '_blank');\n }\n }\n break;\n\n case 'download-certificate':\n // TODO: Multiple certificate support\n {\n const firstCert = this.envelope.documents.find(doc => doc.type === 'certificate');\n if (firstCert) {\n const url = await getDocumentDownloadLink(this.endpoint, this.envelopeId, firstCert.id);\n window.open(url, '_blank');\n }\n }\n // saveCertificate(this.endpoint, this.envelope, this.envelope.certificate_document_id)\n // .then(() => {\n // this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n // })\n // .catch(e => {\n // console.log('Error downloading PDF', e);\n // });\n break;\n\n case 'download-all':\n saveEnvelopesAsZip(this.endpoint, [this.envelope])\n .then(() => {\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n })\n .catch(e => {\n console.log('Error downloading Zip', e);\n });\n break;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (this.showLoadError) {\n return (\n <Host>\n <verdocs-ok-dialog\n heading=\"Unable to View Envelope\"\n message={`Sorry, that envelope is not valid.`}\n buttonLabel=\"OK\"\n onNext={() => {\n this.showLoadError = false;\n }}\n />\n </Host>\n );\n }\n\n if (!this.envelope) {\n return (\n <Host>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </Host>\n );\n }\n\n const menuOptions: any[] = [{id: 'print', label: 'Print'}];\n\n if (userCanCancelEnvelope(this.endpoint.profile, this.envelope)) {\n menuOptions.push({id: 'cancel', label: 'Cancel'});\n }\n\n // Add download options to the menu\n const hasAttachments = this.envelope.documents.length > 0;\n const normalDocCount = this.envelope.documents.filter(doc => doc.type === 'attachment').length;\n const hasCertificate = this.envelope.documents.find(doc => doc.type === 'certificate') !== undefined;\n if (hasAttachments || hasCertificate) {\n menuOptions.push({label: ''});\n if (hasAttachments) {\n menuOptions.push({id: 'download-attachments', label: normalDocCount > 1 ? 'Download Documents' : 'Download Document'});\n }\n if (hasCertificate) {\n menuOptions.push({id: 'download-certificate', label: 'Download Certificate'});\n }\n if (hasAttachments && hasCertificate) {\n menuOptions.push({id: 'download-all', label: 'Download All Files'});\n }\n }\n\n return (\n <Host>\n <div id=\"verdocs-view-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div style={{marginLeft: '10px'}} />\n <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: this.headerTargetId ? '70px' : '15px'}}>\n {(this.envelope?.documents || [])\n .filter(document => document.type !== 'certificate')\n .map(envelopeDocument => {\n const pageNumbers = integerSequence(1, envelopeDocument.pages);\n\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = envelopeDocument.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-envelope-document-page\n envelopeId={this.envelopeId}\n documentId={envelopeDocument.id}\n endpoint={this.endpoint}\n type=\"filled\"\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n pageNumber={pageNumber}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n {this.showCancelDone && (\n <verdocs-ok-dialog\n heading=\"Cancelled\"\n message={`This envelope has been cancelled successfully.`}\n onNext={() => {\n this.showCancelDone = false;\n }}\n />\n )}\n {this.canceling && (\n <div class=\"loading-indicator\">\n <verdocs-loader />\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-f7cf2401.js","mappings":";;;;;;;;;;;;AAAA,MAAM,cAAc,GAAG,8yEAA8yE,CAAC;AACt0E,0BAAe,cAAc;;MCqBhB,WAAW;;;;;;;;;QACd,uBAAkB,GAAG,IAAI,CAAC;wBAOS,IAAI;0BAKlB,EAAE;8BAWS,IAAI;yBA8BvB,KAAK;8BACA,KAAK;6BACN,KAAK;uBAEX,IAAI;wBACe,IAAI;;IAE1C,MAAM,iBAAiB;;QACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,UAAU,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;SAC7B;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACpD,OAAO;SACR;QAED,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI;gBACF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,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,CACO,EACX;SACH,CAAC,CACA,EACL,IAAI,CAAC,cAAc,KAClB,yBACE,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,gDAAgD,EACzD,MAAM,EAAE;gBACN,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;aAC7B,GACD,CACH,EACA,IAAI,CAAC,SAAS,KACb,WAAK,KAAK,EAAC,mBAAmB,IAC5B,yBAAkB,CACd,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/embeds/verdocs-view/verdocs-view.scss?tag=verdocs-view","src/components/embeds/verdocs-view/verdocs-view.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-view {\n display: flex;\n overflow: hidden;\n min-height: 600px;\n position: relative;\n align-items: center;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n\n .document {\n flex: 1;\n width: 100%;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n max-width: 1200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n //justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .loading-indicator {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 10000;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.7);\n }\n}\n\n// Styled separately because the header is often re-parented\n#verdocs-view-header {\n width: 100%;\n color: #fff;\n display: flex;\n z-index: 1000;\n flex: 0 0 56px;\n padding: 0 20px;\n font-size: 12px;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow:\n 0 4px 4px 0 rgb(0 0 0 / 24%),\n 0 0 4px 0 rgb(0 0 0 / 12%);\n\n @media all and (max-width: 500px) {\n padding: 0 10px;\n }\n\n .inner {\n width: 100%;\n display: flex;\n margin: 0 auto;\n padding: 0 20px;\n max-width: 1200px;\n align-items: center;\n flex-direction: row;\n\n @media all and (max-width: 500px) {\n padding: 0 10px;\n }\n }\n\n .logo {\n width: 80px;\n display: none;\n margin: -6px 0 0 0;\n }\n\n .title {\n font-size: 18px;\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n}\n","import {cancelEnvelope, getDocumentDownloadLink, getEnvelope, IEnvelope, integerSequence, userCanCancelEnvelope, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Element, Event, Host, Prop, EventEmitter, Fragment, State} from '@stencil/core';\nimport {saveEnvelopesAsZip} from '../../../utils/utils';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Render the documents attached to an envelope in read-only (view) mode. All documents are\n * displayed in order.\n *\n * ```ts\n * <verdocs-view\n * envelopeId={envelopeId}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-view',\n styleUrl: 'verdocs-view.scss',\n shadow: false,\n})\nexport class VerdocsView {\n private envelopeListenerId = null;\n\n @Element() component: HTMLElement;\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 | null = null;\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the header 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 (e.g. \"fixed\").\n *\n * The movement of the header 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 header's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() headerTargetId: 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 envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n /**\n * Event fired when the user clicks Send Another to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) another: EventEmitter;\n\n /**\n * Event fired when the user clicks Send Another to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) view: EventEmitter;\n\n /**\n * Event fired when the user clicks Done to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) next: EventEmitter;\n @State() canceling = false;\n @State() showCancelDone = false;\n @State() showLoadError = false;\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n async componentWillLoad() {\n if (!this.endpoint) {\n this.endpoint = VerdocsEndpoint.getDefault();\n this.endpoint.loadSession();\n }\n\n if (!this.envelopeId) {\n console.error(`[VIEW] Missing required envelopeId`);\n return;\n }\n\n this.listenToEnvelope();\n if (!this.envelope) {\n try {\n console.log('[VIEW] Loading envelope...');\n this.envelope = await getEnvelope(this.endpoint, this.envelopeId);\n console.log('[VIEW] Loaded envelope', this.envelope);\n } catch (e) {\n this.showLoadError = true;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n }\n\n componentDidRender() {\n const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;\n const headerEl = document.getElementById('verdocs-view-header');\n if (headerTarget && headerEl) {\n console.log('[VIEW] Moving header');\n headerEl.remove();\n headerTarget.append(headerEl);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToEnvelope();\n }\n\n async listenToEnvelope() {\n console.log('[SIDEBAR] Loading envelope', this.envelopeId);\n this.unlistenToEnvelope();\n Store.subscribe(\n 'envelopes',\n this.envelopeId,\n () => getEnvelope(this.endpoint, this.envelopeId),\n true,\n (envelope: IEnvelope) => {\n this.envelope = envelope;\n this.loading = false;\n },\n );\n }\n\n unlistenToEnvelope() {\n if (this.envelopeListenerId) {\n Store.store.delListener(this.envelopeListenerId);\n this.envelopeListenerId = null;\n }\n }\n\n handlePageRendered(_e: any) {\n // const pageInfo = e.detail as IDocumentPageInfo;\n // console.log('[VIEW] Page rendered', pageInfo);\n }\n\n async handleOptionSelected(e: any) {\n switch (e.detail.id) {\n case 'cancel':\n // TODO: Better option for inline-flow confirmation and alert dialogs.\n if (confirm('Are you sure you wish to cancel this envelope? This action cannot be undone.')) {\n this.canceling = true;\n cancelEnvelope(this.endpoint, this.envelopeId)\n .then(r => {\n this.canceling = false;\n console.log('[VIEW] Envelope canceled', r);\n return getEnvelope(this.endpoint, this.envelopeId);\n })\n .then(env => {\n console.log('[VIEW] Loaded new envelope details', env);\n this.envelope = env;\n })\n .catch(e => {\n this.canceling = false;\n console.log('[VIEW] Error canceling envelope', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n this.showCancelDone = true;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'canceled'});\n }\n break;\n\n case 'print':\n window.print();\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'printed'});\n break;\n\n case 'download-attachments':\n // TODO: Multiple document support\n {\n const firstDoc = this.envelope.documents.find(doc => doc.type === 'attachment');\n if (firstDoc) {\n const url = await getDocumentDownloadLink(this.endpoint, this.envelopeId, firstDoc.id);\n window.open(url, '_blank');\n }\n }\n break;\n\n case 'download-certificate':\n // TODO: Multiple certificate support\n {\n const firstCert = this.envelope.documents.find(doc => doc.type === 'certificate');\n if (firstCert) {\n const url = await getDocumentDownloadLink(this.endpoint, this.envelopeId, firstCert.id);\n window.open(url, '_blank');\n }\n }\n // saveCertificate(this.endpoint, this.envelope, this.envelope.certificate_document_id)\n // .then(() => {\n // this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n // })\n // .catch(e => {\n // console.log('Error downloading PDF', e);\n // });\n break;\n\n case 'download-all':\n saveEnvelopesAsZip(this.endpoint, [this.envelope])\n .then(() => {\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n })\n .catch(e => {\n console.log('Error downloading Zip', e);\n });\n break;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (this.showLoadError) {\n return (\n <Host>\n <verdocs-ok-dialog\n heading=\"Unable to View Envelope\"\n message={`Sorry, that envelope is not valid.`}\n buttonLabel=\"OK\"\n onNext={() => {\n this.showLoadError = false;\n }}\n />\n </Host>\n );\n }\n\n if (!this.envelope) {\n return (\n <Host>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </Host>\n );\n }\n\n const menuOptions: any[] = [{id: 'print', label: 'Print'}];\n\n if (userCanCancelEnvelope(this.endpoint.profile, this.envelope)) {\n menuOptions.push({id: 'cancel', label: 'Cancel'});\n }\n\n // Add download options to the menu\n const hasAttachments = this.envelope.documents.length > 0;\n const normalDocCount = this.envelope.documents.filter(doc => doc.type === 'attachment').length;\n const hasCertificate = this.envelope.documents.find(doc => doc.type === 'certificate') !== undefined;\n if (hasAttachments || hasCertificate) {\n menuOptions.push({label: ''});\n if (hasAttachments) {\n menuOptions.push({id: 'download-attachments', label: normalDocCount > 1 ? 'Download Documents' : 'Download Document'});\n }\n if (hasCertificate) {\n menuOptions.push({id: 'download-certificate', label: 'Download Certificate'});\n }\n if (hasAttachments && hasCertificate) {\n menuOptions.push({id: 'download-all', label: 'Download All Files'});\n }\n }\n\n return (\n <Host>\n <div id=\"verdocs-view-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div style={{marginLeft: '10px'}} />\n <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: this.headerTargetId ? '70px' : '15px'}}>\n {(this.envelope?.documents || [])\n .filter(document => document.type !== 'certificate')\n .map(envelopeDocument => {\n const pageNumbers = integerSequence(1, envelopeDocument.pages);\n\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = envelopeDocument.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-envelope-document-page\n envelopeId={this.envelopeId}\n documentId={envelopeDocument.id}\n endpoint={this.endpoint}\n type=\"filled\"\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n pageNumber={pageNumber}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n {this.showCancelDone && (\n <verdocs-ok-dialog\n heading=\"Cancelled\"\n message={`This envelope has been cancelled successfully.`}\n onNext={() => {\n this.showCancelDone = false;\n }}\n />\n )}\n {this.canceling && (\n <div class=\"loading-indicator\">\n <verdocs-loader />\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,22 +1,22 @@
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-324ed895.js';
|
2
2
|
import { VerdocsEndpoint, getTemplate } 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-d4be87ef.js';
|
5
5
|
import { d as defineCustomElement$F } from './p-0e332769.js';
|
6
6
|
import { d as defineCustomElement$E } from './p-070bebd7.js';
|
7
7
|
import { d as defineCustomElement$D } from './p-3201d529.js';
|
8
8
|
import { d as defineCustomElement$C } from './p-84ae0283.js';
|
9
9
|
import { d as defineCustomElement$B } from './p-27548ebd.js';
|
10
|
-
import { d as defineCustomElement$A } from './p-
|
11
|
-
import { d as defineCustomElement$z } from './p-
|
12
|
-
import { d as defineCustomElement$y } from './p-
|
13
|
-
import { d as defineCustomElement$x } from './p-
|
14
|
-
import { d as defineCustomElement$w } from './p-
|
15
|
-
import { d as defineCustomElement$v } from './p-
|
16
|
-
import { d as defineCustomElement$u } from './p-
|
17
|
-
import { d as defineCustomElement$t } from './p-
|
18
|
-
import { d as defineCustomElement$s } from './p-
|
19
|
-
import { d as defineCustomElement$r } from './p-
|
10
|
+
import { d as defineCustomElement$A } from './p-7bd7baa6.js';
|
11
|
+
import { d as defineCustomElement$z } from './p-c5045788.js';
|
12
|
+
import { d as defineCustomElement$y } from './p-1d4829fb.js';
|
13
|
+
import { d as defineCustomElement$x } from './p-8c965486.js';
|
14
|
+
import { d as defineCustomElement$w } from './p-c422d9a0.js';
|
15
|
+
import { d as defineCustomElement$v } from './p-143a763f.js';
|
16
|
+
import { d as defineCustomElement$u } from './p-99128b47.js';
|
17
|
+
import { d as defineCustomElement$t } from './p-813ed998.js';
|
18
|
+
import { d as defineCustomElement$s } from './p-b5e479db.js';
|
19
|
+
import { d as defineCustomElement$r } from './p-c4310332.js';
|
20
20
|
import { d as defineCustomElement$q } from './p-22da6d14.js';
|
21
21
|
import { d as defineCustomElement$p } from './p-7f32e087.js';
|
22
22
|
import { d as defineCustomElement$o } from './p-9c0b30f8.js';
|
@@ -24,20 +24,20 @@ import { d as defineCustomElement$n } from './p-1ae5d7e0.js';
|
|
24
24
|
import { d as defineCustomElement$m } from './p-be261487.js';
|
25
25
|
import { d as defineCustomElement$l } from './p-b7d080eb.js';
|
26
26
|
import { d as defineCustomElement$k } from './p-6719b0d7.js';
|
27
|
-
import { d as defineCustomElement$j } from './p-
|
27
|
+
import { d as defineCustomElement$j } from './p-d54466ed.js';
|
28
28
|
import { d as defineCustomElement$i } from './p-a2f6d2c6.js';
|
29
29
|
import { d as defineCustomElement$h } from './p-62743fd3.js';
|
30
|
-
import { d as defineCustomElement$g } from './p-
|
30
|
+
import { d as defineCustomElement$g } from './p-27a8eef0.js';
|
31
31
|
import { d as defineCustomElement$f } from './p-cce871bf.js';
|
32
32
|
import { d as defineCustomElement$e } from './p-9cfd8022.js';
|
33
33
|
import { d as defineCustomElement$d } from './p-4dd750e9.js';
|
34
|
-
import { d as defineCustomElement$c } from './p-
|
35
|
-
import { d as defineCustomElement$b } from './p-
|
36
|
-
import { d as defineCustomElement$a } from './p-
|
37
|
-
import { d as defineCustomElement$9 } from './p-
|
38
|
-
import { d as defineCustomElement$8 } from './p-
|
39
|
-
import { d as defineCustomElement$7 } from './p-
|
40
|
-
import { d as defineCustomElement$6 } from './p-
|
34
|
+
import { d as defineCustomElement$c } from './p-16b073b8.js';
|
35
|
+
import { d as defineCustomElement$b } from './p-e39c327c.js';
|
36
|
+
import { d as defineCustomElement$a } from './p-550377ba.js';
|
37
|
+
import { d as defineCustomElement$9 } from './p-f238b25b.js';
|
38
|
+
import { d as defineCustomElement$8 } from './p-631808d5.js';
|
39
|
+
import { d as defineCustomElement$7 } from './p-ac7694c0.js';
|
40
|
+
import { d as defineCustomElement$6 } from './p-90e3fae6.js';
|
41
41
|
import { d as defineCustomElement$5 } from './p-325b3828.js';
|
42
42
|
import { d as defineCustomElement$4 } from './p-c00770e6.js';
|
43
43
|
import { d as defineCustomElement$3 } from './p-4d3b9ee9.js';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsEnvelopeRecipientLink$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsEnvelopeRecipientLink$1, d as defineCustomElement$1 } from './p-619747d7.js';
|
2
2
|
|
3
3
|
const VerdocsEnvelopeRecipientLink = VerdocsEnvelopeRecipientLink$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -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, getEnvelope, getInPersonLink, getRecipientsWithActions, recipientCanAct, formatFullName } 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-d4be87ef.js';
|
5
5
|
import { d as defineCustomElement$2 } from './p-0e332769.js';
|
6
6
|
|
7
7
|
const verdocsEnvelopeRecipientSummaryCss = "@-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-envelope-recipient-summary{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:\"Inter\", \"Barlow\", sans-serif;background-color:rgba(0, 0, 0, 0.4980392157)}verdocs-envelope-recipient-summary .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-summary .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-summary .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-summary .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-summary .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-summary .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:rgb(249, 250, 251)}verdocs-envelope-recipient-summary .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:rgb(55, 65, 81);line-height:1.25rem;background-color:#d8d8d8;border:2px solid rgb(156, 163, 175)}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-summary .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;overflow:hidden;border-radius:4px;-ms-flex-align:center;align-items:center;white-space:nowrap;text-overflow:ellipsis;border:1px solid #cccccc;background:rgb(249, 250, 251)}verdocs-envelope-recipient-summary .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-summary .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-summary .buttons verdocs-button button{width:100%}";
|
@@ -3,10 +3,10 @@ import { VerdocsEndpoint, getEnvelope, resendInvitation, cancelEnvelope, formatF
|
|
3
3
|
import { F as FORMAT_TIMESTAMP } from './p-c7ee88c7.js';
|
4
4
|
import { V as VerdocsToast } from './p-04c07b7b.js';
|
5
5
|
import { S as SDKError } from './p-fd97809c.js';
|
6
|
-
import { S as Store } from './p-
|
6
|
+
import { S as Store } from './p-d4be87ef.js';
|
7
7
|
import { d as defineCustomElement$9 } from './p-0e332769.js';
|
8
8
|
import { d as defineCustomElement$8 } from './p-9fb98ea2.js';
|
9
|
-
import { d as defineCustomElement$7 } from './p-
|
9
|
+
import { d as defineCustomElement$7 } from './p-619747d7.js';
|
10
10
|
import { d as defineCustomElement$6 } from './p-7f32e087.js';
|
11
11
|
import { d as defineCustomElement$5 } from './p-b7d080eb.js';
|
12
12
|
import { d as defineCustomElement$4 } from './p-6719b0d7.js';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldAttachment$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldAttachment$1, d as defineCustomElement$1 } from './p-7bd7baa6.js';
|
2
2
|
|
3
3
|
const VerdocsFieldAttachment = VerdocsFieldAttachment$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldCheckbox$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldCheckbox$1, d as defineCustomElement$1 } from './p-c5045788.js';
|
2
2
|
|
3
3
|
const VerdocsFieldCheckbox = VerdocsFieldCheckbox$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldDate$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldDate$1, d as defineCustomElement$1 } from './p-1d4829fb.js';
|
2
2
|
|
3
3
|
const VerdocsFieldDate = VerdocsFieldDate$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldDropdown$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldDropdown$1, d as defineCustomElement$1 } from './p-8c965486.js';
|
2
2
|
|
3
3
|
const VerdocsFieldDropdown = VerdocsFieldDropdown$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldInitial$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldInitial$1, d as defineCustomElement$1 } from './p-c422d9a0.js';
|
2
2
|
|
3
3
|
const VerdocsFieldInitial = VerdocsFieldInitial$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment, d as Host } from './p-324ed895.js';
|
2
2
|
import { getRGBA } from '@verdocs/js-sdk';
|
3
3
|
import { S as SettingsIcon } from './p-b0766439.js';
|
4
|
-
import { S as Store } from './p-
|
4
|
+
import { S as Store } from './p-d4be87ef.js';
|
5
5
|
import { d as defineCustomElement$a } from './p-0e332769.js';
|
6
6
|
import { d as defineCustomElement$9 } from './p-3201d529.js';
|
7
7
|
import { d as defineCustomElement$8 } from './p-84ae0283.js';
|
@@ -9,7 +9,7 @@ import { d as defineCustomElement$7 } from './p-7f32e087.js';
|
|
9
9
|
import { d as defineCustomElement$6 } from './p-1ae5d7e0.js';
|
10
10
|
import { d as defineCustomElement$5 } from './p-6719b0d7.js';
|
11
11
|
import { d as defineCustomElement$4 } from './p-62743fd3.js';
|
12
|
-
import { d as defineCustomElement$3 } from './p-
|
12
|
+
import { d as defineCustomElement$3 } from './p-f238b25b.js';
|
13
13
|
import { d as defineCustomElement$2 } from './p-325b3828.js';
|
14
14
|
|
15
15
|
const verdocsFieldPaymentCss = "@-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-payment{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:24px;height:24px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-payment .settings-icon{position:absolute;top:-3px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-payment .settings-icon svg{fill:#707ae5}verdocs-field-payment .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)}}";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldRadio$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldRadio$1, d as defineCustomElement$1 } from './p-143a763f.js';
|
2
2
|
|
3
3
|
const VerdocsFieldRadio = VerdocsFieldRadio$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldSignature$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldSignature$1, d as defineCustomElement$1 } from './p-99128b47.js';
|
2
2
|
|
3
3
|
const VerdocsFieldSignature = VerdocsFieldSignature$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldTextarea$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldTextarea$1, d as defineCustomElement$1 } from './p-813ed998.js';
|
2
2
|
|
3
3
|
const VerdocsFieldTextarea = VerdocsFieldTextarea$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldTextbox$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldTextbox$1, d as defineCustomElement$1 } from './p-b5e479db.js';
|
2
2
|
|
3
3
|
const VerdocsFieldTextbox = VerdocsFieldTextbox$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { V as VerdocsFieldTimestamp$1, d as defineCustomElement$1 } from './p-
|
1
|
+
import { V as VerdocsFieldTimestamp$1, d as defineCustomElement$1 } from './p-c4310332.js';
|
2
2
|
|
3
3
|
const VerdocsFieldTimestamp = VerdocsFieldTimestamp$1;
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|