@verdocs/web-sdk 1.9.31 → 1.9.32
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/{Envelopes-752bdc31.js → Envelopes-019e8a9f.js} +2 -2
- package/dist/cjs/{Envelopes-752bdc31.js.map → Envelopes-019e8a9f.js.map} +1 -1
- package/dist/cjs/Files-4bdc0c0f.js +49 -0
- package/dist/cjs/Files-4bdc0c0f.js.map +1 -0
- package/dist/cjs/Primitives-be5088cb.js +25 -0
- package/dist/cjs/Primitives-be5088cb.js.map +1 -0
- package/dist/cjs/{Templates-a4370308.js → Templates-358eaee4.js} +2 -2
- package/dist/cjs/{Templates-a4370308.js.map → Templates-358eaee4.js.map} +1 -1
- package/dist/cjs/{templateStore-8c8dc4c1.js → templateStore-eed1f161.js} +3 -4
- package/dist/cjs/templateStore-eed1f161.js.map +1 -0
- package/dist/cjs/{utils-91d249b4.js → utils-787b2115.js} +5 -29
- package/dist/cjs/utils-787b2115.js.map +1 -0
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +4 -2
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +5 -3
- package/dist/cjs/verdocs-preview.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-send.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +9 -5
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +5 -3
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +3 -28
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -4
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/utils/templateStore.js +1 -4
- package/dist/collection/utils/templateStore.js.map +1 -1
- package/dist/collection/utils/utils.js +3 -23
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/Files.js +46 -0
- package/dist/components/Files.js.map +1 -0
- package/dist/components/Primitives.js +22 -0
- package/dist/components/Primitives.js.map +1 -0
- package/dist/components/templateStore.js +1 -2
- package/dist/components/templateStore.js.map +1 -1
- package/dist/components/utils.js +5 -27
- package/dist/components/utils.js.map +1 -1
- package/dist/components/verdocs-sign.js +6 -3
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-create2.js.map +1 -1
- package/dist/components/verdocs-template-fields2.js +1 -1
- package/dist/components/verdocs-upload-dialog2.js +1 -26
- package/dist/components/verdocs-upload-dialog2.js.map +1 -1
- package/dist/components/verdocs-view2.js +1 -1
- package/dist/custom-elements.json +1123 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{Envelopes-83934981.js → Envelopes-c2545a20.js} +2 -2
- package/dist/esm/{Envelopes-83934981.js.map → Envelopes-c2545a20.js.map} +1 -1
- package/dist/esm/Files-70a192df.js +46 -0
- package/dist/esm/Files-70a192df.js.map +1 -0
- package/dist/esm/Primitives-054bc6e5.js +22 -0
- package/dist/esm/Primitives-054bc6e5.js.map +1 -0
- package/dist/esm/{Templates-41762101.js → Templates-ad0e1ebe.js} +2 -2
- package/dist/esm/{Templates-41762101.js.map → Templates-ad0e1ebe.js.map} +1 -1
- package/dist/esm/{templateStore-103a54ab.js → templateStore-7b50460b.js} +2 -3
- package/dist/esm/templateStore-7b50460b.js.map +1 -0
- package/dist/esm/{utils-36d44309.js → utils-6e8bd73f.js} +6 -28
- package/dist/esm/utils-6e8bd73f.js.map +1 -0
- package/dist/esm/verdocs-build.entry.js +3 -3
- package/dist/esm/verdocs-document-page_2.entry.js +2 -1
- package/dist/esm/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm/verdocs-dropdown_2.entry.js +3 -2
- package/dist/esm/verdocs-dropdown_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js +2 -1
- package/dist/esm/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-date.entry.js +2 -1
- package/dist/esm/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm/verdocs-field-dropdown.entry.js +2 -1
- package/dist/esm/verdocs-field-dropdown.entry.js.map +1 -1
- package/dist/esm/verdocs-field-initial.entry.js +2 -1
- package/dist/esm/verdocs-field-initial.entry.js.map +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +2 -1
- package/dist/esm/verdocs-field-payment.entry.js.map +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +2 -1
- package/dist/esm/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm/verdocs-field-signature_3.entry.js +2 -1
- package/dist/esm/verdocs-field-signature_3.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +2 -1
- package/dist/esm/verdocs-field-textarea.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +4 -2
- package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js +2 -1
- package/dist/esm/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm/verdocs-preview.entry.js +5 -3
- package/dist/esm/verdocs-preview.entry.js.map +1 -1
- package/dist/esm/verdocs-send.entry.js +2 -1
- package/dist/esm/verdocs-send.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +8 -4
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +5 -3
- package/dist/esm/verdocs-template-create_4.entry.js.map +1 -1
- package/dist/esm/verdocs-upload-dialog.entry.js +1 -26
- package/dist/esm/verdocs-upload-dialog.entry.js.map +1 -1
- package/dist/esm-es5/{Envelopes-83934981.js → Envelopes-c2545a20.js} +2 -2
- package/dist/esm-es5/{Envelopes-83934981.js.map → Envelopes-c2545a20.js.map} +0 -0
- package/dist/esm-es5/Files-70a192df.js +2 -0
- package/dist/esm-es5/Files-70a192df.js.map +1 -0
- package/dist/esm-es5/Primitives-054bc6e5.js +2 -0
- package/dist/esm-es5/Primitives-054bc6e5.js.map +1 -0
- package/dist/esm-es5/{Templates-41762101.js → Templates-ad0e1ebe.js} +2 -2
- package/dist/esm-es5/{Templates-41762101.js.map → Templates-ad0e1ebe.js.map} +0 -0
- package/dist/esm-es5/templateStore-7b50460b.js +2 -0
- package/dist/esm-es5/templateStore-7b50460b.js.map +1 -0
- package/dist/esm-es5/utils-6e8bd73f.js +2 -0
- package/dist/esm-es5/utils-6e8bd73f.js.map +1 -0
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js.map +1 -1
- package/dist/types/utils/utils.d.ts +0 -2
- package/dist/verdocs-web-sdk/p-008f67ce.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-008f67ce.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-016521f8.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-6896b64c.system.entry.js.map → p-016521f8.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-08800f26.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-8c2cdcc4.entry.js.map → p-08800f26.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-458b639d.js → p-11ab1bd0.js} +2 -2
- package/dist/verdocs-web-sdk/{p-458b639d.js.map → p-11ab1bd0.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-6d858f25.entry.js → p-12fd1696.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6d858f25.entry.js.map → p-12fd1696.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-14513fd8.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-bd6175d9.system.entry.js.map → p-14513fd8.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-7d1a5bc5.system.entry.js → p-14c69e28.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7d1a5bc5.system.entry.js.map → p-14c69e28.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-194a9ea7.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-455c2dd9.entry.js.map → p-194a9ea7.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-210606ed.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-cc30f8c8.entry.js.map → p-210606ed.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-57fad02b.system.js → p-252d594a.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-57fad02b.system.js.map → p-252d594a.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-327858f0.system.js +2 -0
- package/dist/verdocs-web-sdk/p-327858f0.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-3cafb2e3.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-29044b5b.entry.js.map → p-3cafb2e3.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-3e33cd27.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-d9413770.system.entry.js.map → p-3e33cd27.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-417ee5e0.js +2 -0
- package/dist/verdocs-web-sdk/p-417ee5e0.js.map +1 -0
- package/dist/verdocs-web-sdk/p-46e776de.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-26e0caa5.system.entry.js.map → p-46e776de.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-553176fa.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-2d1b5389.system.entry.js.map → p-553176fa.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-5c895ce6.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-b5cf7ddc.system.entry.js.map → p-5c895ce6.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-6f177552.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-206bbfe3.system.entry.js.map → p-6f177552.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-7291906c.js +2 -0
- package/dist/verdocs-web-sdk/p-7291906c.js.map +1 -0
- package/dist/verdocs-web-sdk/p-763b1dd8.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-9f381d10.entry.js.map → p-763b1dd8.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-78989f41.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c8fb8a55.entry.js.map → p-78989f41.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-831ee1b6.system.js +2 -0
- package/dist/verdocs-web-sdk/p-831ee1b6.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-851f5c2b.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-851f5c2b.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-87776dc1.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c35a211a.system.entry.js.map → p-87776dc1.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-893d6bfb.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-2e8a3d90.entry.js.map → p-893d6bfb.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-6baf87ba.js → p-8c0aa0e9.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6baf87ba.js.map → p-8c0aa0e9.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-977ccc81.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-977ccc81.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-9c208c1d.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-a45632ec.entry.js.map → p-9c208c1d.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-9f1225bf.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-49227301.entry.js.map → p-9f1225bf.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-a3820c7f.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-19a634b9.entry.js.map → p-a3820c7f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-30fcf18d.system.js → p-a74a9c6b.system.js} +2 -2
- package/dist/verdocs-web-sdk/p-a74a9c6b.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-a8b91e3f.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-78c6b2b1.entry.js.map → p-a8b91e3f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-a8cc5e31.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-102bc4bc.entry.js.map → p-a8cc5e31.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-aa124212.js +2 -0
- package/dist/verdocs-web-sdk/p-aa124212.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b122f5c7.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-d1c6b0f4.system.entry.js.map → p-b122f5c7.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b94cdaea.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-0398fe67.system.entry.js.map → p-b94cdaea.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b988a40a.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-de207098.entry.js.map → p-b988a40a.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b9a1a471.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-729db0b6.system.entry.js.map → p-b9a1a471.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-bd503b85.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-515f3ab2.entry.js.map → p-bd503b85.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c0cc2b8e.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-5e693763.system.entry.js.map → p-c0cc2b8e.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c0f5116c.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-99495fbb.system.entry.js.map → p-c0f5116c.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-6d8b9e75.system.js → p-c8e8732b.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6d8b9e75.system.js.map → p-c8e8732b.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-d50523fd.system.js +2 -0
- package/dist/verdocs-web-sdk/p-d50523fd.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d85e61ee.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-d85e61ee.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d954919a.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c3d5596a.entry.js.map → p-d954919a.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-3ce35714.js → p-e53f969c.js} +2 -2
- package/dist/verdocs-web-sdk/p-e53f969c.js.map +1 -0
- package/dist/verdocs-web-sdk/p-f36c6695.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-1b3be2ae.system.entry.js.map → p-f36c6695.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-f4a3bc08.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-cf6cfa4f.system.entry.js.map → p-f4a3bc08.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/templateStore-8c8dc4c1.js.map +0 -1
- package/dist/cjs/utils-91d249b4.js.map +0 -1
- package/dist/esm/templateStore-103a54ab.js.map +0 -1
- package/dist/esm/utils-36d44309.js.map +0 -1
- package/dist/esm-es5/templateStore-103a54ab.js +0 -2
- package/dist/esm-es5/templateStore-103a54ab.js.map +0 -1
- package/dist/esm-es5/utils-36d44309.js +0 -2
- package/dist/esm-es5/utils-36d44309.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0225575c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-0225575c.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0398fe67.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-102bc4bc.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-19a634b9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1b3be2ae.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-206bbfe3.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-26e0caa5.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-29044b5b.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-2d1b5389.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-2e8a3d90.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-30fcf18d.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3ce35714.js.map +0 -1
- package/dist/verdocs-web-sdk/p-455c2dd9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-49227301.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-515f3ab2.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-58c4b767.system.js +0 -2
- package/dist/verdocs-web-sdk/p-58c4b767.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-5e693763.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-6896b64c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-71f1e3c9.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-71f1e3c9.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-729db0b6.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-78c6b2b1.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-8c2cdcc4.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-99495fbb.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-9f381d10.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-a45632ec.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b5cf7ddc.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b76c949d.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b76c949d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-bd6175d9.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c35a211a.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c3d5596a.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c8fb8a55.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-cc30f8c8.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-cf6cfa4f.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d1c6b0f4.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d5f48c21.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d5f48c21.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d9413770.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-de207098.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-ff3b285c.js +0 -2
- package/dist/verdocs-web-sdk/p-ff3b285c.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{h as e}from"./p-417ee5e0.js";import{c as o}from"./p-5ea05a1d.js";import{g as l}from"./p-c2cc4492.js";const{state:n,onChange:r}=o({envelope:null,template:null,loadProgress:0,loading:true,error:"",roleNames:[],dirty:false});r("envelope",(async e=>{if(!e){console.log("[ENVELOPESTORE] Clearing envelope");n.roleNames=[];n.dirty=false;n.loading=false;n.error="";n.loadProgress=0;return}console.log("[ENVELOPESTORE] Loaded envelope",e);n.roleNames=e.recipients.map((e=>e.role_name));console.log("[ENVELOPESTORE] Loaded roles",n.roleNames)}));const a=async(o,r)=>{var a,s;if(!r){console.log(`[ENVELOPES] Missing required envelope ID`);return}if(((a=n.envelope)===null||a===void 0?void 0:a.id)===r){console.log(`[ENVELOPES] Skipping load for already-loaded envelope ID`);return}n.error="";n.loading=true;n.envelope=null;try{console.log(`[ENVELOPES] Loading envelope ${r}`);const a=await e(o,r,true);if(!a){console.log("[ENVELOPES] Unable to load envelope");return}n.envelope=a;const s=await l(o,a.template_id,true);if(!a){console.log("[ENVELOPES] Unable to load template");return}n.template=s;n.loading=false}catch(e){n.loading=false;n.error=((s=e===null||e===void 0?void 0:e.response)===null||s===void 0?void 0:s.status)===401?"Authentication required":e.message;console.log("[ENVELOPES] Error loading envelope",e);throw e}};export{a as g,n as s};
|
|
2
|
+
//# sourceMappingURL=p-8c0aa0e9.js.map
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as i,h as t,H as s,F as n}from"./p-ff1278ed.js";import{b as o,s as r,u as a,c as l,d,e as c,t as h,a as u,r as f,f as v}from"./p-417ee5e0.js";import"./p-8efc9749.js";import{a as p,i as g}from"./p-e662f81b.js";import{f as x}from"./p-7291906c.js";import{V as m}from"./p-5e67c42f.js";import{g as b,s as w}from"./p-8c0aa0e9.js";import{S as y}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-aa124212.js";import"./p-5ea05a1d.js";import"./p-c2cc4492.js";var k=undefined&&undefined.__awaiter||function(e,i,t,s){function n(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function r(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s["throw"](e))}catch(e){o(e)}}function l(e){e.done?t(e.value):n(e.value).then(r,a)}l((s=s.apply(e,i||[])).next())}))};var S=undefined&&undefined.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},s,n,o,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(i){return l([e,i])}}function l(r){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,n&&(o=r[0]&2?n["return"]:r[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;if(n=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;n=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){t.label=r[1];break}if(r[0]===6&&t.label<o[1]){t.label=o[1];o=r;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(r);break}if(o[2])t.ops.pop();t.trys.pop();continue}r=i.call(e,t)}catch(e){r=[6,e];n=0}finally{s=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var I=function(e,i,t,s){return k(void 0,void 0,void 0,(function(){return S(this,(function(n){return[2,e.api.put("/envelopes/".concat(i,"/recipients/").concat(t),s).then((function(e){return e.data}))]}))}))};var N=function(e,i,t){return I(e,i,t,{action:"submit"})};var z=function(e,i,t){return I(e,i,t,{action:"decline"})};var j=function(e,i,t,s){return I(e,i,t,{action:"update",agreed:s})};var F=function(e,i,t){var s=new FormData;s.append("signature",t,i);return e.api.post("/signatures",s).then((function(e){return e.data}))};var G=function(e,i,t){var s=new FormData;s.append("initial",t,i);return e.api.post("/initials",s).then((function(e){return e.data}))};const H='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .header{color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 15px;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-sign .header .logo{width:80px;margin:-6px 0 0 10px}verdocs-sign .header .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;padding:0 15px;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-sign .document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}@media print{verdocs-sign .header{display:none}}';const C=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></svg>`;const D=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>`;const L=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false}componentWillLoad(){this.endpoint=new m({sessionType:"signing"})}async componentDidLoad(){var e,i,t,s,n,r,a;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new y("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new y("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new y("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{session:e,recipient:i,signerToken:t}=await o(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode});console.log(`[SIGN] Loaded signing session ${e.email} / ${e.profile_id}`);this.recipient=i;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=t;this.endpoint.setToken(t);if(this.agreed){this.nextButtonLabel="Next"}await b(this.endpoint,this.envelopeId);this.recipientIndex=w.envelope.recipients.findIndex((e=>e.role_name==this.roleId));if(this.recipientIndex>-1){this.recipient=w.envelope.recipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,w.envelope.recipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:w.envelope})}catch(e){console.log("Error with signing session",e);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new y(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(a=e.response)===null||a===void 0?void 0:a.data))}}handleClickAgree(){j(this.endpoint,this.envelopeId,this.roleId,true).then((()=>{var e;this.nextButtonLabel="Next";this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:w.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("Update failure",e);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new y(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;break;case"claim":window.alert("This feature will be available in an upcoming release.");break;case"decline":{const e=await z(this.endpoint,this.envelopeId,this.roleId);console.log("Decline result",e);this.isDone=true}break;case"print":window.print();break;case"download":r(this.endpoint,w.envelope,w.envelope.envelope_document_id).catch((e=>{console.log("Error downloading PDF",e)}));break}}updateRecipientFieldValue(e,i){this.recipient.fields.forEach((t=>{if(t.name===e){t.settings=i.settings;a(t)}}))}saveFieldChange(e,i){l(this.endpoint,this.envelopeId,e,i).then((i=>{this.updateRecipientFieldValue(e,i)})).catch((e=>{var i,t,s,n,o,r;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.errorMessage="Signing session expired."}else{console.log("[SIGN] Server error",e)}(n=this.sdkError)===null||n===void 0?void 0:n.emit(new y(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(r=e.response)===null||r===void 0?void 0:r.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox_group":{const t=e.settings.options.map((e=>({id:e.id,checked:i.target.checked})));return this.saveFieldChange(e.name,{prepared:false,value:{options:t}})}case"radio_button_group":{const t=e.settings.options.map((e=>({id:e.id,selected:i.target.value===e.id})));return this.saveFieldChange(e.name,{prepared:false,value:{options:t}})}case"dropdown":return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":const n=await(await fetch(i.detail)).blob();return G(this.endpoint,"initial",n).then((async i=>{const t=await c(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"signature":const o=await(await fetch(i.detail)).blob();return F(this.endpoint,"signature",o).then((async i=>{const t=await d(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"date":const r=i.target.getAttribute("iso");return this.saveFieldChange(e.name,{prepared:false,value:r});case"timestamp":console.log("Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("Unhandled field update",{value:t,checked:s},e);break}}isFieldValid(e){var i,t,s,n,o,r,a;const{required:l=false}=e;const{result:d="",value:c="",base64:h=""}=e.settings||{};switch(e.type){case"textbox":switch(((i=e.settings)===null||i===void 0?void 0:i.validator)||""){case"email":return g(d);case"phone":return p(d);default:return!l||d!==""}case"signature":case"initial":return!l||h!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!l||d!=="";case"dropdown":return!l||c!=="";case"checkbox_group":const u=(((s=(t=e.settings)===null||t===void 0?void 0:t.options)===null||s===void 0?void 0:s.filter((e=>e.checked)))||[]).length;return!l||u>=(((n=e.settings)===null||n===void 0?void 0:n.minimum_checked)||0)&&u<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!l||(((a=(r=e.settings)===null||r===void 0?void 0:r.options)===null||a===void 0?void 0:a.filter((e=>e.selected)))||[]).length>0;default:return false}}async handleNext(){var e;if(this.nextSubmits){try{const e=await N(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",e);this.showDone=true;this.isDone=true}catch(e){console.log("Error submitting",e)}return}const i=this.recipient.fields.filter((e=>e.required));const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let n=i[s];let o=0;if(o<i.length&&["signature","initial"].includes(n.type)&&((e=n.settings)===null||e===void 0?void 0:e.result)==="signed"){o++;s++;if(s>=i.length){s=0}n=i[s]}if(o>=i.length){n=null}if(n){const e=v(n);const i=document.getElementById(e);i===null||i===void 0?void 0:i.focusField();this.focusedField=n.name}}checkRecipientFields(){const e=this.recipient.fields.filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";this.nextSubmits=true}else{console.log("[SIGN] Remaining invalid fields",e);this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t,s){var n;s.addEventListener("input",h((e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))),250));s.addEventListener("blur",(()=>this.checkRecipientFields()));s.addEventListener("fieldChange",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))));s.setAttribute("roleindex",t);s.setAttribute("xScale",e.xScale);s.setAttribute("yScale",e.yScale);s.setAttribute("initials",this.recipient?x(this.recipient.full_name):"");s.setAttribute("name",((n=this.recipient)===null||n===void 0?void 0:n.full_name)||"")}handlePageRendered(e){const i=e.detail;const t=u(w.roleNames,this.recipient.role_name);const s=this.recipient.fields.filter((e=>e.page===i.pageNumber));console.log("[SIGN] Page rendered, updating fields",{pageInfo:i,roleIndex:t,recipientFields:s});s.forEach((e=>{const s=f(e,i,t,{disabled:false,editable:false,draggable:false,done:this.isDone});if(!s){return}if(Array.isArray(s)){s.map((s=>this.attachFieldAttributes(i,e,t,s)))}else{this.attachFieldAttributes(i,e,t,s)}}));w.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name)).forEach((e=>{const t=u(w.roleNames,e.role_name);const s=e.fields.filter((e=>e.page===i.pageNumber));s.forEach((e=>{const s=f(e,i,t,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!s){return}if(s.setAttribute){s.setAttribute("roleindex",t);s.setAttribute("xScale",i.xScale);s.setAttribute("yScale",i.yScale)}}))}));this.checkRecipientFields()}render(){if(w.loading||!w.envelope){return t(s,null,t("verdocs-loader",null))}const e=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing",disabled:true},{id:"download",label:"Download"}];return t(s,{class:{agreed:this.agreed}},!this.isDone&&!this.finishLater&&t("div",{class:"intro"},"Please review and act on these documents."),!this.isDone&&t("div",{class:"header"},!this.isDone&&!this.finishLater&&t("verdocs-dropdown",{options:e,onOptionSelected:e=>this.handleOptionSelected(e)}),!this.agreed?t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:()=>this.handleClickAgree()})):t(n,null,t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},w.envelope.name),t("div",{style:{flex:"1"}}),t("div",{innerHTML:C,style:{width:"24px",height:"24px",fill:"#fff",cursor:"pointer"},onClick:()=>window.print()}),t("div",{innerHTML:D,style:{width:"24px",height:"24px",fill:"#fff",cursor:"pointer",margin:"0 16px",maginRight:"30px"},onClick:()=>r(this.endpoint,w.envelope,w.envelope.envelope_document_id).catch((()=>{}))})),!this.isDone&&!this.finishLater&&t("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()})),!this.isDone&&!this.agreed?t("div",{class:"cover"}):t("div",{style:{display:"none"}}),this.isDone?t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}):t("div",{class:"document"},(w.envelope.documents||[]).map((e=>{const i=[...(e===null||e===void 0?void 0:e.pages)||[]];i.sort(((e,i)=>e.sequence-i.sequence));return t(n,null,i.map((e=>{var i;const s=(i=w.template)===null||i===void 0?void 0:i.pages.find((i=>i.sequence===e.sequence));return t("verdocs-document-page",{pageImageUri:(s===null||s===void 0?void 0:s.display_uri)||e.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:e.sequence,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the document, use the link in the original email notification inviting you to review and finish the document.",onNext:()=>this.showFinishLater=false}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the Verdoc at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.",onNext:()=>this.showDone=false}))}};L.style=H;export{L as verdocs_sign};
|
|
2
|
+
//# sourceMappingURL=p-977ccc81.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node_modules/@verdocs/js-sdk/Envelopes/Recipients.js","node_modules/@verdocs/js-sdk/Envelopes/Signatures.js","node_modules/@verdocs/js-sdk/Envelopes/Initials.js","src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","updateRecipient","endpoint","envelopeId","roleName","params","_a","api","put","concat","r","data","envelopeRecipientSubmit","action","envelopeRecipientDecline","envelopeRecipientAgree","agreed","createSignature","name","signature","FormData","append","post","createInitials","initials","verdocsSignCss","PrintIcon","DownloadIcon","VerdocsSign","recipientIndex","[object Object]","VerdocsEndpoint","sessionType","sdkError","emit","SDKError","roleId","_b","inviteCode","_c","console","log","session","recipient","signerToken","Envelopes.getSigningSession","email","profile_id","setToken","nextButtonLabel","getEnvelopeById","EnvelopeStore","envelope","recipients","findIndex","role_name","isDone","includes","status","_d","envelopeLoaded","_e","message","_f","response","_g","envelopeUpdated","event","catch","detail","id","finishLater","showFinishLater","window","alert","declineResult","print","savePDF","envelope_document_id","fieldName","updateResult","fields","forEach","oldField","settings","updateDocumentFieldValue","Envelopes.updateEnvelopeField","updateRecipientFieldValue","error","errorMessage","field","checked","target","type","saveFieldChange","prepared","options","map","option","selected","initialsBlob","fetch","blob","async","newInitials","updateEnvelopeFieldInitials","signatureBlob","newSignature","updateEnvelopeFieldSignature","iso","getAttribute","ts","required","base64","validator","isValidEmail","isValidPhone","checkedCount","filter","minimum_checked","maximum_checked","nextSubmits","showDone","requiredFields","focusedIndex","focusedField","nextFocusedIndex","nextRequiredField","skips","getFieldId","el","document","getElementById","focusField","invalidFields","isFieldValid","pageInfo","roleIndex","addEventListener","throttle","handleFieldChange","finally","checkRecipientFields","setAttribute","xScale","yScale","fullNameToInitials","full_name","getRoleIndex","roleNames","recipientFields","page","pageNumber","renderDocumentField","disabled","editable","draggable","Array","isArray","attachFieldAttributes","otherRecipient","otherRoleIndex","loading","h","Host","menuOptions","class","onOptionSelected","handleOptionSelected","onInput","handleClickAgree","Fragment","src","alt","style","flex","innerHTML","width","height","fill","cursor","onClick","margin","maginRight","size","handleNext","display","onSdkError","documents","envelopeDocument","pages","sort","a","b","sequence","templatePage","template","find","p","pageImageUri","display_uri","virtualWidth","virtualHeight","onPageRendered","handlePageRendered","layers","heading","onNext"],"mappings":"wdAAA,IAAIA,EAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,IAAW,MAAOO,GAAKJ,EAAOI,IACpF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,IAAW,MAAOO,GAAKJ,EAAOI,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,GAClGH,GAAMP,EAAYA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xO,GAAKb,KAAKsP,mBAAmBzO,GAC7C0O,OAAQ,CACN,CAAC3L,KAAM,OAAQ2E,KAAM,UACrB,CAAC3E,KAAM,WAAY2E,KAAM,kBAW1CvI,KAAKkH,iBACJ2F,EAAA,oBAAA,CACE2C,QAAQ,8CACRhJ,QAAQ,4HACRiJ,OAAQ,IAAOzP,KAAKkH,gBAAkB,QAIzClH,KAAKmI,cAAgB0E,EAAA,oBAAA,CAAmB2C,QAAQ,gBAAgBhJ,QAASxG,KAAKmI,aAAcsH,OAAQ,IAAOzP,KAAKmI,aAAe,KAC/HnI,KAAKoK,UACJyC,EAAA,oBAAA,CACE2C,QAAQ,eACRhJ,QAAQ,wOACRiJ,OAAQ,IAAOzP,KAAKoK,SAAW","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Update a recipient's status block\n */\nexport var updateRecipient = function (endpoint, envelopeId, roleName, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(roleName), params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Submit an envelope (signing is finished). Note that all fields must be valid/completed for this to succeed.\n */\nexport var envelopeRecipientSubmit = function (endpoint, envelopeId, roleName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'submit' });\n};\n/**\n * Decline to complete an envelope (signing will not terminated).\n */\nexport var envelopeRecipientDecline = function (endpoint, envelopeId, roleName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'decline' });\n};\n/**\n * Claim / change ownership of an envelope. This is a special-case operation only available in certain workflows.\n */\nexport var envelopeRecipientChangeOwner = function (endpoint, envelopeId, roleName, email, fullName) { return updateRecipient(endpoint, envelopeId, roleName, { action: 'owner_update', email: email, full_name: fullName }); };\n/**\n * Agree to electronic signing.\n */\nexport var envelopeRecipientAgree = function (endpoint, envelopeId, roleName, agreed) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', agreed: agreed });\n};\n/**\n * Change a recipient's name.\n */\nexport var envelopeRecipientUpdateName = function (endpoint, envelopeId, roleName, fullName) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'update', new_full_name: fullName });\n};\n/**\n * Change a recipient's name.\n */\nexport var envelopeRecipientPrepare = function (endpoint, envelopeId, roleName, recipients) {\n return updateRecipient(endpoint, envelopeId, roleName, { action: 'prepare', recipients: recipients });\n};\nexport var getSignerToken = function (endpoint, envelopeId, roleName) {\n return endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(encodeURIComponent(roleName), \"/signer-token\"))\n .then(function (r) { return r.data; });\n};\nexport var getInPersonLink = function (endpoint, envelopeId, roleName) {\n return endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients/\").concat(encodeURIComponent(roleName), \"?in_person_link=true\"))\n .then(function (r) { return r.data; });\n};\n","/**\n * Create a signature block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * a signature block to be used for all signature fields in the document. Thus, this is typically called one time to\n * create and store a signature block. Thereafter, the ID of the signature block may be re-used for each signature field\n * to be \"stamped\" by the user.\n */\nexport var createSignature = function (endpoint, name, signature) {\n var data = new FormData();\n data.append('signature', signature, name);\n return endpoint.api //\n .post(\"/signatures\", data)\n .then(function (r) { return r.data; });\n};\n/**\n * Get the availbable signatures for a user.\n */\nexport var getSignatures = function (endpoint) {\n return endpoint.api //\n .get('/signatures')\n .then(function (r) { return r.data; });\n};\n/**\n * Get a user's signature by ID.\n */\nexport var getSignature = function (endpoint, signatureId) {\n return endpoint.api //\n .get(\"/signatures/\".concat(signatureId))\n .then(function (r) { return r.data; });\n};\n/**\n * Delete a user's signature.\n */\nexport var deleteSignature = function (endpoint, signatureId) {\n return endpoint.api //\n .delete(\"/signatures/\".concat(signatureId))\n .then(function (r) { return r.data; });\n};\n","/**\n * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to \"adopt\"\n * an initials block to be used for all initials fields in the document. Thus, this is typically called one time to\n * create and store an initials block. Thereafter, the ID of the initials block may be re-used for each initials field\n * to be \"stamped\" by the user.\n */\nexport var createInitials = function (endpoint, name, initials) {\n var data = new FormData();\n data.append('initial', initials, name);\n return endpoint.api //\n .post(\"/initials\", data)\n .then(function (r) { return r.data; });\n};\n","@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n .header {\n color: #fff;\n display: flex;\n z-index: 1000;\n flex: 0 0 56px;\n padding: 0 15px;\n font-size: 12px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow: 0 4px 4px 0 rgb(0 0 0 / 24%), 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .logo {\n width: 80px;\n margin: -6px 0 0 10px;\n }\n\n .title {\n padding-left: 16px;\n font-size: 18px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n\n .intro {\n width: 100%;\n display: flex;\n flex: 0 0 60px;\n color: #111111;\n padding: 0 15px;\n font-size: 18px;\n font-weight: 500;\n line-height: 28px;\n flex-direction: row;\n background: #ffffff;\n align-items: center;\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999;\n position: absolute;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .document {\n flex: 1;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .agree {\n flex: 1;\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 15px;\n\n .intro {\n display: none;\n }\n\n .header {\n flex: 0 0 56px;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {createInitials} from '@verdocs/js-sdk/Envelopes/Initials';\nimport {createSignature} from '@verdocs/js-sdk/Envelopes/Signatures';\nimport {fullNameToInitials} from '@verdocs/js-sdk/Utils/Primitives';\nimport {isValidEmail, isValidPhone} from '@verdocs/js-sdk/Templates/Validators';\nimport {IDocumentField, IEnvelope, IRecipient} from '@verdocs/js-sdk/Envelopes/Types';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldInitials, updateEnvelopeFieldSignature} from '@verdocs/js-sdk/Envelopes/Envelopes';\nimport {envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit} from '@verdocs/js-sdk/Envelopes/Recipients';\nimport {getFieldId, getRoleIndex, renderDocumentField, savePDF, throttle, updateDocumentFieldValue} from '../../../utils/utils';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop() envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop() roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop() inviteCode: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() recipient: IRecipient | null = null;\n @State() signerToken = null;\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() errorMessage = '';\n @State() focusedField = '';\n @State() isDone = false;\n @State() showDone = false;\n\n @State() finishLater = false;\n @State() showFinishLater = false;\n @State() agreed = false;\n\n recipientIndex: number = -1;\n\n componentWillLoad() {\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n const {session, recipient, signerToken} = await Envelopes.getSigningSession(this.endpoint, {\n envelopeId: this.envelopeId,\n roleId: this.roleId,\n inviteCode: this.inviteCode,\n });\n\n console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);\n\n this.recipient = recipient;\n console.log('[SIGN] We are recipient', this.recipient);\n this.signerToken = signerToken;\n this.endpoint.setToken(signerToken);\n\n if (this.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n await getEnvelopeById(this.endpoint, this.envelopeId);\n\n this.recipientIndex = EnvelopeStore.envelope.recipients.findIndex(recipient => recipient.role_name == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = EnvelopeStore.envelope.recipients[this.recipientIndex];\n this.agreed = this.recipient.agreed;\n console.log('[SIGN] Found our recipient in the envelope', this.recipientIndex, this.recipient);\n } else {\n console.log('[SIGN] Could not find our recipient record', this.roleId, EnvelopeStore.envelope.recipients);\n }\n\n this.isDone = ['submitted', 'canceled', 'declined'].includes(this.recipient.status);\n\n // TODO: Fix service to allow this?\n // const sigs = await getSignatures();\n // console.log('sigs', sigs);\n\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope});\n } catch (e) {\n console.log('Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleClickAgree() {\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(() => {\n this.nextButtonLabel = 'Next';\n this.agreed = true; // The server returns a recipient object but it's not \"deep\" so we track this locally\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('Update failure', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n // this.router.navigate([`view/sign/${this.envelopeId}/role/${this.roleName}/saved`]);\n break;\n case 'claim':\n window.alert('This feature will be available in an upcoming release.');\n break;\n case 'decline':\n {\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('Decline result', declineResult);\n this.isDone = true;\n }\n break;\n case 'print':\n window.print();\n break;\n case 'download':\n savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(e => {\n console.log('Error downloading PDF', e);\n });\n break;\n }\n }\n\n updateRecipientFieldValue(fieldName: string, updateResult: any) {\n this.recipient.fields.forEach(oldField => {\n if (oldField.name === fieldName) {\n oldField.settings = updateResult.settings;\n // TODO: When we break out other fields like value, update them here too\n updateDocumentFieldValue(oldField);\n }\n });\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n Envelopes.updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .then(updateResult => {\n this.updateRecipientFieldValue(fieldName, updateResult);\n })\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n // TODO: Do we want to improve the instructions here?\n console.log('[SIGN] Signing session expired');\n this.errorMessage = 'Signing session expired.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IDocumentField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type) {\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox_group': {\n const options = field.settings.options.map(option => ({id: option.id, checked: e.target.checked}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'radio_button_group': {\n const options = field.settings.options.map(option => ({id: option.id, selected: e.target.value === option.id}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'dropdown':\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(async newInitials => {\n const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n });\n\n case 'signature':\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(async newSignature => {\n const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n });\n\n case 'date':\n const iso = e.target.getAttribute('iso');\n return this.saveFieldChange(field.name, {prepared: false, value: iso});\n\n case 'timestamp':\n console.log('Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldValid(field: IDocumentField) {\n const {required = false} = field;\n const {result = '', value = '', base64 = ''} = field.settings || {};\n switch (field.type) {\n case 'textbox':\n switch (field.settings?.validator || '') {\n case 'email':\n return isValidEmail(result);\n case 'phone':\n return isValidPhone(result);\n default:\n return !required || result !== '';\n }\n\n case 'signature':\n case 'initial':\n return !required || base64 !== '';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'textarea':\n case 'date':\n case 'attachment':\n return !required || result !== '';\n\n case 'dropdown':\n return !required || value !== '';\n\n case 'checkbox_group':\n const checkedCount = (field.settings?.options?.filter(option => option.checked) || []).length;\n return !required || (checkedCount >= (field.settings?.minimum_checked || 0) && checkedCount <= (field.settings?.maximum_checked || 999));\n\n case 'radio_button_group':\n return !required || (field.settings?.options?.filter(option => option.selected) || []).length > 0;\n // TODO\n // case 'checkbox':\n // return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;\n // case 'payment':\n // return <verdocs-field-payment style={style} field={field} id={id} />;\n default:\n return false;\n }\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.showDone = true;\n this.isDone = true;\n } catch (e) {\n console.log('Error submitting', e);\n }\n\n return;\n }\n\n // Find and focus the next incomplete required field\n const requiredFields = this.recipient.fields.filter(field => field.required);\n const focusedIndex = requiredFields.findIndex(field => field.name === this.focusedField);\n\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = requiredFields[nextFocusedIndex];\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < requiredFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && nextRequiredField.settings?.result === 'signed') {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = requiredFields[nextFocusedIndex];\n }\n\n if (skips >= requiredFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.recipient.fields.filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n this.nextSubmits = true;\n } else {\n console.log('[SIGN] Remaining invalid fields', invalidFields);\n this.nextButtonLabel = 'Next';\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, roleIndex, el) {\n el.addEventListener(\n 'input',\n throttle(e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()), 250),\n );\n el.addEventListener('blur', () => this.checkRecipientFields());\n el.addEventListener('fieldChange', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n\n el.setAttribute('roleindex', roleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n el.setAttribute('initials', this.recipient ? fullNameToInitials(this.recipient.full_name) : '');\n el.setAttribute('name', this.recipient?.full_name || '');\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n const roleIndex = getRoleIndex(EnvelopeStore.roleNames, this.recipient.role_name);\n const recipientFields = this.recipient.fields.filter(field => field.page === pageInfo.pageNumber);\n console.log('[SIGN] Page rendered, updating fields', {pageInfo, roleIndex, recipientFields});\n\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, roleIndex, {disabled: false, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, roleIndex, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, roleIndex, el);\n }\n\n // interact(el).draggable({\n // listeners: {\n // start(event) {\n // console.log('[FIELDS] Drag started', event.type, event.target);\n // },\n // move(event) {\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 // end(event) {\n // console.log('[FIELDS] Drag ended', event);\n // // event.target.setAttribute('posX', 0);\n // // event.target.setAttribute('posy', 0);\n // // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n // },\n // },\n // });\n });\n\n // Render fields for \"the other\" recipients\n EnvelopeStore.envelope.recipients\n .filter(recipient => recipient.role_name !== this.recipient.role_name)\n .forEach(otherRecipient => {\n const otherRoleIndex = getRoleIndex(EnvelopeStore.roleNames, otherRecipient.role_name);\n const recipientFields = otherRecipient.fields.filter(field => field.page === pageInfo.pageNumber);\n\n // We don't render other recipients' fields if they've already acted, because those values are now stamped into the document page.\n // TODO: Do we want to render alternate treatments for recipients who have declined (red boxes?) and/or if the envelope is cancelled?\n // TODO: When doing server-side rendering we probably want to \"stamp\" values into the rendered PDF only once the recipient is done\n // acting. Do this once vSign is in Production.\n // TODO: Changed tacks here. During signing we show the template PDFs and everybody's fields, filled in or no. When done, we switch\n // to showing the envelope PDFs with stamped-in values. Confirm this is a good approach.\n // if (!['submitted', 'signed'].includes(otherRecipient.status)) {\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, otherRoleIndex, {\n disabled: true,\n editable: false,\n draggable: false,\n done: this.isDone,\n });\n if (!el) {\n return;\n }\n\n // TODO: Research why this occurs. There are cases when we're getting \"el.setAttribute is not a function\"\n if (el.setAttribute) {\n el.setAttribute('roleindex', otherRoleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n }\n });\n // }\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const menuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing', disabled: true},\n {id: 'download', label: 'Download'},\n ];\n\n return (\n <Host class={{agreed: this.agreed}}>\n {!this.isDone && !this.finishLater && <div class=\"intro\">Please review and act on these documents.</div>}\n\n {!this.isDone && (\n <div class=\"header\">\n {!this.isDone && !this.finishLater && <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />}\n\n {!this.agreed ? (\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"I agree to use electronic records and signatures.\" onInput={() => this.handleClickAgree()} />\n </div>\n ) : (\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer', margin: '0 16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n )}\n\n {!this.isDone && !this.finishLater && <verdocs-button size=\"small\" label={this.nextButtonLabel} disabled={!this.agreed} onClick={() => this.handleNext()} />}\n </div>\n )}\n\n {!this.isDone && !this.agreed ? <div class=\"cover\" /> : <div style={{display: 'none'}} />}\n\n {this.isDone ? (\n // <div>test</div>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n ) : (\n <div class=\"document\">\n {(EnvelopeStore.envelope.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => {\n // In signing mode we show the original template page with all the recipient fields so we can show source formatting and\n // where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or\n // future signers still need to act. Once we're \"done\" we flip to showing the envelope's documents which have the final\n // field vales (so far) stamped into them.\n const templatePage = EnvelopeStore.template?.pages.find(p => p.sequence === page.sequence);\n // TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure\n // we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.\n // console.log('tp', templatePage, page);\n return (\n <verdocs-document-page\n pageImageUri={templatePage?.display_uri || page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n )}\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message=\"To complete the document, use the link in the original email notification inviting you to review and finish the document.\"\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.errorMessage && <verdocs-ok-dialog heading=\"Network Error\" message={this.errorMessage} onNext={() => (this.errorMessage = '')} />}\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message=\"You can access the Verdoc at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.\"\n onNext={() => (this.showDone = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as o,h as s,H as i}from"./p-ff1278ed.js";import"./p-8efc9749.js";import{V as r}from"./p-5e67c42f.js";import{r as a,a as t}from"./p-417ee5e0.js";import{s as n}from"./p-e53f969c.js";import{l}from"./p-11ab1bd0.js";import{S as d}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-aa124212.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-c2cc4492.js";const p='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;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-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';const c=class{constructor(s){e(this,s);this.sdkError=o(this,"sdkError",7);this.endpoint=r.getDefault();this.templateId=null}async componentDidLoad(){var e,o,s;this.endpoint.loadSession();if(!this.templateId){console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);return}try{console.log(`[PREVIEW] Loading template ${this.templateId}`);await l(this.endpoint,this.templateId)}catch(i){console.log("[PREVIEW] Error loading template",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new d(i.message,(o=i.response)===null||o===void 0?void 0:o.status,(s=i.response)===null||s===void 0?void 0:s.data))}}async handleFieldChange(e,o,s){console.log("[PREVIEW] handleFieldChange",e,o,s)}handlePageRendered(e){const o=e.detail;console.log("[PREVIEW] Page rendered",o);const s=n.fields.filter((e=>e.page_sequence===o.pageNumber));console.log("[PREVIEW] Fields on page",s);s.forEach((e=>a(e,o,t(n.roleNames,e.role_name),{disabled:true,editable:false,draggable:false})))}render(){if(n.loading||!n.template){return s(i,null,s("verdocs-loader",null))}const e=[...n.template.pages];e.sort(((e,o)=>e.sequence-o.sequence));return s(i,null,e.map((e=>{console.log("rendering page",e);return s("verdocs-document-page",{pageImageUri:e.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:e.sequence,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}};c.style=p;export{c as verdocs_preview};
|
|
2
|
+
//# sourceMappingURL=p-9c208c1d.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"names":["verdocsPreviewCss","VerdocsPreview","VerdocsEndpoint","getDefault","[object Object]","this","endpoint","loadSession","templateId","console","log","loadTemplate","e","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","field","optionId","pageInfo","detail","fields","TemplateStore","filter","page_sequence","pageNumber","forEach","renderDocumentField","getRoleIndex","roleNames","role_name","disabled","editable","draggable","loading","template","h","Host","pages","sort","a","b","sequence","map","page","pageImageUri","display_uri","virtualWidth","virtualHeight","onPageRendered","handlePageRendered","layers","name","type"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"names":["verdocsPreviewCss","VerdocsPreview","VerdocsEndpoint","getDefault","[object Object]","this","endpoint","loadSession","templateId","console","log","loadTemplate","e","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","field","optionId","pageInfo","detail","fields","TemplateStore","filter","page_sequence","pageNumber","forEach","renderDocumentField","getRoleIndex","roleNames","role_name","disabled","editable","draggable","loading","template","h","Host","pages","sort","a","b","sequence","map","page","pageImageUri","display_uri","virtualWidth","virtualHeight","onPageRendered","handlePageRendered","layers","name","type"],"mappings":"+XAAA,MAAMA,EAAoB,0bCoBbC,EAAc,gFAIWC,EAAgBC,6BAKhB,KASpCC,mCACEC,KAAKC,SAASC,cAEd,IAAKF,KAAKG,WAAY,CACpBC,QAAQC,IAAI,0CAA0CL,KAAKG,cAC3D,OAGF,IACEC,QAAQC,IAAI,8BAA8BL,KAAKG,oBACzCG,EAAaN,KAAKC,SAAUD,KAAKG,YACvC,MAAOI,GACPH,QAAQC,IAAI,mCAAoCE,IAChDC,EAAAR,KAAKS,YAAQ,MAAAD,SAAA,OAAA,EAAAA,EAAEE,KAAK,IAAIC,EAASJ,EAAEK,SAASC,EAAAN,EAAEO,YAAQ,MAAAD,SAAA,OAAA,EAAAA,EAAEE,QAAQC,EAAAT,EAAEO,YAAQ,MAAAE,SAAA,OAAA,EAAAA,EAAEC,QAIhFlB,wBAAwBmB,EAAuBX,EAAQY,GACrDf,QAAQC,IAAI,8BAA+Ba,EAAOX,EAAGY,GAGvDpB,mBAAmBQ,GACjB,MAAMa,EAAWb,EAAEc,OACnBjB,QAAQC,IAAI,0BAA2Be,GAEvC,MAAME,EAASC,EAAcD,OAAOE,QAAON,GAASA,EAAMO,gBAAkBL,EAASM,aACrFtB,QAAQC,IAAI,2BAA4BiB,GACxCA,EAAOK,SAAQT,GAASU,EAAoBV,EAAOE,EAAUS,EAAaN,EAAcO,UAAWZ,EAAMa,WAAY,CAACC,SAAU,KAAMC,SAAU,MAAOC,UAAW,UAGpKnC,SAEE,GAAIwB,EAAcY,UAAYZ,EAAca,SAAU,CACpD,OACEC,EAACC,EAAI,KACHD,EAAA,iBAAA,OAKN,MAAME,EAAQ,IAAIhB,EAAca,SAASG,OACzCA,EAAMC,MAAK,CAACC,EAAGC,IAAMD,EAAEE,SAAWD,EAAEC,WAEpC,OACEN,EAACC,EAAI,KACFC,EAAMK,KAAIC,IACTzC,QAAQC,IAAI,iBAAkBwC,GAC9B,OACER,EAAA,wBAAA,CACES,aAAcD,EAAKE,YACnBC,aAAc,IACdC,cAAe,IACfvB,WAAYmB,EAAKF,SACjBO,eAAgB3C,GAAKP,KAAKmD,mBAAmB5C,GAC7C6C,OAAQ,CACN,CAACC,KAAM,OAAQC,KAAM,UACrB,CAACD,KAAM,WAAYC,KAAM","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-preview {\n font-family: $verdocs-primary-font;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h} from '@stencil/core';\nimport {Event, EventEmitter, Host} from '@stencil/core';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {getRoleIndex, renderDocumentField} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport TemplateStore from '../../../utils/templateStore';\nimport {loadTemplate} from '../../../utils/Templates';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Display a template preview experience. This will display the template's attached\n * documents with signing fields overlaid on each page. Fields will be color-coded\n * by recipient, and will be read-only (cannot be filled, moved, or altered).\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\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() templateId: 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 // TODO: Move to state store so we can load this one time\n async componentDidLoad() {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n try {\n console.log(`[PREVIEW] Loading template ${this.templateId}`);\n await loadTemplate(this.endpoint, this.templateId);\n } catch (e) {\n console.log('[PREVIEW] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async handleFieldChange(field: ITemplateField, e: any, optionId?: string) {\n console.log('[PREVIEW] handleFieldChange', field, e, optionId);\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[PREVIEW] Page rendered', pageInfo);\n\n const fields = TemplateStore.fields.filter(field => field.page_sequence === pageInfo.pageNumber);\n console.log('[PREVIEW] Fields on page', fields);\n fields.forEach(field => renderDocumentField(field, pageInfo, getRoleIndex(TemplateStore.roleNames, field.role_name), {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n // TODO: Render a better error\n if (TemplateStore.loading || !TemplateStore.template) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const pages = [...TemplateStore.template.pages];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Host>\n {pages.map(page => {\n console.log('rendering page', page);\n return (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as o,h as i,H as s,a as t,F as r}from"./p-ff1278ed.js";import{c as n}from"./p-ec26fc38.js";import"./p-8efc9749.js";import{V as d}from"./p-5e67c42f.js";import{g as l,s as a}from"./p-8c0aa0e9.js";import{S as c}from"./p-7a1b2643.js";import{s as p}from"./p-417ee5e0.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-c2cc4492.js";import"./p-aa124212.js";const h=`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#50BE80"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>\n`;const v='verdocs-dropdown{font-family:"Barlow", sans-serif;display:block}verdocs-dropdown .arrow{width:32px;height:26px;background:#fff;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #cccccc;-ms-flex-pack:center;justify-content:center}verdocs-dropdown .arrow svg{fill:#55bc81;-webkit-transition:0.3s;transition:0.3s}verdocs-dropdown .items{width:200px;display:none;z-index:10000;border-radius:5px;background:#33354c;border:1px solid #654dcb}verdocs-dropdown .items[data-show]{display:block}verdocs-dropdown .option{width:100%;color:#fff;border:none;display:block;text-align:left;background:none;padding:10px 20px}verdocs-dropdown .option:hover{cursor:pointer;background:#55bc81}verdocs-dropdown .option[disabled]{color:#aaaaaa}verdocs-dropdown .option[disabled]:hover{color:#aaaaaa;cursor:inherit;background:transparent}verdocs-dropdown.open .items{display:block}verdocs-dropdown.open .arrow{background:#4c56cb;border:1px solid #707ae5}verdocs-dropdown.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1);fill:#fff}';const f=class{constructor(i){e(this,i);this.optionSelected=o(this,"optionSelected",7);this.clickListenerSymbol=new AbortController;this.options=[];this.open=undefined}componentDidLoad(){this.popper=n(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,6]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})}disconnectedCallback(){this.clickListenerSymbol.abort()}clickListener(e){const o=!(e.target==this.el||this.el.contains(e.target));if(o){this.hide()}}handleSelectOption(e,o){e.stopPropagation();this.optionSelected.emit(o);this.hide()}showDropdown(){var e,o;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:true}]}))).catch((()=>{}));(o=this.popper)===null||o===void 0?void 0:o.update().catch((()=>{}))}handleHideDropdown(e){var o,i;if(((o=e===null||e===void 0?void 0:e.target)===null||o===void 0?void 0:o.localName)==="button"&&((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.className)==="arrow"){return}this.hide()}toggleDropdown(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}}hide(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:false}]}))).catch((()=>{}))}render(){var e;return i(s,{class:{open:!!this.open}},i("button",{class:"arrow",innerHTML:h,"aria-label":"Open Menu",onClick:e=>this.toggleDropdown(e),onBlur:e=>this.handleHideDropdown(e),ref:e=>this.dropdownButton=e}),i("div",{class:"items","aria-hidden":!this.open,ref:e=>this.dropdownMenu=e},(e=this.options)===null||e===void 0?void 0:e.map((e=>i("button",{onClick:o=>this.handleSelectOption(o,e),class:"option",disabled:e.disabled},e.label)))))}get el(){return t(this)}};f.style=v;const x='verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .header{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex-align:center;align-items:center;-webkit-transition:all 0.25s;transition:all 0.25s;-ms-flex-pack:center;justify-content:center;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-view .header .inner{width:100%;max-width:1028px}verdocs-view .toolbar{width:100%;margin:0 auto;padding:0 14px;position:relative}verdocs-view .tools{width:100%;color:#fff;height:56px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-view .tools .logo{width:77.5px;margin:-6px 0 0 5px}verdocs-view .tools .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-view .document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-view .document .inner{width:100%;max-width:1028px}';const m=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></svg>`;const w=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>`;const g=class{constructor(i){e(this,i);this.sdkError=o(this,"sdkError",7);this.endpoint=d.getDefault();this.envelopeId=""}componentWillLoad(){this.endpoint.loadSession()}async componentDidLoad(){var e,o,i;if(!this.envelopeId){console.error(`[VIEW] Missing required envelopeId`);return}try{await l(this.endpoint,this.envelopeId)}catch(s){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(s.message,(o=s.response)===null||o===void 0?void 0:o.status,(i=s.response)===null||i===void 0?void 0:i.data))}}handlePageRendered(e){const o=e.detail;console.log("[SIGN] Page rendered",o)}render(){var e;console.log("[VIEW] Rendering",a.error,a.loading,a.envelope);if(a.loading||!a.envelope){return i(s,null,i("verdocs-loader",null))}if(a.error){return i(s,null,i("div",null,a.error))}return i(s,null,i("div",{class:"header"},i("div",{class:"inner"},i("div",{class:"toolbar"},i("div",{class:"tools"},i(r,null,i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},a.envelope.name),i("div",{style:{flex:"1"}}),i("div",{innerHTML:m,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer"},onClick:()=>window.print()}),i("div",{innerHTML:w,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer",marginLeft:"16px",maginRight:"30px"},onClick:()=>p(this.endpoint,a.envelope,a.envelope.envelope_document_id).catch((()=>{}))})))))),i("div",{class:"document"},(((e=a.envelope)===null||e===void 0?void 0:e.documents)||[]).map((e=>{const o=[...(e===null||e===void 0?void 0:e.pages)||[]];o.sort(((e,o)=>e.sequence-o.sequence));return i(r,null,o.map((e=>i("verdocs-document-page",{pageImageUri:e.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:e.sequence,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))))}get component(){return t(this)}};g.style=x;export{f as verdocs_dropdown,g as verdocs_view};
|
|
2
|
+
//# sourceMappingURL=p-9f1225bf.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/controls/verdocs-dropdown/verdocs-dropdown.scss?tag=verdocs-dropdown","src/components/controls/verdocs-dropdown/verdocs-dropdown.tsx","src/components/embeds/verdocs-view/verdocs-view.scss?tag=verdocs-view","src/components/embeds/verdocs-view/verdocs-view.tsx"],"names":["verdocsDropdownCss","VerdocsDropdown","this","clickListenerSymbol","AbortController","[object Object]","popper","createPopper","dropdownButton","dropdownMenu","placement","modifiers","name","options","offset","window","addEventListener","clickListener","bind","signal","abort","e","outside","target","el","contains","hide","option","stopPropagation","optionSelected","emit","setAttribute","removeAttribute","_a","setOptions","enabled","catch","_b","update","localName","className","open","showDropdown","h","Host","class","innerHTML","SortDown","aria-label","onClick","toggleDropdown","onBlur","handleHideDropdown","ref","aria-hidden","map","handleSelectOption","disabled","label","verdocsViewCss","PrintIcon","DownloadIcon","VerdocsView","VerdocsEndpoint","getDefault","endpoint","loadSession","envelopeId","console","error","getEnvelopeById","sdkError","SDKError","message","response","status","_c","data","pageInfo","detail","log","EnvelopeStore","loading","envelope","Fragment","src","alt","style","flex","width","height","fill","cursor","print","marginLeft","maginRight","savePDF","envelope_document_id","documents","envelopeDocument","pages","sort","a","b","sequence","page","pageImageUri","display_uri","virtualWidth","virtualHeight","pageNumber","onPageRendered","handlePageRendered","layers","type"],"mappings":"8hBAAA,MAAMA,EAAqB,gmCC8BdC,EAAe,8EAsB1BC,KAAAC,oBAAsB,IAAIC,6BAXO,uBAYjCC,mBACEH,KAAKI,OAASC,EAAaL,KAAKM,eAAgBN,KAAKO,aAAc,CAACC,UAAW,eAAgBC,UAAW,CAAC,CAACC,KAAM,SAAUC,QAAS,CAACC,OAAQ,CAAC,EAAG,QAElJC,OAAOC,iBAAiB,QAASd,KAAKe,cAAcC,KAAKhB,MAAO,CAACiB,OAAQjB,KAAKC,oBAAoBgB,SAGpGd,uBACEH,KAAKC,oBAAoBiB,QAG3Bf,cAAcgB,GACZ,MAAMC,IAAYD,EAAEE,QAAUrB,KAAKsB,IAAMtB,KAAKsB,GAAGC,SAASJ,EAAEE,SAC5D,GAAID,EAAS,CACXpB,KAAKwB,QAITrB,mBAAmBgB,EAAQM,GACzBN,EAAEO,kBAEF1B,K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AM,SACTF,EAACyC,EAAQ,KACPzC,EAAA,MAAA,CAAK0C,IAAI,4CAA4CC,IAAI,eAAezC,MAAM,SAC9EF,EAAA,MAAA,CAAKE,MAAM,SAASoC,EAAcE,SAASvE,MAC3C+B,EAAA,MAAA,CAAK4C,MAAO,CAACC,KAAM,OACnB7C,EAAA,MAAA,CAAKG,UAAWc,EAAW2B,MAAO,CAACE,MAAO,OAAQC,OAAQ,OAAQC,KAAM,UAAWC,OAAQ,WAAY3C,QAAS,IAAMlC,OAAO8E,UAC7HlD,EAAA,MAAA,CACEG,UAAWe,EACX0B,MAAO,CAACE,MAAO,OAAQC,OAAQ,OAAQC,KAAM,UAAWC,OAAQ,UAAWE,WAAY,OAAQC,WAAY,QAC3G9C,QAAS,IAAM+C,EAAQ9F,KAAK+D,SAAUgB,EAAcE,SAAUF,EAAcE,SAASc,sBAAsB7D,OAAM,gBAQ7HO,EAAA,MAAA,CAAKE,MAAM,eACPZ,EAAAgD,EAAcE,YAAQ,MAAAlD,SAAA,OAAA,EAAAA,EAAEiE,YAAa,IAAI3C,KAAI4C,IAC7C,MAAMC,EAAQ,KAAKD,IAAgB,MAAhBA,SAAgB,OAAA,EAAhBA,EAAkBC,QAAS,IAC9CA,EAAMC,MAAK,CAACC,EAAGC,IAAMD,EAAEE,SAAWD,EAAEC,WAEpC,OACE7D,EAACyC,EAAQ,KACNgB,EAAM7C,KAAIkD,GACT9D,EAAA,wBAAA,CACE+D,aAAcD,EAAKE,YACnBC,aAAc,IACdC,cAAe,IACfC,WAAYL,EAAKD,SACjBO,eAAgB1F,GAAKnB,KAAK8G,mBAAmB3F,GAC7C4F,OAAQ,CACN,CAACrG,KAAM,OAAQsG,KAAM,UACrB,CAACtG,KAAM,WAAYsG,KAAM","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-dropdown {\n font-family: $primary-font;\n display: block;\n\n .arrow {\n width: 32px;\n height: 26px;\n background: #fff;\n cursor: pointer;\n border-radius: 4px;\n align-items: center;\n display: inline-flex;\n border: 1px solid $light-border-color;\n justify-content: center;\n }\n\n .arrow svg {\n fill: $primary-color;\n transition: 0.3s;\n }\n\n .items {\n width: 200px;\n display: none;\n z-index: 10000;\n border-radius: 5px;\n background: $medium-bg;\n border: 1px solid $item-border-color;\n }\n\n .items[data-show] {\n display: block;\n }\n\n .option {\n width: 100%;\n color: #fff;\n border: none;\n display: block;\n text-align: left;\n background: none;\n padding: 10px 20px;\n }\n\n .option:hover {\n cursor: pointer;\n background: $primary-color;\n }\n\n .option[disabled] {\n color: $light-disabled-color;\n }\n\n .option[disabled]:hover {\n color: $light-disabled-color;\n cursor: inherit;\n background: transparent;\n }\n\n &.open {\n .items {\n display: block;\n }\n\n .arrow {\n background: $secondary-color;\n border: 1px solid $border-color;\n }\n\n .arrow svg {\n transform: scaleY(-1);\n fill: #fff;\n }\n }\n}\n","import {Host} from '@stencil/core';\nimport {createPopper, Instance} from '@popperjs/core';\nimport {Component, Prop, Element, State, h, Event, EventEmitter} from '@stencil/core';\nimport SortDown from './down-arrow.svg';\n\nexport interface IMenuOption {\n label: string;\n id?: any;\n faIcon?: any;\n disabled?: boolean;\n}\n\n/**\n * Display a drop-down menu button. A menu of the specified options will be displayed when the button is pressed. The menu will be hidden\n * when the button is pressed again, or an option is selected.\n *\n * ```html\n * <verdocs-dropdown\n * options={[\n * {label: 'Option 1', disabled: true},\n * {label: 'Option 2', id: '2'}\n * ]}\n * label=\"OK\" onClick={() => (console.log('OK clicked'))}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-dropdown',\n styleUrl: 'verdocs-dropdown.scss',\n})\nexport class VerdocsDropdown {\n @Element()\n el: HTMLElement;\n\n private dropdownButton?: HTMLButtonElement;\n private dropdownMenu?: HTMLDivElement;\n private popper?: Instance;\n\n /**\n * The menu options to display.\n */\n @Prop() options: IMenuOption[] = [];\n\n /**\n * Event fired when a menu option is clicked.\n * Web Component events need to be \"composed\" to cross the Shadow DOM and be received by parent frameworks.\n */\n @Event({composed: true}) optionSelected: EventEmitter<IMenuOption>;\n\n @State() open: boolean;\n\n // We need to do this to reliably disconnect the click-away listener\n clickListenerSymbol = new AbortController();\n componentDidLoad() {\n this.popper = createPopper(this.dropdownButton, this.dropdownMenu, {placement: 'bottom-start', modifiers: [{name: 'offset', options: {offset: [0, 6]}}]});\n\n window.addEventListener('click', this.clickListener.bind(this), {signal: this.clickListenerSymbol.signal});\n }\n\n disconnectedCallback() {\n this.clickListenerSymbol.abort();\n }\n\n clickListener(e: any) {\n const outside = !(e.target == this.el || this.el.contains(e.target));\n if (outside) {\n this.hide();\n }\n }\n\n handleSelectOption(e: any, option: IMenuOption) {\n e.stopPropagation();\n // this.isOpen = false;\n this.optionSelected.emit(option);\n this.hide();\n }\n\n // See https://popper.js.org/docs/v2/tutorial/\n // What we're doing here is clearing event listeners when they aren't needed, to increase performance in lists\n showDropdown() {\n // this.isOpen = true;\n this.dropdownMenu.setAttribute('data-show', '');\n this.dropdownMenu.removeAttribute('aria-hidden');\n\n this.popper\n ?.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, {name: 'eventListeners', enabled: true}],\n }))\n .catch(() => {});\n\n this.popper?.update().catch(() => {});\n }\n\n handleHideDropdown(e: any) {\n if (e?.target?.localName === 'button' && e?.target?.className === 'arrow') {\n // This event is fired when a menu element is clicked because the button \"loses focus\" then too\n return;\n }\n\n this.hide();\n }\n\n toggleDropdown(e: any) {\n e.stopPropagation();\n\n if (this.open) {\n this.hide();\n } else {\n this.showDropdown();\n }\n }\n\n hide() {\n this.open = false;\n this.dropdownMenu.removeAttribute('data-show');\n this.dropdownMenu.setAttribute('aria-hidden', 'true');\n this.popper\n ?.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, {name: 'eventListeners', enabled: false}],\n }))\n .catch(() => {});\n }\n\n render() {\n return (\n <Host class={{open: !!this.open}}>\n <button\n class=\"arrow\"\n innerHTML={SortDown}\n aria-label=\"Open Menu\"\n onClick={e => this.toggleDropdown(e)}\n onBlur={e => this.handleHideDropdown(e)}\n ref={el => (this.dropdownButton = el as HTMLButtonElement)}\n />\n\n <div class=\"items\" aria-hidden={!this.open} ref={el => (this.dropdownMenu = el as HTMLDivElement)}>\n {this.options?.map(option => (\n <button onClick={e => this.handleSelectOption(e, option)} class=\"option\" disabled={option.disabled}>\n {option.label}\n </button>\n ))}\n </div>\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-view {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n\n .header {\n flex: 0;\n display: flex;\n z-index: 1000;\n align-items: center;\n transition: all 0.25s;\n justify-content: center;\n background-color: $medium-bg;\n box-shadow: 0 4px 4px 0 rgb(0 0 0 / 24%), 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .toolbar {\n width: 100%;\n margin: 0 auto;\n padding: 0 14px;\n position: relative;\n }\n\n .tools {\n width: 100%;\n color: #fff;\n height: 56px;\n display: flex;\n font-size: 12px;\n align-items: center;\n flex-direction: row;\n background-color: $medium-bg;\n\n .logo {\n width: 77.5px;\n margin: -6px 0 0 5px;\n }\n\n .title {\n padding-left: 16px;\n font-size: 18px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n\n .document {\n flex: 1;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Element, Event, Host, Prop, EventEmitter, Fragment} from '@stencil/core';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\nimport {savePDF} from '../../../utils/utils';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Render the documents attached to an envelope in read-only (view) mode. All documents are displayed in order.\n */\n@Component({\n tag: 'verdocs-view',\n styleUrl: 'verdocs-view.scss',\n shadow: false,\n})\nexport class VerdocsView {\n @Element() component: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * 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 componentWillLoad() {\n this.endpoint.loadSession();\n }\n\n // TODO: Handling signing vs preview-as-user cases\n // TODO: Handle anonymous case and failure to load due to not being logged in\n async componentDidLoad() {\n if (!this.envelopeId) {\n console.error(`[VIEW] Missing required envelopeId`);\n return;\n }\n\n try {\n await getEnvelopeById(this.endpoint, this.envelopeId);\n } catch (e) {\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[SIGN] Page rendered', pageInfo);\n }\n\n render() {\n console.log('[VIEW] Rendering', EnvelopeStore.error, EnvelopeStore.loading, EnvelopeStore.envelope);\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (EnvelopeStore.error) {\n return (\n <Host>\n <div>{EnvelopeStore.error}</div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"header\">\n <div class=\"inner\">\n <div class=\"toolbar\">\n <div class=\"tools\">\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer', marginLeft: '16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"document\">\n {(EnvelopeStore.envelope?.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n ))}\n </Fragment>\n );\n })}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["src/components/controls/verdocs-dropdown/verdocs-dropdown.scss?tag=verdocs-dropdown","src/components/controls/verdocs-dropdown/verdocs-dropdown.tsx","src/components/embeds/verdocs-view/verdocs-view.scss?tag=verdocs-view","src/components/embeds/verdocs-view/verdocs-view.tsx"],"names":["verdocsDropdownCss","VerdocsDropdown","this","clickListenerSymbol","AbortController","[object Object]","popper","createPopper","dropdownButton","dropdownMenu","placement","modifiers","name","options","offset","window","addEventListener","clickListener","bind","signal","abort","e","outside","target","el","contains","hide","option","stopPropagation","optionSelected","emit","setAttribute","removeAttribute","_a","setOptions","enabled","catch","_b","update","localName","className","open","showDropdown","h","Host","class","innerHTML","SortDown","aria-label","onClick","toggleDropdown","onBlur","handleHideDropdown","ref","aria-hidden","map","handleSelectOption","disabled","label","verdocsViewCss","PrintIcon","DownloadIcon","VerdocsView","VerdocsEndpoint","getDefault","endpoint","loadSession","envelopeId","console","error","getEnvelopeById","sdkError","SDKError","message","response","status","_c","data","pageInfo","detail","log","EnvelopeStore","loading","envelope","Fragment","src","alt","style","flex","width","height","fill","cursor","print","marginLeft","maginRight","savePDF","envelope_document_id","documents","envelopeDocument","pages","sort","a","b","sequence","page","pageImageUri","display_uri","virtualWidth","virtualHeight","pageNumber","onPageRendered","handlePageRendered","layers","type"],"mappings":"sjBAAA,MAAMA,EAAqB,gmCC8BdC,EAAe,8EAsB1BC,KAAAC,oBAAsB,IAAIC,6BAXO,uBAYjCC,mBACEH,KAAKI,OAASC,EAAaL,KAAKM,eAAgBN,KAAKO,aAAc,CAACC,UAAW,eAAgBC,UAAW,CAAC,CAACC,KAAM,SAAUC,QAAS,CAACC,OAAQ,CAAC,EAAG,QAElJC,OAAOC,iBAAiB,QAASd,KAAKe,cAAcC,KAAKhB,MAAO,CAACiB,OAAQjB,KAAKC,oBAAoBgB,SAGpGd,uBACEH,KAAKC,oBAAoBiB,QAG3Bf,cAAcgB,GACZ,MAAMC,IAAYD,EAAEE,QAAUrB,KAAKsB,IAAMtB,KAAKsB,GAAGC,SAASJ,EAAEE,SAC5D,GAAID,EAAS,CACXpB,KAAKwB,QAITrB,mBAAmBgB,EAAQM,GACzBN,EAAEO,kBAEF1B,KAAK2B,eAAeC,KAAKH,GACzBzB,KAAKwB,OA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A,CAAK0C,IAAI,4CAA4CC,IAAI,eAAezC,MAAM,SAC9EF,EAAA,MAAA,CAAKE,MAAM,SAASoC,EAAcE,SAASvE,MAC3C+B,EAAA,MAAA,CAAK4C,MAAO,CAACC,KAAM,OACnB7C,EAAA,MAAA,CAAKG,UAAWc,EAAW2B,MAAO,CAACE,MAAO,OAAQC,OAAQ,OAAQC,KAAM,UAAWC,OAAQ,WAAY3C,QAAS,IAAMlC,OAAO8E,UAC7HlD,EAAA,MAAA,CACEG,UAAWe,EACX0B,MAAO,CAACE,MAAO,OAAQC,OAAQ,OAAQC,KAAM,UAAWC,OAAQ,UAAWE,WAAY,OAAQC,WAAY,QAC3G9C,QAAS,IAAM+C,EAAQ9F,KAAK+D,SAAUgB,EAAcE,SAAUF,EAAcE,SAASc,sBAAsB7D,OAAM,gBAQ7HO,EAAA,MAAA,CAAKE,MAAM,eACPZ,EAAAgD,EAAcE,YAAQ,MAAAlD,SAAA,OAAA,EAAAA,EAAEiE,YAAa,IAAI3C,KAAI4C,IAC7C,MAAMC,EAAQ,KAAKD,IAAgB,MAAhBA,SAAgB,OAAA,EAAhBA,EAAkBC,QAAS,IAC9CA,EAAMC,MAAK,CAACC,EAAGC,IAAMD,EAAEE,SAAWD,EAAEC,WAEpC,OACE7D,EAACyC,EAAQ,KACNgB,EAAM7C,KAAIkD,GACT9D,EAAA,wBAAA,CACE+D,aAAcD,EAAKE,YACnBC,aAAc,IACdC,cAAe,IACfC,WAAYL,EAAKD,SACjBO,eAAgB1F,GAAKnB,KAAK8G,mBAAmB3F,GAC7C4F,OAAQ,CACN,CAACrG,KAAM,OAAQsG,KAAM,UACrB,CAACtG,KAAM,WAAYsG,KAAM","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-dropdown {\n font-family: $primary-font;\n display: block;\n\n .arrow {\n width: 32px;\n height: 26px;\n background: #fff;\n cursor: pointer;\n border-radius: 4px;\n align-items: center;\n display: inline-flex;\n border: 1px solid $light-border-color;\n justify-content: center;\n }\n\n .arrow svg {\n fill: $primary-color;\n transition: 0.3s;\n }\n\n .items {\n width: 200px;\n display: none;\n z-index: 10000;\n border-radius: 5px;\n background: $medium-bg;\n border: 1px solid $item-border-color;\n }\n\n .items[data-show] {\n display: block;\n }\n\n .option {\n width: 100%;\n color: #fff;\n border: none;\n display: block;\n text-align: left;\n background: none;\n padding: 10px 20px;\n }\n\n .option:hover {\n cursor: pointer;\n background: $primary-color;\n }\n\n .option[disabled] {\n color: $light-disabled-color;\n }\n\n .option[disabled]:hover {\n color: $light-disabled-color;\n cursor: inherit;\n background: transparent;\n }\n\n &.open {\n .items {\n display: block;\n }\n\n .arrow {\n background: $secondary-color;\n border: 1px solid $border-color;\n }\n\n .arrow svg {\n transform: scaleY(-1);\n fill: #fff;\n }\n }\n}\n","import {Host} from '@stencil/core';\nimport {createPopper, Instance} from '@popperjs/core';\nimport {Component, Prop, Element, State, h, Event, EventEmitter} from '@stencil/core';\nimport SortDown from './down-arrow.svg';\n\nexport interface IMenuOption {\n label: string;\n id?: any;\n faIcon?: any;\n disabled?: boolean;\n}\n\n/**\n * Display a drop-down menu button. A menu of the specified options will be displayed when the button is pressed. The menu will be hidden\n * when the button is pressed again, or an option is selected.\n *\n * ```html\n * <verdocs-dropdown\n * options={[\n * {label: 'Option 1', disabled: true},\n * {label: 'Option 2', id: '2'}\n * ]}\n * label=\"OK\" onClick={() => (console.log('OK clicked'))}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-dropdown',\n styleUrl: 'verdocs-dropdown.scss',\n})\nexport class VerdocsDropdown {\n @Element()\n el: HTMLElement;\n\n private dropdownButton?: HTMLButtonElement;\n private dropdownMenu?: HTMLDivElement;\n private popper?: Instance;\n\n /**\n * The menu options to display.\n */\n @Prop() options: IMenuOption[] = [];\n\n /**\n * Event fired when a menu option is clicked.\n * Web Component events need to be \"composed\" to cross the Shadow DOM and be received by parent frameworks.\n */\n @Event({composed: true}) optionSelected: EventEmitter<IMenuOption>;\n\n @State() open: boolean;\n\n // We need to do this to reliably disconnect the click-away listener\n clickListenerSymbol = new AbortController();\n componentDidLoad() {\n this.popper = createPopper(this.dropdownButton, this.dropdownMenu, {placement: 'bottom-start', modifiers: [{name: 'offset', options: {offset: [0, 6]}}]});\n\n window.addEventListener('click', this.clickListener.bind(this), {signal: this.clickListenerSymbol.signal});\n }\n\n disconnectedCallback() {\n this.clickListenerSymbol.abort();\n }\n\n clickListener(e: any) {\n const outside = !(e.target == this.el || this.el.contains(e.target));\n if (outside) {\n this.hide();\n }\n }\n\n handleSelectOption(e: any, option: IMenuOption) {\n e.stopPropagation();\n // this.isOpen = false;\n this.optionSelected.emit(option);\n this.hide();\n }\n\n // See https://popper.js.org/docs/v2/tutorial/\n // What we're doing here is clearing event listeners when they aren't needed, to increase performance in lists\n showDropdown() {\n // this.isOpen = true;\n this.dropdownMenu.setAttribute('data-show', '');\n this.dropdownMenu.removeAttribute('aria-hidden');\n\n this.popper\n ?.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, {name: 'eventListeners', enabled: true}],\n }))\n .catch(() => {});\n\n this.popper?.update().catch(() => {});\n }\n\n handleHideDropdown(e: any) {\n if (e?.target?.localName === 'button' && e?.target?.className === 'arrow') {\n // This event is fired when a menu element is clicked because the button \"loses focus\" then too\n return;\n }\n\n this.hide();\n }\n\n toggleDropdown(e: any) {\n e.stopPropagation();\n\n if (this.open) {\n this.hide();\n } else {\n this.showDropdown();\n }\n }\n\n hide() {\n this.open = false;\n this.dropdownMenu.removeAttribute('data-show');\n this.dropdownMenu.setAttribute('aria-hidden', 'true');\n this.popper\n ?.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, {name: 'eventListeners', enabled: false}],\n }))\n .catch(() => {});\n }\n\n render() {\n return (\n <Host class={{open: !!this.open}}>\n <button\n class=\"arrow\"\n innerHTML={SortDown}\n aria-label=\"Open Menu\"\n onClick={e => this.toggleDropdown(e)}\n onBlur={e => this.handleHideDropdown(e)}\n ref={el => (this.dropdownButton = el as HTMLButtonElement)}\n />\n\n <div class=\"items\" aria-hidden={!this.open} ref={el => (this.dropdownMenu = el as HTMLDivElement)}>\n {this.options?.map(option => (\n <button onClick={e => this.handleSelectOption(e, option)} class=\"option\" disabled={option.disabled}>\n {option.label}\n </button>\n ))}\n </div>\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-view {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n\n .header {\n flex: 0;\n display: flex;\n z-index: 1000;\n align-items: center;\n transition: all 0.25s;\n justify-content: center;\n background-color: $medium-bg;\n box-shadow: 0 4px 4px 0 rgb(0 0 0 / 24%), 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .toolbar {\n width: 100%;\n margin: 0 auto;\n padding: 0 14px;\n position: relative;\n }\n\n .tools {\n width: 100%;\n color: #fff;\n height: 56px;\n display: flex;\n font-size: 12px;\n align-items: center;\n flex-direction: row;\n background-color: $medium-bg;\n\n .logo {\n width: 77.5px;\n margin: -6px 0 0 5px;\n }\n\n .title {\n padding-left: 16px;\n font-size: 18px;\n font-weight: 500;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n\n .document {\n flex: 1;\n height: 100%;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Element, Event, Host, Prop, EventEmitter, Fragment} from '@stencil/core';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\nimport {savePDF} from '../../../utils/utils';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Render the documents attached to an envelope in read-only (view) mode. All documents are displayed in order.\n */\n@Component({\n tag: 'verdocs-view',\n styleUrl: 'verdocs-view.scss',\n shadow: false,\n})\nexport class VerdocsView {\n @Element() component: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * 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 componentWillLoad() {\n this.endpoint.loadSession();\n }\n\n // TODO: Handling signing vs preview-as-user cases\n // TODO: Handle anonymous case and failure to load due to not being logged in\n async componentDidLoad() {\n if (!this.envelopeId) {\n console.error(`[VIEW] Missing required envelopeId`);\n return;\n }\n\n try {\n await getEnvelopeById(this.endpoint, this.envelopeId);\n } catch (e) {\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[SIGN] Page rendered', pageInfo);\n }\n\n render() {\n console.log('[VIEW] Rendering', EnvelopeStore.error, EnvelopeStore.loading, EnvelopeStore.envelope);\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (EnvelopeStore.error) {\n return (\n <Host>\n <div>{EnvelopeStore.error}</div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"header\">\n <div class=\"inner\">\n <div class=\"toolbar\">\n <div class=\"tools\">\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer', marginLeft: '16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"document\">\n {(EnvelopeStore.envelope?.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n ))}\n </Fragment>\n );\n })}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,h as e,H as t}from"./p-ff1278ed.js";import{g as i}from"./p-6de76553.js";import{g as d}from"./p-417ee5e0.js";import"./p-21603661.js";import"./p-aa124212.js";const s='verdocs-field-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:14px;height:14px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-field-radio-button svg{margin-top:4px}verdocs-field-radio-button.disabled{opacity:0.5}verdocs-field-radio-button.disabled.done{opacity:1}verdocs-field-radio-button.done input[type=radio]{margin:0;padding:0;width:10px;height:10px}verdocs-field-radio-button:not(.done) input[type=radio]{position:absolute;opacity:0}verdocs-field-radio-button:not(.done) input[type=radio]+label:before{content:"";border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:10px;height:10px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-field-radio-button:not(.done) input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-field-radio-button:not(.done) input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-field-radio-button:not(.done) input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-field-radio-button:not(.done) input[type=radio]+label:empty:before{margin-right:0}verdocs-field-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-field-radio-button.hide{display:none}verdocs-field-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';const r=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>`;const a=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>`;const n=class{constructor(e){o(this,e);this.field=null;this.option=0;this.disabled=false;this.done=false;this.roleindex=0}render(){var o,s;const n=d(this.field);const l=(s=(o=this.disabled)!==null&&o!==void 0?o:n.disabled)!==null&&s!==void 0?s:false;const p=this.field["rgba"]||i(this.roleindex);const b=n.options[this.option];const c=`${this.field.name}-${b.id}`;if(this.done){return e(t,{class:{done:this.done},style:{maxWidth:"10px"}},e("span",{innerHTML:!!b.selected?a:r}))}return e(t,{class:{required:n.required,disabled:l},style:{backgroundColor:p}},e("input",{id:c,type:"radio",value:b.id,tabIndex:n.order,name:this.field.name,checked:!!b.selected,disabled:l,required:n.required}),e("label",{htmlFor:c}))}};n.style=s;export{n as verdocs_field_radio_button};
|
|
2
|
+
//# sourceMappingURL=p-a3820c7f.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.scss?tag=verdocs-field-radio-button","src/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.tsx"],"names":["verdocsFieldRadioButtonCss","RadioIconUnselected","RadioIconSelected","VerdocsFieldRadioButton","[object Object]","settings","getFieldSettings","this","field","disabled","_b","_a","backgroundColor","getRGBA","roleindex","option","options","id","name","done","h","Host","class","style","maxWidth","innerHTML","selected","required","type","value","tabIndex","order","checked","htmlFor"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["src/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.scss?tag=verdocs-field-radio-button","src/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.tsx"],"names":["verdocsFieldRadioButtonCss","RadioIconUnselected","RadioIconSelected","VerdocsFieldRadioButton","[object Object]","settings","getFieldSettings","this","field","disabled","_b","_a","backgroundColor","getRGBA","roleindex","option","options","id","name","done","h","Host","class","style","maxWidth","innerHTML","selected","required","type","value","tabIndex","order","checked","htmlFor"],"mappings":"0KAAA,MAAMA,EAA6B,guDCMnC,MAAMC,EAAsB,qNAE5B,MAAMC,EAAoB,oRAUbC,EAAuB,0CAIsB,iBAK/B,gBAKI,gBAKJ,qBAKI,EAE7BC,iBACE,MAAMC,EAAWC,EAAiBC,KAAKC,OACvC,MAAMC,GAAWC,GAAAC,EAAAJ,KAAKE,YAAQ,MAAAE,SAAA,EAAAA,EAAIN,EAASI,YAAQ,MAAAC,SAAA,EAAAA,EAAI,MACvD,MAAME,EAAkBL,KAAKC,MAAM,SAAWK,EAAQN,KAAKO,WAC3D,MAAMC,EAASV,EAASW,QAAQT,KAAKQ,QACrC,MAAME,EAAK,GAAGV,KAAKC,MAAMU,QAAQH,EAAOE,KAExC,GAAIV,KAAKY,KAAM,CACb,OACEC,EAACC,EAAI,CAACC,MAAO,CAACH,KAAMZ,KAAKY,MAAOI,MAAO,CAACC,SAAU,SAChDJ,EAAA,OAAA,CAAMK,YAAaV,EAAOW,SAAWxB,EAAoBD,KAK/D,OACEmB,EAACC,EAAI,CAACC,MAAO,CAACK,SAAUtB,EAASsB,SAAUlB,SAAAA,GAAWc,MAAO,CAACX,gBAAAA,IAC5DQ,EAAA,QAAA,CACEH,GAAIA,EACJW,KAAK,QACLC,MAAOd,EAAOE,GACda,SAAUzB,EAAS0B,MACnBb,KAAMX,KAAKC,MAAMU,KACjBc,UAAWjB,EAAOW,SAClBjB,SAAUA,EACVkB,SAAUtB,EAASsB,WAErBP,EAAA,QAAA,CAAOa,QAAShB","sourcesContent":["@import '../../../theme.scss';\n\n// See https://www.sliderrevolution.com/resources/styling-radio-buttons/\nverdocs-field-radio-button {\n font-family: $verdocs-primary-font;\n width: 14px;\n height: 14px;\n display: block;\n font-size: 11px;\n position: relative;\n background-color: transparent;\n transform-origin: bottom left;\n border-radius: 100%;\n\n svg {\n margin-top: 4px;\n }\n\n &.disabled {\n opacity: 0.5;\n }\n\n &.disabled.done {\n opacity: 1;\n }\n\n &.done input[type='radio'] {\n margin: 0;\n padding: 0;\n width: 10px;\n height: 10px;\n }\n\n &:not(.done) input[type='radio'] {\n position: absolute;\n opacity: 0;\n\n + label {\n &:before {\n content: '';\n //background: $verdocs-grey-3;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.6);\n display: inline-block;\n width: 10px;\n height: 10px;\n position: absolute;\n left: 1px;\n top: 1px;\n cursor: pointer;\n text-align: center;\n transition: all 250ms ease;\n }\n }\n\n &:checked {\n + label {\n &:before {\n background-color: $verdocs-green;\n box-shadow: inset 0 0 0 2px $verdocs-grey-3;\n }\n }\n }\n\n &:focus {\n + label {\n &:before {\n outline: none;\n border-color: $verdocs-green;\n }\n }\n }\n\n &:disabled {\n + label {\n &:before {\n box-shadow: inset 0 0 0 4px $verdocs-grey-3;\n border-color: darken($verdocs-grey-3, 25%);\n background: darken($verdocs-grey-3, 25%);\n }\n }\n }\n\n + label {\n &:empty {\n &:before {\n margin-right: 0;\n }\n }\n }\n }\n\n &.required {\n input[type='radio'] {\n + label {\n &:before {\n border: 1px solid $verdocs-red-1;\n }\n }\n }\n }\n\n &.hide {\n display: none;\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.75s 2;\n }\n}\n","import {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {Component, h, Host, Prop} from '@stencil/core';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField} from '@verdocs/js-sdk/Envelopes/Types';\nimport {getFieldSettings} from '../../../utils/utils';\n\nconst RadioIconUnselected = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"></path></svg>`;\n\nconst RadioIconSelected = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z\"></path></svg>`;\n\n/**\n * Displays a radio button.\n */\n@Component({\n tag: 'verdocs-field-radio-button',\n styleUrl: 'verdocs-field-radio-button.scss',\n shadow: false,\n})\nexport class VerdocsFieldRadioButton {\n /**\n * The document or template field to display.\n */\n @Prop() field: IDocumentField | ITemplateField | null = null;\n\n /**\n * The index of the settings option this particular checkbox is for\n */\n @Prop() option: number = 0;\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() disabled?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop() done?: boolean = false;\n\n /**\n * If set, the field will be colored using this index value to select the background color.\n */\n @Prop() roleindex?: number = 0;\n\n render() {\n const settings = getFieldSettings(this.field);\n const disabled = this.disabled ?? settings.disabled ?? false;\n const backgroundColor = this.field['rgba'] || getRGBA(this.roleindex);\n const option = settings.options[this.option];\n const id = `${this.field.name}-${option.id}`;\n\n if (this.done) {\n return (\n <Host class={{done: this.done}} style={{maxWidth: '10px'}}>\n <span innerHTML={!!option.selected ? RadioIconSelected : RadioIconUnselected} />\n </Host>\n );\n }\n\n return (\n <Host class={{required: settings.required, disabled}} style={{backgroundColor}}>\n <input\n id={id}\n type=\"radio\"\n value={option.id}\n tabIndex={settings.order}\n name={this.field.name}\n checked={!!option.selected}\n disabled={disabled}\n required={settings.required}\n />\n <label htmlFor={id} />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(r.next(e))}catch(e){a(e)}}function i(e){try{s(r["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):o(e.value).then(l,i)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(e){return function(t){return s([e,t])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=l[0]&2?o["return"]:l[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;if(o=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1];a=l;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(l);break}if(a[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-0f6da8c7.system.js","./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{s(r.next(e))}catch(e){a(e)}}function i(e){try{s(r["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):o(e.value).then(l,i)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(e){return function(t){return s([e,t])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=l[0]&2?o["return"]:l[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;if(o=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1];a=l;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(l);break}if(a[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-0f6da8c7.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,n;return{setters:[function(e){t=e.c},function(e){n=e.i}],execute:function(){var r=this;var o=t({template:null,loadProgress:0,loading:true,pageNumbers:[],pageUris:{},roleNames:[],fields:[],dirty:false}),a=o.state,l=o.onChange;e("s",a);l("template",(function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(t){if(!e){console.log("[TEMPLATESTORE] Clearing template");a.fields=[];a.roleNames=[];a.pageNumbers=[];a.dirty=false;a.loading=false;a.loadProgress=0;return[2]}console.log("[TEMPLATESTORE] Template loaded",e);a.roleNames=e.roles.map((function(e){return e.name}));console.log("[TEMPLATESTORE] Loaded roles",a.roleNames);a.fields=[];e.roles.forEach((function(e){var t;(t=a.fields).push.apply(t,e.fields)}));console.log("[TEMPLATESTORE] Loaded fields",a.fields);a.pageNumbers=n(1,e.pages.length);return[2]}))}))}));l("fields",(function(e){console.log("[TEMPLATESTORE] Field changed",e);a.dirty=true}))}}}));
|
|
2
|
+
//# sourceMappingURL=p-a74a9c6b.system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["src/utils/templateStore.ts"],"names":["_a","createStore","template","loadProgress","loading","pageNumbers","pageUris","roleNames","fields","dirty","state","onChange","exports","newTemplate","__awaiter","_this","console","log","roles","map","role","name","forEach","push","apply","integerSequence","pages","length","newField"],"mappings":"onDAOM,IAAAA,EAAoBC,EAAY,CACpCC,SAAU,KACVC,aAAc,EACdC,QAAS,KAETC,YAAa,GACbC,SAAU,GACVC,UAAW,GACXC,OAAQ,GACRC,MAAO,QATFC,EAAKV,EAAAU,MAAEC,EAAQX,EAAAW,SAUrBC,EAAA,IAAAF,GAEDC,EAAS,YAAY,SAAME,GAAW,OAAAC,UAAAC,OAAA,OAAA,GAAA,gDACpC,IAAKF,EAAa,CAChBG,QAAQC,IAAI,qCACZP,EAAMF,OAAS,GACfE,EAAMH,UAAY,GAClBG,EAAML,YAAc,GACpBK,EAAMD,MAAQ,MACdC,EAAMN,QAAU,MAChBM,EAAMP,aAAe,EACrB,MAAA,CAAA,GAGFa,QAAQC,IAAI,kCAAmCJ,GAE/CH,EAAMH,UAAYM,EAAYK,MAAMC,KAAI,SAAAC,GAAQ,OAAAA,EAAKC,QACrDL,QAAQC,IAAI,+BAAgCP,EAAMH,WAElDG,EAAMF,OAAS,GACfK,EAAYK,MAAMI,SAAQ,SAAAF,UACxBpB,EAAAU,EAAMF,QAAOe,KAAIC,MAAAxB,EAAIoB,EAAKZ,WAG5BQ,QAAQC,IAAI,gCAAiCP,EAAMF,QAEnDE,EAAML,YAAcoB,EAAgB,EAAGZ,EAAYa,MAAMC,2BAG3DhB,EAAS,UAAU,SAAAiB,GACjBZ,QAAQC,IAAI,gCAAiCW,GAC7ClB,EAAMD,MAAQ","sourcesContent":["// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to\n// resolve. This needs to export a single default value of the store's state. Any helper functions should go in Templates.ts here.\n\nimport {createStore} from '@stencil/store';\nimport {integerSequence} from '@verdocs/js-sdk/Utils/Primitives';\nimport {ITemplate, ITemplateField} from '@verdocs/js-sdk/Templates/Types';\n\nconst {state, onChange} = createStore({\n template: null as ITemplate | null,\n loadProgress: 0,\n loading: true,\n\n pageNumbers: [] as number[],\n pageUris: {} as Record<number, string>,\n roleNames: [] as string[],\n fields: [] as ITemplateField[],\n dirty: false,\n});\n\nonChange('template', async newTemplate => {\n if (!newTemplate) {\n console.log('[TEMPLATESTORE] Clearing template');\n state.fields = [];\n state.roleNames = [];\n state.pageNumbers = [];\n state.dirty = false;\n state.loading = false;\n state.loadProgress = 0;\n return;\n }\n\n console.log('[TEMPLATESTORE] Template loaded', newTemplate);\n\n state.roleNames = newTemplate.roles.map(role => role.name);\n console.log('[TEMPLATESTORE] Loaded roles', state.roleNames);\n\n state.fields = [];\n newTemplate.roles.forEach(role => {\n state.fields.push(...role.fields);\n });\n\n console.log('[TEMPLATESTORE] Loaded fields', state.fields);\n\n state.pageNumbers = integerSequence(1, newTemplate.pages.length);\n});\n\nonChange('fields', newField => {\n console.log('[TEMPLATESTORE] Field changed', newField);\n state.dirty = true;\n});\n\nexport default state;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as m,h as a,H as r,a as b}from"./p-ff1278ed.js";import{t as g}from"./p-417ee5e0.js";import"./p-21603661.js";import"./p-aa124212.js";const t="verdocs-document-page{width:100%;position:relative}verdocs-document-page .verdocs-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-document-page .verdocs-document-page-layer.img{width:100%}";const s=class{constructor(a){e(this,a);this.pageRendered=m(this,"pageRendered",7);this.pageImageUri="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`;this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true}componentDidLoad(){this.resizeObserver=new ResizeObserver(g((e=>{for(const m of e){const e=m.contentRect.width;this.renderedWidth=e;this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)}disconnectedCallback(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({container:this.container,containerId:this.containerId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})}render(){const e=`${this.renderedHeight}px`;return a(r,{id:`${this.containerId}`,style:{height:e}},this.layers.map((m=>m.type==="div"?a("div",{class:"verdocs-document-page-layer",id:`${this.containerId}-${m.name}`,style:{height:e}}):a("img",{class:"verdocs-document-page-layer img",id:`${this.containerId}-${m.name}`,src:this.pageImageUri,alt:`Page ${this.pageNumber}`,"aria-hidden":true,onLoad:e=>{this.naturalWidth=e.target.naturalWidth;this.naturalHeight=e.target.naturalHeight;this.aspectRatio=this.naturalWidth/this.naturalHeight;this.virtualHeight=this.virtualWidth/this.aspectRatio}}))))}get container(){return b(this)}};s.style=t;const o="verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";const i=class{constructor(m){e(this,m)}render(){return a(r,null)}};i.style=o;export{s as verdocs_document_page,i as verdocs_loader};
|
|
2
|
+
//# sourceMappingURL=p-a8b91e3f.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","src/components/elements/verdocs-document-page/verdocs-document-page.tsx","src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","src/components/controls/verdocs-loader/verdocs-loader.tsx"],"names":["verdocsDocumentPageCss","VerdocsDocumentPage","name","type","Math","random","toString","substring","this","virtualWidth","virtualHeight","[object Object]","resizeObserver","ResizeObserver","throttle","entries","entry","renderedWidth","contentRect","width","renderedHeight","notifyRenderedSize","observe","container","_a","disconnect","skipFirstNotification","pageRendered","emit","containerId","pageNumber","naturalWidth","naturalHeight","aspectRatio","xScale","yScale","height","h","Host","id","style","layers","map","layer","class","src","pageImageUri","alt","aria-hidden","onLoad","e","target","verdocsLoaderCss","VerdocsLoader"],"mappings":"4HAAA,MAAMA,EAAyB,6SCgBlBC,EAAmB,4FAOC,mBAMF,oBAME,uBAMgB,gBAchB,CAAC,CAACC,KAAM,OAAQC,KAAM,4BAO9B,yBAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,yBAEvDC,KAAKC,iCACJD,KAAKE,gCACPF,KAAKC,gCACJD,KAAKE,+BACPF,KAAKC,aAAeD,KAAKE,yCAEvB,KAEjCC,mBACEH,KAAKI,eAAiB,IAAIC,eACxBC,GAASC,IACP,IAAK,MAAMC,KAASD,EAAS,CAC3B,MAAME,EAAgBD,EAAME,YAAYC,MACxCX,KAAKS,cAAgBA,EACrBT,KAAKY,eAAiBZ,KAAKE,eAAiBO,EAAgBT,KAAKC,cAGnED,KAAKa,uBACJ,MAGLb,KAAKI,eAAeU,QAAQd,KAAKe,WAGnCZ,8BACEa,EAAAhB,KAAKI,kBAAc,MAAAY,SAAA,OAAA,EAAAA,EAAEC,aASvBd,qBAGE,GAAIH,KAAKkB,sBAAuB,CAC9BlB,KAAKkB,sBAAwB,MAC7B,OAGFlB,KAAKmB,aAAaC,KAAK,CACrBL,UAAWf,KAAKe,UAChBM,YAAarB,KAAKqB,YAClBC,WAAYtB,KAAKsB,WACjBrB,aAAcD,KAAKC,aACnBC,cAAeF,KAAKE,cACpBO,cAAeT,KAAKS,cACpBG,eAAgBZ,KAAKY,eACrBW,aAAcvB,KAAKuB,aACnBC,cAAexB,KAAKwB,cACpBC,YAAazB,KAAKyB,YAClBC,OAAQ1B,KAAKS,cAAgBT,KAAKC,aAClC0B,OAAQ3B,KAAKY,eAAiBZ,KAAKE,gBAIvCC,SACE,MAAMyB,EAAS,GAAG5B,KAAKY,mBAEvB,OACEiB,EAACC,EAAI,CAACC,GAAI,GAAG/B,KAAKqB,cAAeW,MAAO,CAACJ,OAAAA,IACtC5B,KAAKiC,OAAOC,KAAIC,GACfA,EAAMxC,OAAS,MACbkC,EAAA,MAAA,CAAKO,MAAM,8BAA8BL,GAAI,GAAG/B,KAAKqB,eAAec,EAAMzC,OAAQsC,MAAO,CAACJ,OAAAA,KAE1FC,EAAA,MAAA,CACEO,MAAM,kCACNL,GAAI,GAAG/B,KAAKqB,eAAec,EAAMzC,OACjC2C,IAAKrC,KAAKsC,aACVC,IAAK,QAAQvC,KAAKsB,aAAYkB,cACjB,KACbC,OAASC,IAQP1C,KAAKuB,aAAemB,EAAEC,OAAOpB,aAC7BvB,KAAKwB,cAAgBkB,EAAEC,OAAOnB,cAC9BxB,KAAKyB,YAAczB,KAAKuB,aAAevB,KAAKwB,cAC5CxB,KAAKE,cAAgBF,KAAKC,aAAeD,KAAKyB,6DCpJ9D,MAAMmB,EAAmB,kqUCUZC,EAAa,+BACxB1C,SACE,OAAO0B,EAACC,EAAI","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {throttle} from '../../../utils/utils';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n // Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.\n // When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.\n // componentDidRender() {\n // this.notifyRenderedSize();\n // }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n this.pageRendered.emit({\n container: this.container,\n containerId: this.containerId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale: this.renderedWidth / this.virtualWidth,\n yScale: this.renderedHeight / this.virtualHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","src/components/elements/verdocs-document-page/verdocs-document-page.tsx","src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","src/components/controls/verdocs-loader/verdocs-loader.tsx"],"names":["verdocsDocumentPageCss","VerdocsDocumentPage","name","type","Math","random","toString","substring","this","virtualWidth","virtualHeight","[object Object]","resizeObserver","ResizeObserver","throttle","entries","entry","renderedWidth","contentRect","width","renderedHeight","notifyRenderedSize","observe","container","_a","disconnect","skipFirstNotification","pageRendered","emit","containerId","pageNumber","naturalWidth","naturalHeight","aspectRatio","xScale","yScale","height","h","Host","id","style","layers","map","layer","class","src","pageImageUri","alt","aria-hidden","onLoad","e","target","verdocsLoaderCss","VerdocsLoader"],"mappings":"oJAAA,MAAMA,EAAyB,6SCgBlBC,EAAmB,4FAOC,mBAMF,oBAME,uBAMgB,gBAchB,CAAC,CAACC,KAAM,OAAQC,KAAM,4BAO9B,yBAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,yBAEvDC,KAAKC,iCACJD,KAAKE,gCACPF,KAAKC,gCACJD,KAAKE,+BACPF,KAAKC,aAAeD,KAAKE,yCAEvB,KAEjCC,mBACEH,KAAKI,eAAiB,IAAIC,eACxBC,GAASC,IACP,IAAK,MAAMC,KAASD,EAAS,CAC3B,MAAME,EAAgBD,EAAME,YAAYC,MACxCX,KAAKS,cAAgBA,EACrBT,KAAKY,eAAiBZ,KAAKE,eAAiBO,EAAgBT,KAAKC,cAGnED,KAAKa,uBACJ,MAGLb,KAAKI,eAAeU,QAAQd,KAAKe,WAGnCZ,8BACEa,EAAAhB,KAAKI,kBAAc,MAAAY,SAAA,OAAA,EAAAA,EAAEC,aASvBd,qBAGE,GAAIH,KAAKkB,sBAAuB,CAC9BlB,KAAKkB,sBAAwB,MAC7B,OAGFlB,KAAKmB,aAAaC,KAAK,CACrBL,UAAWf,KAAKe,UAChBM,YAAarB,KAAKqB,YAClBC,WAAYtB,KAAKsB,WACjBrB,aAAcD,KAAKC,aACnBC,cAAeF,KAAKE,cACpBO,cAAeT,KAAKS,cACpBG,eAAgBZ,KAAKY,eACrBW,aAAcvB,KAAKuB,aACnBC,cAAexB,KAAKwB,cACpBC,YAAazB,KAAKyB,YAClBC,OAAQ1B,KAAKS,cAAgBT,KAAKC,aAClC0B,OAAQ3B,KAAKY,eAAiBZ,KAAKE,gBAIvCC,SACE,MAAMyB,EAAS,GAAG5B,KAAKY,mBAEvB,OACEiB,EAACC,EAAI,CAACC,GAAI,GAAG/B,KAAKqB,cAAeW,MAAO,CAACJ,OAAAA,IACtC5B,KAAKiC,OAAOC,KAAIC,GACfA,EAAMxC,OAAS,MACbkC,EAAA,MAAA,CAAKO,MAAM,8BAA8BL,GAAI,GAAG/B,KAAKqB,eAAec,EAAMzC,OAAQsC,MAAO,CAACJ,OAAAA,KAE1FC,EAAA,MAAA,CACEO,MAAM,kCACNL,GAAI,GAAG/B,KAAKqB,eAAec,EAAMzC,OACjC2C,IAAKrC,KAAKsC,aACVC,IAAK,QAAQvC,KAAKsB,aAAYkB,cACjB,KACbC,OAASC,IAQP1C,KAAKuB,aAAemB,EAAEC,OAAOpB,aAC7BvB,KAAKwB,cAAgBkB,EAAEC,OAAOnB,cAC9BxB,KAAKyB,YAAczB,KAAKuB,aAAevB,KAAKwB,cAC5CxB,KAAKE,cAAgBF,KAAKC,aAAeD,KAAKyB,6DCpJ9D,MAAMmB,EAAmB,kqUCUZC,EAAa,+BACxB1C,SACE,OAAO0B,EAACC,EAAI","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {throttle} from '../../../utils/utils';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n // Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.\n // When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.\n // componentDidRender() {\n // this.notifyRenderedSize();\n // }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n this.pageRendered.emit({\n container: this.container,\n containerId: this.containerId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale: this.renderedWidth / this.virtualWidth,\n yScale: this.renderedHeight / this.virtualHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as i,c as t,h as e,H as s}from"./p-ff1278ed.js";import{g as o}from"./p-6de76553.js";import{g as l}from"./p-417ee5e0.js";import"./p-21603661.js";import"./p-aa124212.js";const n='verdocs-field-initial{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:83px;height:36px;display:block;font-size:11px;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-initial.disabled{opacity:0.5}verdocs-field-initial.done{border:none;opacity:1}verdocs-field-initial img{display:block;max-width:100%;max-height:100%}verdocs-field-initial button{-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-initial button.hide{display:none}verdocs-field-initial.required{border:1px solid #cc0000}verdocs-field-initial.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-initial verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-initial verdocs-button-panel[data-active],verdocs-field-initial verdocs-button-panel:hover{opacity:1}verdocs-field-initial verdocs-button-panel .icon svg{fill:#333333}verdocs-field-initial verdocs-button-panel .icon:hover svg{fill:#000000}';const a='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';const r=class{constructor(e){i(this,e);this.adopt=t(this,"adopt",7);this.cancel=t(this,"cancel",7);this.fieldChange=t(this,"fieldChange",7);this.settingsPress=t(this,"settingsPress",7);this.field=null;this.disabled=false;this.initials="";this.editable=false;this.moveable=false;this.done=false;this.roleindex=0;this.tempInitials=""}async focusField(){this.handleShow()}hideDialog(){var i;(i=this.dialog)===null||i===void 0?void 0:i.remove();this.dialog=null}handleAdopt(i){var t;console.log("[INITIAL] Adopted initials");this.tempInitials=i.detail;(t=this.fieldChange)===null||t===void 0?void 0:t.emit(this.tempInitials);this.hideDialog()}handleShow(){this.dialog=document.createElement("verdocs-initial-dialog");this.dialog.setAttribute("initials",this.initials);this.dialog.setAttribute("roleindex",this.roleindex);this.dialog.addEventListener("cancel",(()=>this.hideDialog()));this.dialog.addEventListener("next",(i=>this.handleAdopt(i)));document.body.append(this.dialog)}render(){var i,t;const n=l(this.field);const r=n.base64||this.tempInitials;const d=(t=(i=this.disabled)!==null&&i!==void 0?i:n.disabled)!==null&&t!==void 0?t:false;const c=this.field["rgba"]||o(this.roleindex);if(this.done){return e(s,{class:{done:this.done}},r&&e("img",{src:r,alt:"Initials"}))}return e(s,{class:{required:n.required,disabled:d},style:{backgroundColor:c}},r?e("img",{src:r,alt:"Initials"}):e("button",{class:{},onClick:()=>!d&&this.handleShow()},"Initials"),this.editable&&e("verdocs-button-panel",{icon:a},e("h6",null,"Field Settings"),e("form",null,e("verdocs-select-input",{label:"Recipient",options:[{label:"Buyer",value:"Buyer"},{label:"Seller",value:"Seller"}]}),e("verdocs-text-input",{label:"Field Name",value:"",placeholder:"Stored field name...",onInput:i=>console.log("ipt",i)}),e("verdocs-text-input",{label:"Placeholder",value:"",placeholder:"Placeholder text...",onInput:i=>console.log("ipt",i)}))))}};r.style=n;export{r as verdocs_field_initial};
|
|
2
|
+
//# sourceMappingURL=p-a8cc5e31.entry.js.map
|