@verdocs/web-sdk 6.5.0-beta.32 → 6.5.0-beta.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Types-RUyU-svM.js → Types-YJQtg77a.js} +4 -3
- package/dist/{esm/Types-dqxNbm_b.js.map → cjs/Types-YJQtg77a.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-otZIKCGM.js → utils-DjHWIYcY.js} +3 -3
- package/dist/cjs/{utils-otZIKCGM.js.map → utils-DjHWIYcY.js.map} +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog_8.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +86 -12
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +36 -25
- package/dist/cjs/verdocs-sign.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-document-page.verdocs-toolbar-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.css +8 -0
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +3 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +34 -0
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +77 -2
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.css +3 -0
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +6 -5
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +3 -3
- package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.css +21 -0
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +31 -21
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
- package/dist/collection/utils/Types.js +2 -1
- package/dist/collection/utils/Types.js.map +1 -1
- package/dist/components/{p-DLKz8oGD.js → p-1PWpeHpK.js} +3 -3
- package/dist/components/{p-DLKz8oGD.js.map → p-1PWpeHpK.js.map} +1 -1
- package/dist/components/{p-BSXsWUmY.js → p-BWvUv89M.js} +39 -29
- package/dist/components/p-BWvUv89M.js.map +1 -0
- package/dist/components/{p-CrKrBZZL.js → p-BcGvNPBh.js} +7 -7
- package/dist/components/{p-CrKrBZZL.js.map → p-BcGvNPBh.js.map} +1 -1
- package/dist/components/{p-YzC4BSrh.js → p-BttIJYW3.js} +7 -5
- package/dist/components/p-BttIJYW3.js.map +1 -0
- package/dist/components/{p-88SuPfj4.js → p-C35_YsQk.js} +3 -3
- package/dist/components/{p-88SuPfj4.js.map → p-C35_YsQk.js.map} +1 -1
- package/dist/components/{p-COtqu2dZ.js → p-CMNmfu0F.js} +3 -3
- package/dist/components/{p-COtqu2dZ.js.map → p-CMNmfu0F.js.map} +1 -1
- package/dist/components/{p-B7nY_WEM.js → p-CY-c2d8q.js} +9 -9
- package/dist/components/p-CY-c2d8q.js.map +1 -0
- package/dist/components/{p-DWZamcQd.js → p-CeHrzafI.js} +9 -8
- package/dist/components/p-CeHrzafI.js.map +1 -0
- package/dist/components/{p-BaFfUg65.js → p-DKO4_Yp9.js} +3 -3
- package/dist/components/{p-BaFfUg65.js.map → p-DKO4_Yp9.js.map} +1 -1
- package/dist/components/{p-Dl7Xw8F0.js → p-DMMF9yT2.js} +3 -3
- package/dist/components/{p-Dl7Xw8F0.js.map → p-DMMF9yT2.js.map} +1 -1
- package/dist/components/p-Dh9AjNdu.js +292 -0
- package/dist/components/p-Dh9AjNdu.js.map +1 -0
- package/dist/components/{p-IUjGbyAi.js → p-Dk8BEvRP.js} +3 -3
- package/dist/components/{p-IUjGbyAi.js.map → p-Dk8BEvRP.js.map} +1 -1
- package/dist/components/{p-ChDalz5Z.js → p-DyeSZpGe.js} +3 -3
- package/dist/components/{p-ChDalz5Z.js.map → p-DyeSZpGe.js.map} +1 -1
- package/dist/components/{p-Bu_0SDFO.js → p-Iv65sQlJ.js} +3 -3
- package/dist/components/{p-Bu_0SDFO.js.map → p-Iv65sQlJ.js.map} +1 -1
- package/dist/components/verdocs-build.js +8 -8
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +2 -2
- package/dist/components/verdocs-field-date.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-quick-filter.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +4 -4
- package/dist/components/verdocs-signing-progress.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/Types-BqoC0yeA.js +9 -0
- package/dist/{cjs/Types-RUyU-svM.js.map → esm/Types-BqoC0yeA.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-ivPfUH2E.js → utils-Deu82Q9L.js} +3 -3
- package/dist/esm/{utils-ivPfUH2E.js.map → utils-Deu82Q9L.js.map} +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_8.entry.js +2 -2
- package/dist/esm/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm/verdocs-download-dialog_4.entry.js +2 -2
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +2 -2
- package/dist/esm/verdocs-field-attachment_11.entry.js +86 -12
- package/dist/esm/verdocs-pagination_2.entry.js +2 -2
- package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +37 -26
- package/dist/esm/verdocs-sign.entry.js +2 -2
- package/dist/esm/verdocs-template-document-page.verdocs-toolbar-icon.entry.js.map +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Types-BqoC0yeA.js +2 -0
- package/dist/esm-es5/{Types-dqxNbm_b.js.map → Types-BqoC0yeA.js.map} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-ivPfUH2E.js → utils-Deu82Q9L.js} +2 -2
- package/dist/esm-es5/{utils-ivPfUH2E.js.map → utils-Deu82Q9L.js.map} +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm-es5/verdocs-download-dialog_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +2 -2
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page.verdocs-toolbar-icon.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/fields/verdocs-field-date/verdocs-field-date.d.ts +6 -1
- package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +3 -3
- package/dist/types/utils/Types.d.ts +1 -1
- package/dist/verdocs-web-sdk/{p-751501f3.entry.js → p-07a00b97.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-96c50a15.system.entry.js → p-16e4f438.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b7a88f34.system.entry.js → p-178d03a6.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-1bde2f57.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-1bde2f57.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-3c1ca466.entry.js → p-3aebfd86.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-12a23bdb.entry.js → p-4671fd0b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f615bed5.entry.js → p-5cf0d300.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7165eccc.system.entry.js → p-8cb631da.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-932934f5.system.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-932934f5.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-cff62722.system.entry.js → p-9ec65cad.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/p-B_NM_Ddi.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-dY2Fe8ON.system.js.map → p-BaVMqmM6.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-D0t6QCh_.system.js → p-BgKRsvh1.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-D0t6QCh_.system.js.map → p-BgKRsvh1.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BqoC0yeA.js +2 -0
- package/dist/verdocs-web-sdk/{p-dqxNbm_b.js.map → p-BqoC0yeA.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BxZoitZ8.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-C2OP3llY.system.js +2 -0
- package/dist/verdocs-web-sdk/{p-CgZsFvRv.system.js.map → p-C2OP3llY.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-Baa2Y5Zk.system.js.map → p-C5FCNerT.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-DKu4yKnD.system.js.map → p-CwV2z4y9.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-BM3jxk1D.system.js.map → p-DAagWDJf.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-DDdzKvq8.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-BUDKtx9r.system.js.map → p-DZCgLJyz.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-Cz_PSCK3.system.js.map → p-Dxsz-5-P.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-BpvxoJa6.system.js.map → p-H1Tf5vYL.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-f5d355d5.system.entry.js → p-c0fbae7e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6598380f.entry.js → p-c1b0b0a8.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-3899da33.entry.js → p-c288939e.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-4cbec34e.system.entry.js → p-c4ca9e20.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-d09f0a2c.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-d09f0a2c.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-363f13cb.system.entry.js → p-dbaaa79f.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-42ad9ea7.entry.js → p-e74f4251.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fe97fd80.entry.js → p-ea23d10b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-721b3041.system.entry.js → p-ee6623f7.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-f986d5dd.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-f986d5dd.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-CHm_85GB.js → p-oC6bZSel.js} +2 -2
- package/dist/verdocs-web-sdk/{p-CHm_85GB.js.map → p-oC6bZSel.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-template-document-page.verdocs-toolbar-icon.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-B7nY_WEM.js.map +0 -1
- package/dist/components/p-BSXsWUmY.js.map +0 -1
- package/dist/components/p-DR_BGSby.js +0 -217
- package/dist/components/p-DR_BGSby.js.map +0 -1
- package/dist/components/p-DWZamcQd.js.map +0 -1
- package/dist/components/p-YzC4BSrh.js.map +0 -1
- package/dist/esm/Types-dqxNbm_b.js +0 -8
- package/dist/esm-es5/Types-dqxNbm_b.js +0 -2
- package/dist/verdocs-web-sdk/p-344a99c7.system.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-344a99c7.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-8c86b7fd.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-8c86b7fd.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CgZsFvRv.system.js +0 -2
- package/dist/verdocs-web-sdk/p-DNUz9v6d.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-DsA3pbFK.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-DyCZUrdb.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c3e7b3ce.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c3e7b3ce.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dqxNbm_b.js +0 -2
- package/dist/verdocs-web-sdk/p-e23c5042.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-e23c5042.entry.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-751501f3.entry.js.map → p-07a00b97.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-96c50a15.system.entry.js.map → p-16e4f438.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b7a88f34.system.entry.js.map → p-178d03a6.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3c1ca466.entry.js.map → p-3aebfd86.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-12a23bdb.entry.js.map → p-4671fd0b.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f615bed5.entry.js.map → p-5cf0d300.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7165eccc.system.entry.js.map → p-8cb631da.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-cff62722.system.entry.js.map → p-9ec65cad.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f5d355d5.system.entry.js.map → p-c0fbae7e.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-6598380f.entry.js.map → p-c1b0b0a8.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3899da33.entry.js.map → p-c288939e.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4cbec34e.system.entry.js.map → p-c4ca9e20.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-363f13cb.system.entry.js.map → p-dbaaa79f.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-42ad9ea7.entry.js.map → p-e74f4251.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fe97fd80.entry.js.map → p-ea23d10b.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-721b3041.system.entry.js.map → p-ee6623f7.system.entry.js.map} +0 -0
package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-template-fields.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAyC,WAAW,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEvI,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,WAAW,GAAG,mJAAmJ,CAAC;AAExK,MAAM,SAAS,GACb,mZAAmZ,CAAC;AAEtZ,MAAM,SAAS,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = this.template?.roles || [];\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n this.selectedRoleName = template.roles?.[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<number, IDocumentPageInfo> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n // console.log('[FIELDS] Page rendered', pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, pageNumber: number) {\n if (this.placing) {\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const selectableRoles = (this.template?.roles || []).map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verdocs-template-fields.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,WAA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AAQ,CAAE,MAAM,KAAI,GAAG,EACtC,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,KAAK,EACX,OAAO,EAAE,CAAC,CAAe,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EACxE,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;gCACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;gCAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;6BAChC,GACD,CACO,CACZ,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CACE;YACL,IAAI,CAAC,kBAAkB,IAAI,CAC1B,yBACE,OAAO,EAAC,qBAAqB,EAC7B,OAAO,EAAE,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,KAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,oDAAoD,EACtJ,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAC/C,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z\"></path></svg>';\n\nconst iconDropdown =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke=\"#ffffff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25\" /></svg>';\n\nconst iconAttachment =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13\" /></svg>';\n\nconst separator = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14.707 14.707\"><g><rect x=\"6.275\" y=\"0\" fill=\"#ffffff7f\" width=\"1\" height=\"15\"/></g></svg>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n const sorted = [...(template.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n this.selectedRoleName = sorted[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(pageInfo.documentId));\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('documentid', String(field.document_id));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const sortedRoles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n const selectableRoles = sortedRoles.map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/utils/Types.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACvC,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/utils/Types.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACvC,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;AAC9B,uCAAuC","sourcesContent":["export interface IDocumentPageInfo {\n containerId: string;\n documentId: string;\n pageNumber: number;\n virtualWidth: number;\n virtualHeight: number;\n renderedWidth: number;\n renderedHeight: number;\n naturalWidth: number;\n naturalHeight: number;\n aspectRatio: number;\n xScale: number;\n yScale: number;\n}\n\nexport interface IPageLayer {\n name: string;\n type: 'div' | 'canvas';\n}\n\nexport const FORMAT_TIMESTAMP = 'P pp';\n// export const FORMAT_TIMESTAMP = 'Y-MM-dd hh:mm:ss a';\nexport const FORMAT_DATE = 'P'\n// export const FORMAT_DATE = 'y-MM-dd'\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment, d as Host } from './p-CUAGH_8P.js';
|
|
2
2
|
import { r as requireFormat } from './p-BvYQ0L1f.js';
|
|
3
|
-
import { F as FORMAT_TIMESTAMP } from './p-
|
|
3
|
+
import { F as FORMAT_TIMESTAMP } from './p-DMMF9yT2.js';
|
|
4
4
|
import { S as SettingsIcon } from './p-Du758Jse.js';
|
|
5
5
|
import { S as Store } from './p-bS8INhRF.js';
|
|
6
6
|
import { d as defineCustomElement$9 } from './p-CwklHveG.js';
|
|
@@ -195,6 +195,6 @@ function defineCustomElement() {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
export { VerdocsFieldTimestamp as V, defineCustomElement as d };
|
|
198
|
-
//# sourceMappingURL=p-
|
|
198
|
+
//# sourceMappingURL=p-1PWpeHpK.js.map
|
|
199
199
|
|
|
200
|
-
//# sourceMappingURL=p-
|
|
200
|
+
//# sourceMappingURL=p-1PWpeHpK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-DLKz8oGD.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,0vDAA0vD;;MCgB9wD,qBAAqB,iBAAAA,kBAAA,CAAA,MAAA,qBAAA,SAAAC,CAAA,CAAA;AALlC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAQE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;;AAGG;AACK,QAAA,IAAK,CAAA,KAAA,GAAsC,IAAI;AAEvD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;;AAGG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAI,CAAA,IAAA,GAAa,KAAK;AAE7C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAY,CAAC;AAYtB,QAAA,IAAiB,CAAA,iBAAA,GAAa,KAAK;AACnC,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;AAmFzB;IAhFC,UAAU,GAAA;AACR,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;;AAGZ,IAAA,MAAM,UAAU,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BAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,IAAI,CAAC,iBAAiB;aACjD,EACD,CAAA,EAED,IAAI,CAAC,iBAAiB,KACrB,sBAAgB,MAAM,EAAE,CAAkC,+BAAA,EAAA,SAAS,CAAE,CAAA,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAAA,EACxH,CACE,CAAA,mCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACvC,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,0EAA0E,EAAA,CACpF,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","format"],"sources":["src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.scss?tag=verdocs-field-timestamp","src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-timestamp {\n width: 160px;\n height: 15px;\n display: block;\n font-size: 9px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: var(--verdocs-field-background, transparent);\n transform-origin: bottom left;\n font-family: $verdocs-primary-font;\n\n &.done {\n opacity: 1;\n }\n\n input {\n position: absolute;\n\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n opacity: 0.5;\n width: 100%;\n height: 100%;\n font-size: 9px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: var(--verdocs-field-text-color, rgba(0, 0, 0, 0.87));\n border: var(--verdocs-field-border, 1px solid rgba(0, 0, 0, 0.2));\n border-radius: var(--verdocs-field-radius);\n\n &.hide {\n display: none;\n }\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.required {\n border: 1px solid var(--verdocs-required-field-border);\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import {format} from 'date-fns/format';\nimport {ITemplateField, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, Fragment, State, Listen} from '@stencil/core';\nimport {FORMAT_TIMESTAMP} from '../../../utils/Types';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a timestamp. Timestamps are not editable by signers. Instead, they are automatically\n * filled when the signer submits the document.\n */\n@Component({\n tag: 'verdocs-field-timestamp',\n styleUrl: 'verdocs-field-timestamp.scss',\n shadow: false,\n})\nexport class VerdocsFieldTimestamp {\n private el: HTMLInputElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop() pagenumber?: number = 1;\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 when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n @Listen('blur', {capture: true})\n handleBlur() {\n this.focused = false;\n }\n\n @Method() async focusField() {\n this.el.focus();\n this.focused = true;\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n this.showingProperties = false;\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = '', value = '', label = ''} = field || {};\n const signerClass = `signer-${(index % 10) + 1}`;\n\n const formatted = format(new Date(value || new Date().toISOString()), FORMAT_TIMESTAMP);\n\n if (done) {\n return <Host class={{done}}>{formatted}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused, [signerClass]: true}}>\n {label && <label>{label}</label>}\n <input type=\"text\" placeholder={placeholder} value={formatted} disabled={true} ref={el => (this.el = el)} onFocus={() => (this.focused = true)} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => this.hideSettingsPanel()}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Time stamps are automatically set when the recipient signs the document.'}\n />\n </verdocs-portal>\n )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AA,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAAA,EACxH,CACE,CAAA,mCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACvC,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,0EAA0E,EAAA,CACpF,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement","format"],"sources":["src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.scss?tag=verdocs-field-timestamp","src/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-timestamp {\n width: 160px;\n height: 15px;\n display: block;\n font-size: 9px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: var(--verdocs-field-background, transparent);\n transform-origin: bottom left;\n font-family: $verdocs-primary-font;\n\n &.done {\n opacity: 1;\n }\n\n input {\n position: absolute;\n\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n opacity: 0.5;\n width: 100%;\n height: 100%;\n font-size: 9px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: var(--verdocs-field-text-color, rgba(0, 0, 0, 0.87));\n border: var(--verdocs-field-border, 1px solid rgba(0, 0, 0, 0.2));\n border-radius: var(--verdocs-field-radius);\n\n &.hide {\n display: none;\n }\n }\n\n label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n &.required {\n border: 1px solid var(--verdocs-required-field-border);\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import {format} from 'date-fns/format';\nimport {ITemplateField, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Method, Event, EventEmitter, Fragment, State, Listen} from '@stencil/core';\nimport {FORMAT_TIMESTAMP} from '../../../utils/Types';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Display a timestamp. Timestamps are not editable by signers. Instead, they are automatically\n * filled when the signer submits the document.\n */\n@Component({\n tag: 'verdocs-field-timestamp',\n styleUrl: 'verdocs-field-timestamp.scss',\n shadow: false,\n})\nexport class VerdocsFieldTimestamp {\n private el: HTMLInputElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop() pagenumber?: number = 1;\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 when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n @Listen('blur', {capture: true})\n handleBlur() {\n this.focused = false;\n }\n\n @Method() async focusField() {\n this.el.focus();\n this.focused = true;\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n this.showingProperties = false;\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = '', value = '', label = ''} = field || {};\n const signerClass = `signer-${(index % 10) + 1}`;\n\n const formatted = format(new Date(value || new Date().toISOString()), FORMAT_TIMESTAMP);\n\n if (done) {\n return <Host class={{done}}>{formatted}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused, [signerClass]: true}}>\n {label && <label>{label}</label>}\n <input type=\"text\" placeholder={placeholder} value={formatted} disabled={true} ref={el => (this.el = el)} onFocus={() => (this.focused = true)} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => this.hideSettingsPanel()}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={'Time stamps are automatically set when the recipient signs the document.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-CUAGH_8P.js';
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, d as Host, F as Fragment } from './p-CUAGH_8P.js';
|
|
2
2
|
import { i as interact } from './p-CGNX5HqF.js';
|
|
3
3
|
import { VerdocsEndpoint, getTemplate, updateField, createField, integerSequence } from '@verdocs/js-sdk';
|
|
4
|
-
import { g as getFieldId, h as updateCssTransform, i as removeCssTransform, j as setControlStyles, d as defaultHeight, k as defaultWidth } from './p-
|
|
4
|
+
import { g as getFieldId, h as updateCssTransform, i as removeCssTransform, j as setControlStyles, d as defaultHeight, k as defaultWidth } from './p-Dk8BEvRP.js';
|
|
5
|
+
import { D as DocumentPageIcon } from './p-Du758Jse.js';
|
|
5
6
|
import { V as VerdocsToast } from './p-CyvDgtoV.js';
|
|
6
7
|
import { S as SDKError } from './p-C1sRVZWv.js';
|
|
7
8
|
import { S as Store } from './p-bS8INhRF.js';
|
|
@@ -11,27 +12,27 @@ import { d as defineCustomElement$n } from './p-UM5wCODg.js';
|
|
|
11
12
|
import { d as defineCustomElement$m } from './p-CO3KQG1e.js';
|
|
12
13
|
import { d as defineCustomElement$l } from './p-C0qRY7Gm.js';
|
|
13
14
|
import { d as defineCustomElement$k } from './p-1zwMmY7V.js';
|
|
14
|
-
import { d as defineCustomElement$j } from './p-
|
|
15
|
+
import { d as defineCustomElement$j } from './p-Dh9AjNdu.js';
|
|
15
16
|
import { d as defineCustomElement$i } from './p-CufGuqmE.js';
|
|
16
17
|
import { d as defineCustomElement$h } from './p-CpcMSzRA.js';
|
|
17
18
|
import { d as defineCustomElement$g } from './p-CwkHIsJM.js';
|
|
18
19
|
import { d as defineCustomElement$f } from './p-C4Zz2HX1.js';
|
|
19
20
|
import { d as defineCustomElement$e } from './p-BXDILz20.js';
|
|
20
|
-
import { d as defineCustomElement$d } from './p-
|
|
21
|
-
import { d as defineCustomElement$c } from './p-
|
|
21
|
+
import { d as defineCustomElement$d } from './p-CeHrzafI.js';
|
|
22
|
+
import { d as defineCustomElement$c } from './p-1PWpeHpK.js';
|
|
22
23
|
import { d as defineCustomElement$b } from './p-CHLvWYEx.js';
|
|
23
24
|
import { d as defineCustomElement$a } from './p-BCKfiFng.js';
|
|
24
25
|
import { d as defineCustomElement$9 } from './p-Bt8fO1FH.js';
|
|
25
26
|
import { d as defineCustomElement$8 } from './p-Sywj-5pY.js';
|
|
26
27
|
import { d as defineCustomElement$7 } from './p-D_KhbsnA.js';
|
|
27
28
|
import { d as defineCustomElement$6 } from './p-Cd0WoTsM.js';
|
|
28
|
-
import { d as defineCustomElement$5 } from './p-
|
|
29
|
+
import { d as defineCustomElement$5 } from './p-CY-c2d8q.js';
|
|
29
30
|
import { d as defineCustomElement$4 } from './p-CG5hnDaJ.js';
|
|
30
31
|
import { d as defineCustomElement$3 } from './p-764zY_TM.js';
|
|
31
32
|
import { d as defineCustomElement$2 } from './p-Cif8CeGC.js';
|
|
32
33
|
import { d as defineCustomElement$1 } from './p-DHJY1Udu.js';
|
|
33
34
|
|
|
34
|
-
const verdocsTemplateFieldsCss = "verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";
|
|
35
|
+
const verdocsTemplateFieldsCss = "verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";
|
|
35
36
|
|
|
36
37
|
const iconTextbox = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';
|
|
37
38
|
const iconCheck = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';
|
|
@@ -135,7 +136,7 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
135
136
|
componentWillUpdate() {
|
|
136
137
|
var _a, _b;
|
|
137
138
|
// If a new role was added and there were none yet so far, or the "selected" role was deleted, reset our selection
|
|
138
|
-
const roles = ((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [];
|
|
139
|
+
const roles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
|
|
139
140
|
if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {
|
|
140
141
|
this.selectedRoleName = ((_b = roles[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
|
|
141
142
|
console.log('[FIELDS] Selected new role', this.selectedRoleName);
|
|
@@ -147,11 +148,12 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
147
148
|
async listenToTemplate() {
|
|
148
149
|
this.unlistenToTemplate();
|
|
149
150
|
Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId), false, (template) => {
|
|
150
|
-
var _a
|
|
151
|
+
var _a;
|
|
151
152
|
this.template = template;
|
|
152
153
|
this.loading = false;
|
|
153
154
|
if (!this.selectedRoleName) {
|
|
154
|
-
|
|
155
|
+
const sorted = [...(template.roles || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
|
|
156
|
+
this.selectedRoleName = ((_a = sorted[0]) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
155
157
|
}
|
|
156
158
|
});
|
|
157
159
|
}
|
|
@@ -174,18 +176,21 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
174
176
|
});
|
|
175
177
|
el.setAttribute('templateid', this.templateId);
|
|
176
178
|
el.setAttribute('fieldname', field.name);
|
|
179
|
+
el.setAttribute('documentid', String(pageInfo.documentId));
|
|
177
180
|
el.setAttribute('pageNumber', String(pageInfo.pageNumber));
|
|
178
181
|
el.setAttribute('xScale', String(pageInfo.xScale));
|
|
179
182
|
el.setAttribute('yScale', String(pageInfo.yScale));
|
|
180
183
|
el.setAttribute('name', field.name);
|
|
181
184
|
}
|
|
182
185
|
handlePageRendered(e) {
|
|
183
|
-
var _a;
|
|
186
|
+
var _a, _b;
|
|
187
|
+
var _c, _d;
|
|
184
188
|
const pageInfo = e.detail;
|
|
185
|
-
|
|
186
|
-
this.cachedPageInfo[pageInfo.
|
|
189
|
+
console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);
|
|
190
|
+
(_a = (_c = this.cachedPageInfo)[_d = pageInfo.documentId]) !== null && _a !== void 0 ? _a : (_c[_d] = {});
|
|
191
|
+
this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;
|
|
187
192
|
this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;
|
|
188
|
-
(((
|
|
193
|
+
(((_b = this.template) === null || _b === void 0 ? void 0 : _b.fields) || [])
|
|
189
194
|
.filter(field => field && field.page === pageInfo.pageNumber)
|
|
190
195
|
.forEach(field => {
|
|
191
196
|
const id = getFieldId(field);
|
|
@@ -193,6 +198,7 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
193
198
|
if (el) {
|
|
194
199
|
el.setAttribute('fieldname', field.name);
|
|
195
200
|
el.setAttribute('pagenumber', String(field.page));
|
|
201
|
+
el.setAttribute('documentid', String(field.document_id));
|
|
196
202
|
this.makeDraggable(el);
|
|
197
203
|
}
|
|
198
204
|
});
|
|
@@ -225,7 +231,8 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
225
231
|
return;
|
|
226
232
|
}
|
|
227
233
|
const pageNumber = event.target.getAttribute('pagenumber');
|
|
228
|
-
|
|
234
|
+
const documentId = event.target.getAttribute('documentid');
|
|
235
|
+
let { naturalWidth = 612, naturalHeight = 792, renderedHeight = 792 } = this.cachedPageInfo[documentId][pageNumber];
|
|
229
236
|
const clientRect = event.target.getBoundingClientRect();
|
|
230
237
|
const parent = event.target.parentElement;
|
|
231
238
|
const parentRect = parent.getBoundingClientRect();
|
|
@@ -239,16 +246,16 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
239
246
|
if (newY > renderedHeight) {
|
|
240
247
|
newPageNumber = Math.min(newPageNumber + 1, ((_d = (_c = (((_b = this.template) === null || _b === void 0 ? void 0 : _b.documents) || [])) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.pages) || 1);
|
|
241
248
|
newY -= renderedHeight;
|
|
242
|
-
renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;
|
|
249
|
+
renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;
|
|
243
250
|
console.log('Next page', { newPageNumber, newY, renderedHeight });
|
|
244
251
|
}
|
|
245
252
|
else if (newY < 0) {
|
|
246
253
|
newPageNumber = Math.max(newPageNumber - 1, 1);
|
|
247
|
-
renderedHeight = this.cachedPageInfo[newPageNumber].renderedHeight;
|
|
254
|
+
renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;
|
|
248
255
|
newY += renderedHeight;
|
|
249
256
|
console.log('[FIELDS] Next page', { newPageNumber, newY, renderedHeight });
|
|
250
257
|
}
|
|
251
|
-
const { x, y } = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - width, naturalHeight - height);
|
|
258
|
+
const { x, y } = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);
|
|
252
259
|
try {
|
|
253
260
|
const params = { x, y, page: newPageNumber };
|
|
254
261
|
const updatedField = await updateField(this.endpoint, this.templateId, name, params);
|
|
@@ -262,7 +269,7 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
262
269
|
event.target.removeAttribute('posX');
|
|
263
270
|
event.target.removeAttribute('posY');
|
|
264
271
|
removeCssTransform(event.target);
|
|
265
|
-
const { xScale = 1, yScale = 1 } = this.cachedPageInfo[pageNumber];
|
|
272
|
+
const { xScale = 1, yScale = 1 } = this.cachedPageInfo[documentId][pageNumber];
|
|
266
273
|
setControlStyles(event.target, updatedField, xScale, yScale);
|
|
267
274
|
(_e = this.templateUpdated) === null || _e === void 0 ? void 0 : _e.emit({ endpoint: this.endpoint, template: newTemplate, event: 'updated-field' });
|
|
268
275
|
}
|
|
@@ -286,22 +293,23 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
286
293
|
return fieldName;
|
|
287
294
|
}
|
|
288
295
|
// Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.
|
|
289
|
-
viewCoordinatesToPageCoordinates(viewX, viewY, pageNumber, xMax, yMax) {
|
|
290
|
-
const { xScale = 1, yScale = 1, renderedHeight = 792 } = this.cachedPageInfo[pageNumber];
|
|
296
|
+
viewCoordinatesToPageCoordinates(viewX, viewY, documentId, pageNumber, xMax, yMax) {
|
|
297
|
+
const { xScale = 1, yScale = 1, renderedHeight = 792 } = this.cachedPageInfo[documentId][pageNumber];
|
|
291
298
|
const x = Math.floor(Math.min(viewX / xScale, xMax));
|
|
292
299
|
const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));
|
|
293
300
|
return { x, y };
|
|
294
301
|
}
|
|
295
|
-
async handleClickPage(e, pageNumber) {
|
|
302
|
+
async handleClickPage(e, documentId, pageNumber) {
|
|
296
303
|
var _a;
|
|
297
304
|
if (this.placing) {
|
|
305
|
+
console.log('Placing field', { documentId, pageNumber });
|
|
298
306
|
const clickedX = e.offsetX;
|
|
299
307
|
const clickedY = e.offsetY;
|
|
300
308
|
const width = defaultWidth(this.placing);
|
|
301
309
|
const height = defaultHeight(this.placing);
|
|
302
|
-
const cachedPage = this.cachedPageInfo[pageNumber];
|
|
310
|
+
const cachedPage = this.cachedPageInfo[documentId][pageNumber];
|
|
303
311
|
const { naturalWidth = 612, naturalHeight = 792 } = cachedPage;
|
|
304
|
-
const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, pageNumber, naturalWidth - width, naturalHeight - height);
|
|
312
|
+
const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);
|
|
305
313
|
const x = Math.floor(coords.x);
|
|
306
314
|
const y = Math.floor(coords.y);
|
|
307
315
|
const field = {
|
|
@@ -344,7 +352,8 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
344
352
|
if (!this.endpoint.session) {
|
|
345
353
|
return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
|
346
354
|
}
|
|
347
|
-
const
|
|
355
|
+
const sortedRoles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
|
|
356
|
+
const selectableRoles = sortedRoles.map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
|
|
348
357
|
return (h(Host, { class: this.placing ? { [`placing-${this.placing}`]: true } : {}, onSubmit: () => { } }, h("div", { id: "verdocs-template-fields-toolbar" }, h("div", { class: "add-for" }, "Add field:"), h("verdocs-select-input", { value: this.selectedRoleName, options: selectableRoles, onInput: (e) => (this.selectedRoleName = e.target.value) }), menuOptions.map(option => (h("verdocs-toolbar-icon", { text: option.tooltip, icon: option.icon, class: option.class, onClick: () => {
|
|
349
358
|
// We ignore empty-tooltip entries because they're separators
|
|
350
359
|
if (option.tooltip) {
|
|
@@ -359,11 +368,12 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
|
|
|
359
368
|
} })))), h("div", { class: "pages" }, (((_b = this.template) === null || _b === void 0 ? void 0 : _b.documents) || []).map(document => {
|
|
360
369
|
const pageNumbers = integerSequence(1, document.pages);
|
|
361
370
|
return pageNumbers.map(page => {
|
|
371
|
+
var _a;
|
|
362
372
|
const pageSize = document.page_sizes[page];
|
|
363
|
-
return (h("verdocs-template-document-page", { templateId: this.templateId, documentId: document.id, pageNumber: page, virtualWidth: (pageSize === null || pageSize === void 0 ? void 0 : pageSize.width) || 612, virtualHeight: (pageSize === null || pageSize === void 0 ? void 0 : pageSize.height) || 792, disabled: true, editable: true, done: false, onClick: (e) => this.handleClickPage(e, page), onPageRendered: e => this.handlePageRendered(e), layers: [
|
|
373
|
+
return (h(Fragment, null, ((_a = this.template) === null || _a === void 0 ? void 0 : _a.documents.length) > 1 && (h("div", { class: "document-separator" }, h("div", { innerHTML: DocumentPageIcon }), h("span", null, document.name))), h("verdocs-template-document-page", { templateId: this.templateId, documentId: document.id, pageNumber: page, virtualWidth: (pageSize === null || pageSize === void 0 ? void 0 : pageSize.width) || 612, virtualHeight: (pageSize === null || pageSize === void 0 ? void 0 : pageSize.height) || 792, disabled: true, editable: true, done: false, onClick: (e) => this.handleClickPage(e, document.id, page), onPageRendered: e => this.handlePageRendered(e), layers: [
|
|
364
374
|
{ name: 'page', type: 'canvas' },
|
|
365
375
|
{ name: 'controls', type: 'div' },
|
|
366
|
-
] }));
|
|
376
|
+
] })));
|
|
367
377
|
});
|
|
368
378
|
})), this.showMustSelectRole && (h("verdocs-ok-dialog", { heading: "Unable to add field", message: (((_c = this.template) === null || _c === void 0 ? void 0 : _c.roles) || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.', onNext: () => (this.showMustSelectRole = false) }))));
|
|
369
379
|
}
|
|
@@ -523,6 +533,6 @@ function defineCustomElement() {
|
|
|
523
533
|
}
|
|
524
534
|
|
|
525
535
|
export { VerdocsTemplateFields as V, defineCustomElement as d };
|
|
526
|
-
//# sourceMappingURL=p-
|
|
536
|
+
//# sourceMappingURL=p-BWvUv89M.js.map
|
|
527
537
|
|
|
528
|
-
//# sourceMappingURL=p-
|
|
538
|
+
//# sourceMappingURL=p-BWvUv89M.js.map
|