@verdocs/web-sdk 6.8.3 → 6.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/cjs/{Icons-GgNiIFTt.js → Icons-TVvtZ5iL.js} +2 -6
  2. package/dist/cjs/{Icons-GgNiIFTt.js.map → Icons-TVvtZ5iL.js.map} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-view.entry.cjs.js.map +1 -1
  5. package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +2 -2
  6. package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +111 -17
  7. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-sign.cjs.entry.js +50 -22
  11. package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
  12. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  13. package/dist/collection/components/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.css +6 -5
  14. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +54 -4
  15. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +48 -20
  16. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  17. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.css +33 -37
  18. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +56 -9
  19. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js.map +1 -1
  20. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.css +33 -37
  21. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +56 -9
  22. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js.map +1 -1
  23. package/dist/components/{p-B91pFl_v.js → p-5-YwGwyn.js} +13 -13
  24. package/dist/components/{p-B91pFl_v.js.map → p-5-YwGwyn.js.map} +1 -1
  25. package/dist/components/{p-4iMdAi-F.js → p-BDv5kBUR.js} +3 -5
  26. package/dist/components/p-BDv5kBUR.js.map +1 -0
  27. package/dist/components/{p-BYz85yxG.js → p-BZRJWqKI.js} +3 -3
  28. package/dist/components/{p-BYz85yxG.js.map → p-BZRJWqKI.js.map} +1 -1
  29. package/dist/components/{p-Bys760t8.js → p-Bafj7hI1.js} +3 -3
  30. package/dist/components/{p-Bys760t8.js.map → p-Bafj7hI1.js.map} +1 -1
  31. package/dist/components/{p-B4HqZ5yO.js → p-By2QlfRC.js} +3 -3
  32. package/dist/components/{p-B4HqZ5yO.js.map → p-By2QlfRC.js.map} +1 -1
  33. package/dist/components/{p-CdoA0Vhp.js → p-C3E0_BBd.js} +12 -12
  34. package/dist/components/{p-CdoA0Vhp.js.map → p-C3E0_BBd.js.map} +1 -1
  35. package/dist/components/{p-C8STy7JQ.js → p-C5fwD53I.js} +4 -4
  36. package/dist/components/{p-C8STy7JQ.js.map → p-C5fwD53I.js.map} +1 -1
  37. package/dist/components/{p-b0kPOapT.js → p-CDbm89Va.js} +14 -14
  38. package/dist/components/{p-b0kPOapT.js.map → p-CDbm89Va.js.map} +1 -1
  39. package/dist/components/{p-CNwYj4cS.js → p-CFi6VKgU.js} +3 -3
  40. package/dist/components/{p-CNwYj4cS.js.map → p-CFi6VKgU.js.map} +1 -1
  41. package/dist/components/{p-yvuxqHqW.js → p-CWGxLuye.js} +3 -3
  42. package/dist/components/{p-yvuxqHqW.js.map → p-CWGxLuye.js.map} +1 -1
  43. package/dist/components/{p-D5iqEzJy.js → p-CjDMm6od.js} +3 -3
  44. package/dist/components/{p-D5iqEzJy.js.map → p-CjDMm6od.js.map} +1 -1
  45. package/dist/components/{p-CcCp1gLW.js → p-CxyvrlVc.js} +59 -12
  46. package/dist/components/p-CxyvrlVc.js.map +1 -0
  47. package/dist/components/{p-D0JcxROc.js → p-DCaxeiL7.js} +59 -12
  48. package/dist/components/p-DCaxeiL7.js.map +1 -0
  49. package/dist/components/{p-Bw4ea7Kw.js → p-DzM2oGUr.js} +3 -3
  50. package/dist/components/{p-Bw4ea7Kw.js.map → p-DzM2oGUr.js.map} +1 -1
  51. package/dist/components/{p-CwA1DkPT.js → p-PGFRj24l.js} +4 -4
  52. package/dist/components/p-PGFRj24l.js.map +1 -0
  53. package/dist/components/{p-8aKU2veY.js → p-mFB74--W.js} +3 -3
  54. package/dist/components/{p-8aKU2veY.js.map → p-mFB74--W.js.map} +1 -1
  55. package/dist/components/{p-wSGGYtAF.js → p-tyY7kKNB.js} +3 -3
  56. package/dist/components/{p-wSGGYtAF.js.map → p-tyY7kKNB.js.map} +1 -1
  57. package/dist/components/verdocs-adopt-signature-dialog.js +1 -1
  58. package/dist/components/verdocs-build.js +15 -15
  59. package/dist/components/verdocs-field-attachment.js +1 -1
  60. package/dist/components/verdocs-field-checkbox.js +1 -1
  61. package/dist/components/verdocs-field-date.js +1 -1
  62. package/dist/components/verdocs-field-dropdown.js +1 -1
  63. package/dist/components/verdocs-field-initial.js +1 -1
  64. package/dist/components/verdocs-field-payment.js +1 -1
  65. package/dist/components/verdocs-field-radio.js +1 -1
  66. package/dist/components/verdocs-field-signature.js +1 -1
  67. package/dist/components/verdocs-field-textarea.js +1 -1
  68. package/dist/components/verdocs-field-textbox.js +1 -1
  69. package/dist/components/verdocs-field-timestamp.js +1 -1
  70. package/dist/components/verdocs-file-chooser.js +1 -1
  71. package/dist/components/verdocs-preview.js +1 -1
  72. package/dist/components/verdocs-sign.js +51 -23
  73. package/dist/components/verdocs-sign.js.map +1 -1
  74. package/dist/components/verdocs-template-attachments.js +1 -1
  75. package/dist/components/verdocs-template-document-page.js +1 -1
  76. package/dist/components/verdocs-template-fields.js +1 -1
  77. package/dist/esm/{Icons-uiSvPcsq.js → Icons-BU5rnXp2.js} +3 -5
  78. package/dist/esm/{Icons-uiSvPcsq.js.map → Icons-BU5rnXp2.js.map} +1 -1
  79. package/dist/esm/loader.js +1 -1
  80. package/dist/esm/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-view.entry.js.map +1 -1
  81. package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +2 -2
  82. package/dist/esm/verdocs-field-attachment_11.entry.js +111 -17
  83. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  84. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  85. package/dist/esm/verdocs-preview_7.entry.js +1 -1
  86. package/dist/esm/verdocs-sign.entry.js +50 -22
  87. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  88. package/dist/esm/verdocs-web-sdk.js +1 -1
  89. package/dist/esm-es5/{Icons-uiSvPcsq.js → Icons-BU5rnXp2.js} +2 -2
  90. package/dist/esm-es5/{Icons-uiSvPcsq.js.map → Icons-BU5rnXp2.js.map} +1 -1
  91. package/dist/esm-es5/loader.js +1 -1
  92. package/dist/esm-es5/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-view.entry.js.map +1 -1
  93. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
  95. package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-field-attachment_11.entry.js.map +1 -1
  97. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  102. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  103. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +2 -0
  104. package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +8 -1
  105. package/dist/types/components/fields/verdocs-field-signature/verdocs-field-signature.d.ts +8 -1
  106. package/dist/verdocs-web-sdk/p-081b245d.system.entry.js +2 -0
  107. package/dist/verdocs-web-sdk/p-081b245d.system.entry.js.map +1 -0
  108. package/dist/verdocs-web-sdk/p-0faa3e84.entry.js +2 -0
  109. package/dist/verdocs-web-sdk/{p-bf7fb952.entry.js.map → p-0faa3e84.entry.js.map} +1 -1
  110. package/dist/verdocs-web-sdk/p-35JuQlcA.system.js.map +1 -0
  111. package/dist/verdocs-web-sdk/{p-1c2f170a.system.entry.js → p-43d3ef1d.system.entry.js} +2 -2
  112. package/dist/verdocs-web-sdk/p-4b67e923.system.entry.js +2 -0
  113. package/dist/verdocs-web-sdk/p-4b67e923.system.entry.js.map +1 -0
  114. package/dist/verdocs-web-sdk/{p-72ff97d7.entry.js → p-5bc00fc6.entry.js} +3 -3
  115. package/dist/verdocs-web-sdk/{p-d026af3f.system.entry.js → p-6bbe3f73.system.entry.js} +2 -2
  116. package/dist/verdocs-web-sdk/p-6c5ecf49.entry.js +2 -0
  117. package/dist/verdocs-web-sdk/p-6c5ecf49.entry.js.map +1 -0
  118. package/dist/verdocs-web-sdk/p-8e8c0110.entry.js +2 -0
  119. package/dist/verdocs-web-sdk/p-8e8c0110.entry.js.map +1 -0
  120. package/dist/verdocs-web-sdk/p-93e9df57.system.entry.js +2 -0
  121. package/dist/verdocs-web-sdk/p-93e9df57.system.entry.js.map +1 -0
  122. package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
  123. package/dist/verdocs-web-sdk/{p-uiSvPcsq.js → p-BU5rnXp2.js} +2 -2
  124. package/dist/verdocs-web-sdk/{p-uiSvPcsq.js.map → p-BU5rnXp2.js.map} +1 -1
  125. package/dist/verdocs-web-sdk/p-C5U_96FD.system.js.map +1 -0
  126. package/dist/verdocs-web-sdk/p-COM7km0I.system.js.map +1 -0
  127. package/dist/verdocs-web-sdk/{p-B-lvFg2a.system.js.map → p-CaEXyfjG.system.js.map} +1 -1
  128. package/dist/verdocs-web-sdk/{p-C0HruX7m.system.js.map → p-CvwnnOmD.system.js.map} +1 -1
  129. package/dist/verdocs-web-sdk/{p-BnNnWnOr.system.js.map → p-DEv3ZZhp.system.js.map} +1 -1
  130. package/dist/verdocs-web-sdk/{p-DejNzlEq.system.js → p-GqS1qR-V.system.js} +2 -2
  131. package/dist/verdocs-web-sdk/{p-DejNzlEq.system.js.map → p-GqS1qR-V.system.js.map} +1 -1
  132. package/dist/verdocs-web-sdk/{p-59243cd3.system.entry.js → p-acf58947.system.entry.js} +3 -3
  133. package/dist/verdocs-web-sdk/{p-4d0a53c0.entry.js → p-e06f9319.entry.js} +2 -2
  134. package/dist/verdocs-web-sdk/{p-cec41aeb.entry.js → p-edc49225.entry.js} +2 -2
  135. package/dist/verdocs-web-sdk/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-view.entry.esm.js.map +1 -1
  136. package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
  137. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  138. package/package.json +1 -1
  139. package/dist/components/p-4iMdAi-F.js.map +0 -1
  140. package/dist/components/p-CcCp1gLW.js.map +0 -1
  141. package/dist/components/p-CwA1DkPT.js.map +0 -1
  142. package/dist/components/p-D0JcxROc.js.map +0 -1
  143. package/dist/verdocs-web-sdk/p-066b9068.entry.js +0 -2
  144. package/dist/verdocs-web-sdk/p-066b9068.entry.js.map +0 -1
  145. package/dist/verdocs-web-sdk/p-4d2642f5.system.entry.js +0 -2
  146. package/dist/verdocs-web-sdk/p-4d2642f5.system.entry.js.map +0 -1
  147. package/dist/verdocs-web-sdk/p-BREkr6mU.system.js.map +0 -1
  148. package/dist/verdocs-web-sdk/p-BjX323yE.system.js.map +0 -1
  149. package/dist/verdocs-web-sdk/p-CVkABARN.system.js.map +0 -1
  150. package/dist/verdocs-web-sdk/p-b2108c5c.system.entry.js +0 -2
  151. package/dist/verdocs-web-sdk/p-b2108c5c.system.entry.js.map +0 -1
  152. package/dist/verdocs-web-sdk/p-b5db2ed4.entry.js +0 -2
  153. package/dist/verdocs-web-sdk/p-b5db2ed4.entry.js.map +0 -1
  154. package/dist/verdocs-web-sdk/p-bf7fb952.entry.js +0 -2
  155. package/dist/verdocs-web-sdk/p-d4cfa91a.system.entry.js +0 -2
  156. package/dist/verdocs-web-sdk/p-d4cfa91a.system.entry.js.map +0 -1
  157. /package/dist/verdocs-web-sdk/{p-1c2f170a.system.entry.js.map → p-43d3ef1d.system.entry.js.map} +0 -0
  158. /package/dist/verdocs-web-sdk/{p-72ff97d7.entry.js.map → p-5bc00fc6.entry.js.map} +0 -0
  159. /package/dist/verdocs-web-sdk/{p-d026af3f.system.entry.js.map → p-6bbe3f73.system.entry.js.map} +0 -0
  160. /package/dist/verdocs-web-sdk/{p-59243cd3.system.entry.js.map → p-acf58947.system.entry.js.map} +0 -0
  161. /package/dist/verdocs-web-sdk/{p-4d0a53c0.entry.js.map → p-e06f9319.entry.js.map} +0 -0
  162. /package/dist/verdocs-web-sdk/{p-cec41aeb.entry.js.map → p-edc49225.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"p-B4HqZ5yO.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,oBAAoB,GAAG,60EAA60E;;ACM12E,MAAM,mBAAmB,GAAG,CAAA,kNAAA,CAAoN;AAEhP,MAAM,iBAAiB,GAAG,CAAA,2QAAA,CAA6Q;MAU1R,iBAAiB,iBAAAA,kBAAA,CAAA,MAAA,iBAAA,SAAAC,CAAA,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,CAAC,CAAC,eAAe,EAAE;AACnB,gBAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,IAAI,CAAC,iBAAiB;AAClD,aAAC,EACD,CAAA,EAED,IAAI,CAAC,iBAAiB,KACrB,sBAAgB,MAAM,EAAE,CAAA,+BAAA,EAAkC,SAAS,CAAA,CAAE,EAAE,WAAW,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAAA,EACxH,CACE,CAAA,mCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,EAC/C,QAAQ,EAAE,MAAK;;AACb,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAC,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC;AAC1C,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,iBAAiB,EAAE,CAAC,IAAG;;AACrB,gBAAA,CAAA,EAAA,GAAA,IAAI,CAAC,eAAe,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACpC,gBAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE;AACjC,aAAC,EACD,QAAQ,EAAE,qGAAqG,EAAA,CAC/G,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-radio/verdocs-field-radio.scss?tag=verdocs-field-radio","src/components/fields/verdocs-field-radio/verdocs-field-radio.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\n// See https://www.sliderrevolution.com/resources/styling-radio-buttons/\nverdocs-field-radio {\n font-family: $verdocs-primary-font;\n width: 14px;\n height: 14px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n border-radius: 100%;\n\n svg {\n margin-top: 4px;\n }\n\n &.disabled.done {\n opacity: 1;\n }\n\n // To avoid conflicting with the use of a label for the checkbox itself\n div.label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n div.group {\n top: 14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #bb0589;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n }\n\n input {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n }\n\n &.disabled input {\n opacity: 0.5;\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: 12px;\n height: 12px;\n position: absolute;\n // This looks off in Storybook but correct in apps.\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: #f3f3fc;\n background: #f3f3fc;\n }\n }\n }\n\n + label {\n &:empty {\n &:before {\n margin-right: 0;\n }\n }\n }\n }\n\n &.required {\n border: 1px solid var(--verdocs-required-field-border);\n }\n\n &.hide {\n display: none;\n }\n\n verdocs-button-panel {\n margin-left: -20px;\n margin-top: -7px;\n transform: scale(0.7);\n }\n\n .settings-icon {\n position: absolute;\n top: -6px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import interact from 'interactjs';\nimport {ITemplateField, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, Event, EventEmitter, h, Host, Method, Prop, Fragment, State, Element, Listen} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\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',\n styleUrl: 'verdocs-field-radio.scss',\n shadow: false,\n})\nexport class VerdocsFieldRadio {\n @Element() el: HTMLElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set to true, it will force interact to unset the el, resulting in no dragging the field.\n */\n @Prop({reflect: true}) isPreview?: boolean;\n\n /**\n * If set, overrides the field's settings object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, overrides the field's required object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) required?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @Listen('blur')\n handleBlur() {\n this.focused = false;\n }\n\n @Method()\n async focusField() {\n this.el.focus();\n this.focused = true;\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n componentDidUpdate() {\n if (this.isPreview) {\n interact(this.el).unset();\n return;\n }\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {name, required = false, label = '', group = '', value = false, readonly = false} = field || {};\n const signerClass = `signer-${(index % 10) + 1}`;\n\n const selected = value === 'true';\n\n if (done) {\n return (\n <Host class={{done}} style={{maxWidth: '10px'}}>\n <span innerHTML={selected ? RadioIconSelected : RadioIconUnselected} />\n </Host>\n );\n }\n\n return (\n <Host class={{required: this.required || required, disabled, done, focused, [signerClass]: true}}>\n {label && <div class=\"label\">{label}</div>}\n {editable && group && <div class=\"group\">{group}</div>}\n\n <input id={fieldname} type=\"radio\" name={group || fieldname} value={name} checked={!!selected} disabled={readonly || disabled} required={required} />\n <label htmlFor={fieldname} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={\"Radio buttons capture the recipient's selection of just one of several related (exclusive) options.\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AAE,qGAAqG,EAAA,CAC/G,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-radio/verdocs-field-radio.scss?tag=verdocs-field-radio","src/components/fields/verdocs-field-radio/verdocs-field-radio.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\n// See https://www.sliderrevolution.com/resources/styling-radio-buttons/\nverdocs-field-radio {\n font-family: $verdocs-primary-font;\n width: 14px;\n height: 14px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n background-color: transparent;\n transform-origin: bottom left;\n border-radius: 100%;\n\n svg {\n margin-top: 4px;\n }\n\n &.disabled.done {\n opacity: 1;\n }\n\n // To avoid conflicting with the use of a label for the checkbox itself\n div.label {\n top: -14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #4a4a99;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n }\n\n div.group {\n top: 14px;\n left: -1px;\n height: 14px;\n color: white;\n padding: 0 4px;\n font-size: 9px;\n line-height: 13px;\n position: absolute;\n background: #bb0589;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n }\n\n input {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n }\n\n &.disabled input {\n opacity: 0.5;\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: 12px;\n height: 12px;\n position: absolute;\n // This looks off in Storybook but correct in apps.\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: #f3f3fc;\n background: #f3f3fc;\n }\n }\n }\n\n + label {\n &:empty {\n &:before {\n margin-right: 0;\n }\n }\n }\n }\n\n &.required {\n border: 1px solid var(--verdocs-required-field-border);\n }\n\n &.hide {\n display: none;\n }\n\n verdocs-button-panel {\n margin-left: -20px;\n margin-top: -7px;\n transform: scale(0.7);\n }\n\n .settings-icon {\n position: absolute;\n top: -6px;\n left: -20px;\n display: inline-block;\n cursor: pointer;\n opacity: 0.3;\n\n svg {\n fill: $border-color;\n }\n\n &:hover {\n opacity: 1;\n }\n }\n}\n","import interact from 'interactjs';\nimport {ITemplateField, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, Event, EventEmitter, h, Host, Method, Prop, Fragment, State, Element, Listen} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\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',\n styleUrl: 'verdocs-field-radio.scss',\n shadow: false,\n})\nexport class VerdocsFieldRadio {\n @Element() el: HTMLElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set to true, it will force interact to unset the el, resulting in no dragging the field.\n */\n @Prop({reflect: true}) isPreview?: boolean;\n\n /**\n * If set, overrides the field's settings object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, overrides the field's required object. Primarily used in Storybook mode.\n */\n @Prop({reflect: true}) required?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @Listen('blur')\n handleBlur() {\n this.focused = false;\n }\n\n @Method()\n async focusField() {\n this.el.focus();\n this.focused = true;\n }\n\n @Method()\n async showSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.showPanel) {\n settingsPanel.showPanel();\n }\n }\n\n @Method()\n async hideSettingsPanel() {\n const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.fieldname}`) as any;\n if (settingsPanel && settingsPanel.hidePanel) {\n settingsPanel.hidePanel();\n }\n }\n\n componentDidUpdate() {\n if (this.isPreview) {\n interact(this.el).unset();\n return;\n }\n }\n\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {name, required = false, label = '', group = '', value = false, readonly = false} = field || {};\n const signerClass = `signer-${(index % 10) + 1}`;\n\n const selected = value === 'true';\n\n if (done) {\n return (\n <Host class={{done}} style={{maxWidth: '10px'}}>\n <span innerHTML={selected ? RadioIconSelected : RadioIconUnselected} />\n </Host>\n );\n }\n\n return (\n <Host class={{required: this.required || required, disabled, done, focused, [signerClass]: true}}>\n {label && <div class=\"label\">{label}</div>}\n {editable && group && <div class=\"group\">{group}</div>}\n\n <input id={fieldname} type=\"radio\" name={group || fieldname} value={name} checked={!!selected} disabled={readonly || disabled} required={required} />\n <label htmlFor={fieldname} />\n\n {editable && (\n <Fragment>\n <div\n id={`verdocs-settings-panel-trigger-${fieldname}`}\n style={{transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})`}}\n class=\"settings-icon\"\n innerHTML={SettingsIcon}\n onClick={(e: any) => {\n e.stopPropagation();\n this.showingProperties = !this.showingProperties;\n }}\n />\n\n {this.showingProperties && (\n <verdocs-portal anchor={`verdocs-settings-panel-trigger-${fieldname}`} onClickAway={() => (this.showingProperties = false)}>\n <verdocs-template-field-properties\n templateId={sourceid}\n fieldName={fieldname}\n onClose={() => (this.showingProperties = false)}\n onDelete={() => {\n this.deleted?.emit({fieldName: fieldname});\n return this.hideSettingsPanel();\n }}\n onSettingsChanged={e => {\n this.settingsChanged?.emit(e.detail);\n return this.hideSettingsPanel();\n }}\n helpText={\"Radio buttons capture the recipient's selection of just one of several related (exclusive) options.\"}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -6,16 +6,16 @@ import { d as defineCustomElement$n } from './p-C_yyK5xE.js';
6
6
  import { d as defineCustomElement$m } from './p-BvV9rOTP.js';
7
7
  import { d as defineCustomElement$l } from './p-CdmWI0-q.js';
8
8
  import { d as defineCustomElement$k } from './p-Ba_mXs1J.js';
9
- import { d as defineCustomElement$j } from './p-D5iqEzJy.js';
10
- import { d as defineCustomElement$i } from './p-CNwYj4cS.js';
11
- import { d as defineCustomElement$h } from './p-Bw4ea7Kw.js';
12
- import { d as defineCustomElement$g } from './p-BYz85yxG.js';
13
- import { d as defineCustomElement$f } from './p-CcCp1gLW.js';
14
- import { d as defineCustomElement$e } from './p-B4HqZ5yO.js';
15
- import { d as defineCustomElement$d } from './p-D0JcxROc.js';
16
- import { d as defineCustomElement$c } from './p-yvuxqHqW.js';
17
- import { d as defineCustomElement$b } from './p-Bys760t8.js';
18
- import { d as defineCustomElement$a } from './p-wSGGYtAF.js';
9
+ import { d as defineCustomElement$j } from './p-CjDMm6od.js';
10
+ import { d as defineCustomElement$i } from './p-CFi6VKgU.js';
11
+ import { d as defineCustomElement$h } from './p-DzM2oGUr.js';
12
+ import { d as defineCustomElement$g } from './p-BZRJWqKI.js';
13
+ import { d as defineCustomElement$f } from './p-CxyvrlVc.js';
14
+ import { d as defineCustomElement$e } from './p-By2QlfRC.js';
15
+ import { d as defineCustomElement$d } from './p-DCaxeiL7.js';
16
+ import { d as defineCustomElement$c } from './p-CWGxLuye.js';
17
+ import { d as defineCustomElement$b } from './p-Bafj7hI1.js';
18
+ import { d as defineCustomElement$a } from './p-tyY7kKNB.js';
19
19
  import { d as defineCustomElement$9 } from './p-BC5N3FIA.js';
20
20
  import { d as defineCustomElement$8 } from './p-CnPaJH5T.js';
21
21
  import { d as defineCustomElement$7 } from './p-CNKACBaL.js';
@@ -383,6 +383,6 @@ function defineCustomElement() {
383
383
  }
384
384
 
385
385
  export { VerdocsTemplateDocumentPage as V, defineCustomElement as d };
386
- //# sourceMappingURL=p-CdoA0Vhp.js.map
386
+ //# sourceMappingURL=p-C3E0_BBd.js.map
387
387
 
388
- //# sourceMappingURL=p-CdoA0Vhp.js.map
388
+ //# sourceMappingURL=p-C3E0_BBd.js.map
@@ -1 +1 @@
1
- {"file":"p-CdoA0Vhp.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,wjBAAwjB;;MCmBllB,2BAA2B,iBAAAA,kBAAA,CAAA,MAAA,2BAAA,SAAAC,CAAA,CAAA;AALxC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAKjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAAG,KAAK;AAEpB;;AAEG;AACoB,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAE9C;;AAEG;AACoB,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAE9C;;AAEG;AACoB,QAAA,IAAU,CAAA,UAAA,GAAW,CAAC;AAE7C;;;AAGG;AACK,QAAA,IAAY,CAAA,Y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,CACD,KAEF,CAAA,CAAA,KAAA,EAAA,IAAA,CAAW,CACZ;SAAA,CACF,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-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 .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\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-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop({reflect: true}) templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop({reflect: true}) documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop({reflect: true}) 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 @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 @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\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 componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n 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 const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\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,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\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 this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-C3E0_BBd.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,wjBAAwjB;;MCmBllB,2BAA2B,iBAAAA,kBAAA,CAAA,MAAA,2BAAA,SAAAC,CAAA,CAAA;AALxC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAKjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAAG,KAAK;AAEpB;;AAEG;AACoB,QAAA,IA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zD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW;AACzD,oBAAA,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW;AAC/D,iBAAC,EAAA,CACD,KAEF,CAAA,CAAA,KAAA,EAAA,IAAA,CAAW,CACZ;SAAA,CACF,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-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 .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\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-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop({reflect: true}) templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop({reflect: true}) documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop({reflect: true}) 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 @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 @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\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 componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n 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 const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\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,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\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 this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,12 +1,12 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-CUAGH_8P.js';
2
2
  import { VerdocsEndpoint, getTemplate, createTemplateDocument, deleteTemplateDocument } from '@verdocs/js-sdk';
3
- import { b as DocIcon, c as PngIcon, J as JpgIcon, d as PdfIcon, F as FileIcon, e as PageCountIcon, T as TrashIcon } from './p-4iMdAi-F.js';
3
+ import { b as DocIcon, P as PngIcon, J as JpgIcon, c as PdfIcon, F as FileIcon, d as PageCountIcon, T as TrashIcon } from './p-BDv5kBUR.js';
4
4
  import { S as SDKError } from './p-C1sRVZWv.js';
5
5
  import { S as Store } from './p-bS8INhRF.js';
6
6
  import { d as defineCustomElement$7 } from './p-C_yyK5xE.js';
7
7
  import { d as defineCustomElement$6 } from './p-CdmWI0-q.js';
8
8
  import { d as defineCustomElement$5 } from './p-Ba_mXs1J.js';
9
- import { d as defineCustomElement$4 } from './p-8aKU2veY.js';
9
+ import { d as defineCustomElement$4 } from './p-mFB74--W.js';
10
10
  import { d as defineCustomElement$3 } from './p-CNKACBaL.js';
11
11
  import { d as defineCustomElement$2 } from './p-o9BQIoXw.js';
12
12
  import { d as defineCustomElement$1 } from './p-DzEqts-G.js';
@@ -231,6 +231,6 @@ function defineCustomElement() {
231
231
  }
232
232
 
233
233
  export { VerdocsTemplateAttachments as V, defineCustomElement as d };
234
- //# sourceMappingURL=p-C8STy7JQ.js.map
234
+ //# sourceMappingURL=p-C5fwD53I.js.map
235
235
 
236
- //# sourceMappingURL=p-C8STy7JQ.js.map
236
+ //# sourceMappingURL=p-C5fwD53I.js.map
@@ -1 +1 @@
1
- {"file":"p-C8STy7JQ.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,6BAA6B,GAAG,2mFAA2mF;;MCepoF,0BAA0B,iBAAAA,kBAAA,CAAA,MAAA,0BAAA,SAAAC,CAAA,CAAA;AALvC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAEjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAuBtB,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAa,CAAA,aAAA,GAAG,cAAc;AAC9B,QAAA,IAAe,CAAA,eAAA,GAAG,CAAC;AACnB,QAAA,IAAe,CAAA,eAAA,GAAG,KAAK;AACvB,QAAA,IAAqB,CAAA,qBAA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AA,gBAAA,EAAA,EAAgB,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,SAAS,KAAI,EAAE,EAAE,MAAM,IAAI,IAAI,CAAC,SAAS,GAAI,CAChJ,EAEL,IAAI,CAAC,eAAe,KACnB,CAAA,CAAA,mBAAA,EAAA,EAAmB,OAAO,EAAC,6BAA6B,EAAC,OAAO,EAAC,iDAAiD,EAAC,MAAM,EAAE,OAAO,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,EAAA,CAAI,CACpK,EAEA,IAAI,CAAC,qBAAqB,KACzB,CACE,CAAA,mBAAA,EAAA,EAAA,OAAO,EAAC,yBAAyB,EACjC,OAAO,EAAC,yGAAyG,EACjH,MAAM,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EAClC,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,MAAK;AACX,gBAAA,IAAI,CAAC,qBAAqB,GAAG,IAAI;AACnC,aAAC,EACD,CAAA,CACH,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-attachments/verdocs-template-attachments.scss?tag=verdocs-template-attachments","src/components/templates/verdocs-template-attachments/verdocs-template-attachments.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-attachments {\n font-family: $verdocs-primary-font;\n\n h5 {\n font-size: 16px;\n font-weight: bold;\n margin: 0 0 10px 0;\n color: $verdocs-grey-blue;\n }\n\n .attachments {\n margin: 0 0 40px 0;\n }\n\n .attachment {\n display: flex;\n padding: 5px 0;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n color: $label-color;\n\n &:hover {\n .trash-icon {\n display: flex;\n }\n\n .pages {\n display: none;\n }\n }\n }\n\n svg {\n width: 28px;\n height: 28px;\n fill: $verdocs-bg-4;\n margin: 2px 0 0 0;\n }\n\n .file-icon {\n flex: 0;\n }\n\n .pages {\n width: 24px;\n height: 24px;\n flex: 0 0 24px;\n padding-left: 4px;\n position: relative;\n margin: -10px 0 0 0;\n\n .pages-icon {\n top: 0;\n left: 0;\n width: 24px;\n height: 24px;\n position: absolute;\n }\n\n .count {\n top: 11px;\n left: 7px;\n z-index: 1;\n width: 18px;\n font-size: 12px;\n font-weight: 500;\n position: absolute;\n text-align: center;\n letter-spacing: -2px;\n }\n }\n\n .filename {\n flex: 1;\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-bottom: 1px dotted #cccccc;\n }\n\n .trash-icon {\n flex: 0;\n display: none;\n\n &:hover {\n cursor: pointer;\n }\n }\n\n verdocs-file-chooser {\n margin: 10px 0;\n border: 2px dashed #979797;\n }\n\n .loader-wrapper {\n background-color: $verdocs-grey-4;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n position: relative;\n width: 320px;\n height: 320px;\n text-align: center;\n border: 2px dashed #979797;\n justify-content: flex-end;\n }\n\n .progress-wrapper {\n padding: 20px;\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {Component, h, Event, EventEmitter, Prop, Host, State} from '@stencil/core';\nimport {createTemplateDocument, deleteTemplateDocument, getTemplate, ITemplate, ITemplateDocument, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {DocIcon, FileIcon, JpgIcon, PageCountIcon, PdfIcon, PngIcon, TrashIcon} from '../../../utils/Icons';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Displays an edit form that allows the user to view, add, or remove a template's attachments.\n * Note that an active session and valid template ID must be supplied.\n */\n@Component({\n tag: 'verdocs-template-attachments',\n styleUrl: 'verdocs-template-attachments.scss',\n shadow: false,\n})\nexport class VerdocsTemplateAttachments {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired when the user clicks the next button.\n */\n @Event({composed: true}) next: EventEmitter<{template: ITemplate}>;\n\n /**\n * Event fired when the user updates the template.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: 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 @State() uploading = false;\n @State() progressLabel = 'Uploading...';\n @State() progressPercent = 0;\n @State() showDeleteError = false;\n @State() confirmDeleteDocument: ITemplateDocument | null = null;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[ROLES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[ROLES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[TEMPLATE ATTACHMENTS] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n handleCancel(e) {\n e.stopPropagation();\n this.exit.emit();\n }\n\n handleUploadProgress(percent: number) {\n if (percent >= 99) {\n this.progressPercent = 100;\n this.progressLabel = 'Processing...';\n } else {\n this.progressPercent = percent;\n }\n }\n\n async handleUpload(e) {\n e.stopPropagation();\n\n const file = e.detail.file as File;\n if (!file) {\n return;\n }\n\n console.log('[ATTACHMENTS] Uploading...', file);\n\n this.uploading = true;\n this.progressLabel = 'Uploading...';\n\n try {\n const template = await createTemplateDocument(this.endpoint, this.templateId, file, this.handleUploadProgress.bind(this));\n console.log('[ATTACHMENTS] Created attachment', template);\n\n // TODO: Just updated it in place.\n this.template = await Store.getTemplate(this.endpoint, this.templateId, true);\n console.log('[ATTACHMENTS] Updated template', this.template);\n\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'attachments'});\n\n this.uploading = false;\n this.progressLabel = '';\n this.progressPercent = 0;\n } catch (e) {\n console.log('[ATTACHMENTS] Error creating template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n this.uploading = false;\n }\n }\n\n handleNext(e: any) {\n e.stopPropagation();\n this.uploading = false;\n this.progressLabel = '';\n this.progressPercent = 0;\n this.next?.emit({template: this.template});\n }\n\n async confirmDelete() {\n await deleteTemplateDocument(this.endpoint, this.confirmDeleteDocument.id);\n // TODO: Update it in place\n this.template = await Store.getTemplate(this.endpoint, this.templateId, true);\n console.log('[ATTACHMENTS] New template', this.template);\n this.confirmDeleteDocument = null;\n }\n\n async handleDelete(document: ITemplateDocument) {\n if ((this.template?.documents || []).length > 1) {\n this.confirmDeleteDocument = document;\n } else {\n this.showDeleteError = true;\n }\n }\n\n getFileIcon(document: ITemplateDocument) {\n switch (document.mime) {\n case 'application/pdf':\n return PdfIcon;\n case 'image/jpeg':\n return JpgIcon;\n case 'image/png':\n return PngIcon;\n case 'application/msword':\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return DocIcon;\n }\n\n return FileIcon;\n }\n\n render() {\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n if (this.loading) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !this.template) {\n return <Host class=\"empty\" />;\n }\n\n return (\n <Host>\n <h5>Existing Attachments</h5>\n\n <div class=\"attachments\">\n {(this.template?.documents || []).map(document => (\n <div class=\"attachment\">\n <div class=\"file-icon\" innerHTML={this.getFileIcon(document)} />\n <div class=\"filename\" title={document.name}>\n {document.name}\n </div>\n <div class=\"pages\">\n <div class=\"count\">{document.pages}</div>\n <div class=\"pages-icon\" innerHTML={PageCountIcon} />\n </div>\n <div class=\"trash-icon\" innerHTML={TrashIcon} onClick={() => this.handleDelete(document)} />\n </div>\n ))}\n </div>\n\n <h5>Attach a New Document</h5>\n\n {this.uploading ? (\n <div class=\"loader-wrapper\">\n <verdocs-loader />\n\n {this.progressLabel && (\n <div class=\"progress-wrapper\">\n <verdocs-progress-bar showPercent={true} percent={this.progressPercent} label={this.progressLabel} />\n </div>\n )}\n </div>\n ) : (\n <verdocs-file-chooser onFileSelected={e => this.handleUpload(e)} />\n )}\n\n <div class=\"buttons\">\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} disabled={this.uploading} />\n <verdocs-button label=\"Next\" size=\"small\" onClick={e => this.handleNext(e)} disabled={!(this.template?.documents || []).length || this.uploading} />\n </div>\n\n {this.showDeleteError && (\n <verdocs-ok-dialog heading=\"Unable to Delete Attachment\" message=\"Templates must contain at least one attachment.\" onNext={() => (this.showDeleteError = false)} />\n )}\n\n {this.confirmDeleteDocument && (\n <verdocs-ok-dialog\n heading=\"Delete this Attachment?\"\n message=\"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.\"\n onNext={() => this.confirmDelete()}\n showCancel={true}\n onExit={() => {\n this.confirmDeleteDocument = null;\n }}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-C5fwD53I.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,6BAA6B,GAAG,2mFAA2mF;;MCepoF,0BAA0B,iBAAAA,kBAAA,CAAA,MAAA,0BAAA,SAAAC,CAAA,CAAA;AALvC,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAEjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAuBtB,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAa,CAAA,aAAA,GAAG,cAAc;AAC9B,QAAA,IAAe,CAAA,eAAA,GAAG,CAAC;AACnB,QAAA,IAAe,CAAA,eAAA,GAAG,KAAK;AACvB,QAAA,IAAqB,CAAA,qBAAA,GAA6B,IAAI;AAEtD,QAAA,IAAO,CAAA,OAAA,GAAG,IAAI;AACd,QAAA,IAAQ,CAAA,QAAA,GAAqB,IAAI;AAwN3C;AAtNC,IAAA,MAAM,iBAAiB,GAAA;;AACrB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;AAE3B,YAAA,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,CAAA,qCAAA,EAAwC,IAAI,CAAC,UAAU,CAAE,CAAA,CAAC;gBACtE;;AAGF,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;AAC1B,gBAAA,OAAO,CAAC,G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AM,EAAE,OAAO,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,EAAA,CAAI,CACpK,EAEA,IAAI,CAAC,qBAAqB,KACzB,CACE,CAAA,mBAAA,EAAA,EAAA,OAAO,EAAC,yBAAyB,EACjC,OAAO,EAAC,yGAAyG,EACjH,MAAM,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EAClC,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,MAAK;AACX,gBAAA,IAAI,CAAC,qBAAqB,GAAG,IAAI;AACnC,aAAC,EACD,CAAA,CACH,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/templates/verdocs-template-attachments/verdocs-template-attachments.scss?tag=verdocs-template-attachments","src/components/templates/verdocs-template-attachments/verdocs-template-attachments.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-attachments {\n font-family: $verdocs-primary-font;\n\n h5 {\n font-size: 16px;\n font-weight: bold;\n margin: 0 0 10px 0;\n color: $verdocs-grey-blue;\n }\n\n .attachments {\n margin: 0 0 40px 0;\n }\n\n .attachment {\n display: flex;\n padding: 5px 0;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n color: $label-color;\n\n &:hover {\n .trash-icon {\n display: flex;\n }\n\n .pages {\n display: none;\n }\n }\n }\n\n svg {\n width: 28px;\n height: 28px;\n fill: $verdocs-bg-4;\n margin: 2px 0 0 0;\n }\n\n .file-icon {\n flex: 0;\n }\n\n .pages {\n width: 24px;\n height: 24px;\n flex: 0 0 24px;\n padding-left: 4px;\n position: relative;\n margin: -10px 0 0 0;\n\n .pages-icon {\n top: 0;\n left: 0;\n width: 24px;\n height: 24px;\n position: absolute;\n }\n\n .count {\n top: 11px;\n left: 7px;\n z-index: 1;\n width: 18px;\n font-size: 12px;\n font-weight: 500;\n position: absolute;\n text-align: center;\n letter-spacing: -2px;\n }\n }\n\n .filename {\n flex: 1;\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n border-bottom: 1px dotted #cccccc;\n }\n\n .trash-icon {\n flex: 0;\n display: none;\n\n &:hover {\n cursor: pointer;\n }\n }\n\n verdocs-file-chooser {\n margin: 10px 0;\n border: 2px dashed #979797;\n }\n\n .loader-wrapper {\n background-color: $verdocs-grey-4;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n position: relative;\n width: 320px;\n height: 320px;\n text-align: center;\n border: 2px dashed #979797;\n justify-content: flex-end;\n }\n\n .progress-wrapper {\n padding: 20px;\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {Component, h, Event, EventEmitter, Prop, Host, State} from '@stencil/core';\nimport {createTemplateDocument, deleteTemplateDocument, getTemplate, ITemplate, ITemplateDocument, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {DocIcon, FileIcon, JpgIcon, PageCountIcon, PdfIcon, PngIcon, TrashIcon} from '../../../utils/Icons';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Displays an edit form that allows the user to view, add, or remove a template's attachments.\n * Note that an active session and valid template ID must be supplied.\n */\n@Component({\n tag: 'verdocs-template-attachments',\n styleUrl: 'verdocs-template-attachments.scss',\n shadow: false,\n})\nexport class VerdocsTemplateAttachments {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired when the user clicks the next button.\n */\n @Event({composed: true}) next: EventEmitter<{template: ITemplate}>;\n\n /**\n * Event fired when the user updates the template.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: 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 @State() uploading = false;\n @State() progressLabel = 'Uploading...';\n @State() progressPercent = 0;\n @State() showDeleteError = false;\n @State() confirmDeleteDocument: ITemplateDocument | null = null;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[ROLES] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[ROLES] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[TEMPLATE ATTACHMENTS] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n handleCancel(e) {\n e.stopPropagation();\n this.exit.emit();\n }\n\n handleUploadProgress(percent: number) {\n if (percent >= 99) {\n this.progressPercent = 100;\n this.progressLabel = 'Processing...';\n } else {\n this.progressPercent = percent;\n }\n }\n\n async handleUpload(e) {\n e.stopPropagation();\n\n const file = e.detail.file as File;\n if (!file) {\n return;\n }\n\n console.log('[ATTACHMENTS] Uploading...', file);\n\n this.uploading = true;\n this.progressLabel = 'Uploading...';\n\n try {\n const template = await createTemplateDocument(this.endpoint, this.templateId, file, this.handleUploadProgress.bind(this));\n console.log('[ATTACHMENTS] Created attachment', template);\n\n // TODO: Just updated it in place.\n this.template = await Store.getTemplate(this.endpoint, this.templateId, true);\n console.log('[ATTACHMENTS] Updated template', this.template);\n\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'attachments'});\n\n this.uploading = false;\n this.progressLabel = '';\n this.progressPercent = 0;\n } catch (e) {\n console.log('[ATTACHMENTS] Error creating template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n this.uploading = false;\n }\n }\n\n handleNext(e: any) {\n e.stopPropagation();\n this.uploading = false;\n this.progressLabel = '';\n this.progressPercent = 0;\n this.next?.emit({template: this.template});\n }\n\n async confirmDelete() {\n await deleteTemplateDocument(this.endpoint, this.confirmDeleteDocument.id);\n // TODO: Update it in place\n this.template = await Store.getTemplate(this.endpoint, this.templateId, true);\n console.log('[ATTACHMENTS] New template', this.template);\n this.confirmDeleteDocument = null;\n }\n\n async handleDelete(document: ITemplateDocument) {\n if ((this.template?.documents || []).length > 1) {\n this.confirmDeleteDocument = document;\n } else {\n this.showDeleteError = true;\n }\n }\n\n getFileIcon(document: ITemplateDocument) {\n switch (document.mime) {\n case 'application/pdf':\n return PdfIcon;\n case 'image/jpeg':\n return JpgIcon;\n case 'image/png':\n return PngIcon;\n case 'application/msword':\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return DocIcon;\n }\n\n return FileIcon;\n }\n\n render() {\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n if (this.loading) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n // This is meant to be a companion for larger visual experiences so we just go blank on errors for now.\n if (!this.endpoint.session || !this.template) {\n return <Host class=\"empty\" />;\n }\n\n return (\n <Host>\n <h5>Existing Attachments</h5>\n\n <div class=\"attachments\">\n {(this.template?.documents || []).map(document => (\n <div class=\"attachment\">\n <div class=\"file-icon\" innerHTML={this.getFileIcon(document)} />\n <div class=\"filename\" title={document.name}>\n {document.name}\n </div>\n <div class=\"pages\">\n <div class=\"count\">{document.pages}</div>\n <div class=\"pages-icon\" innerHTML={PageCountIcon} />\n </div>\n <div class=\"trash-icon\" innerHTML={TrashIcon} onClick={() => this.handleDelete(document)} />\n </div>\n ))}\n </div>\n\n <h5>Attach a New Document</h5>\n\n {this.uploading ? (\n <div class=\"loader-wrapper\">\n <verdocs-loader />\n\n {this.progressLabel && (\n <div class=\"progress-wrapper\">\n <verdocs-progress-bar showPercent={true} percent={this.progressPercent} label={this.progressLabel} />\n </div>\n )}\n </div>\n ) : (\n <verdocs-file-chooser onFileSelected={e => this.handleUpload(e)} />\n )}\n\n <div class=\"buttons\">\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} disabled={this.uploading} />\n <verdocs-button label=\"Next\" size=\"small\" onClick={e => this.handleNext(e)} disabled={!(this.template?.documents || []).length || this.uploading} />\n </div>\n\n {this.showDeleteError && (\n <verdocs-ok-dialog heading=\"Unable to Delete Attachment\" message=\"Templates must contain at least one attachment.\" onNext={() => (this.showDeleteError = false)} />\n )}\n\n {this.confirmDeleteDocument && (\n <verdocs-ok-dialog\n heading=\"Delete this Attachment?\"\n message=\"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.\"\n onNext={() => this.confirmDelete()}\n showCancel={true}\n onExit={() => {\n this.confirmDeleteDocument = null;\n }}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, c as createEvent, h, d as Host, F as Fragme
2
2
  import { i as interact } from './p-CGNX5HqF.js';
3
3
  import { VerdocsEndpoint, getTemplate, updateField, createField, integerSequence } from '@verdocs/js-sdk';
4
4
  import { g as getFieldId, h as updateCssTransform, i as removeCssTransform, j as setControlStyles, d as defaultHeight, k as defaultWidth } from './p-Dpu4D5bv.js';
5
- import { D as DocumentPageIcon } from './p-4iMdAi-F.js';
5
+ import { D as DocumentPageIcon } from './p-BDv5kBUR.js';
6
6
  import { V as VerdocsToast } from './p-D97GxsI-.js';
7
7
  import { S as SDKError } from './p-C1sRVZWv.js';
8
8
  import { S as Store } from './p-bS8INhRF.js';
@@ -10,23 +10,23 @@ import { d as defineCustomElement$p } from './p-C_yyK5xE.js';
10
10
  import { d as defineCustomElement$o } from './p-BvV9rOTP.js';
11
11
  import { d as defineCustomElement$n } from './p-CdmWI0-q.js';
12
12
  import { d as defineCustomElement$m } from './p-Ba_mXs1J.js';
13
- import { d as defineCustomElement$l } from './p-D5iqEzJy.js';
14
- import { d as defineCustomElement$k } from './p-CNwYj4cS.js';
15
- import { d as defineCustomElement$j } from './p-Bw4ea7Kw.js';
16
- import { d as defineCustomElement$i } from './p-BYz85yxG.js';
17
- import { d as defineCustomElement$h } from './p-CcCp1gLW.js';
18
- import { d as defineCustomElement$g } from './p-B4HqZ5yO.js';
19
- import { d as defineCustomElement$f } from './p-D0JcxROc.js';
20
- import { d as defineCustomElement$e } from './p-yvuxqHqW.js';
21
- import { d as defineCustomElement$d } from './p-Bys760t8.js';
22
- import { d as defineCustomElement$c } from './p-wSGGYtAF.js';
13
+ import { d as defineCustomElement$l } from './p-CjDMm6od.js';
14
+ import { d as defineCustomElement$k } from './p-CFi6VKgU.js';
15
+ import { d as defineCustomElement$j } from './p-DzM2oGUr.js';
16
+ import { d as defineCustomElement$i } from './p-BZRJWqKI.js';
17
+ import { d as defineCustomElement$h } from './p-CxyvrlVc.js';
18
+ import { d as defineCustomElement$g } from './p-By2QlfRC.js';
19
+ import { d as defineCustomElement$f } from './p-DCaxeiL7.js';
20
+ import { d as defineCustomElement$e } from './p-CWGxLuye.js';
21
+ import { d as defineCustomElement$d } from './p-Bafj7hI1.js';
22
+ import { d as defineCustomElement$c } from './p-tyY7kKNB.js';
23
23
  import { d as defineCustomElement$b } from './p-BC5N3FIA.js';
24
24
  import { d as defineCustomElement$a } from './p-CnPaJH5T.js';
25
25
  import { d as defineCustomElement$9 } from './p-CNKACBaL.js';
26
26
  import { d as defineCustomElement$8 } from './p-o9BQIoXw.js';
27
27
  import { d as defineCustomElement$7 } from './p-DUYRis3A.js';
28
28
  import { d as defineCustomElement$6 } from './p-C1AtapGD.js';
29
- import { d as defineCustomElement$5 } from './p-CdoA0Vhp.js';
29
+ import { d as defineCustomElement$5 } from './p-C3E0_BBd.js';
30
30
  import { d as defineCustomElement$4 } from './p-Cal5IvqT.js';
31
31
  import { d as defineCustomElement$3 } from './p--qy4LrSt.js';
32
32
  import { d as defineCustomElement$2 } from './p-xrtrbzOw.js';
@@ -533,6 +533,6 @@ function defineCustomElement() {
533
533
  }
534
534
 
535
535
  export { VerdocsTemplateFields as V, defineCustomElement as d };
536
- //# sourceMappingURL=p-b0kPOapT.js.map
536
+ //# sourceMappingURL=p-CDbm89Va.js.map
537
537
 
538
- //# sourceMappingURL=p-b0kPOapT.js.map
538
+ //# sourceMappingURL=p-CDbm89Va.js.map