@verdocs/web-sdk 6.2.6 → 6.2.7

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 (60) hide show
  1. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +22 -12
  2. package/dist/cjs/verdocs-sign.cjs.entry.js +7 -0
  3. package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
  4. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -0
  5. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  6. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +16 -11
  7. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
  8. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +6 -1
  9. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js.map +1 -1
  10. package/dist/components/{p-LPa2SLXL.js → p-CJt2BxDt.js} +18 -13
  11. package/dist/components/p-CJt2BxDt.js.map +1 -0
  12. package/dist/components/{p-CzUVVFEJ.js → p-D2DrESHF.js} +4 -4
  13. package/dist/components/{p-CzUVVFEJ.js.map → p-D2DrESHF.js.map} +1 -1
  14. package/dist/components/{p-BiuMDRxW.js → p-D_sm-ZDj.js} +8 -3
  15. package/dist/components/p-D_sm-ZDj.js.map +1 -0
  16. package/dist/components/{p-80nhsQfQ.js → p-gEwPUp5J.js} +5 -5
  17. package/dist/components/{p-80nhsQfQ.js.map → p-gEwPUp5J.js.map} +1 -1
  18. package/dist/components/{p-CA_Xcyt7.js → p-vDfciSeg.js} +5 -5
  19. package/dist/components/{p-CA_Xcyt7.js.map → p-vDfciSeg.js.map} +1 -1
  20. package/dist/components/verdocs-build.js +5 -5
  21. package/dist/components/verdocs-field-date.js +1 -1
  22. package/dist/components/verdocs-field-dropdown.js +1 -1
  23. package/dist/components/verdocs-preview.js +1 -1
  24. package/dist/components/verdocs-sign.js +7 -0
  25. package/dist/components/verdocs-sign.js.map +1 -1
  26. package/dist/components/verdocs-template-document-page.js +1 -1
  27. package/dist/components/verdocs-template-fields.js +1 -1
  28. package/dist/esm/verdocs-field-attachment_13.entry.js +22 -12
  29. package/dist/esm/verdocs-sign.entry.js +7 -0
  30. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  31. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  32. package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
  33. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  34. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  35. package/dist/verdocs-web-sdk/p-54a99b75.system.entry.js +2 -0
  36. package/dist/verdocs-web-sdk/p-54a99b75.system.entry.js.map +1 -0
  37. package/dist/verdocs-web-sdk/p-5b010bdb.entry.js +2 -0
  38. package/dist/verdocs-web-sdk/p-5b010bdb.entry.js.map +1 -0
  39. package/dist/verdocs-web-sdk/p-BSxnvcXp.system.js +1 -1
  40. package/dist/verdocs-web-sdk/p-BsSES842.system.js.map +1 -0
  41. package/dist/verdocs-web-sdk/p-CDd3Y_Oc.system.js.map +1 -0
  42. package/dist/verdocs-web-sdk/p-e7b26cd8.system.entry.js +2 -0
  43. package/dist/verdocs-web-sdk/p-e7b26cd8.system.entry.js.map +1 -0
  44. package/dist/verdocs-web-sdk/p-fa410d5c.entry.js +2 -0
  45. package/dist/verdocs-web-sdk/p-fa410d5c.entry.js.map +1 -0
  46. package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
  47. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/components/p-BiuMDRxW.js.map +0 -1
  50. package/dist/components/p-LPa2SLXL.js.map +0 -1
  51. package/dist/verdocs-web-sdk/p-0c2b17b8.system.entry.js +0 -2
  52. package/dist/verdocs-web-sdk/p-0c2b17b8.system.entry.js.map +0 -1
  53. package/dist/verdocs-web-sdk/p-0c895013.entry.js +0 -2
  54. package/dist/verdocs-web-sdk/p-0c895013.entry.js.map +0 -1
  55. package/dist/verdocs-web-sdk/p-16c12330.system.entry.js +0 -2
  56. package/dist/verdocs-web-sdk/p-16c12330.system.entry.js.map +0 -1
  57. package/dist/verdocs-web-sdk/p-778aa621.entry.js +0 -2
  58. package/dist/verdocs-web-sdk/p-778aa621.entry.js.map +0 -1
  59. package/dist/verdocs-web-sdk/p-CqY4YwuC.system.js.map +0 -1
  60. package/dist/verdocs-web-sdk/p-WL8pZ5_5.system.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"file":"p-CJt2BxDt.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,mBAAmB,GAAG,i5vBAAi5vB;;MCkBh6vB,gBAAgB,iBAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAAC,CAAA,CAAA;AAL7B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AASE;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAA4B,UAAU;AAEnE;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAE5C;;AAEG;AACoB,QAAA,IAAS,CAAA,SAAA,GAAW,EAAE;AAE7C;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;;AAGG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AAEjD;;AAEG;AACoB,QAAA,IAAI,CAAA,IAAA,GAAa,KAAK;AAE7C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACoB,QAAA,IAAM,CAAA,MAAA,GAAY,CAAC;AAE1C;;AAEG;AACoB,QAAA,IAAU,CAAA,UAAA,GAAY,CAAC;QAsBrC,IAAA,CAAA,WAAW,GAAG,CAAA,oBAAA,EAAuB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CA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s-field-date/verdocs-field-date.scss?tag=verdocs-field-date","src/components/fields/verdocs-field-date/verdocs-field-date.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-date {\n font-family: $verdocs-primary-font;\n width: 74px;\n height: 20px;\n display: block;\n font-size: 11px;\n position: relative;\n scroll-margin: 20px 0;\n letter-spacing: 0.3px;\n background-color: transparent;\n transform-origin: bottom left;\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n label {\n top: -14px;\n left: 0;\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 input {\n position: absolute;\n\n font-size: 12px;\n\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n font-weight: 500;\n transform-origin: 0 0;\n height: 100%;\n width: 100%;\n background: none;\n border: 1px solid $light-border-color;\n appearance: none;\n\n &.hide {\n display: none;\n }\n }\n\n &.disabled input {\n opacity: 0.5;\n }\n\n &.required {\n input {\n border: 1px solid $verdocs-red-1;\n }\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n .settings-icon {\n position: absolute;\n top: -3px;\n left: -18px;\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\n.air-datepicker-cell.-year-.-other-decade-,\n.air-datepicker-cell.-day-.-other-month- {\n color: var(--adp-color-other-month);\n}\n.air-datepicker-cell.-year-.-other-decade-:hover,\n.air-datepicker-cell.-day-.-other-month-:hover {\n color: var(--adp-color-other-month-hover);\n}\n.-disabled-.-focus-.air-datepicker-cell.-year-.-other-decade-,\n.-disabled-.-focus-.air-datepicker-cell.-day-.-other-month- {\n color: var(--adp-color-other-month);\n}\n.-selected-.air-datepicker-cell.-year-.-other-decade-,\n.-selected-.air-datepicker-cell.-day-.-other-month- {\n color: #fff;\n background: var(--adp-background-color-selected-other-month);\n}\n.-selected-.-focus-.air-datepicker-cell.-year-.-other-decade-,\n.-selected-.-focus-.air-datepicker-cell.-day-.-other-month- {\n background: var(--adp-background-color-selected-other-month-focused);\n}\n.-in-range-.air-datepicker-cell.-year-.-other-decade-,\n.-in-range-.air-datepicker-cell.-day-.-other-month- {\n background-color: var(--adp-background-color-in-range);\n color: var(--adp-color);\n}\n.-in-range-.-focus-.air-datepicker-cell.-year-.-other-decade-,\n.-in-range-.-focus-.air-datepicker-cell.-day-.-other-month- {\n background-color: var(--adp-background-color-in-range-focused);\n}\n.air-datepicker-cell.-year-.-other-decade-:empty,\n.air-datepicker-cell.-day-.-other-month-:empty {\n background: none;\n border: none;\n}\n.air-datepicker-cell {\n border-radius: var(--adp-cell-border-radius);\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n z-index: 1;\n}\n.air-datepicker-cell.-focus- {\n background: var(--adp-cell-background-color-hover);\n}\n.air-datepicker-cell.-current- {\n color: var(--adp-color-current-date);\n}\n.air-datepicker-cell.-current-.-focus- {\n color: var(--adp-color);\n}\n.air-datepicker-cell.-current-.-in-range- {\n color: var(--adp-color-current-date);\n}\n.air-datepicker-cell.-disabled- {\n cursor: default;\n color: var(--adp-color-disabled);\n}\n.air-datepicker-cell.-disabled-.-focus- {\n color: var(--adp-color-disabled);\n}\n.air-datepicker-cell.-disabled-.-in-range- {\n color: var(--adp-color-disabled-in-range);\n}\n.air-datepicker-cell.-disabled-.-current-.-focus- {\n color: var(--adp-color-disabled);\n}\n.air-datepicker-cell.-in-range- {\n background: var(--adp-cell-background-color-in-range);\n border-radius: 0;\n}\n.air-datepicker-cell.-in-range-:hover {\n background: var(--adp-cell-background-color-in-range-hover);\n}\n.air-datepicker-cell.-range-from- {\n border: 1px solid var(--adp-cell-border-color-in-range);\n background-color: var(--adp-cell-background-color-in-range);\n border-radius: var(--adp-cell-border-radius) 0 0 var(--adp-cell-border-radius);\n}\n.air-datepicker-cell.-range-to- {\n border: 1px solid var(--adp-cell-border-color-in-range);\n background-color: var(--adp-cell-background-color-in-range);\n border-radius: 0 var(--adp-cell-border-radius) var(--adp-cell-border-radius) 0;\n}\n.air-datepicker-cell.-range-to-.-range-from- {\n border-radius: var(--adp-cell-border-radius);\n}\n.air-datepicker-cell.-selected- {\n color: #fff;\n border: none;\n background: var(--adp-cell-background-color-selected);\n}\n.air-datepicker-cell.-selected-.-current- {\n color: #fff;\n background: var(--adp-cell-background-color-selected);\n}\n.air-datepicker-cell.-selected-.-focus- {\n background: var(--adp-cell-background-color-selected-hover);\n}\n.air-datepicker-body {\n transition: all var(--adp-transition-duration) var(--adp-transition-ease);\n}\n.air-datepicker-body.-hidden- {\n display: none;\n}\n.air-datepicker-body--day-names {\n display: grid;\n grid-template-columns: repeat(7, var(--adp-day-cell-width));\n margin: 8px 0 3px;\n}\n.air-datepicker-body--day-name {\n color: var(--adp-day-name-color);\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n text-align: center;\n text-transform: uppercase;\n font-size: 0.8em;\n}\n.air-datepicker-body--day-name.-clickable- {\n cursor: pointer;\n}\n.air-datepicker-body--day-name.-clickable-:hover {\n color: var(--adp-day-name-color-hover);\n}\n.air-datepicker-body--cells {\n display: grid;\n}\n.air-datepicker-body--cells.-days- {\n grid-template-columns: repeat(7, var(--adp-day-cell-width));\n grid-auto-rows: var(--adp-day-cell-height);\n}\n.air-datepicker-body--cells.-months- {\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: var(--adp-month-cell-height);\n}\n.air-datepicker-body--cells.-years- {\n grid-template-columns: repeat(4, 1fr);\n grid-auto-rows: var(--adp-year-cell-height);\n}\n.air-datepicker-nav {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--adp-border-color-inner);\n min-height: var(--adp-nav-height);\n padding: var(--adp-padding);\n box-sizing: content-box;\n}\n.-only-timepicker- .air-datepicker-nav {\n display: none;\n}\n.air-datepicker-nav--title,\n.air-datepicker-nav--action {\n display: flex;\n cursor: pointer;\n align-items: center;\n justify-content: center;\n}\n.air-datepicker-nav--action {\n width: var(--adp-nav-action-size);\n border-radius: var(--adp-border-radius);\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.air-datepicker-nav--action:hover {\n background: var(--adp-background-color-hover);\n}\n.air-datepicker-nav--action:active {\n background: var(--adp-background-color-active);\n}\n.air-datepicker-nav--action.-disabled- {\n visibility: hidden;\n}\n.air-datepicker-nav--action svg {\n width: 32px;\n height: 32px;\n}\n.air-datepicker-nav--action path {\n fill: none;\n stroke: var(--adp-nav-arrow-color);\n stroke-width: 2px;\n}\n.air-datepicker-nav--title {\n border-radius: var(--adp-border-radius);\n padding: 0 8px;\n}\n.air-datepicker-nav--title i {\n font-style: normal;\n color: var(--adp-nav-color-secondary);\n margin-left: 0.3em;\n}\n.air-datepicker-nav--title:hover {\n background: var(--adp-background-color-hover);\n}\n.air-datepicker-nav--title:active {\n background: var(--adp-background-color-active);\n}\n.air-datepicker-nav--title.-disabled- {\n cursor: default;\n background: none;\n}\n.air-datepicker-buttons {\n display: grid;\n grid-auto-columns: 1fr;\n grid-auto-flow: column;\n}\n.air-datepicker-button {\n display: inline-flex;\n color: var(--adp-btn-color);\n border-radius: var(--adp-btn-border-radius);\n cursor: pointer;\n height: var(--adp-btn-height);\n border: none;\n background: rgba(255, 255, 255, 0);\n}\n.air-datepicker-button:hover {\n color: var(--adp-btn-color-hover);\n background: var(--adp-btn-background-color-hover);\n}\n.air-datepicker-button:focus {\n color: var(--adp-btn-color-hover);\n background: var(--adp-btn-background-color-hover);\n outline: none;\n}\n.air-datepicker-button:active {\n background: var(--adp-btn-background-color-active);\n}\n.air-datepicker-button span {\n outline: none;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n.air-datepicker-time {\n display: grid;\n grid-template-columns: max-content 1fr;\n grid-column-gap: 12px;\n align-items: center;\n position: relative;\n padding: 0 var(--adp-time-padding-inner);\n}\n.-only-timepicker- .air-datepicker-time {\n border-top: none;\n}\n.air-datepicker-time--current {\n display: flex;\n align-items: center;\n flex: 1;\n font-size: 14px;\n text-align: center;\n}\n.air-datepicker-time--current-colon {\n margin: 0 2px 3px;\n line-height: 1;\n}\n.air-datepicker-time--current-hours,\n.air-datepicker-time--current-minutes {\n line-height: 1;\n font-size: 19px;\n font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;\n position: relative;\n z-index: 1;\n}\n.air-datepicker-time--current-hours:after,\n.air-datepicker-time--current-minutes:after {\n content: '';\n background: var(--adp-background-color-hover);\n border-radius: var(--adp-border-radius);\n position: absolute;\n left: -2px;\n top: -3px;\n right: -2px;\n bottom: -2px;\n z-index: -1;\n opacity: 0;\n}\n.air-datepicker-time--current-hours.-focus-:after,\n.air-datepicker-time--current-minutes.-focus-:after {\n opacity: 1;\n}\n.air-datepicker-time--current-ampm {\n text-transform: uppercase;\n align-self: flex-end;\n color: var(--adp-time-day-period-color);\n margin-left: 6px;\n font-size: 11px;\n margin-bottom: 1px;\n}\n.air-datepicker-time--row {\n display: flex;\n align-items: center;\n font-size: 11px;\n height: 17px;\n background: linear-gradient(to right, var(--adp-time-track-color), var(--adp-time-track-color)) left 50%/100% var(--adp-time-track-height) no-repeat;\n}\n.air-datepicker-time--row:first-child {\n margin-bottom: 4px;\n}\n.air-datepicker-time--row input[type='range'] {\n background: none;\n cursor: pointer;\n flex: 1;\n height: 100%;\n width: 100%;\n padding: 0;\n margin: 0;\n -webkit-appearance: none;\n}\n.air-datepicker-time--row input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n}\n.air-datepicker-time--row input[type='range']::-ms-tooltip {\n display: none;\n}\n.air-datepicker-time--row input[type='range']:hover::-webkit-slider-thumb {\n border-color: var(--adp-time-track-color-hover);\n}\n.air-datepicker-time--row input[type='range']:hover::-moz-range-thumb {\n border-color: var(--adp-time-track-color-hover);\n}\n.air-datepicker-time--row input[type='range']:hover::-ms-thumb {\n border-color: var(--adp-time-track-color-hover);\n}\n.air-datepicker-time--row input[type='range']:focus {\n outline: none;\n}\n.air-datepicker-time--row input[type='range']:focus::-webkit-slider-thumb {\n background: var(--adp-cell-background-color-selected);\n border-color: var(--adp-cell-background-color-selected);\n}\n.air-datepicker-time--row input[type='range']:focus::-moz-range-thumb {\n background: var(--adp-cell-background-color-selected);\n border-color: var(--adp-cell-background-color-selected);\n}\n.air-datepicker-time--row input[type='range']:focus::-ms-thumb {\n background: var(--adp-cell-background-color-selected);\n border-color: var(--adp-cell-background-color-selected);\n}\n.air-datepicker-time--row input[type='range']::-webkit-slider-thumb {\n box-sizing: border-box;\n height: 12px;\n width: 12px;\n border-radius: 3px;\n border: 1px solid var(--adp-time-track-color);\n background: #fff;\n cursor: pointer;\n -webkit-transition: background var(--adp-transition-duration);\n transition: background var(--adp-transition-duration);\n}\n.air-datepicker-time--row input[type='range']::-moz-range-thumb {\n box-sizing: border-box;\n height: 12px;\n width: 12px;\n border-radius: 3px;\n border: 1px solid var(--adp-time-track-color);\n background: #fff;\n cursor: pointer;\n -moz-transition: background var(--adp-transition-duration);\n transition: background var(--adp-transition-duration);\n}\n.air-datepicker-time--row input[type='range']::-ms-thumb {\n box-sizing: border-box;\n height: 12px;\n width: 12px;\n border-radius: 3px;\n border: 1px solid var(--adp-time-track-color);\n background: #fff;\n cursor: pointer;\n -ms-transition: background var(--adp-transition-duration);\n transition: background var(--adp-transition-duration);\n}\n.air-datepicker-time--row input[type='range']::-webkit-slider-thumb {\n margin-top: calc(var(--adp-time-thumb-size) / 2 * -1);\n}\n.air-datepicker-time--row input[type='range']::-webkit-slider-runnable-track {\n border: none;\n height: var(--adp-time-track-height);\n cursor: pointer;\n color: rgba(0, 0, 0, 0);\n background: rgba(0, 0, 0, 0);\n}\n.air-datepicker-time--row input[type='range']::-moz-range-track {\n border: none;\n height: var(--adp-time-track-height);\n cursor: pointer;\n color: rgba(0, 0, 0, 0);\n background: rgba(0, 0, 0, 0);\n}\n.air-datepicker-time--row input[type='range']::-ms-track {\n border: none;\n height: var(--adp-time-track-height);\n cursor: pointer;\n color: rgba(0, 0, 0, 0);\n background: rgba(0, 0, 0, 0);\n}\n.air-datepicker-time--row input[type='range']::-ms-fill-lower {\n background: rgba(0, 0, 0, 0);\n}\n.air-datepicker-time--row input[type='range']::-ms-fill-upper {\n background: rgba(0, 0, 0, 0);\n}\n.air-datepicker {\n --adp-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n --adp-font-size: 14px;\n --adp-width: 246px;\n --adp-z-index: 100;\n --adp-padding: 4px;\n --adp-grid-areas: 'nav' 'body' 'timepicker' 'buttons';\n --adp-transition-duration: 0.3s;\n --adp-transition-ease: ease-out;\n --adp-transition-offset: 8px;\n --adp-background-color: #fff;\n --adp-background-color-hover: #f0f0f0;\n --adp-background-color-active: #eaeaea;\n --adp-background-color-in-range: rgba(92, 196, 239, 0.1);\n --adp-background-color-in-range-focused: rgba(92, 196, 239, 0.2);\n --adp-background-color-selected-other-month-focused: #8ad5f4;\n --adp-background-color-selected-other-month: #a2ddf6;\n --adp-color: #4a4a4a;\n --adp-color-secondary: #9c9c9c;\n --adp-accent-color: #4eb5e6;\n --adp-color-current-date: var(--adp-accent-color);\n --adp-color-other-month: #dedede;\n --adp-color-disabled: #aeaeae;\n --adp-color-disabled-in-range: #939393;\n --adp-color-other-month-hover: #c5c5c5;\n --adp-border-color: #dbdbdb;\n --adp-border-color-inner: #efefef;\n --adp-border-radius: 4px;\n --adp-border-color-inline: #d7d7d7;\n --adp-nav-height: 32px;\n --adp-nav-arrow-color: var(--adp-color-secondary);\n --adp-nav-action-size: 32px;\n --adp-nav-color-secondary: var(--adp-color-secondary);\n --adp-day-name-color: #ff9a19;\n --adp-day-name-color-hover: #8ad5f4;\n --adp-day-cell-width: 1fr;\n --adp-day-cell-height: 32px;\n --adp-month-cell-height: 42px;\n --adp-year-cell-height: 56px;\n --adp-pointer-size: 10px;\n --adp-poiner-border-radius: 2px;\n --adp-pointer-offset: 14px;\n --adp-cell-border-radius: 4px;\n --adp-cell-background-color-hover: var(--adp-background-color-hover);\n --adp-cell-background-color-selected: #5cc4ef;\n --adp-cell-background-color-selected-hover: #45bced;\n --adp-cell-background-color-in-range: rgba(92, 196, 239, 0.1);\n --adp-cell-background-color-in-range-hover: rgba(92, 196, 239, 0.2);\n --adp-cell-border-color-in-range: var(--adp-cell-background-color-selected);\n --adp-btn-height: 32px;\n --adp-btn-color: var(--adp-accent-color);\n --adp-btn-color-hover: var(--adp-color);\n --adp-btn-border-radius: var(--adp-border-radius);\n --adp-btn-background-color-hover: var(--adp-background-color-hover);\n --adp-btn-background-color-active: var(--adp-background-color-active);\n --adp-time-track-height: 1px;\n --adp-time-track-color: #dedede;\n --adp-time-track-color-hover: #b1b1b1;\n --adp-time-thumb-size: 12px;\n --adp-time-padding-inner: 10px;\n --adp-time-day-period-color: var(--adp-color-secondary);\n --adp-mobile-font-size: 16px;\n --adp-mobile-nav-height: 40px;\n --adp-mobile-width: 320px;\n --adp-mobile-day-cell-height: 38px;\n --adp-mobile-month-cell-height: 48px;\n --adp-mobile-year-cell-height: 64px;\n}\n.air-datepicker-overlay {\n --adp-overlay-background-color: rgba(0, 0, 0, 0.3);\n --adp-overlay-transition-duration: 0.3s;\n --adp-overlay-transition-ease: ease-out;\n --adp-overlay-z-index: 99;\n}\n.air-datepicker {\n background: var(--adp-background-color);\n border: 1px solid var(--adp-border-color);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n border-radius: var(--adp-border-radius);\n box-sizing: content-box;\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: repeat(4, max-content);\n grid-template-areas: var(--adp-grid-areas);\n font-family: var(--adp-font-family), sans-serif;\n font-size: var(--adp-font-size);\n color: var(--adp-color);\n width: var(--adp-width);\n position: absolute;\n transition:\n opacity var(--adp-transition-duration) var(--adp-transition-ease),\n transform var(--adp-transition-duration) var(--adp-transition-ease);\n z-index: var(--adp-z-index);\n}\n.air-datepicker:not(.-custom-position-) {\n opacity: 0;\n}\n.air-datepicker.-from-top- {\n transform: translateY(calc(var(--adp-transition-offset) * -1));\n}\n.air-datepicker.-from-right- {\n transform: translateX(var(--adp-transition-offset));\n}\n.air-datepicker.-from-bottom- {\n transform: translateY(var(--adp-transition-offset));\n}\n.air-datepicker.-from-left- {\n transform: translateX(calc(var(--adp-transition-offset) * -1));\n}\n.air-datepicker.-active-:not(.-custom-position-) {\n transform: translate(0, 0);\n opacity: 1;\n}\n.air-datepicker.-active-.-custom-position- {\n transition: none;\n}\n.air-datepicker.-inline- {\n border-color: var(--adp-border-color-inline);\n box-shadow: none;\n position: static;\n left: auto;\n right: auto;\n opacity: 1;\n transform: none;\n}\n.air-datepicker.-inline- .air-datepicker--pointer {\n display: none;\n}\n.air-datepicker.-is-mobile- {\n --adp-font-size: var(--adp-mobile-font-size);\n --adp-day-cell-height: var(--adp-mobile-day-cell-height);\n --adp-month-cell-height: var(--adp-mobile-month-cell-height);\n --adp-year-cell-height: var(--adp-mobile-year-cell-height);\n --adp-nav-height: var(--adp-mobile-nav-height);\n --adp-nav-action-size: var(--adp-mobile-nav-height);\n position: fixed;\n width: var(--adp-mobile-width);\n border: none;\n}\n.air-datepicker.-is-mobile- * {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.air-datepicker.-is-mobile- .air-datepicker--pointer {\n display: none;\n}\n.air-datepicker.-is-mobile-:not(.-custom-position-) {\n transform: translate(-50%, calc(-50% + var(--adp-transition-offset)));\n}\n.air-datepicker.-is-mobile-.-active-:not(.-custom-position-) {\n transform: translate(-50%, -50%);\n}\n.air-datepicker.-custom-position- {\n transition: none;\n}\n.air-datepicker-global-container {\n position: absolute;\n left: 0;\n top: 0;\n}\n.air-datepicker--pointer {\n --pointer-half-size: calc(var(--adp-pointer-size) / 2);\n position: absolute;\n width: var(--adp-pointer-size);\n height: var(--adp-pointer-size);\n z-index: -1;\n}\n.air-datepicker--pointer:after {\n content: '';\n position: absolute;\n background: #fff;\n border-top: 1px solid var(--adp-border-color-inline);\n border-right: 1px solid var(--adp-border-color-inline);\n border-top-right-radius: var(--adp-poiner-border-radius);\n width: var(--adp-pointer-size);\n height: var(--adp-pointer-size);\n box-sizing: border-box;\n}\n.-top-left- .air-datepicker--pointer,\n.-top-center- .air-datepicker--pointer,\n.-top-right- .air-datepicker--pointer,\n[data-popper-placement^='top'] .air-datepicker--pointer {\n top: calc(100% - var(--pointer-half-size) + 1px);\n}\n.-top-left- .air-datepicker--pointer:after,\n.-top-center- .air-datepicker--pointer:after,\n.-top-right- .air-datepicker--pointer:after,\n[data-popper-placement^='top'] .air-datepicker--pointer:after {\n transform: rotate(135deg);\n}\n.-right-top- .air-datepicker--pointer,\n.-right-center- .air-datepicker--pointer,\n.-right-bottom- .air-datepicker--pointer,\n[data-popper-placement^='right'] .air-datepicker--pointer {\n right: calc(100% - var(--pointer-half-size) + 1px);\n}\n.-right-top- .air-datepicker--pointer:after,\n.-right-center- .air-datepicker--pointer:after,\n.-right-bottom- .air-datepicker--pointer:after,\n[data-popper-placement^='right'] .air-datepicker--pointer:after {\n transform: rotate(225deg);\n}\n.-bottom-left- .air-datepicker--pointer,\n.-bottom-center- .air-datepicker--pointer,\n.-bottom-right- .air-datepicker--pointer,\n[data-popper-placement^='bottom'] .air-datepicker--pointer {\n bottom: calc(100% - var(--pointer-half-size) + 1px);\n}\n.-bottom-left- .air-datepicker--pointer:after,\n.-bottom-center- .air-datepicker--pointer:after,\n.-bottom-right- .air-datepicker--pointer:after,\n[data-popper-placement^='bottom'] .air-datepicker--pointer:after {\n transform: rotate(315deg);\n}\n.-left-top- .air-datepicker--pointer,\n.-left-center- .air-datepicker--pointer,\n.-left-bottom- .air-datepicker--pointer,\n[data-popper-placement^='left'] .air-datepicker--pointer {\n left: calc(100% - var(--pointer-half-size) + 1px);\n}\n.-left-top- .air-datepicker--pointer:after,\n.-left-center- .air-datepicker--pointer:after,\n.-left-bottom- .air-datepicker--pointer:after,\n[data-popper-placement^='left'] .air-datepicker--pointer:after {\n transform: rotate(45deg);\n}\n.-top-left- .air-datepicker--pointer,\n.-bottom-left- .air-datepicker--pointer {\n left: var(--adp-pointer-offset);\n}\n.-top-right- .air-datepicker--pointer,\n.-bottom-right- .air-datepicker--pointer {\n right: var(--adp-pointer-offset);\n}\n.-top-center- .air-datepicker--pointer,\n.-bottom-center- .air-datepicker--pointer {\n left: calc(50% - var(--adp-pointer-size) / 2);\n}\n.-left-top- .air-datepicker--pointer,\n.-right-top- .air-datepicker--pointer {\n top: var(--adp-pointer-offset);\n}\n.-left-bottom- .air-datepicker--pointer,\n.-right-bottom- .air-datepicker--pointer {\n bottom: var(--adp-pointer-offset);\n}\n.-left-center- .air-datepicker--pointer,\n.-right-center- .air-datepicker--pointer {\n top: calc(50% - var(--adp-pointer-size) / 2);\n}\n.air-datepicker--navigation {\n grid-area: nav;\n}\n.air-datepicker--content {\n box-sizing: content-box;\n padding: var(--adp-padding);\n grid-area: body;\n}\n.-only-timepicker- .air-datepicker--content {\n display: none;\n}\n.air-datepicker--time {\n grid-area: timepicker;\n}\n.air-datepicker--buttons {\n grid-area: buttons;\n}\n.air-datepicker--buttons,\n.air-datepicker--time {\n padding: var(--adp-padding);\n border-top: 1px solid var(--adp-border-color-inner);\n}\n.air-datepicker-overlay {\n position: fixed;\n background: var(--adp-overlay-background-color);\n left: 0;\n top: 0;\n width: 0;\n height: 0;\n opacity: 0;\n transition:\n opacity var(--adp-overlay-transition-duration) var(--adp-overlay-transition-ease),\n left 0s,\n height 0s,\n width 0s;\n transition-delay: 0s, var(--adp-overlay-transition-duration), var(--adp-overlay-transition-duration), var(--adp-overlay-transition-duration);\n z-index: var(--adp-overlay-z-index);\n}\n.air-datepicker-overlay.-active- {\n opacity: 1;\n width: 100%;\n height: 100%;\n transition:\n opacity var(--adp-overlay-transition-duration) var(--adp-overlay-transition-ease),\n height 0s,\n width 0s;\n}\n\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import {format} from 'date-fns';\nimport {getRGBA} from '@verdocs/js-sdk';\nimport AirDatepicker from 'air-datepicker';\nimport localeEn from 'air-datepicker/locale/en';\nimport type {ITemplateField} from '@verdocs/js-sdk';\nimport {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Fragment, State} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {FORMAT_DATE} from '../../../utils/Types';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Displays a date field. When tapped or clicked, the input element will display a date picker component.\n */\n@Component({\n tag: 'verdocs-field-date',\n styleUrl: 'verdocs-field-date.scss',\n shadow: false,\n})\nexport class VerdocsFieldDate {\n @Element()\n private hostEl: HTMLInputElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop() field?: ITemplateField;\n\n /**\n * Event fired on every character entered into / deleted from the field.\n */\n @Event({composed: true}) settingsPress: EventEmitter;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() containerId = `verdocs-date-picker-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() showingProperties?: boolean = false;\n\n @Method()\n async focusField() {\n // Our input field is fake, so we fake the flash too\n this.focused = true;\n this.picker?.show();\n setTimeout(() => {\n this.focused = false;\n }, 500);\n }\n\n picker: AirDatepicker<HTMLElement> | null = null;\n\n componentDidLoad() {\n const {source, sourceid, fieldname} = this;\n const {field} = Store.getField(source, sourceid, fieldname, this.field);\n const {readonly = false} = field || {};\n\n if (!readonly) {\n this.picker = new AirDatepicker<HTMLElement>(`#${this.containerId}`, {\n locale: localeEn,\n isMobile: true,\n autoClose: true,\n onShow: () => (this.focused = true),\n onHide: () => (this.focused = false),\n onSelect: ({date, formattedDate}) => {\n const event = new CustomEvent('fieldChange', {detail: {date, formattedDate}});\n this.hostEl.dispatchEvent(event);\n },\n });\n }\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 @State() focused?: boolean = false;\n\n // NOTE: We don't use a \"date\" field here because browsers vary widely in their formatting of it.\n render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n const {required = false, placeholder = 'Date...', value = '', label = '', readonly = false} = field || {};\n const backgroundColor = getRGBA(index);\n\n const formattedValue = value ? format(new Date(value), FORMAT_DATE) : '';\n\n if (this.done) {\n return <Host class={{done}}>{formattedValue}</Host>;\n }\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n\n <input\n name={fieldname}\n class=\"input-el\"\n type=\"text\"\n value={formattedValue}\n id={this.containerId}\n placeholder={placeholder}\n disabled={readonly || disabled}\n onFocus={() => (this.focused = true)}\n onBlur={() => (this.focused = false)}\n />\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-${field.name}`} 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={'Date fields allow the user to select a date.'}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -8,8 +8,8 @@ import { d as defineCustomElement$m } from './p-KqTfG8Kf.js';
8
8
  import { d as defineCustomElement$l } from './p-CBRYaKLM.js';
9
9
  import { d as defineCustomElement$k } from './p-Ck_1uk0F.js';
10
10
  import { d as defineCustomElement$j } from './p-gGtgKfmC.js';
11
- import { d as defineCustomElement$i } from './p-LPa2SLXL.js';
12
- import { d as defineCustomElement$h } from './p-BiuMDRxW.js';
11
+ import { d as defineCustomElement$i } from './p-CJt2BxDt.js';
12
+ import { d as defineCustomElement$h } from './p-D_sm-ZDj.js';
13
13
  import { d as defineCustomElement$g } from './p-jXH2SygA.js';
14
14
  import { d as defineCustomElement$f } from './p-BPPiqx8Q.js';
15
15
  import { d as defineCustomElement$e } from './p-BJqJsTbt.js';
@@ -389,6 +389,6 @@ function defineCustomElement() {
389
389
  }
390
390
 
391
391
  export { VerdocsTemplateDocumentPage as V, defineCustomElement as d };
392
- //# sourceMappingURL=p-CzUVVFEJ.js.map
392
+ //# sourceMappingURL=p-D2DrESHF.js.map
393
393
 
394
- //# sourceMappingURL=p-CzUVVFEJ.js.map
394
+ //# sourceMappingURL=p-D2DrESHF.js.map
@@ -1 +1 @@
1
- {"file":"p-CzUVVFEJ.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B;;MCmB14B,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,GAA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C,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() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (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 @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 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 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 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 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 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 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 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 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 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 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-D2DrESHF.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B;;MCmB14B,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;AACK,QAAA,IAAU,C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AEF,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() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (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 @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 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 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 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 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 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 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 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 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 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 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}
@@ -79,7 +79,12 @@ const VerdocsFieldDropdown = /*@__PURE__*/ proxyCustomElement(class VerdocsField
79
79
  setTimeout(() => {
80
80
  this.focused = false;
81
81
  }, 500);
82
- (_a = this.selectEl) === null || _a === void 0 ? void 0 : _a.showPicker();
82
+ const { source, sourceid, fieldname } = this;
83
+ const { field } = Store.getField(source, sourceid, fieldname, this.field);
84
+ const { readonly = false } = field || {};
85
+ if (!readonly) {
86
+ (_a = this.selectEl) === null || _a === void 0 ? void 0 : _a.showPicker();
87
+ }
83
88
  }
84
89
  handleChange(e) {
85
90
  this.fieldChange.emit(e.target.value);
@@ -203,6 +208,6 @@ function defineCustomElement() {
203
208
  }
204
209
 
205
210
  export { VerdocsFieldDropdown as V, defineCustomElement as d };
206
- //# sourceMappingURL=p-BiuMDRxW.js.map
211
+ //# sourceMappingURL=p-D_sm-ZDj.js.map
207
212
 
208
- //# sourceMappingURL=p-BiuMDRxW.js.map
213
+ //# sourceMappingURL=p-D_sm-ZDj.js.map
@@ -0,0 +1 @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,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,kFAAkF,EAAA,CAC5F,CACa,CAClB,CACQ,CACZ,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.scss?tag=verdocs-field-dropdown","src/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-dropdown {\n font-family: $verdocs-primary-font;\n width: 85px;\n height: 20px;\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\n label {\n top: -14px;\n left: 0;\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 select {\n // This is needed to bring down the cursor from the parent element, which is where interactjs applies it\n cursor: inherit;\n\n position: absolute;\n background: linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);\n background-position:\n calc(100% - 7px) 6px,\n calc(100% - 3px) 6px,\n 100% 0;\n background-size:\n 5px 5px,\n 5px 5px,\n 2.5em 2.5em;\n background-repeat: no-repeat;\n appearance: none;\n\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n font-weight: 500;\n transform-origin: 0 0;\n height: 100%;\n width: 100%;\n font-size: 11px;\n border: 1px solid rgba(0, 0, 0, 0.2);\n padding: 0 5px;\n\n &:focus {\n outline: none;\n }\n\n &.hide {\n display: none;\n }\n }\n\n &.disabled select {\n opacity: 0.5;\n }\n\n &.required {\n select {\n border: 1px solid $verdocs-red-1;\n }\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.4s 1;\n }\n\n verdocs-button-panel {\n display: block;\n margin-left: -33px;\n margin-top: -1px;\n transform: scale(0.7);\n }\n\n .settings-icon {\n position: absolute;\n top: -2px;\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\n@keyframes verdocs-field-pulse {\n 0% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n 50% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.35);\n }\n}\n","import {ITemplateField, getRGBA, IEnvelopeField} from '@verdocs/js-sdk';\nimport {Component, Event, EventEmitter, h, Host, Method, Prop, Fragment, State} from '@stencil/core';\nimport {SettingsIcon} from '../../../utils/Icons';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Displays a dropdown field that allows the user to choose one of a list of options.\n */\n@Component({\n tag: 'verdocs-field-dropdown',\n styleUrl: 'verdocs-field-dropdown.scss',\n shadow: false,\n})\nexport class VerdocsFieldDropdown {\n selectEl: HTMLSelectElement;\n\n /**\n * Fields may be attached to templates or envelopes, but only template fields may be edited.\n */\n @Prop({reflect: true}) source: 'template' | 'envelope' = 'template';\n\n /**\n * The source template or envelope ID the field is found in.\n */\n @Prop({reflect: true}) sourceid: string = '';\n\n /**\n * The name of the field to display.\n */\n @Prop({reflect: true}) fieldname: string = '';\n\n /**\n * Override the field's settings. This is intended to be used during signing when fields are being\n * mutated.\n */\n @Prop() field: IEnvelopeField | null | undefined = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop({reflect: true}) disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop({reflect: true}) editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop({reflect: true}) moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop({reflect: true}) done?: boolean = false;\n\n /**\n * If set, the field will be be scaled horizontally by this factor.\n */\n @Prop({reflect: true}) xscale?: number = 1;\n\n /**\n * If set, the field will be be scaled vertically by this factor.\n */\n @Prop({reflect: true}) yscale?: number = 1;\n\n /**\n * The page the field is on\n */\n @Prop({reflect: true}) pagenumber?: number = 1;\n\n /**\n * Event fired when the input field value changes. Note that this will only be fired on blur, tab-out, ENTER key press, etc.\n * It is generally the best event to subscribe to than `input` for most cases EXCEPT autocomplete fields that need to see every\n * keypress.\n */\n @Event({composed: true}) fieldChange: EventEmitter<string>;\n\n /**\n * Event fired when the field's settings are changed.\n */\n @Event({composed: true}) settingsChanged: EventEmitter<{fieldName: string; field: ITemplateField}>;\n\n /**\n * Event fired when the field is deleted.\n */\n @Event({composed: true}) deleted: EventEmitter<{fieldName: string}>;\n\n @State() showingProperties?: boolean = false;\n @State() focused = false;\n\n @Method()\n async focusField() {\n // Our input field is fake, so we fake the flash too\n this.focused = true;\n setTimeout(() => {\n this.focused = false;\n }, 500);\n\n const {source, sourceid, fieldname} = this;\n const {field} = Store.getField(source, sourceid, fieldname, this.field);\n const {readonly = false} = field || {};\n\n if (!readonly) {\n this.selectEl?.showPicker();\n }\n }\n\n handleChange(e: any) {\n this.fieldChange.emit(e.target.value);\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 render() {\n const {source, sourceid, fieldname, editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1} = this;\n\n const {index, field} = Store.getField(source, sourceid, fieldname, this.field);\n let {required = false, value = '', label = '', options, readonly = false} = field || {};\n const backgroundColor = getRGBA(index);\n\n // TODO: Consolidate value/defaultValue handling between template and envelope fields.\n if ((field as any)?.value) {\n value = (field as any)?.value;\n }\n\n if (done) {\n return <Host class={{done}}>{value}</Host>;\n }\n\n // TODO: Look for other places this mistaken assumption was made.\n // Defaults only apply in destructuring if undefined. null doesn't trigger it.\n options ||= [];\n\n return (\n <Host class={{required, disabled, done, focused}} style={{backgroundColor}}>\n {label && <label>{label}</label>}\n\n <select disabled={readonly || disabled} onChange={e => this.handleChange(e)} ref={el => (this.selectEl = el as HTMLSelectElement)}>\n <option value=\"\">Select...</option>\n {options.map(option => (\n <option value={option.id} selected={option.id === value}>\n {option.label}\n </option>\n ))}\n {!options.length && (\n <option value=\"NA\" selected={'NA' === value}>\n N/A\n </option>\n )}\n </select>\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={\"Dropdowns are used to capture a recipient's selection of one of several options.\"}\n />\n </verdocs-portal>\n )}\n </Fragment>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -8,8 +8,8 @@ import { d as defineCustomElement$n } from './p-KqTfG8Kf.js';
8
8
  import { d as defineCustomElement$m } from './p-CBRYaKLM.js';
9
9
  import { d as defineCustomElement$l } from './p-Ck_1uk0F.js';
10
10
  import { d as defineCustomElement$k } from './p-gGtgKfmC.js';
11
- import { d as defineCustomElement$j } from './p-LPa2SLXL.js';
12
- import { d as defineCustomElement$i } from './p-BiuMDRxW.js';
11
+ import { d as defineCustomElement$j } from './p-CJt2BxDt.js';
12
+ import { d as defineCustomElement$i } from './p-D_sm-ZDj.js';
13
13
  import { d as defineCustomElement$h } from './p-jXH2SygA.js';
14
14
  import { d as defineCustomElement$g } from './p-BPPiqx8Q.js';
15
15
  import { d as defineCustomElement$f } from './p-BJqJsTbt.js';
@@ -23,7 +23,7 @@ import { d as defineCustomElement$8 } from './p-BUDGHfvB.js';
23
23
  import { d as defineCustomElement$7 } from './p-C3iwT41e.js';
24
24
  import { d as defineCustomElement$6 } from './p-kvTSiSQ0.js';
25
25
  import { d as defineCustomElement$5 } from './p-LeCnrgBv.js';
26
- import { d as defineCustomElement$4 } from './p-CzUVVFEJ.js';
26
+ import { d as defineCustomElement$4 } from './p-D2DrESHF.js';
27
27
  import { d as defineCustomElement$3 } from './p-Da1nfhXq.js';
28
28
  import { d as defineCustomElement$2 } from './p-BvDqCFDj.js';
29
29
  import { d as defineCustomElement$1 } from './p-9Csbf-tN.js';
@@ -263,6 +263,6 @@ function defineCustomElement() {
263
263
  }
264
264
 
265
265
  export { VerdocsPreview as V, defineCustomElement as d };
266
- //# sourceMappingURL=p-80nhsQfQ.js.map
266
+ //# sourceMappingURL=p-gEwPUp5J.js.map
267
267
 
268
- //# sourceMappingURL=p-80nhsQfQ.js.map
268
+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EAAE,EAAE,GAAG,CAAC,QAAQ,IAAG;YAC/C,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;AACtD,YAAA,QACE,CAAC,CAAA,QAAQ,EACN,IAAA,EAAA,WAAW,CAAC,GAAG,CAAC,UAAU,IAAG;;AAC5B,gBAAA,MAAM,QAAQ,GAAG,CAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,UAAU,0CAAG,UAAU,CAAC,KAAI,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAC;AAE/E,gBAAA,QACE,CACE,CAAA,gCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,CAAC,WAAW,EAChC,UAAU,EAAE,QAAQ,CAAC,EAAE,EACvB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,KAAK,EACX,YAAY,EAAE,QAAQ,CAAC,KAAK,EAC5B,aAAa,EAAE,QAAQ,CAAC,MAAM,EAC9B,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;AACN,wBAAA,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;AAC9B,wBAAA,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;qBAChC,EAAA,CACD;aAEL,CAAC,CACO;SAEd,CAAC,CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"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 {getTemplate, integerSequence, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Component, Prop, h, State, Fragment, Watch} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\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 * ```ts\n * <verdocs-preview\n * templateId={TEMPLATE_ID}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() 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 @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[PREVIEW] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[PREVIEW] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handlePageRendered(_e: any) {\n // const pageInfo = e.detail as IDocumentPageInfo;\n // const fields = (this.template?.fields || []).filter(field => field.page === pageInfo.pageNumber);\n // console.log('[PREVIEW] Page rendered', pageInfo, fields);\n // fields.forEach(field => renderDocumentField(field, pageInfo, {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = document.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-template-document-page\n templateId={document.template_id}\n documentId={document.id}\n pageNumber={pageNumber}\n disabled={true}\n editable={false}\n done={false}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\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 </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-gEwPUp5J.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,mvBAAmvB;;MCsBhwB,cAAc,iBAAAA,kBAAA,CAAA,MAAA,cAAA,SAAAC,CAAA,CAAA;AAL3B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;AAMU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CAAC,UAAU,0CAAG,UAAU,CAAC,KAAI,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAC;AAE/E,gBAAA,QACE,CACE,CAAA,gCAAA,EAAA,EAAA,UAAU,EAAE,QAAQ,CAAC,WAAW,EAChC,UAAU,EAAE,QAAQ,CAAC,EAAE,EACvB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,EACd,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,KAAK,EACX,YAAY,EAAE,QAAQ,CAAC,KAAK,EAC5B,aAAa,EAAE,QAAQ,CAAC,MAAM,EAC9B,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;AACN,wBAAA,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;AAC9B,wBAAA,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;qBAChC,EAAA,CACD;aAEL,CAAC,CACO;SAEd,CAAC,CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"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 {getTemplate, integerSequence, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Component, Prop, h, State, Fragment, Watch} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\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 * ```ts\n * <verdocs-preview\n * templateId={TEMPLATE_ID}\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n private templateListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() 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 @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[PREVIEW] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[PREVIEW] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[PREVIEW] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handlePageRendered(_e: any) {\n // const pageInfo = e.detail as IDocumentPageInfo;\n // const fields = (this.template?.fields || []).filter(field => field.page === pageInfo.pageNumber);\n // console.log('[PREVIEW] Page rendered', pageInfo, fields);\n // fields.forEach(field => renderDocumentField(field, pageInfo, {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = document.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n return (\n <verdocs-template-document-page\n templateId={document.template_id}\n documentId={document.id}\n pageNumber={pageNumber}\n disabled={true}\n editable={false}\n done={false}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\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 </Host>\n );\n }\n}\n"],"version":3}
@@ -11,8 +11,8 @@ import { d as defineCustomElement$o } from './p-KqTfG8Kf.js';
11
11
  import { d as defineCustomElement$n } from './p-CBRYaKLM.js';
12
12
  import { d as defineCustomElement$m } from './p-Ck_1uk0F.js';
13
13
  import { d as defineCustomElement$l } from './p-gGtgKfmC.js';
14
- import { d as defineCustomElement$k } from './p-LPa2SLXL.js';
15
- import { d as defineCustomElement$j } from './p-BiuMDRxW.js';
14
+ import { d as defineCustomElement$k } from './p-CJt2BxDt.js';
15
+ import { d as defineCustomElement$j } from './p-D_sm-ZDj.js';
16
16
  import { d as defineCustomElement$i } from './p-jXH2SygA.js';
17
17
  import { d as defineCustomElement$h } from './p-BPPiqx8Q.js';
18
18
  import { d as defineCustomElement$g } from './p-BJqJsTbt.js';
@@ -26,7 +26,7 @@ import { d as defineCustomElement$9 } from './p-BUDGHfvB.js';
26
26
  import { d as defineCustomElement$8 } from './p-C3iwT41e.js';
27
27
  import { d as defineCustomElement$7 } from './p-kvTSiSQ0.js';
28
28
  import { d as defineCustomElement$6 } from './p-LeCnrgBv.js';
29
- import { d as defineCustomElement$5 } from './p-CzUVVFEJ.js';
29
+ import { d as defineCustomElement$5 } from './p-D2DrESHF.js';
30
30
  import { d as defineCustomElement$4 } from './p-Da1nfhXq.js';
31
31
  import { d as defineCustomElement$3 } from './p-BvDqCFDj.js';
32
32
  import { d as defineCustomElement$2 } from './p-BW3GsUj9.js';
@@ -529,6 +529,6 @@ function defineCustomElement() {
529
529
  }
530
530
 
531
531
  export { VerdocsTemplateFields as V, defineCustomElement as d };
532
- //# sourceMappingURL=p-CA_Xcyt7.js.map
532
+ //# sourceMappingURL=p-vDfciSeg.js.map
533
533
 
534
- //# sourceMappingURL=p-CA_Xcyt7.js.map
534
+ //# sourceMappingURL=p-vDfciSeg.js.map